-
Notifications
You must be signed in to change notification settings - Fork 31.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sqlite: refactor prepared statement iterator #57569
base: main
Are you sure you want to change the base?
Conversation
This commit refactors the StatementSync iterator implementation in two primary ways: - The iterator internal state is no longer exposed to JavaScript. - The iterator prevents the prepared statement from being GC'ed. Fixes: nodejs#57493
Review requested:
|
THROW_AND_RETURN_ON_BAD_STATE( | ||
env, iter->stmt_->IsFinalized(), "statement has been finalized"); | ||
Isolate* isolate = env->isolate(); | ||
LocalVector<Name> keys(isolate, {env->done_string(), env->value_string()}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit... LocalVector here might be overkill when a simple array would do. Non-blocking tho.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #57569 +/- ##
==========================================
+ Coverage 90.24% 90.25% +0.01%
==========================================
Files 630 630
Lines 185013 184989 -24
Branches 36241 36233 -8
==========================================
+ Hits 166966 166971 +5
+ Misses 10998 10973 -25
+ Partials 7049 7045 -4
🚀 New features to boost your workflow:
|
🙏 This implementation is better than my original one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
This commit refactors the StatementSync iterator implementation in two primary ways:
Fixes: #57493