Uh oh!
There was an error while loading. Please reload this page.
sqlite: add stmt persistent flag - #62757
Conversation
nodejs-github-bot
commented
Apr 15, 2026
Review requested:
|
There was a problem hiding this comment.
Pull request overview
Adds a new persistent option to DatabaseSync#prepare() in node:sqlite, exposing SQLite’s SQLITE_PREPARE_PERSISTENT hint to influence statement memory-allocation strategy for frequently reused prepared statements.
Changes:
- Add
options.persistentparsing/validation toDatabaseSync::Prepare()and passSQLITE_PREPARE_PERSISTENTviasqlite3_prepare_v3(). - Add parallel tests covering
persistent: true/false, type validation, and interoperability with other options. - Document the new option and update the implementation reference from
sqlite3_prepare_v2()tosqlite3_prepare_v3().
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/node_sqlite.cc | Parses options.persistent and uses sqlite3_prepare_v3(..., SQLITE_PREPARE_PERSISTENT) when enabled. |
test/parallel/test-sqlite-statement-sync.js | Adds coverage for correct execution and argument validation for persistent. |
doc/api/sqlite.md | Documents persistent and updates the underlying SQLite API reference/link definitions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
504bd95 to
4f2ef78Comparearaujogui
commented
Apr 15, 2026
Interesting thing: SQLITE_PREPARE_PERSISTENT is enabled by default on better-sqlite3 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@## main #62757 +/- ##
==========================================
+ Coverage 90.31% 90.32% +0.01%
==========================================
Files 751 751 Lines 249776 250019 +243 Branches 47173 47227 +54 ==========================================
+ Hits 225587 225833 +246 + Misses 15585 15559 -26 - Partials 8604 8627 +23
🚀 New features to boost your workflow:
|
At least makes sense to enable it by default for SQLTagStore statements I'd say. |
araujogui
commented
May 27, 2026
@nodejs/sqlite Friendly bump |
Uh oh!
There was an error while loading. Please reload this page.
125d667 to
69fc714Comparetrivikr
commented
Aug 12, 2026
@araujogui Can you please rebase from main? |
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
69fc714 to
d32e5e6Comparearaujogui
commented
Aug 13, 2026
Rebased |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as outdated.
This comment was marked as outdated.
nodejs-github-bot
commented
Aug 14, 2026
Uh oh!
There was an error while loading. Please reload this page.
nodejs-github-bot
commented
Aug 14, 2026
Landed in c8996ea |
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com> PR-URL: #62757 Reviewed-By: Xuguang Mei <meixuguang@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com> PR-URL: #62757 Reviewed-By: Xuguang Mei <meixuguang@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
Add statement's persistent argument flag
Reference:
https://sqlite.org/c3ref/c_prepare_dont_log.html#sqlitepreparepersistent