Skip to content

Commit c2679ee

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

File tree

2 files changed

+62
-2
lines changed

2 files changed

+62
-2
lines changed

doc/changelogs/CHANGELOG_V22.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161

6262
### Notable Changes
6363

64-
### require(esm) is now enabled by default
64+
#### require(esm) is now enabled by default
6565

6666
Support for loading native ES modules using require() had been available on v20.x and v22.x under the command line flag --experimental-require-module, and available by default on v23.x. In this release, it is now no longer behind a flag on v22.x.
6767

@@ -103,7 +103,36 @@ Certificates added:
103103

104104
Contributed by Richard Lau in [#55681](https://github.com/nodejs/node/pull/55681)
105105

106-
### Other Notable Changes
106+
#### SQLite Session Extension
107+
108+
Basic support for the [SQLite Session Extension](https://www.sqlite.org/sessionintro.html)
109+
got added to the experimental `node:sqlite` module.
110+
111+
```js
112+
const sourceDb = new DatabaseSync(':memory:');
113+
const targetDb = new DatabaseSync(':memory:');
114+
115+
sourceDb.exec('CREATE TABLE data(key INTEGER PRIMARY KEY, value TEXT)');
116+
targetDb.exec('CREATE TABLE data(key INTEGER PRIMARY KEY, value TEXT)');
117+
118+
const session = sourceDb.createSession();
119+
120+
const insert = sourceDb.prepare('INSERT INTO data (key, value) VALUES (?, ?)');
121+
insert.run(1, 'hello');
122+
insert.run(2, 'world');
123+
124+
const changeset = session.changeset();
125+
targetDb.applyChangeset(changeset);
126+
// Now that the changeset has been applied, targetDb contains the same data as sourceDb.
127+
```
128+
129+
Of note to distributors when dynamically linking with SQLite (using the `--shared-sqlite`
130+
flag): compiling SQLite with `SQLITE_ENABLE_SESSION` and `SQLITE_ENABLE_PREUPDATE_HOOK`
131+
defines is now required.
132+
133+
Contributed by Bart Louwers in [#54181](https://github.com/nodejs/node/pull/54181).
134+
135+
#### Other Notable Changes
107136

108137
* \[[`4920869935`](https://github.com/nodejs/node/commit/4920869935)] - **(SEMVER-MINOR)** **assert**: make assertion\_error use Myers diff algorithm (Giovanni Bucci) [#54862](https://github.com/nodejs/node/pull/54862)
109138
* \[[`ccffd3b819`](https://github.com/nodejs/node/commit/ccffd3b819)] - **doc**: enforce strict policy to semver-major releases (Rafael Gonzaga) [#55732](https://github.com/nodejs/node/pull/55732)

doc/changelogs/CHANGELOG_V23.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,37 @@ 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)
235+
got added to the experimental `node:sqlite` module.
236+
237+
```js
238+
const sourceDb = new DatabaseSync(':memory:');
239+
const targetDb = new DatabaseSync(':memory:');
240+
241+
sourceDb.exec('CREATE TABLE data(key INTEGER PRIMARY KEY, value TEXT)');
242+
targetDb.exec('CREATE TABLE data(key INTEGER PRIMARY KEY, value TEXT)');
243+
244+
const session = sourceDb.createSession();
245+
246+
const insert = sourceDb.prepare('INSERT INTO data (key, value) VALUES (?, ?)');
247+
insert.run(1, 'hello');
248+
insert.run(2, 'world');
249+
250+
const changeset = session.changeset();
251+
targetDb.applyChangeset(changeset);
252+
// Now that the changeset has been applied, targetDb contains the same data as sourceDb.
253+
```
254+
255+
Of note to distributors when dynamically linking with SQLite (using the `--shared-sqlite`
256+
flag): compiling SQLite with `SQLITE_ENABLE_SESSION` and `SQLITE_ENABLE_PREUPDATE_HOOK`
257+
defines is now required.
258+
259+
Contributed by Bart Louwers in [#54181](https://github.com/nodejs/node/pull/54181).
260+
261+
#### Other Notable Changes
262+
232263
* \[[`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)
233264
* \[[`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)
234265
* \[[`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)