Skip to content

Commit 710b8fc

Browse files
louwersaduh95
authored andcommitted
doc: add entry to changelog about SQLite Session Extension
PR-URL: #56318 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Akhil Marsonya <[email protected]> Reviewed-By: Ulises Gascón <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent dc3dafc commit 710b8fc

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

doc/changelogs/CHANGELOG_V23.md

+31
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,37 @@ Contributed by Giovanni Bucci in [#54630](https://github.com/nodejs/node/pull/54
399399
400400
### Notable Changes
401401
402+
#### SQLite Session Extension
403+
404+
Basic support for the [SQLite Session Extension](https://www.sqlite.org/sessionintro.html)
405+
got added to the experimental `node:sqlite` module.
406+
407+
```js
408+
const sourceDb = new DatabaseSync(':memory:');
409+
const targetDb = new DatabaseSync(':memory:');
410+
411+
sourceDb.exec('CREATE TABLE data(key INTEGER PRIMARY KEY, value TEXT)');
412+
targetDb.exec('CREATE TABLE data(key INTEGER PRIMARY KEY, value TEXT)');
413+
414+
const session = sourceDb.createSession();
415+
416+
const insert = sourceDb.prepare('INSERT INTO data (key, value) VALUES (?, ?)');
417+
insert.run(1, 'hello');
418+
insert.run(2, 'world');
419+
420+
const changeset = session.changeset();
421+
targetDb.applyChangeset(changeset);
422+
// Now that the changeset has been applied, targetDb contains the same data as sourceDb.
423+
```
424+
425+
Of note to distributors when dynamically linking with SQLite (using the `--shared-sqlite`
426+
flag): compiling SQLite with `SQLITE_ENABLE_SESSION` and `SQLITE_ENABLE_PREUPDATE_HOOK`
427+
defines is now required.
428+
429+
Contributed by Bart Louwers in [#54181](https://github.com/nodejs/node/pull/54181).
430+
431+
#### Other Notable Changes
432+
402433
* \[[`5767b76c30`](https://github.com/nodejs/node/commit/5767b76c30)] - **doc**: enforce strict policy to semver-major releases (Rafael Gonzaga) [#55732](https://github.com/nodejs/node/pull/55732)
403434
* \[[`ccb69bb8d5`](https://github.com/nodejs/node/commit/ccb69bb8d5)] - **(SEMVER-MINOR)** **src**: add cli option to preserve env vars on dr (Rafael Gonzaga) [#55697](https://github.com/nodejs/node/pull/55697)
404435
* \[[`d4e792643d`](https://github.com/nodejs/node/commit/d4e792643d)] - **(SEMVER-MINOR)** **util**: add sourcemap support to getCallSites (Marco Ippolito) [#55589](https://github.com/nodejs/node/pull/55589)

0 commit comments

Comments
 (0)