fix(sqlite): keep statement iterators exhausted - #9909
Conversation
addc439 to
48cf508
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughSQLite statement iterators now stay exhausted after a ChangesSQLite iterator exhaustion
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to SQLite statement iterators now remain exhausted after a completed loop, returning the expected terminal result on later calls. The behavior is covered by regression testing and presents no remaining merge-readiness risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Landed on |
After a
for...ofloop consumed aDatabaseSyncstatement iterator, calling.next()on that same iterator restarted it at the first row. Node keeps the iterator exhausted and returns{ done: true, value: null }.The SQLite-specific array iterator now clears its backing array when it reaches the end, matching its existing terminal behavior after
.return(). Callingstatement.iterate()again still creates a fresh iterator and executes a second pass normally. A runtime regression covers the optimizedfor...ofdrain followed by a manual.next().Refs #9202.
Validation:
sqlite_iterator_stays_exhausted_after_fused_for_of_drainsqlite/statements/iterate.tsoutput matches Node 26.5.1perry-runtime: 3,243 passed, 4 ignored; doc tests 8 ignoredperry-stdlib: 132 passed./scripts/run_lint_gates.sh: all 64 gates passed, 2 CI-only skippedSummary by CodeRabbit
Bug Fixes
for...ofloop..next()afterward correctly returns{ done: true, value: null }instead of replaying rows.Documentation