What's Changed
- feat: make selects optionally lazy by @LuisDuarte1 in #101
In a effort to make workers-qb
more efficient for databases that can support cursors/iterables it now supports lazy selects so that, a query like this doesn't potentially OoM the worker:
SELECT * FROM table
The API for this is backwards-compatible and you can enable lazy selects by specifying the lazy parameter:
// this will now return a iterable instead of a list
this.db
.select('table')
.execute({lazy: true})
It also works for .fetchAll
too
// it will also return a iterable
this.db
.fetchAll({tableName: "table", lazy: true})
.execute()
Full Changelog: v1.8.0...v1.9.0