StatementSyncIterator
TypeIterates over the rows of a statement, as returned by StatementSync.iterate(). It's a
standard JS iterator, so it works with for...of, spread syntax and iterator helpers.
Properties
This type has no properties.
Methods
next() -> { done: boolean, value: any }
Reads the next row.
Declaration
next() -> { done: boolean, value: any }
Returns
{ done: boolean, value: any }
The next row as `value`, or `done: true` (with `value` `null`) once there are no more rows
Example
const rows = db.prepare('SELECT * FROM notes').iterate()
const first = rows.next().value
return() -> { done: boolean, value: any }
Stops iterating, releasing the statement. `for...of` calls this when the loop exits early.
Declaration
return() -> { done: boolean, value: any }
Returns
{ done: boolean, value: any }
`{ done: true, value: null }`
Example
rows.return()