sqlite: add stmt persistent flag#62757
Conversation
|
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.
504bd95 to
4f2ef78
Compare
|
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.32% 90.32%
=======================================
Files 730 730
Lines 234671 234690 +19
Branches 43946 43957 +11
=======================================
+ Hits 211965 211993 +28
+ Misses 14423 14420 -3
+ Partials 8283 8277 -6
🚀 New features to boost your workflow:
|
|
At least makes sense to enable it by default for SQLTagStore statements I'd say. |
|
@nodejs/sqlite Friendly bump |
5de847e to
125d667
Compare
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
125d667 to
69fc714
Compare
Add statement's persistent argument flag
Reference:
https://sqlite.org/c3ref/c_prepare_dont_log.html#sqlitepreparepersistent