[streaming] add sqlite support, minor refactor.