Skip to content

Commit eb77127

Browse files
fix: removed injected "export {}" from sqlite3-opfs-async-proxy.js (#142)
* fix: removed injected "export {}" from sqlite3-opfs-async-proxy.js * chore: bumped version, updated deps * chore: update SQLite Wasm binaries from master (a5070d083c6c6f58acf25d551b1cb30a02e291bc) (#19) Co-authored-by: jurerotar <28565137+jurerotar@users.noreply.github.com> * feat: added additional missing capi types * chore: update SQLite Wasm binaries from master (8e272dd9a76b9ebc3f356e0990392a9380954992) (#20) Co-authored-by: jurerotar <28565137+jurerotar@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent b0c1bf4 commit eb77127

File tree

8 files changed

+900
-819
lines changed

8 files changed

+900
-819
lines changed

package-lock.json

Lines changed: 268 additions & 276 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sqlite.org/sqlite-wasm",
3-
"version": "3.51.2-build4",
3+
"version": "3.51.2-build5",
44
"description": "SQLite Wasm conveniently wrapped as an ES Module.",
55
"type": "module",
66
"repository": {
@@ -64,17 +64,17 @@
6464
},
6565
"devDependencies": {
6666
"@types/node": "^25.0.10",
67-
"@vitest/browser": "^4.0.17",
68-
"@vitest/browser-playwright": "^4.0.17",
69-
"happy-dom": "^20.3.4",
67+
"@vitest/browser": "^4.0.18",
68+
"@vitest/browser-playwright": "^4.0.18",
69+
"happy-dom": "^20.3.7",
7070
"http-server": "github:vapier/http-server",
7171
"lefthook": "2.0.15",
72-
"playwright": "^1.57.0",
72+
"playwright": "^1.58.0",
7373
"prettier": "^3.8.1",
7474
"prettier-plugin-jsdoc": "^1.8.0",
7575
"publint": "^0.3.17",
76-
"tsdown": "^0.20.0-beta.4",
76+
"tsdown": "^0.20.1",
7777
"typescript": "^5.9.3",
78-
"vitest": "^4.0.17"
78+
"vitest": "^4.0.18"
7979
}
8080
}

src/bin/sqlite3-bundler-friendly.mjs

Lines changed: 113 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
**
3030
** SQLITE_VERSION "3.52.0"
3131
** SQLITE_VERSION_NUMBER 3052000
32-
** SQLITE_SOURCE_ID "2026-01-20 18:30:48 2b3b36da9d60c265dceec5964ea51c752d81f41459fb6849c8faea658b253552"
32+
** SQLITE_SOURCE_ID "2026-01-25 15:18:31 8b53b97833afe27c0c3782c5fbc0437976215b571579f73a94c33e28d3fedb41"
3333
**
34-
** Emscripten SDK: 4.0.23
34+
** Emscripten SDK: 5.0.0
3535
*/
3636
// This code implements the `-sMODULARIZE` settings by taking the generated
3737
// JS program code (INNER_JS_CODE) and wrapping it in a factory function.
@@ -529,9 +529,9 @@ async function createWasm() {
529529

530530

531531
/**
532-
* @param {number} ptr
533-
* @param {string} type
534-
*/
532+
* @param {number} ptr
533+
* @param {string} type
534+
*/
535535
function getValue(ptr, type = 'i8') {
536536
if (type.endsWith('*')) type = '*';
537537
switch (type) {
@@ -551,10 +551,10 @@ async function createWasm() {
551551

552552

553553
/**
554-
* @param {number} ptr
555-
* @param {number} value
556-
* @param {string} type
557-
*/
554+
* @param {number} ptr
555+
* @param {number} value
556+
* @param {string} type
557+
*/
558558
function setValue(ptr, value, type = 'i8') {
559559
if (type.endsWith('*')) type = '*';
560560
switch (type) {
@@ -633,99 +633,99 @@ async function createWasm() {
633633
return root + dir;
634634
},
635635
basename:(path) => path && path.match(/([^\/]+|\/)\/*$/)[1],
636-
join:(...paths) => PATH.normalize(paths.join('/')),
637-
join2:(l, r) => PATH.normalize(l + '/' + r),
636+
join:(...paths) => PATH.normalize(paths.join('/')),
637+
join2:(l, r) => PATH.normalize(l + '/' + r),
638+
};
639+
640+
var initRandomFill = () => {
641+
642+
return (view) => crypto.getRandomValues(view);
638643
};
639-
640-
var initRandomFill = () => {
641-
642-
return (view) => crypto.getRandomValues(view);
643-
};
644-
var randomFill = (view) => {
645-
// Lazily init on the first invocation.
646-
(randomFill = initRandomFill())(view);
647-
};
648-
649-
650-
651-
var PATH_FS = {
652-
resolve:(...args) => {
653-
var resolvedPath = '',
654-
resolvedAbsolute = false;
655-
for (var i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {
656-
var path = (i >= 0) ? args[i] : FS.cwd();
657-
// Skip empty and invalid entries
658-
if (typeof path != 'string') {
659-
throw new TypeError('Arguments to path.resolve must be strings');
660-
} else if (!path) {
661-
return ''; // an invalid portion invalidates the whole thing
662-
}
663-
resolvedPath = path + '/' + resolvedPath;
664-
resolvedAbsolute = PATH.isAbs(path);
665-
}
666-
// At this point the path should be resolved to a full absolute path, but
667-
// handle relative paths to be safe (might happen when process.cwd() fails)
668-
resolvedPath = PATH.normalizeArray(resolvedPath.split('/').filter((p) => !!p), !resolvedAbsolute).join('/');
669-
return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
670-
},
671-
relative:(from, to) => {
672-
from = PATH_FS.resolve(from).slice(1);
673-
to = PATH_FS.resolve(to).slice(1);
674-
function trim(arr) {
675-
var start = 0;
676-
for (; start < arr.length; start++) {
677-
if (arr[start] !== '') break;
678-
}
679-
var end = arr.length - 1;
680-
for (; end >= 0; end--) {
681-
if (arr[end] !== '') break;
682-
}
683-
if (start > end) return [];
684-
return arr.slice(start, end - start + 1);
685-
}
686-
var fromParts = trim(from.split('/'));
687-
var toParts = trim(to.split('/'));
688-
var length = Math.min(fromParts.length, toParts.length);
689-
var samePartsLength = length;
690-
for (var i = 0; i < length; i++) {
691-
if (fromParts[i] !== toParts[i]) {
692-
samePartsLength = i;
693-
break;
694-
}
644+
var randomFill = (view) => {
645+
// Lazily init on the first invocation.
646+
(randomFill = initRandomFill())(view);
647+
};
648+
649+
650+
651+
var PATH_FS = {
652+
resolve:(...args) => {
653+
var resolvedPath = '',
654+
resolvedAbsolute = false;
655+
for (var i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {
656+
var path = (i >= 0) ? args[i] : FS.cwd();
657+
// Skip empty and invalid entries
658+
if (typeof path != 'string') {
659+
throw new TypeError('Arguments to path.resolve must be strings');
660+
} else if (!path) {
661+
return ''; // an invalid portion invalidates the whole thing
695662
}
696-
var outputParts = [];
697-
for (var i = samePartsLength; i < fromParts.length; i++) {
698-
outputParts.push('..');
663+
resolvedPath = path + '/' + resolvedPath;
664+
resolvedAbsolute = PATH.isAbs(path);
665+
}
666+
// At this point the path should be resolved to a full absolute path, but
667+
// handle relative paths to be safe (might happen when process.cwd() fails)
668+
resolvedPath = PATH.normalizeArray(resolvedPath.split('/').filter((p) => !!p), !resolvedAbsolute).join('/');
669+
return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
670+
},
671+
relative:(from, to) => {
672+
from = PATH_FS.resolve(from).slice(1);
673+
to = PATH_FS.resolve(to).slice(1);
674+
function trim(arr) {
675+
var start = 0;
676+
for (; start < arr.length; start++) {
677+
if (arr[start] !== '') break;
678+
}
679+
var end = arr.length - 1;
680+
for (; end >= 0; end--) {
681+
if (arr[end] !== '') break;
682+
}
683+
if (start > end) return [];
684+
return arr.slice(start, end - start + 1);
685+
}
686+
var fromParts = trim(from.split('/'));
687+
var toParts = trim(to.split('/'));
688+
var length = Math.min(fromParts.length, toParts.length);
689+
var samePartsLength = length;
690+
for (var i = 0; i < length; i++) {
691+
if (fromParts[i] !== toParts[i]) {
692+
samePartsLength = i;
693+
break;
699694
}
700-
outputParts = outputParts.concat(toParts.slice(samePartsLength));
701-
return outputParts.join('/');
702-
},
695+
}
696+
var outputParts = [];
697+
for (var i = samePartsLength; i < fromParts.length; i++) {
698+
outputParts.push('..');
699+
}
700+
outputParts = outputParts.concat(toParts.slice(samePartsLength));
701+
return outputParts.join('/');
702+
},
703+
};
704+
705+
706+
var UTF8Decoder = new TextDecoder();
707+
708+
var findStringEnd = (heapOrArray, idx, maxBytesToRead, ignoreNul) => {
709+
var maxIdx = idx + maxBytesToRead;
710+
if (ignoreNul) return maxIdx;
711+
// TextDecoder needs to know the byte length in advance, it doesn't stop on
712+
// null terminator by itself.
713+
// As a tiny code save trick, compare idx against maxIdx using a negation,
714+
// so that maxBytesToRead=undefined/NaN means Infinity.
715+
while (heapOrArray[idx] && !(idx >= maxIdx)) ++idx;
716+
return idx;
703717
};
704-
705-
706-
var UTF8Decoder = new TextDecoder();
707-
708-
var findStringEnd = (heapOrArray, idx, maxBytesToRead, ignoreNul) => {
709-
var maxIdx = idx + maxBytesToRead;
710-
if (ignoreNul) return maxIdx;
711-
// TextDecoder needs to know the byte length in advance, it doesn't stop on
712-
// null terminator by itself.
713-
// As a tiny code save trick, compare idx against maxIdx using a negation,
714-
// so that maxBytesToRead=undefined/NaN means Infinity.
715-
while (heapOrArray[idx] && !(idx >= maxIdx)) ++idx;
716-
return idx;
717-
};
718-
719-
/**
720-
* Given a pointer 'idx' to a null-terminated UTF8-encoded string in the given
721-
* array that contains uint8 values, returns a copy of that string as a
722-
* Javascript String object.
723-
* heapOrArray is either a regular array, or a JavaScript typed array view.
724-
* @param {number=} idx
725-
* @param {number=} maxBytesToRead
726-
* @param {boolean=} ignoreNul - If true, the function will not stop on a NUL character.
727-
* @return {string}
728-
*/
718+
719+
/**
720+
* Given a pointer 'idx' to a null-terminated UTF8-encoded string in the given
721+
* array that contains uint8 values, returns a copy of that string as a
722+
* Javascript String object.
723+
* heapOrArray is either a regular array, or a JavaScript typed array view.
724+
* @param {number=} idx
725+
* @param {number=} maxBytesToRead
726+
* @param {boolean=} ignoreNul - If true, the function will not stop on a NUL character.
727+
* @return {string}
728+
*/
729729
var UTF8ArrayToString = (heapOrArray, idx = 0, maxBytesToRead, ignoreNul) => {
730730

731731
var endPtr = findStringEnd(heapOrArray, idx, maxBytesToRead, ignoreNul);
@@ -3017,18 +3017,18 @@ async function createWasm() {
30173017

30183018

30193019
/**
3020-
* Given a pointer 'ptr' to a null-terminated UTF8-encoded string in the
3021-
* emscripten HEAP, returns a copy of that string as a Javascript String object.
3022-
*
3023-
* @param {number} ptr
3024-
* @param {number=} maxBytesToRead - An optional length that specifies the
3025-
* maximum number of bytes to read. You can omit this parameter to scan the
3026-
* string until the first 0 byte. If maxBytesToRead is passed, and the string
3027-
* at [ptr, ptr+maxBytesToReadr[ contains a null byte in the middle, then the
3028-
* string will cut short at that byte index.
3029-
* @param {boolean=} ignoreNul - If true, the function will not stop on a NUL character.
3030-
* @return {string}
3031-
*/
3020+
* Given a pointer 'ptr' to a null-terminated UTF8-encoded string in the
3021+
* emscripten HEAP, returns a copy of that string as a Javascript String object.
3022+
*
3023+
* @param {number} ptr
3024+
* @param {number=} maxBytesToRead - An optional length that specifies the
3025+
* maximum number of bytes to read. You can omit this parameter to scan the
3026+
* string until the first 0 byte. If maxBytesToRead is passed, and the string
3027+
* at [ptr, ptr+maxBytesToReadr[ contains a null byte in the middle, then the
3028+
* string will cut short at that byte index.
3029+
* @param {boolean=} ignoreNul - If true, the function will not stop on a NUL character.
3030+
* @return {string}
3031+
*/
30323032
var UTF8ToString = (ptr, maxBytesToRead, ignoreNul) => {
30333033
if (!ptr) return '';
30343034
var end = findStringEnd(HEAPU8, ptr, maxBytesToRead, ignoreNul);
@@ -4745,9 +4745,9 @@ Module.runSQLite3PostLoadInit = async function(
47454745
**
47464746
** SQLITE_VERSION "3.52.0"
47474747
** SQLITE_VERSION_NUMBER 3052000
4748-
** SQLITE_SOURCE_ID "2026-01-20 18:30:48 2b3b36da9d60c265dceec5964ea51c752d81f41459fb6849c8faea658b253552"
4748+
** SQLITE_SOURCE_ID "2026-01-25 15:18:31 8b53b97833afe27c0c3782c5fbc0437976215b571579f73a94c33e28d3fedb41"
47494749
**
4750-
** Emscripten SDK: 4.0.23
4750+
** Emscripten SDK: 5.0.0
47514751
*/
47524752
/*
47534753
2022-05-22
@@ -6920,7 +6920,7 @@ globalThis.sqlite3ApiBootstrap.defaultConfig = Object.create(null);
69206920
*/
69216921
globalThis.sqlite3ApiBootstrap.sqlite3 = undefined;
69226922
globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
6923-
sqlite3.version = {"libVersion": "3.52.0", "libVersionNumber": 3052000, "sourceId": "2026-01-20 18:30:48 2b3b36da9d60c265dceec5964ea51c752d81f41459fb6849c8faea658b253552","downloadVersion": 3520000,"scm":{ "sha3-256": "2b3b36da9d60c265dceec5964ea51c752d81f41459fb6849c8faea658b253552","branch": "trunk","tags": "","datetime": "2026-01-20T18:30:48.704Z"}};
6923+
sqlite3.version = {"libVersion": "3.52.0", "libVersionNumber": 3052000, "sourceId": "2026-01-25 15:18:31 8b53b97833afe27c0c3782c5fbc0437976215b571579f73a94c33e28d3fedb41","downloadVersion": 3520000,"scm":{ "sha3-256": "8b53b97833afe27c0c3782c5fbc0437976215b571579f73a94c33e28d3fedb41","branch": "trunk","tags": "","datetime": "2026-01-25T15:18:31.737Z"}};
69246924
});
69256925
/**
69266926
2022-07-08

0 commit comments

Comments
 (0)