@livestore/wa-sqlite 1.0.1-dev.24 → 1.0.1-dev.26
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 +1 -1
- package/src/sqlite-api.js +6 -4
- package/src/types/index.d.ts +4 -0
package/package.json
CHANGED
package/src/sqlite-api.js
CHANGED
|
@@ -568,7 +568,7 @@ export function Factory(Module) {
|
|
|
568
568
|
databases.add(db);
|
|
569
569
|
|
|
570
570
|
Module.ccall('RegisterExtensionFunctions', 'void', ['number'], [db]);
|
|
571
|
-
check(fname, rc);
|
|
571
|
+
check(fname, rc, db);
|
|
572
572
|
return db;
|
|
573
573
|
} finally {
|
|
574
574
|
Module._sqlite3_free(zVfs);
|
|
@@ -591,7 +591,7 @@ export function Factory(Module) {
|
|
|
591
591
|
databases.add(db);
|
|
592
592
|
|
|
593
593
|
Module.ccall('RegisterExtensionFunctions', 'void', ['number'], [db]);
|
|
594
|
-
check(fname, rc);
|
|
594
|
+
check(fname, rc, db);
|
|
595
595
|
return db;
|
|
596
596
|
} finally {
|
|
597
597
|
Module._sqlite3_free(zVfs);
|
|
@@ -939,13 +939,15 @@ export function Factory(Module) {
|
|
|
939
939
|
const registeredVfs = new Set();
|
|
940
940
|
|
|
941
941
|
sqlite3.vfs_register = function(vfs, makeDefault) {
|
|
942
|
-
if (registeredVfs.has(vfs)) return
|
|
943
|
-
const result = Module.vfs_register(vfs, makeDefault);
|
|
942
|
+
if (registeredVfs.has(vfs.name)) return
|
|
943
|
+
const result = Module.vfs_register(vfs.name, makeDefault);
|
|
944
944
|
const res = check('sqlite3_vfs_register', result);
|
|
945
945
|
registeredVfs.add(vfs);
|
|
946
946
|
return res
|
|
947
947
|
};
|
|
948
948
|
|
|
949
|
+
sqlite3.vfs_registered = registeredVfs;
|
|
950
|
+
|
|
949
951
|
function check(fname, result, db = null, allowed = [SQLite.SQLITE_OK]) {
|
|
950
952
|
if (allowed.includes(result)) return result;
|
|
951
953
|
const message = db ?
|
package/src/types/index.d.ts
CHANGED
|
@@ -37,6 +37,8 @@ interface SQLiteVFS {
|
|
|
37
37
|
/** Maximum length of a file path in UTF-8 bytes (default 64) */
|
|
38
38
|
mxPathName?: number;
|
|
39
39
|
|
|
40
|
+
name: string;
|
|
41
|
+
|
|
40
42
|
close(): void|Promise<void>;
|
|
41
43
|
isReady(): boolean|Promise<boolean>;
|
|
42
44
|
|
|
@@ -891,6 +893,8 @@ interface SQLiteAPI {
|
|
|
891
893
|
* @returns `SQLITE_OK` (throws exception on error)
|
|
892
894
|
*/
|
|
893
895
|
vfs_register(vfs: SQLiteVFS, makeDefault?: boolean): number;
|
|
896
|
+
|
|
897
|
+
vfs_registered: Set<string>;
|
|
894
898
|
}
|
|
895
899
|
|
|
896
900
|
declare module '@livestore/wa-sqlite' {
|