support for streams in the query function of the db