Skip to content

Commit 420abf1

Browse files
committed
Prepare 3.50.0 release
1 parent 6eb3232 commit 420abf1

File tree

6 files changed

+261
-75
lines changed

6 files changed

+261
-75
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sqlite.org/sqlite-wasm",
3-
"version": "3.49.2-build1",
3+
"version": "3.50.0-build1",
44
"description": "SQLite Wasm conveniently wrapped as an ES Module.",
55
"keywords": [
66
"sqlite",

sqlite-wasm/jswasm/sqlite3-bundler-friendly.mjs

Lines changed: 82 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
/*
2727
** This code was built from sqlite3 version...
2828
**
29-
** SQLITE_VERSION "3.49.2"
30-
** SQLITE_VERSION_NUMBER 3049002
31-
** SQLITE_SOURCE_ID "2025-05-07 10:39:52 17144570b0d96ae63cd6f3edca39e27ebd74925252bbaf6723bcb2f6b4861fb1"
29+
** SQLITE_VERSION "3.50.0"
30+
** SQLITE_VERSION_NUMBER 3050000
31+
** SQLITE_SOURCE_ID "2025-05-29 14:26:00 dfc790f998f450d9c35e3ba1c8c89c17466cb559f87b0239e4aab9d34e28f742"
3232
**
3333
** Using the Emscripten SDK version 3.1.70.
3434
*/
@@ -10051,7 +10051,7 @@ var sqlite3InitModule = (() => {
1005110051
if (!(tgt instanceof StructBinder.StructType)) {
1005210052
toss('Usage error: target object is-not-a StructType.');
1005310053
} else if (!(func instanceof Function) && !wasm.isPtr(func)) {
10054-
toss('Usage errror: expecting a Function or WASM pointer to one.');
10054+
toss('Usage error: expecting a Function or WASM pointer to one.');
1005510055
}
1005610056
if (1 === arguments.length) {
1005710057
return (n, f) => callee(tgt, n, f, applyArgcCheck);
@@ -10165,11 +10165,11 @@ var sqlite3InitModule = (() => {
1016510165

1016610166
globalThis.sqlite3ApiBootstrap.initializers.push(function (sqlite3) {
1016710167
sqlite3.version = {
10168-
libVersion: '3.49.2',
10169-
libVersionNumber: 3049002,
10168+
libVersion: '3.50.0',
10169+
libVersionNumber: 3050000,
1017010170
sourceId:
10171-
'2025-05-07 10:39:52 17144570b0d96ae63cd6f3edca39e27ebd74925252bbaf6723bcb2f6b4861fb1',
10172-
downloadVersion: 3490200,
10171+
'2025-05-29 14:26:00 dfc790f998f450d9c35e3ba1c8c89c17466cb559f87b0239e4aab9d34e28f742',
10172+
downloadVersion: 3500000,
1017310173
};
1017410174
});
1017510175

@@ -11536,6 +11536,12 @@ var sqlite3InitModule = (() => {
1153611536
rc.changeCount =
1153711537
db.changes(true, 64 === rc.countChanges) - changeCount;
1153811538
}
11539+
const lastInsertRowId = !!rc.lastInsertRowId
11540+
? sqlite3.capi.sqlite3_last_insert_rowid(db)
11541+
: undefined;
11542+
if (undefined !== lastInsertRowId) {
11543+
rc.lastInsertRowId = lastInsertRowId;
11544+
}
1153911545
if (rc.callback instanceof Function) {
1154011546
rc.callback = theCallback;
1154111547

@@ -13007,7 +13013,7 @@ var sqlite3InitModule = (() => {
1300713013
capi.SQLITE_OPEN_MAIN_JOURNAL |
1300813014
capi.SQLITE_OPEN_SUPER_JOURNAL |
1300913015
capi.SQLITE_OPEN_WAL;
13010-
13016+
const FLAG_COMPUTE_DIGEST_V2 = capi.SQLITE_OPEN_MEMORY;
1301113017
const OPAQUE_DIR_NAME = '.opaque';
1301213018

1301313019
const getRandomName = () => Math.random().toString(36).slice(2);
@@ -13237,6 +13243,7 @@ var sqlite3InitModule = (() => {
1323713243
xOpen: function f(pVfs, zName, pFile, flags, pOutFlags) {
1323813244
const pool = getPoolForVfs(pVfs);
1323913245
try {
13246+
flags &= ~FLAG_COMPUTE_DIGEST_V2;
1324013247
pool.log(`xOpen ${wasm.cstrToJs(zName)} ${flags}`);
1324113248

1324213249
const path =
@@ -13385,8 +13392,7 @@ var sqlite3InitModule = (() => {
1338513392

1338613393
getFileNames() {
1338713394
const rc = [];
13388-
const iter = this.#mapFilenameToSAH.keys();
13389-
for (const n of iter) rc.push(n);
13395+
for (const n of this.#mapFilenameToSAH.keys()) rc.push(n);
1339013396
return rc;
1339113397
}
1339213398

@@ -13427,7 +13433,7 @@ var sqlite3InitModule = (() => {
1342713433
this.#availableSAH.clear();
1342813434
}
1342913435

13430-
async acquireAccessHandles(clearFiles) {
13436+
async acquireAccessHandles(clearFiles = false) {
1343113437
const files = [];
1343213438
for await (const [name, h] of this.#dhOpaque) {
1343313439
if ('file' === h.kind) {
@@ -13478,12 +13484,14 @@ var sqlite3InitModule = (() => {
1347813484

1347913485
const fileDigest = new Uint32Array(HEADER_DIGEST_SIZE / 4);
1348013486
sah.read(fileDigest, { at: HEADER_OFFSET_DIGEST });
13481-
const compDigest = this.computeDigest(this.#apBody);
13487+
const compDigest = this.computeDigest(this.#apBody, flags);
13488+
1348213489
if (fileDigest.every((v, i) => v === compDigest[i])) {
1348313490
const pathBytes = this.#apBody.findIndex((v) => 0 === v);
1348413491
if (0 === pathBytes) {
1348513492
sah.truncate(HEADER_OFFSET_DATA);
1348613493
}
13494+
1348713495
return pathBytes
1348813496
? textDecoder.decode(this.#apBody.subarray(0, pathBytes))
1348913497
: '';
@@ -13499,10 +13507,13 @@ var sqlite3InitModule = (() => {
1349913507
if (HEADER_MAX_PATH_SIZE <= enc.written + 1) {
1350013508
toss('Path too long:', path);
1350113509
}
13510+
if (path && flags) {
13511+
flags |= FLAG_COMPUTE_DIGEST_V2;
13512+
}
1350213513
this.#apBody.fill(0, enc.written, HEADER_MAX_PATH_SIZE);
1350313514
this.#dvBody.setUint32(HEADER_OFFSET_FLAGS, flags);
13515+
const digest = this.computeDigest(this.#apBody, flags);
1350413516

13505-
const digest = this.computeDigest(this.#apBody);
1350613517
sah.write(this.#apBody, { at: 0 });
1350713518
sah.write(digest, { at: HEADER_OFFSET_DIGEST });
1350813519
sah.flush();
@@ -13516,14 +13527,18 @@ var sqlite3InitModule = (() => {
1351613527
}
1351713528
}
1351813529

13519-
computeDigest(byteArray) {
13520-
let h1 = 0xdeadbeef;
13521-
let h2 = 0x41c6ce57;
13522-
for (const v of byteArray) {
13523-
h1 = 31 * h1 + v * 307;
13524-
h2 = 31 * h2 + v * 307;
13530+
computeDigest(byteArray, fileFlags) {
13531+
if (fileFlags & FLAG_COMPUTE_DIGEST_V2) {
13532+
let h1 = 0xdeadbeef;
13533+
let h2 = 0x41c6ce57;
13534+
for (const v of byteArray) {
13535+
h1 = Math.imul(h1 ^ v, 2654435761);
13536+
h2 = Math.imul(h2 ^ v, 104729);
13537+
}
13538+
return new Uint32Array([h1 >>> 0, h2 >>> 0]);
13539+
} else {
13540+
return new Uint32Array([0, 0]);
1352513541
}
13526-
return new Uint32Array([h1 >>> 0, h2 >>> 0]);
1352713542
}
1352813543

1352913544
async reset(clearFiles) {
@@ -13620,11 +13635,45 @@ var sqlite3InitModule = (() => {
1362013635
});
1362113636
this.#dhVfsRoot = this.#dhVfsParent = undefined;
1362213637
} catch (e) {
13623-
sqlite3.config.error(this.vfsName, 'removeVfs() failed:', e);
13638+
sqlite3.config.error(
13639+
this.vfsName,
13640+
'removeVfs() failed with no recovery strategy:',
13641+
e,
13642+
);
1362413643
}
1362513644
return true;
1362613645
}
1362713646

13647+
pauseVfs() {
13648+
if (this.#mapS3FileToOFile_.size > 0) {
13649+
sqlite3.SQLite3Error.toss(
13650+
capi.SQLITE_MISUSE,
13651+
'Cannot pause VFS',
13652+
this.vfsName,
13653+
'because it has opened files.',
13654+
);
13655+
}
13656+
if (this.#mapSAHToName.size > 0) {
13657+
capi.sqlite3_vfs_unregister(this.vfsName);
13658+
this.releaseAccessHandles();
13659+
}
13660+
return this;
13661+
}
13662+
13663+
isPaused() {
13664+
return 0 === this.#mapSAHToName.size;
13665+
}
13666+
13667+
async unpauseVfs() {
13668+
if (0 === this.#mapSAHToName.size) {
13669+
return this.acquireAccessHandles(false).then(
13670+
() => capi.sqlite3_vfs_register(this.#cVfs, 0),
13671+
this,
13672+
);
13673+
}
13674+
return this;
13675+
}
13676+
1362813677
exportFile(name) {
1362913678
const sah =
1363013679
this.#mapFilenameToSAH.get(name) || toss('File not found:', name);
@@ -13769,6 +13818,17 @@ var sqlite3InitModule = (() => {
1376913818
async removeVfs() {
1377013819
return this.#p.removeVfs();
1377113820
}
13821+
13822+
pauseVfs() {
13823+
this.#p.pauseVfs();
13824+
return this;
13825+
}
13826+
async unpauseVfs() {
13827+
return this.#p.unpauseVfs().then(() => this);
13828+
}
13829+
isPaused() {
13830+
return this.#p.isPaused();
13831+
}
1377213832
}
1377313833

1377413834
const apiVersionCheck = async () => {

sqlite-wasm/jswasm/sqlite3-node.mjs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
/*
2727
** This code was built from sqlite3 version...
2828
**
29-
** SQLITE_VERSION "3.49.2"
30-
** SQLITE_VERSION_NUMBER 3049002
31-
** SQLITE_SOURCE_ID "2025-05-07 10:39:52 17144570b0d96ae63cd6f3edca39e27ebd74925252bbaf6723bcb2f6b4861fb1"
29+
** SQLITE_VERSION "3.50.0"
30+
** SQLITE_VERSION_NUMBER 3050000
31+
** SQLITE_SOURCE_ID "2025-05-29 14:26:00 dfc790f998f450d9c35e3ba1c8c89c17466cb559f87b0239e4aab9d34e28f742"
3232
**
3333
** Using the Emscripten SDK version 3.1.70.
3434
*/
@@ -10071,7 +10071,7 @@ var sqlite3InitModule = (() => {
1007110071
if (!(tgt instanceof StructBinder.StructType)) {
1007210072
toss('Usage error: target object is-not-a StructType.');
1007310073
} else if (!(func instanceof Function) && !wasm.isPtr(func)) {
10074-
toss('Usage errror: expecting a Function or WASM pointer to one.');
10074+
toss('Usage error: expecting a Function or WASM pointer to one.');
1007510075
}
1007610076
if (1 === arguments.length) {
1007710077
return (n, f) => callee(tgt, n, f, applyArgcCheck);
@@ -10185,11 +10185,11 @@ var sqlite3InitModule = (() => {
1018510185

1018610186
globalThis.sqlite3ApiBootstrap.initializers.push(function (sqlite3) {
1018710187
sqlite3.version = {
10188-
libVersion: '3.49.2',
10189-
libVersionNumber: 3049002,
10188+
libVersion: '3.50.0',
10189+
libVersionNumber: 3050000,
1019010190
sourceId:
10191-
'2025-05-07 10:39:52 17144570b0d96ae63cd6f3edca39e27ebd74925252bbaf6723bcb2f6b4861fb1',
10192-
downloadVersion: 3490200,
10191+
'2025-05-29 14:26:00 dfc790f998f450d9c35e3ba1c8c89c17466cb559f87b0239e4aab9d34e28f742',
10192+
downloadVersion: 3500000,
1019310193
};
1019410194
});
1019510195

@@ -11556,6 +11556,12 @@ var sqlite3InitModule = (() => {
1155611556
rc.changeCount =
1155711557
db.changes(true, 64 === rc.countChanges) - changeCount;
1155811558
}
11559+
const lastInsertRowId = !!rc.lastInsertRowId
11560+
? sqlite3.capi.sqlite3_last_insert_rowid(db)
11561+
: undefined;
11562+
if (undefined !== lastInsertRowId) {
11563+
rc.lastInsertRowId = lastInsertRowId;
11564+
}
1155911565
if (rc.callback instanceof Function) {
1156011566
rc.callback = theCallback;
1156111567

0 commit comments

Comments
 (0)