You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, better-sqlite3 allows stopping an active iterator by calling return(). This ensures clean-up and halts further reads. Here's an example:
conststmt=db.prepare("SELECT * FROM organizations");// This has 100k rowsconstiter=stmt.iterate();constrow=iter.next();if(cancelTriggered){iter.return();// Stop reading and perform clean-up}
Since we don't yet support return(), an alternative is to manually exhaust the iterator:
if(cancelTriggered){for(const_rowofiter){}}
Would it be possible to add support for return() to simplify the process? Thanks!
The text was updated successfully, but these errors were encountered:
Currently, better-sqlite3 allows stopping an active iterator by calling return(). This ensures clean-up and halts further reads. Here's an example:
Since we don't yet support
return()
, an alternative is to manually exhaust the iterator:Would it be possible to add support for
return()
to simplify the process? Thanks!The text was updated successfully, but these errors were encountered: