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 91.55% 89.68% -1.88%
==========================================
Files 356 706 +350
Lines 149601 218146 +68545
Branches 23395 41735 +18340
==========================================
+ Hits 136967 195638 +58671
- Misses 12371 14407 +2036
- Partials 263 8101 +7838
🚀 New features to boost your workflow:
|
|
At least makes sense to enable it by default for SQLTagStore statements I'd say. |
Add statement's persistent argument flag
Reference:
https://sqlite.org/c3ref/c_prepare_dont_log.html#sqlitepreparepersistent