Skip to content

Commit bac497d

Browse files
committed
doc: add entry to changelog about SQLite Session Extension
1 parent a85ef6a commit bac497d

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

doc/changelogs/CHANGELOG_V23.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,34 @@ Contributed by Giovanni Bucci in [#54630](https://github.com/nodejs/node/pull/54
229229

230230
### Notable Changes
231231

232+
#### SQLite Session Extension
233+
234+
Basic support for the [SQLite Session Extension](https://www.sqlite.org/sessionintro.html) got added to the experimental `node:sqlite` module.
235+
236+
```js
237+
const sourceDb = new DatabaseSync(':memory:');
238+
const targetDb = new DatabaseSync(':memory:');
239+
240+
sourceDb.exec('CREATE TABLE data(key INTEGER PRIMARY KEY, value TEXT)');
241+
targetDb.exec('CREATE TABLE data(key INTEGER PRIMARY KEY, value TEXT)');
242+
243+
const session = sourceDb.createSession();
244+
245+
const insert = sourceDb.prepare('INSERT INTO data (key, value) VALUES (?, ?)');
246+
insert.run(1, 'hello');
247+
insert.run(2, 'world');
248+
249+
const changeset = session.changeset();
250+
targetDb.applyChangeset(changeset);
251+
// Now that the changeset has been applied, targetDb contains the same data as sourceDb.
252+
```
253+
254+
Of note to distributors when dynamically linking with SQLite (using the `--shared-sqlite` flag): compiling SQLite with `SQLITE_ENABLE_SESSION` and `SQLITE_ENABLE_PREUPDATE_HOOK` defines is now required.
255+
256+
Contributed by Bart Louwers in [#54181](https://github.com/nodejs/node/pull/54181).
257+
258+
#### Other Notable Changes
259+
232260
* \[[`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)
233261
* \[[`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)
234262
* \[[`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)