meadow-connection-sqlite 1.0.19 → 1.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meadow-connection-sqlite",
3
- "version": "1.0.19",
3
+ "version": "1.0.20",
4
4
  "description": "Meadow SQLite Plugin",
5
5
  "main": "source/Meadow-Connection-SQLite.js",
6
6
  "scripts": {
@@ -41,13 +41,15 @@
41
41
  "url": "https://github.com/stevenvelozo/meadow-connection-sqlite/issues"
42
42
  },
43
43
  "homepage": "https://github.com/stevenvelozo/meadow-connection-sqlite",
44
+ "engines": {
45
+ "node": ">=22.5.0"
46
+ },
44
47
  "devDependencies": {
45
- "pict-docuserve": "^0.1.5",
46
- "quackage": "^1.1.0",
47
- "retold-harness": "^1.1.2"
48
+ "pict-docuserve": "^1.0.0",
49
+ "quackage": "^1.2.3",
50
+ "retold-harness": "^1.1.11"
48
51
  },
49
52
  "dependencies": {
50
- "better-sqlite3": "^12.6.2",
51
53
  "fable-serviceproviderbase": "^3.0.19"
52
54
  }
53
55
  }
@@ -4,7 +4,22 @@
4
4
  */
5
5
  const libFableServiceProviderBase = require('fable-serviceproviderbase');
6
6
 
7
- const libSQLite = require('better-sqlite3');
7
+ // Use Node's built-in synchronous SQLite binding (added in v22.5.0; stable
8
+ // in v24+ but available unflagged in current v22 LTS releases — it just
9
+ // emits a single ExperimentalWarning at first import on older v22 minors).
10
+ //
11
+ // Switched from `better-sqlite3` to eliminate the native-compile toolchain
12
+ // from every consumer's Dockerfile (python3 + make + g++ were required to
13
+ // build the better-sqlite3 native addon and broke recurrently on apt GPG
14
+ // signature failures and architecture mismatches across host/container
15
+ // boundaries). `node:sqlite` ships with the runtime — zero install, no
16
+ // compile, no architecture portability concerns.
17
+ //
18
+ // API surface used here is a near-direct match: `new DatabaseSync(path,
19
+ // opts)`, `.exec(sql)`, `.prepare(sql).all/get/run(...)`. The one
20
+ // difference is that `node:sqlite` does NOT expose a `.pragma()` helper —
21
+ // pragmas are issued via `.exec('PRAGMA ...')` (see connectAsync below).
22
+ const { DatabaseSync: libSQLite } = require('node:sqlite');
8
23
 
9
24
  const libMeadowSchemaSQLite = require('./Meadow-Schema-SQLite.js');
10
25
 
@@ -170,9 +185,10 @@ class MeadowConnectionSQLite extends libFableServiceProviderBase
170
185
  {
171
186
  this.log.info(`Meadow-Connection-SQLite connecting to file [${tmpConnectionSettings.SQLiteFilePath}].`);
172
187
  this._database = new libSQLite(tmpConnectionSettings.SQLiteFilePath, tmpConnectionSettings);
173
- // According to the documentation, setting this journal mode is very important for performance.
174
- // > Though not required, [it is generally important to set the WAL pragma for performance reasons](https://github.com/WiseLibs/better-sqlite3/blob/master/docs/performance.md).
175
- this._database.pragma('journal_mode = WAL');
188
+ // Set WAL journal mode for performance. node:sqlite has no
189
+ // `.pragma()` helper (unlike better-sqlite3) — pragmas go
190
+ // through the standard `.exec()` path.
191
+ this._database.exec('PRAGMA journal_mode = WAL');
176
192
  this._SchemaProvider.setDatabase(this._database);
177
193
  this.log.info(`Meadow-Connection-SQLite successfully connected to SQLite file [${tmpConnectionSettings.SQLiteFilePath}].`);
178
194
  this.connected = true;
@@ -190,8 +206,9 @@ class MeadowConnectionSQLite extends libFableServiceProviderBase
190
206
  {
191
207
  if (this.connected && this._database)
192
208
  {
193
- // In better-sqlite3, prepared statements are created via db.prepare(sql)
194
- // This getter is maintained for API consistency with other providers.
209
+ // Prepared statements are created via `db.prepare(sql)` on the
210
+ // returned DatabaseSync handle. Maintained for API consistency
211
+ // with other Meadow connection providers.
195
212
  return this._database;
196
213
  }
197
214
  else