@powersync/web 0.0.0-dev-20260225163712 → 0.0.0-dev-20260226160529
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/dist/26d61ca9f5694d064635.wasm +0 -0
- package/dist/b4c6283dc473b6b3fd24.wasm +0 -0
- package/dist/c78985091a0b22aaef03.wasm +0 -0
- package/dist/ca59e199e1138b553fad.wasm +0 -0
- package/dist/index.umd.js +299 -180
- package/dist/index.umd.js.map +1 -1
- package/dist/worker/SharedSyncImplementation.umd.js +302 -276
- package/dist/worker/SharedSyncImplementation.umd.js.map +1 -1
- package/dist/worker/WASQLiteDB.umd.js +303 -277
- package/dist/worker/WASQLiteDB.umd.js.map +1 -1
- package/dist/worker/{node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260225162137_node_modules_journeyapps_wa--416f63.umd.js → node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260226145021_node_modules_journeyapps_wa--0e69f0.umd.js} +12 -12
- package/dist/worker/{node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260225162137_node_modules_journeyapps_wa--416f63.umd.js.map → node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260226145021_node_modules_journeyapps_wa--0e69f0.umd.js.map} +1 -1
- package/dist/worker/{node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260225162137_node_modules_journeyapps_wa--f08dda.umd.js → node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260226145021_node_modules_journeyapps_wa--1787c2.umd.js} +16 -16
- package/dist/worker/{node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260225162137_node_modules_journeyapps_wa--f08dda.umd.js.map → node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260226145021_node_modules_journeyapps_wa--1787c2.umd.js.map} +1 -1
- package/dist/worker/{node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260225162137_node_modules_journeyapps_wa--3f11fc.umd.js → node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260226145021_node_modules_journeyapps_wa--24f702.umd.js} +270 -151
- package/dist/worker/node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260226145021_node_modules_journeyapps_wa--24f702.umd.js.map +1 -0
- package/dist/worker/{node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260225162137_node_modules_journeyapps_wa--8c697a.umd.js → node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260226145021_node_modules_journeyapps_wa--4e15a2.umd.js} +8 -8
- package/dist/worker/{node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260225162137_node_modules_journeyapps_wa--8c697a.umd.js.map → node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260226145021_node_modules_journeyapps_wa--4e15a2.umd.js.map} +1 -1
- package/dist/worker/{node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260225162137_node_modules_journeyapps_wa--2cbf50.umd.js → node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260226145021_node_modules_journeyapps_wa--7ba318.umd.js} +8 -8
- package/dist/worker/{node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260225162137_node_modules_journeyapps_wa--2cbf50.umd.js.map → node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260226145021_node_modules_journeyapps_wa--7ba318.umd.js.map} +1 -1
- package/dist/worker/{node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260225162137_node_modules_journeyapps_wa--dccfb9.umd.js → node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260226145021_node_modules_journeyapps_wa--919198.umd.js} +8 -8
- package/dist/worker/{node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260225162137_node_modules_journeyapps_wa--dccfb9.umd.js.map → node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260226145021_node_modules_journeyapps_wa--919198.umd.js.map} +1 -1
- package/dist/worker/{node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260225162137_node_modules_journeyapps_wa--f02f25.umd.js → node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260226145021_node_modules_journeyapps_wa--997c14.umd.js} +8 -8
- package/dist/worker/{node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260225162137_node_modules_journeyapps_wa--f02f25.umd.js.map → node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260226145021_node_modules_journeyapps_wa--997c14.umd.js.map} +1 -1
- package/dist/worker/{node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260225162137_node_modules_journeyapps_wa--2a0897.umd.js → node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260226145021_node_modules_journeyapps_wa--a6ce73.umd.js} +12 -12
- package/dist/worker/{node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260225162137_node_modules_journeyapps_wa--2a0897.umd.js.map → node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260226145021_node_modules_journeyapps_wa--a6ce73.umd.js.map} +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/dist/0b773f34701fc3938b2f.wasm +0 -0
- package/dist/687fe6480511183aa1de.wasm +0 -0
- package/dist/87c58d5d82e1759b558e.wasm +0 -0
- package/dist/90aaeb7a1019ddabcbd4.wasm +0 -0
- package/dist/worker/node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260225162137_node_modules_journeyapps_wa--3f11fc.umd.js.map +0 -1
|
@@ -695,9 +695,9 @@ function generateUUID() {
|
|
|
695
695
|
|
|
696
696
|
/***/ },
|
|
697
697
|
|
|
698
|
-
/***/ "../../node_modules/.pnpm/@journeyapps+wa-sqlite@0.0.0-dev-
|
|
698
|
+
/***/ "../../node_modules/.pnpm/@journeyapps+wa-sqlite@0.0.0-dev-20260226145021/node_modules/@journeyapps/wa-sqlite/src/sqlite-api.js"
|
|
699
699
|
/*!**************************************************************************************************************************************!*\
|
|
700
|
-
!*** ../../node_modules/.pnpm/@journeyapps+wa-sqlite@0.0.0-dev-
|
|
700
|
+
!*** ../../node_modules/.pnpm/@journeyapps+wa-sqlite@0.0.0-dev-20260226145021/node_modules/@journeyapps/wa-sqlite/src/sqlite-api.js ***!
|
|
701
701
|
\**************************************************************************************************************************************/
|
|
702
702
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
703
703
|
|
|
@@ -938,7 +938,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
938
938
|
/* harmony export */ SQLITE_WARNING: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_WARNING),
|
|
939
939
|
/* harmony export */ SQLiteError: () => (/* binding */ SQLiteError)
|
|
940
940
|
/* harmony export */ });
|
|
941
|
-
/* harmony import */ var _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./sqlite-constants.js */ "../../node_modules/.pnpm/@journeyapps+wa-sqlite@0.0.0-dev-
|
|
941
|
+
/* harmony import */ var _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./sqlite-constants.js */ "../../node_modules/.pnpm/@journeyapps+wa-sqlite@0.0.0-dev-20260226145021/node_modules/@journeyapps/wa-sqlite/src/sqlite-constants.js");
|
|
942
942
|
// Copyright 2021 Roy T. Hashimoto. All Rights Reserved.
|
|
943
943
|
|
|
944
944
|
|
|
@@ -948,8 +948,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
948
948
|
* Need to have a serializer for bigint
|
|
949
949
|
* https://github.com/GoogleChromeLabs/jsbi/issues/30
|
|
950
950
|
*/
|
|
951
|
-
if (typeof BigInt.prototype[
|
|
952
|
-
BigInt.prototype[
|
|
951
|
+
if (typeof BigInt.prototype["toJSON"] == "undefined") {
|
|
952
|
+
BigInt.prototype["toJSON"] = function () {
|
|
953
953
|
return this.toString();
|
|
954
954
|
};
|
|
955
955
|
}
|
|
@@ -957,7 +957,7 @@ if (typeof BigInt.prototype['toJSON'] == 'undefined') {
|
|
|
957
957
|
const MAX_INT64 = 0x7fffffffffffffffn;
|
|
958
958
|
const MIN_INT64 = -0x8000000000000000n;
|
|
959
959
|
|
|
960
|
-
const AsyncFunction = Object.getPrototypeOf(async function(){}).constructor;
|
|
960
|
+
const AsyncFunction = Object.getPrototypeOf(async function () {}).constructor;
|
|
961
961
|
|
|
962
962
|
class SQLiteError extends Error {
|
|
963
963
|
constructor(message, code) {
|
|
@@ -968,7 +968,6 @@ class SQLiteError extends Error {
|
|
|
968
968
|
|
|
969
969
|
const async = true;
|
|
970
970
|
|
|
971
|
-
|
|
972
971
|
/**
|
|
973
972
|
* Builds a Javascript API from the Emscripten module. This API is still
|
|
974
973
|
* low-level and closely corresponds to the C API exported by the module,
|
|
@@ -991,7 +990,7 @@ function Factory(Module) {
|
|
|
991
990
|
// Convert a JS string to a C string. sqlite3_malloc is used to allocate
|
|
992
991
|
// memory (use sqlite3_free to deallocate).
|
|
993
992
|
function createUTF8(s) {
|
|
994
|
-
if (typeof s !==
|
|
993
|
+
if (typeof s !== "string") return 0;
|
|
995
994
|
const utf8 = textEncoder.encode(s);
|
|
996
995
|
const zts = Module._sqlite3_malloc(utf8.byteLength + 1);
|
|
997
996
|
Module.HEAPU8.set(utf8, zts);
|
|
@@ -1022,11 +1021,11 @@ function Factory(Module) {
|
|
|
1022
1021
|
* @param {number} hi32
|
|
1023
1022
|
* @returns {number|bigint}
|
|
1024
1023
|
*/
|
|
1025
|
-
const cvt32x2AsSafe = (function() {
|
|
1024
|
+
const cvt32x2AsSafe = (function () {
|
|
1026
1025
|
const hiMax = BigInt(Number.MAX_SAFE_INTEGER) >> 32n;
|
|
1027
1026
|
const hiMin = BigInt(Number.MIN_SAFE_INTEGER) >> 32n;
|
|
1028
1027
|
|
|
1029
|
-
return function(lo32, hi32) {
|
|
1028
|
+
return function (lo32, hi32) {
|
|
1030
1029
|
if (hi32 > hiMax || hi32 < hiMin) {
|
|
1031
1030
|
// Can't be expressed as a Number so use BigInt.
|
|
1032
1031
|
return cvt32x2ToBigInt(lo32, hi32);
|
|
@@ -1042,18 +1041,18 @@ function Factory(Module) {
|
|
|
1042
1041
|
const databases = new Set();
|
|
1043
1042
|
function verifyDatabase(db) {
|
|
1044
1043
|
if (!databases.has(db)) {
|
|
1045
|
-
throw new SQLiteError(
|
|
1044
|
+
throw new SQLiteError("not a database", _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_MISUSE);
|
|
1046
1045
|
}
|
|
1047
1046
|
}
|
|
1048
1047
|
|
|
1049
1048
|
const mapStmtToDB = new Map();
|
|
1050
1049
|
function verifyStatement(stmt) {
|
|
1051
1050
|
if (!mapStmtToDB.has(stmt)) {
|
|
1052
|
-
throw new SQLiteError(
|
|
1051
|
+
throw new SQLiteError("not a statement", _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_MISUSE);
|
|
1053
1052
|
}
|
|
1054
1053
|
}
|
|
1055
1054
|
|
|
1056
|
-
sqlite3.bind_collection = function(stmt, bindings) {
|
|
1055
|
+
sqlite3.bind_collection = function (stmt, bindings) {
|
|
1057
1056
|
verifyStatement(stmt);
|
|
1058
1057
|
const isArray = Array.isArray(bindings);
|
|
1059
1058
|
const nBindings = sqlite3.bind_parameter_count(stmt);
|
|
@@ -1067,16 +1066,16 @@ function Factory(Module) {
|
|
|
1067
1066
|
return _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OK;
|
|
1068
1067
|
};
|
|
1069
1068
|
|
|
1070
|
-
sqlite3.bind = function(stmt, i, value) {
|
|
1069
|
+
sqlite3.bind = function (stmt, i, value) {
|
|
1071
1070
|
verifyStatement(stmt);
|
|
1072
1071
|
switch (typeof value) {
|
|
1073
|
-
case
|
|
1072
|
+
case "number":
|
|
1074
1073
|
if (value === (value | 0)) {
|
|
1075
1074
|
return sqlite3.bind_int(stmt, i, value);
|
|
1076
1075
|
} else {
|
|
1077
1076
|
return sqlite3.bind_double(stmt, i, value);
|
|
1078
1077
|
}
|
|
1079
|
-
case
|
|
1078
|
+
case "string":
|
|
1080
1079
|
return sqlite3.bind_text(stmt, i, value);
|
|
1081
1080
|
case "boolean":
|
|
1082
1081
|
return sqlite3.bind_int(stmt, i, value ? 1 : 0);
|
|
@@ -1085,22 +1084,22 @@ function Factory(Module) {
|
|
|
1085
1084
|
return sqlite3.bind_blob(stmt, i, value);
|
|
1086
1085
|
} else if (value === null) {
|
|
1087
1086
|
return sqlite3.bind_null(stmt, i);
|
|
1088
|
-
} else if (typeof value ===
|
|
1087
|
+
} else if (typeof value === "bigint") {
|
|
1089
1088
|
return sqlite3.bind_int64(stmt, i, value);
|
|
1090
1089
|
} else if (value === undefined) {
|
|
1091
1090
|
// Existing binding (or NULL) will be used.
|
|
1092
1091
|
return _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_NOTICE;
|
|
1093
1092
|
} else {
|
|
1094
|
-
console.warn(
|
|
1093
|
+
console.warn("unknown binding converted to null", value);
|
|
1095
1094
|
return sqlite3.bind_null(stmt, i);
|
|
1096
1095
|
}
|
|
1097
1096
|
}
|
|
1098
1097
|
};
|
|
1099
1098
|
|
|
1100
|
-
sqlite3.bind_blob = (function() {
|
|
1101
|
-
const fname =
|
|
1102
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1103
|
-
return function(stmt, i, value) {
|
|
1099
|
+
sqlite3.bind_blob = (function () {
|
|
1100
|
+
const fname = "sqlite3_bind_blob";
|
|
1101
|
+
const f = Module.cwrap(fname, ...decl("nnnnn:n"));
|
|
1102
|
+
return function (stmt, i, value) {
|
|
1104
1103
|
verifyStatement(stmt);
|
|
1105
1104
|
// @ts-ignore
|
|
1106
1105
|
const byteLength = value.byteLength ?? value.length;
|
|
@@ -1111,30 +1110,30 @@ function Factory(Module) {
|
|
|
1111
1110
|
};
|
|
1112
1111
|
})();
|
|
1113
1112
|
|
|
1114
|
-
sqlite3.bind_parameter_count = (function() {
|
|
1115
|
-
const fname =
|
|
1116
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1117
|
-
return function(stmt) {
|
|
1113
|
+
sqlite3.bind_parameter_count = (function () {
|
|
1114
|
+
const fname = "sqlite3_bind_parameter_count";
|
|
1115
|
+
const f = Module.cwrap(fname, ...decl("n:n"));
|
|
1116
|
+
return function (stmt) {
|
|
1118
1117
|
verifyStatement(stmt);
|
|
1119
1118
|
const result = f(stmt);
|
|
1120
1119
|
return result;
|
|
1121
1120
|
};
|
|
1122
1121
|
})();
|
|
1123
1122
|
|
|
1124
|
-
sqlite3.bind_double = (function() {
|
|
1125
|
-
const fname =
|
|
1126
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1127
|
-
return function(stmt, i, value) {
|
|
1123
|
+
sqlite3.bind_double = (function () {
|
|
1124
|
+
const fname = "sqlite3_bind_double";
|
|
1125
|
+
const f = Module.cwrap(fname, ...decl("nnn:n"));
|
|
1126
|
+
return function (stmt, i, value) {
|
|
1128
1127
|
verifyStatement(stmt);
|
|
1129
1128
|
const result = f(stmt, i, value);
|
|
1130
1129
|
return check(fname, result, mapStmtToDB.get(stmt));
|
|
1131
1130
|
};
|
|
1132
1131
|
})();
|
|
1133
1132
|
|
|
1134
|
-
sqlite3.bind_int = (function() {
|
|
1135
|
-
const fname =
|
|
1136
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1137
|
-
return function(stmt, i, value) {
|
|
1133
|
+
sqlite3.bind_int = (function () {
|
|
1134
|
+
const fname = "sqlite3_bind_int";
|
|
1135
|
+
const f = Module.cwrap(fname, ...decl("nnn:n"));
|
|
1136
|
+
return function (stmt, i, value) {
|
|
1138
1137
|
verifyStatement(stmt);
|
|
1139
1138
|
if (value > 0x7fffffff || value < -0x80000000) return _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_RANGE;
|
|
1140
1139
|
|
|
@@ -1143,10 +1142,10 @@ function Factory(Module) {
|
|
|
1143
1142
|
};
|
|
1144
1143
|
})();
|
|
1145
1144
|
|
|
1146
|
-
sqlite3.bind_int64 = (function() {
|
|
1147
|
-
const fname =
|
|
1148
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1149
|
-
return function(stmt, i, value) {
|
|
1145
|
+
sqlite3.bind_int64 = (function () {
|
|
1146
|
+
const fname = "sqlite3_bind_int64";
|
|
1147
|
+
const f = Module.cwrap(fname, ...decl("nnnn:n"));
|
|
1148
|
+
return function (stmt, i, value) {
|
|
1150
1149
|
verifyStatement(stmt);
|
|
1151
1150
|
if (value > MAX_INT64 || value < MIN_INT64) return _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_RANGE;
|
|
1152
1151
|
|
|
@@ -1157,30 +1156,30 @@ function Factory(Module) {
|
|
|
1157
1156
|
};
|
|
1158
1157
|
})();
|
|
1159
1158
|
|
|
1160
|
-
sqlite3.bind_null = (function() {
|
|
1161
|
-
const fname =
|
|
1162
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1163
|
-
return function(stmt, i) {
|
|
1159
|
+
sqlite3.bind_null = (function () {
|
|
1160
|
+
const fname = "sqlite3_bind_null";
|
|
1161
|
+
const f = Module.cwrap(fname, ...decl("nn:n"));
|
|
1162
|
+
return function (stmt, i) {
|
|
1164
1163
|
verifyStatement(stmt);
|
|
1165
1164
|
const result = f(stmt, i);
|
|
1166
1165
|
return check(fname, result, mapStmtToDB.get(stmt));
|
|
1167
1166
|
};
|
|
1168
1167
|
})();
|
|
1169
1168
|
|
|
1170
|
-
sqlite3.bind_parameter_name = (function() {
|
|
1171
|
-
const fname =
|
|
1172
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1173
|
-
return function(stmt, i) {
|
|
1169
|
+
sqlite3.bind_parameter_name = (function () {
|
|
1170
|
+
const fname = "sqlite3_bind_parameter_name";
|
|
1171
|
+
const f = Module.cwrap(fname, ...decl("n:s"));
|
|
1172
|
+
return function (stmt, i) {
|
|
1174
1173
|
verifyStatement(stmt);
|
|
1175
1174
|
const result = f(stmt, i);
|
|
1176
1175
|
return result;
|
|
1177
1176
|
};
|
|
1178
1177
|
})();
|
|
1179
1178
|
|
|
1180
|
-
sqlite3.bind_text = (function() {
|
|
1181
|
-
const fname =
|
|
1182
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1183
|
-
return function(stmt, i, value) {
|
|
1179
|
+
sqlite3.bind_text = (function () {
|
|
1180
|
+
const fname = "sqlite3_bind_text";
|
|
1181
|
+
const f = Module.cwrap(fname, ...decl("nnnnn:n"));
|
|
1182
|
+
return function (stmt, i, value) {
|
|
1184
1183
|
verifyStatement(stmt);
|
|
1185
1184
|
const ptr = createUTF8(value);
|
|
1186
1185
|
const result = f(stmt, i, ptr, -1, sqliteFreeAddress);
|
|
@@ -1188,41 +1187,41 @@ function Factory(Module) {
|
|
|
1188
1187
|
};
|
|
1189
1188
|
})();
|
|
1190
1189
|
|
|
1191
|
-
sqlite3.changes = (function() {
|
|
1192
|
-
const fname =
|
|
1193
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1194
|
-
return function(db) {
|
|
1190
|
+
sqlite3.changes = (function () {
|
|
1191
|
+
const fname = "sqlite3_changes";
|
|
1192
|
+
const f = Module.cwrap(fname, ...decl("n:n"));
|
|
1193
|
+
return function (db) {
|
|
1195
1194
|
verifyDatabase(db);
|
|
1196
1195
|
const result = f(db);
|
|
1197
1196
|
return result;
|
|
1198
1197
|
};
|
|
1199
1198
|
})();
|
|
1200
1199
|
|
|
1201
|
-
sqlite3.clear_bindings = (function() {
|
|
1202
|
-
const fname =
|
|
1203
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1204
|
-
return function(stmt) {
|
|
1200
|
+
sqlite3.clear_bindings = (function () {
|
|
1201
|
+
const fname = "sqlite3_clear_bindings";
|
|
1202
|
+
const f = Module.cwrap(fname, ...decl("n:n"));
|
|
1203
|
+
return function (stmt) {
|
|
1205
1204
|
verifyStatement(stmt);
|
|
1206
1205
|
const result = f(stmt);
|
|
1207
1206
|
return check(fname, result, mapStmtToDB.get(stmt));
|
|
1208
1207
|
};
|
|
1209
1208
|
})();
|
|
1210
1209
|
|
|
1211
|
-
sqlite3.last_insert_id = (function() {
|
|
1212
|
-
const fname =
|
|
1213
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1214
|
-
return function(db) {
|
|
1210
|
+
sqlite3.last_insert_id = (function () {
|
|
1211
|
+
const fname = "sqlite3_last_insert_rowid";
|
|
1212
|
+
const f = Module.cwrap(fname, ...decl("n:n"));
|
|
1213
|
+
return function (db) {
|
|
1215
1214
|
verifyDatabase(db);
|
|
1216
1215
|
const result = f(db);
|
|
1217
1216
|
// trace(fname, result);
|
|
1218
1217
|
return result;
|
|
1219
1218
|
};
|
|
1220
1219
|
})();
|
|
1221
|
-
|
|
1222
|
-
sqlite3.close = (function() {
|
|
1223
|
-
const fname =
|
|
1224
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1225
|
-
return async function(db) {
|
|
1220
|
+
|
|
1221
|
+
sqlite3.close = (function () {
|
|
1222
|
+
const fname = "sqlite3_close";
|
|
1223
|
+
const f = Module.cwrap(fname, ...decl("n:n"), { async });
|
|
1224
|
+
return async function (db) {
|
|
1226
1225
|
verifyDatabase(db);
|
|
1227
1226
|
const result = await f(db);
|
|
1228
1227
|
databases.delete(db);
|
|
@@ -1230,7 +1229,7 @@ function Factory(Module) {
|
|
|
1230
1229
|
};
|
|
1231
1230
|
})();
|
|
1232
1231
|
|
|
1233
|
-
sqlite3.column = function(stmt, iCol) {
|
|
1232
|
+
sqlite3.column = function (stmt, iCol) {
|
|
1234
1233
|
verifyStatement(stmt);
|
|
1235
1234
|
const type = sqlite3.column_type(stmt, iCol);
|
|
1236
1235
|
switch (type) {
|
|
@@ -1247,14 +1246,14 @@ function Factory(Module) {
|
|
|
1247
1246
|
case _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_TEXT:
|
|
1248
1247
|
return sqlite3.column_text(stmt, iCol);
|
|
1249
1248
|
default:
|
|
1250
|
-
throw new SQLiteError(
|
|
1249
|
+
throw new SQLiteError("unknown type", type);
|
|
1251
1250
|
}
|
|
1252
1251
|
};
|
|
1253
1252
|
|
|
1254
|
-
sqlite3.column_blob = (function() {
|
|
1255
|
-
const fname =
|
|
1256
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1257
|
-
return function(stmt, iCol) {
|
|
1253
|
+
sqlite3.column_blob = (function () {
|
|
1254
|
+
const fname = "sqlite3_column_blob";
|
|
1255
|
+
const f = Module.cwrap(fname, ...decl("nn:n"));
|
|
1256
|
+
return function (stmt, iCol) {
|
|
1258
1257
|
verifyStatement(stmt);
|
|
1259
1258
|
const nBytes = sqlite3.column_bytes(stmt, iCol);
|
|
1260
1259
|
const address = f(stmt, iCol);
|
|
@@ -1263,52 +1262,52 @@ function Factory(Module) {
|
|
|
1263
1262
|
};
|
|
1264
1263
|
})();
|
|
1265
1264
|
|
|
1266
|
-
sqlite3.column_bytes = (function() {
|
|
1267
|
-
const fname =
|
|
1268
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1269
|
-
return function(stmt, iCol) {
|
|
1265
|
+
sqlite3.column_bytes = (function () {
|
|
1266
|
+
const fname = "sqlite3_column_bytes";
|
|
1267
|
+
const f = Module.cwrap(fname, ...decl("nn:n"));
|
|
1268
|
+
return function (stmt, iCol) {
|
|
1270
1269
|
verifyStatement(stmt);
|
|
1271
1270
|
const result = f(stmt, iCol);
|
|
1272
1271
|
return result;
|
|
1273
1272
|
};
|
|
1274
1273
|
})();
|
|
1275
1274
|
|
|
1276
|
-
sqlite3.column_count = (function() {
|
|
1277
|
-
const fname =
|
|
1278
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1279
|
-
return function(stmt) {
|
|
1275
|
+
sqlite3.column_count = (function () {
|
|
1276
|
+
const fname = "sqlite3_column_count";
|
|
1277
|
+
const f = Module.cwrap(fname, ...decl("n:n"));
|
|
1278
|
+
return function (stmt) {
|
|
1280
1279
|
verifyStatement(stmt);
|
|
1281
1280
|
const result = f(stmt);
|
|
1282
1281
|
return result;
|
|
1283
1282
|
};
|
|
1284
1283
|
})();
|
|
1285
1284
|
|
|
1286
|
-
sqlite3.column_double = (function() {
|
|
1287
|
-
const fname =
|
|
1288
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1289
|
-
return function(stmt, iCol) {
|
|
1285
|
+
sqlite3.column_double = (function () {
|
|
1286
|
+
const fname = "sqlite3_column_double";
|
|
1287
|
+
const f = Module.cwrap(fname, ...decl("nn:n"));
|
|
1288
|
+
return function (stmt, iCol) {
|
|
1290
1289
|
verifyStatement(stmt);
|
|
1291
1290
|
const result = f(stmt, iCol);
|
|
1292
1291
|
return result;
|
|
1293
1292
|
};
|
|
1294
1293
|
})();
|
|
1295
1294
|
|
|
1296
|
-
sqlite3.column_int = (function() {
|
|
1295
|
+
sqlite3.column_int = (function () {
|
|
1297
1296
|
// Retrieve int64 but use only the lower 32 bits. The upper 32-bits are
|
|
1298
1297
|
// accessible with Module.getTempRet0().
|
|
1299
|
-
const fname =
|
|
1300
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1301
|
-
return function(stmt, iCol) {
|
|
1298
|
+
const fname = "sqlite3_column_int64";
|
|
1299
|
+
const f = Module.cwrap(fname, ...decl("nn:n"));
|
|
1300
|
+
return function (stmt, iCol) {
|
|
1302
1301
|
verifyStatement(stmt);
|
|
1303
1302
|
const result = f(stmt, iCol);
|
|
1304
1303
|
return result;
|
|
1305
1304
|
};
|
|
1306
1305
|
})();
|
|
1307
1306
|
|
|
1308
|
-
sqlite3.column_int64 = (function() {
|
|
1309
|
-
const fname =
|
|
1310
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1311
|
-
return function(stmt, iCol) {
|
|
1307
|
+
sqlite3.column_int64 = (function () {
|
|
1308
|
+
const fname = "sqlite3_column_int64";
|
|
1309
|
+
const f = Module.cwrap(fname, ...decl("nn:n"));
|
|
1310
|
+
return function (stmt, iCol) {
|
|
1312
1311
|
verifyStatement(stmt);
|
|
1313
1312
|
const lo32 = f(stmt, iCol);
|
|
1314
1313
|
const hi32 = Module.getTempRet0();
|
|
@@ -1317,17 +1316,17 @@ function Factory(Module) {
|
|
|
1317
1316
|
};
|
|
1318
1317
|
})();
|
|
1319
1318
|
|
|
1320
|
-
sqlite3.column_name = (function() {
|
|
1321
|
-
const fname =
|
|
1322
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1323
|
-
return function(stmt, iCol) {
|
|
1319
|
+
sqlite3.column_name = (function () {
|
|
1320
|
+
const fname = "sqlite3_column_name";
|
|
1321
|
+
const f = Module.cwrap(fname, ...decl("nn:s"));
|
|
1322
|
+
return function (stmt, iCol) {
|
|
1324
1323
|
verifyStatement(stmt);
|
|
1325
1324
|
const result = f(stmt, iCol);
|
|
1326
1325
|
return result;
|
|
1327
1326
|
};
|
|
1328
1327
|
})();
|
|
1329
1328
|
|
|
1330
|
-
sqlite3.column_names = function(stmt) {
|
|
1329
|
+
sqlite3.column_names = function (stmt) {
|
|
1331
1330
|
const columns = [];
|
|
1332
1331
|
const nColumns = sqlite3.column_count(stmt);
|
|
1333
1332
|
for (let i = 0; i < nColumns; ++i) {
|
|
@@ -1336,34 +1335,45 @@ function Factory(Module) {
|
|
|
1336
1335
|
return columns;
|
|
1337
1336
|
};
|
|
1338
1337
|
|
|
1339
|
-
sqlite3.column_text = (function() {
|
|
1340
|
-
const fname =
|
|
1341
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1342
|
-
return function(stmt, iCol) {
|
|
1338
|
+
sqlite3.column_text = (function () {
|
|
1339
|
+
const fname = "sqlite3_column_text";
|
|
1340
|
+
const f = Module.cwrap(fname, ...decl("nn:s"));
|
|
1341
|
+
return function (stmt, iCol) {
|
|
1343
1342
|
verifyStatement(stmt);
|
|
1344
1343
|
const result = f(stmt, iCol);
|
|
1345
1344
|
return result;
|
|
1346
1345
|
};
|
|
1347
1346
|
})();
|
|
1348
1347
|
|
|
1349
|
-
sqlite3.column_type = (function() {
|
|
1350
|
-
const fname =
|
|
1351
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1352
|
-
return function(stmt, iCol) {
|
|
1348
|
+
sqlite3.column_type = (function () {
|
|
1349
|
+
const fname = "sqlite3_column_type";
|
|
1350
|
+
const f = Module.cwrap(fname, ...decl("nn:n"));
|
|
1351
|
+
return function (stmt, iCol) {
|
|
1353
1352
|
verifyStatement(stmt);
|
|
1354
1353
|
const result = f(stmt, iCol);
|
|
1355
1354
|
return result;
|
|
1356
1355
|
};
|
|
1357
1356
|
})();
|
|
1358
1357
|
|
|
1359
|
-
sqlite3.create_function = function(
|
|
1358
|
+
sqlite3.create_function = function (
|
|
1359
|
+
db,
|
|
1360
|
+
zFunctionName,
|
|
1361
|
+
nArg,
|
|
1362
|
+
eTextRep,
|
|
1363
|
+
pApp,
|
|
1364
|
+
xFunc,
|
|
1365
|
+
xStep,
|
|
1366
|
+
xFinal,
|
|
1367
|
+
) {
|
|
1360
1368
|
verifyDatabase(db);
|
|
1361
|
-
|
|
1369
|
+
|
|
1362
1370
|
// Convert SQLite callback arguments to JavaScript-friendly arguments.
|
|
1363
1371
|
function adapt(f) {
|
|
1364
|
-
return f instanceof AsyncFunction
|
|
1365
|
-
|
|
1366
|
-
|
|
1372
|
+
return f instanceof AsyncFunction
|
|
1373
|
+
? async (ctx, n, values) =>
|
|
1374
|
+
f(ctx, Module.HEAP32.subarray(values / 4, values / 4 + n))
|
|
1375
|
+
: (ctx, n, values) =>
|
|
1376
|
+
f(ctx, Module.HEAP32.subarray(values / 4, values / 4 + n));
|
|
1367
1377
|
}
|
|
1368
1378
|
|
|
1369
1379
|
const result = Module.create_function(
|
|
@@ -1374,21 +1384,22 @@ function Factory(Module) {
|
|
|
1374
1384
|
pApp,
|
|
1375
1385
|
xFunc && adapt(xFunc),
|
|
1376
1386
|
xStep && adapt(xStep),
|
|
1377
|
-
xFinal
|
|
1378
|
-
|
|
1387
|
+
xFinal,
|
|
1388
|
+
);
|
|
1389
|
+
return check("sqlite3_create_function", result, db);
|
|
1379
1390
|
};
|
|
1380
1391
|
|
|
1381
|
-
sqlite3.data_count = (function() {
|
|
1382
|
-
const fname =
|
|
1383
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1384
|
-
return function(stmt) {
|
|
1392
|
+
sqlite3.data_count = (function () {
|
|
1393
|
+
const fname = "sqlite3_data_count";
|
|
1394
|
+
const f = Module.cwrap(fname, ...decl("n:n"));
|
|
1395
|
+
return function (stmt) {
|
|
1385
1396
|
verifyStatement(stmt);
|
|
1386
1397
|
const result = f(stmt);
|
|
1387
1398
|
return result;
|
|
1388
1399
|
};
|
|
1389
1400
|
})();
|
|
1390
1401
|
|
|
1391
|
-
sqlite3.exec = async function(db, sql, callback) {
|
|
1402
|
+
sqlite3.exec = async function (db, sql, callback) {
|
|
1392
1403
|
for await (const stmt of sqlite3.statements(db, sql)) {
|
|
1393
1404
|
let columns;
|
|
1394
1405
|
while ((await sqlite3.step(stmt)) === _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_ROW) {
|
|
@@ -1402,12 +1413,12 @@ function Factory(Module) {
|
|
|
1402
1413
|
return _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OK;
|
|
1403
1414
|
};
|
|
1404
1415
|
|
|
1405
|
-
sqlite3.finalize = (function() {
|
|
1406
|
-
const fname =
|
|
1407
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1408
|
-
return async function(stmt) {
|
|
1416
|
+
sqlite3.finalize = (function () {
|
|
1417
|
+
const fname = "sqlite3_finalize";
|
|
1418
|
+
const f = Module.cwrap(fname, ...decl("n:n"), { async });
|
|
1419
|
+
return async function (stmt) {
|
|
1409
1420
|
const result = await f(stmt);
|
|
1410
|
-
mapStmtToDB.delete(stmt)
|
|
1421
|
+
mapStmtToDB.delete(stmt);
|
|
1411
1422
|
|
|
1412
1423
|
// Don't throw on error here. Typically the error has already been
|
|
1413
1424
|
// thrown and finalize() is part of the cleanup.
|
|
@@ -1415,56 +1426,56 @@ function Factory(Module) {
|
|
|
1415
1426
|
};
|
|
1416
1427
|
})();
|
|
1417
1428
|
|
|
1418
|
-
sqlite3.get_autocommit = (function() {
|
|
1419
|
-
const fname =
|
|
1420
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1421
|
-
return function(db) {
|
|
1429
|
+
sqlite3.get_autocommit = (function () {
|
|
1430
|
+
const fname = "sqlite3_get_autocommit";
|
|
1431
|
+
const f = Module.cwrap(fname, ...decl("n:n"));
|
|
1432
|
+
return function (db) {
|
|
1422
1433
|
const result = f(db);
|
|
1423
1434
|
return result;
|
|
1424
1435
|
};
|
|
1425
1436
|
})();
|
|
1426
1437
|
|
|
1427
|
-
sqlite3.libversion = (function() {
|
|
1428
|
-
const fname =
|
|
1429
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1430
|
-
return function() {
|
|
1438
|
+
sqlite3.libversion = (function () {
|
|
1439
|
+
const fname = "sqlite3_libversion";
|
|
1440
|
+
const f = Module.cwrap(fname, ...decl(":s"));
|
|
1441
|
+
return function () {
|
|
1431
1442
|
const result = f();
|
|
1432
1443
|
return result;
|
|
1433
1444
|
};
|
|
1434
1445
|
})();
|
|
1435
1446
|
|
|
1436
|
-
sqlite3.libversion_number = (function() {
|
|
1437
|
-
const fname =
|
|
1438
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1439
|
-
return function() {
|
|
1447
|
+
sqlite3.libversion_number = (function () {
|
|
1448
|
+
const fname = "sqlite3_libversion_number";
|
|
1449
|
+
const f = Module.cwrap(fname, ...decl(":n"));
|
|
1450
|
+
return function () {
|
|
1440
1451
|
const result = f();
|
|
1441
1452
|
return result;
|
|
1442
1453
|
};
|
|
1443
1454
|
})();
|
|
1444
1455
|
|
|
1445
|
-
sqlite3.limit = (function() {
|
|
1446
|
-
const fname =
|
|
1447
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1448
|
-
return function(db, id, newVal) {
|
|
1456
|
+
sqlite3.limit = (function () {
|
|
1457
|
+
const fname = "sqlite3_limit";
|
|
1458
|
+
const f = Module.cwrap(fname, ...decl("nnn:n"));
|
|
1459
|
+
return function (db, id, newVal) {
|
|
1449
1460
|
const result = f(db, id, newVal);
|
|
1450
1461
|
return result;
|
|
1451
1462
|
};
|
|
1452
1463
|
})();
|
|
1453
1464
|
|
|
1454
|
-
sqlite3.open_v2 = (function() {
|
|
1455
|
-
const fname =
|
|
1456
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1457
|
-
return async function(zFilename, flags, zVfs) {
|
|
1465
|
+
sqlite3.open_v2 = (function () {
|
|
1466
|
+
const fname = "sqlite3_open_v2";
|
|
1467
|
+
const f = Module.cwrap(fname, ...decl("snnn:n"), { async });
|
|
1468
|
+
return async function (zFilename, flags, zVfs) {
|
|
1458
1469
|
flags = flags || _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OPEN_CREATE | _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OPEN_READWRITE;
|
|
1459
1470
|
zVfs = createUTF8(zVfs);
|
|
1460
1471
|
try {
|
|
1461
1472
|
// Allow retry operations.
|
|
1462
1473
|
const rc = await retry(() => f(zFilename, tmpPtr[0], flags, zVfs));
|
|
1463
1474
|
|
|
1464
|
-
const db = Module.getValue(tmpPtr[0],
|
|
1475
|
+
const db = Module.getValue(tmpPtr[0], "*");
|
|
1465
1476
|
databases.add(db);
|
|
1466
1477
|
|
|
1467
|
-
Module.ccall(
|
|
1478
|
+
Module.ccall("RegisterExtensionFunctions", "number", ["number"], [db]);
|
|
1468
1479
|
check(fname, rc);
|
|
1469
1480
|
return db;
|
|
1470
1481
|
} finally {
|
|
@@ -1473,31 +1484,31 @@ function Factory(Module) {
|
|
|
1473
1484
|
};
|
|
1474
1485
|
})();
|
|
1475
1486
|
|
|
1476
|
-
sqlite3.progress_handler = function(db, nProgressOps, handler, userData) {
|
|
1487
|
+
sqlite3.progress_handler = function (db, nProgressOps, handler, userData) {
|
|
1477
1488
|
verifyDatabase(db);
|
|
1478
1489
|
Module.progress_handler(db, nProgressOps, handler, userData);
|
|
1479
|
-
}
|
|
1490
|
+
};
|
|
1480
1491
|
|
|
1481
|
-
sqlite3.reset = (function() {
|
|
1482
|
-
const fname =
|
|
1483
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1484
|
-
return async function(stmt) {
|
|
1492
|
+
sqlite3.reset = (function () {
|
|
1493
|
+
const fname = "sqlite3_reset";
|
|
1494
|
+
const f = Module.cwrap(fname, ...decl("n:n"), { async });
|
|
1495
|
+
return async function (stmt) {
|
|
1485
1496
|
verifyStatement(stmt);
|
|
1486
1497
|
const result = await f(stmt);
|
|
1487
1498
|
return check(fname, result, mapStmtToDB.get(stmt));
|
|
1488
1499
|
};
|
|
1489
1500
|
})();
|
|
1490
1501
|
|
|
1491
|
-
sqlite3.result = function(context, value) {
|
|
1502
|
+
sqlite3.result = function (context, value) {
|
|
1492
1503
|
switch (typeof value) {
|
|
1493
|
-
case
|
|
1504
|
+
case "number":
|
|
1494
1505
|
if (value === (value | 0)) {
|
|
1495
1506
|
sqlite3.result_int(context, value);
|
|
1496
1507
|
} else {
|
|
1497
1508
|
sqlite3.result_double(context, value);
|
|
1498
1509
|
}
|
|
1499
1510
|
break;
|
|
1500
|
-
case
|
|
1511
|
+
case "string":
|
|
1501
1512
|
sqlite3.result_text(context, value);
|
|
1502
1513
|
break;
|
|
1503
1514
|
default:
|
|
@@ -1505,20 +1516,20 @@ function Factory(Module) {
|
|
|
1505
1516
|
sqlite3.result_blob(context, value);
|
|
1506
1517
|
} else if (value === null) {
|
|
1507
1518
|
sqlite3.result_null(context);
|
|
1508
|
-
} else if (typeof value ===
|
|
1519
|
+
} else if (typeof value === "bigint") {
|
|
1509
1520
|
return sqlite3.result_int64(context, value);
|
|
1510
1521
|
} else {
|
|
1511
|
-
console.warn(
|
|
1522
|
+
console.warn("unknown result converted to null", value);
|
|
1512
1523
|
sqlite3.result_null(context);
|
|
1513
1524
|
}
|
|
1514
1525
|
break;
|
|
1515
1526
|
}
|
|
1516
1527
|
};
|
|
1517
1528
|
|
|
1518
|
-
sqlite3.result_blob = (function() {
|
|
1519
|
-
const fname =
|
|
1520
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1521
|
-
return function(context, value) {
|
|
1529
|
+
sqlite3.result_blob = (function () {
|
|
1530
|
+
const fname = "sqlite3_result_blob";
|
|
1531
|
+
const f = Module.cwrap(fname, ...decl("nnnn:n"));
|
|
1532
|
+
return function (context, value) {
|
|
1522
1533
|
// @ts-ignore
|
|
1523
1534
|
const byteLength = value.byteLength ?? value.length;
|
|
1524
1535
|
const ptr = Module._sqlite3_malloc(byteLength);
|
|
@@ -1527,26 +1538,26 @@ function Factory(Module) {
|
|
|
1527
1538
|
};
|
|
1528
1539
|
})();
|
|
1529
1540
|
|
|
1530
|
-
sqlite3.result_double = (function() {
|
|
1531
|
-
const fname =
|
|
1532
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1533
|
-
return function(context, value) {
|
|
1541
|
+
sqlite3.result_double = (function () {
|
|
1542
|
+
const fname = "sqlite3_result_double";
|
|
1543
|
+
const f = Module.cwrap(fname, ...decl("nn:n"));
|
|
1544
|
+
return function (context, value) {
|
|
1534
1545
|
f(context, value); // void return
|
|
1535
1546
|
};
|
|
1536
1547
|
})();
|
|
1537
1548
|
|
|
1538
|
-
sqlite3.result_int = (function() {
|
|
1539
|
-
const fname =
|
|
1540
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1541
|
-
return function(context, value) {
|
|
1549
|
+
sqlite3.result_int = (function () {
|
|
1550
|
+
const fname = "sqlite3_result_int";
|
|
1551
|
+
const f = Module.cwrap(fname, ...decl("nn:n"));
|
|
1552
|
+
return function (context, value) {
|
|
1542
1553
|
f(context, value); // void return
|
|
1543
1554
|
};
|
|
1544
1555
|
})();
|
|
1545
1556
|
|
|
1546
|
-
sqlite3.result_int64 = (function() {
|
|
1547
|
-
const fname =
|
|
1548
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1549
|
-
return function(context, value) {
|
|
1557
|
+
sqlite3.result_int64 = (function () {
|
|
1558
|
+
const fname = "sqlite3_result_int64";
|
|
1559
|
+
const f = Module.cwrap(fname, ...decl("nnn:n"));
|
|
1560
|
+
return function (context, value) {
|
|
1550
1561
|
if (value > MAX_INT64 || value < MIN_INT64) return _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_RANGE;
|
|
1551
1562
|
|
|
1552
1563
|
const lo32 = value & 0xffffffffn;
|
|
@@ -1555,24 +1566,24 @@ function Factory(Module) {
|
|
|
1555
1566
|
};
|
|
1556
1567
|
})();
|
|
1557
1568
|
|
|
1558
|
-
sqlite3.result_null = (function() {
|
|
1559
|
-
const fname =
|
|
1560
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1561
|
-
return function(context) {
|
|
1569
|
+
sqlite3.result_null = (function () {
|
|
1570
|
+
const fname = "sqlite3_result_null";
|
|
1571
|
+
const f = Module.cwrap(fname, ...decl("n:n"));
|
|
1572
|
+
return function (context) {
|
|
1562
1573
|
f(context); // void return
|
|
1563
1574
|
};
|
|
1564
1575
|
})();
|
|
1565
1576
|
|
|
1566
|
-
sqlite3.result_text = (function() {
|
|
1567
|
-
const fname =
|
|
1568
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1569
|
-
return function(context, value) {
|
|
1577
|
+
sqlite3.result_text = (function () {
|
|
1578
|
+
const fname = "sqlite3_result_text";
|
|
1579
|
+
const f = Module.cwrap(fname, ...decl("nnnn:n"));
|
|
1580
|
+
return function (context, value) {
|
|
1570
1581
|
const ptr = createUTF8(value);
|
|
1571
1582
|
f(context, ptr, -1, sqliteFreeAddress); // void return
|
|
1572
1583
|
};
|
|
1573
1584
|
})();
|
|
1574
1585
|
|
|
1575
|
-
sqlite3.row = function(stmt) {
|
|
1586
|
+
sqlite3.row = function (stmt) {
|
|
1576
1587
|
const row = [];
|
|
1577
1588
|
const nColumns = sqlite3.data_count(stmt);
|
|
1578
1589
|
for (let i = 0; i < nColumns; ++i) {
|
|
@@ -1586,7 +1597,7 @@ function Factory(Module) {
|
|
|
1586
1597
|
return row;
|
|
1587
1598
|
};
|
|
1588
1599
|
|
|
1589
|
-
sqlite3.set_authorizer = function(db, xAuth, pApp) {
|
|
1600
|
+
sqlite3.set_authorizer = function (db, xAuth, pApp) {
|
|
1590
1601
|
verifyDatabase(db);
|
|
1591
1602
|
|
|
1592
1603
|
// Convert SQLite callback arguments to JavaScript-friendly arguments.
|
|
@@ -1597,37 +1608,40 @@ function Factory(Module) {
|
|
|
1597
1608
|
Module.UTF8ToString(p3),
|
|
1598
1609
|
Module.UTF8ToString(p4),
|
|
1599
1610
|
Module.UTF8ToString(p5),
|
|
1600
|
-
Module.UTF8ToString(p6)
|
|
1611
|
+
Module.UTF8ToString(p6),
|
|
1601
1612
|
];
|
|
1602
|
-
}
|
|
1613
|
+
}
|
|
1603
1614
|
function adapt(f) {
|
|
1604
|
-
return f instanceof AsyncFunction
|
|
1605
|
-
|
|
1606
|
-
|
|
1615
|
+
return f instanceof AsyncFunction
|
|
1616
|
+
? async (_, iAction, p3, p4, p5, p6) =>
|
|
1617
|
+
f(...cvtArgs(_, iAction, p3, p4, p5, p6))
|
|
1618
|
+
: (_, iAction, p3, p4, p5, p6) =>
|
|
1619
|
+
f(...cvtArgs(_, iAction, p3, p4, p5, p6));
|
|
1607
1620
|
}
|
|
1608
1621
|
|
|
1609
1622
|
const result = Module.set_authorizer(db, adapt(xAuth), pApp);
|
|
1610
|
-
return check(
|
|
1623
|
+
return check("sqlite3_set_authorizer", result, db);
|
|
1611
1624
|
};
|
|
1612
1625
|
|
|
1613
|
-
sqlite3.sql = (function() {
|
|
1614
|
-
const fname =
|
|
1615
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1616
|
-
return function(stmt) {
|
|
1626
|
+
sqlite3.sql = (function () {
|
|
1627
|
+
const fname = "sqlite3_sql";
|
|
1628
|
+
const f = Module.cwrap(fname, ...decl("n:s"));
|
|
1629
|
+
return function (stmt) {
|
|
1617
1630
|
verifyStatement(stmt);
|
|
1618
1631
|
const result = f(stmt);
|
|
1619
1632
|
return result;
|
|
1620
1633
|
};
|
|
1621
1634
|
})();
|
|
1622
1635
|
|
|
1623
|
-
sqlite3.statements = function(db, sql, options = {}) {
|
|
1636
|
+
sqlite3.statements = function (db, sql, options = {}) {
|
|
1624
1637
|
const prepare = Module.cwrap(
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
[
|
|
1628
|
-
{ async: true }
|
|
1638
|
+
"sqlite3_prepare_v3",
|
|
1639
|
+
"number",
|
|
1640
|
+
["number", "number", "number", "number", "number", "number"],
|
|
1641
|
+
{ async: true },
|
|
1642
|
+
);
|
|
1629
1643
|
|
|
1630
|
-
return (async function*() {
|
|
1644
|
+
return (async function* () {
|
|
1631
1645
|
const onFinally = [];
|
|
1632
1646
|
try {
|
|
1633
1647
|
// Encode SQL string to UTF-8.
|
|
@@ -1642,7 +1656,7 @@ function Factory(Module) {
|
|
|
1642
1656
|
onFinally.push(() => Module._sqlite3_free(pzHead));
|
|
1643
1657
|
Module.HEAPU8.set(utf8, pzHead);
|
|
1644
1658
|
Module.HEAPU8[pzEnd - 1] = 0;
|
|
1645
|
-
|
|
1659
|
+
|
|
1646
1660
|
// Use extra space for the statement handle and SQL tail pointer.
|
|
1647
1661
|
const pStmt = pzHead + allocSize - 8;
|
|
1648
1662
|
const pzTail = pzHead + allocSize - 4;
|
|
@@ -1656,16 +1670,16 @@ function Factory(Module) {
|
|
|
1656
1670
|
stmt = 0;
|
|
1657
1671
|
}
|
|
1658
1672
|
onFinally.push(maybeFinalize);
|
|
1659
|
-
|
|
1673
|
+
|
|
1660
1674
|
// Loop over statements.
|
|
1661
|
-
Module.setValue(pzTail, pzHead,
|
|
1675
|
+
Module.setValue(pzTail, pzHead, "*");
|
|
1662
1676
|
do {
|
|
1663
1677
|
// Reclaim resources for the previous iteration.
|
|
1664
1678
|
maybeFinalize();
|
|
1665
1679
|
|
|
1666
1680
|
// Call sqlite3_prepare_v3() for the next statement.
|
|
1667
1681
|
// Allow retry operations.
|
|
1668
|
-
const zTail = Module.getValue(pzTail,
|
|
1682
|
+
const zTail = Module.getValue(pzTail, "*");
|
|
1669
1683
|
const rc = await retry(() => {
|
|
1670
1684
|
return prepare(
|
|
1671
1685
|
db,
|
|
@@ -1673,14 +1687,15 @@ function Factory(Module) {
|
|
|
1673
1687
|
pzEnd - pzTail,
|
|
1674
1688
|
options.flags || 0,
|
|
1675
1689
|
pStmt,
|
|
1676
|
-
pzTail
|
|
1690
|
+
pzTail,
|
|
1691
|
+
);
|
|
1677
1692
|
});
|
|
1678
1693
|
|
|
1679
1694
|
if (rc !== _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OK) {
|
|
1680
|
-
check(
|
|
1695
|
+
check("sqlite3_prepare_v3", rc, db);
|
|
1681
1696
|
}
|
|
1682
|
-
|
|
1683
|
-
stmt = Module.getValue(pStmt,
|
|
1697
|
+
|
|
1698
|
+
stmt = Module.getValue(pStmt, "*");
|
|
1684
1699
|
if (stmt) {
|
|
1685
1700
|
mapStmtToDB.set(stmt, db);
|
|
1686
1701
|
yield stmt;
|
|
@@ -1694,25 +1709,28 @@ function Factory(Module) {
|
|
|
1694
1709
|
})();
|
|
1695
1710
|
};
|
|
1696
1711
|
|
|
1697
|
-
sqlite3.step = (function() {
|
|
1698
|
-
const fname =
|
|
1699
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1700
|
-
return async function(stmt) {
|
|
1712
|
+
sqlite3.step = (function () {
|
|
1713
|
+
const fname = "sqlite3_step";
|
|
1714
|
+
const f = Module.cwrap(fname, ...decl("n:n"), { async });
|
|
1715
|
+
return async function (stmt) {
|
|
1701
1716
|
verifyStatement(stmt);
|
|
1702
1717
|
|
|
1703
1718
|
// Allow retry operations.
|
|
1704
1719
|
const rc = await retry(() => f(stmt));
|
|
1705
1720
|
|
|
1706
|
-
return check(fname, rc, mapStmtToDB.get(stmt), [
|
|
1721
|
+
return check(fname, rc, mapStmtToDB.get(stmt), [
|
|
1722
|
+
_sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_ROW,
|
|
1723
|
+
_sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_DONE,
|
|
1724
|
+
]);
|
|
1707
1725
|
};
|
|
1708
1726
|
})();
|
|
1709
1727
|
|
|
1710
|
-
sqlite3.commit_hook = function(db, xCommitHook) {
|
|
1728
|
+
sqlite3.commit_hook = function (db, xCommitHook) {
|
|
1711
1729
|
verifyDatabase(db);
|
|
1712
1730
|
Module.commit_hook(db, xCommitHook);
|
|
1713
1731
|
};
|
|
1714
1732
|
|
|
1715
|
-
sqlite3.update_hook = function(db, xUpdateHook) {
|
|
1733
|
+
sqlite3.update_hook = function (db, xUpdateHook) {
|
|
1716
1734
|
verifyDatabase(db);
|
|
1717
1735
|
|
|
1718
1736
|
// Convert SQLite callback arguments to JavaScript-friendly arguments.
|
|
@@ -1721,19 +1739,21 @@ function Factory(Module) {
|
|
|
1721
1739
|
iUpdateType,
|
|
1722
1740
|
Module.UTF8ToString(dbName),
|
|
1723
1741
|
Module.UTF8ToString(tblName),
|
|
1724
|
-
|
|
1742
|
+
cvt32x2ToBigInt(lo32, hi32),
|
|
1725
1743
|
];
|
|
1726
|
-
}
|
|
1744
|
+
}
|
|
1727
1745
|
function adapt(f) {
|
|
1728
|
-
return f instanceof AsyncFunction
|
|
1729
|
-
|
|
1730
|
-
|
|
1746
|
+
return f instanceof AsyncFunction
|
|
1747
|
+
? async (iUpdateType, dbName, tblName, lo32, hi32) =>
|
|
1748
|
+
f(...cvtArgs(iUpdateType, dbName, tblName, lo32, hi32))
|
|
1749
|
+
: (iUpdateType, dbName, tblName, lo32, hi32) =>
|
|
1750
|
+
f(...cvtArgs(iUpdateType, dbName, tblName, lo32, hi32));
|
|
1731
1751
|
}
|
|
1732
1752
|
|
|
1733
1753
|
Module.update_hook(db, adapt(xUpdateHook));
|
|
1734
|
-
}
|
|
1754
|
+
};
|
|
1735
1755
|
|
|
1736
|
-
sqlite3.value = function(pValue) {
|
|
1756
|
+
sqlite3.value = function (pValue) {
|
|
1737
1757
|
const type = sqlite3.value_type(pValue);
|
|
1738
1758
|
switch (type) {
|
|
1739
1759
|
case _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_BLOB:
|
|
@@ -1749,14 +1769,14 @@ function Factory(Module) {
|
|
|
1749
1769
|
case _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_TEXT:
|
|
1750
1770
|
return sqlite3.value_text(pValue);
|
|
1751
1771
|
default:
|
|
1752
|
-
throw new SQLiteError(
|
|
1772
|
+
throw new SQLiteError("unknown type", type);
|
|
1753
1773
|
}
|
|
1754
1774
|
};
|
|
1755
1775
|
|
|
1756
|
-
sqlite3.value_blob = (function() {
|
|
1757
|
-
const fname =
|
|
1758
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1759
|
-
return function(pValue) {
|
|
1776
|
+
sqlite3.value_blob = (function () {
|
|
1777
|
+
const fname = "sqlite3_value_blob";
|
|
1778
|
+
const f = Module.cwrap(fname, ...decl("n:n"));
|
|
1779
|
+
return function (pValue) {
|
|
1760
1780
|
const nBytes = sqlite3.value_bytes(pValue);
|
|
1761
1781
|
const address = f(pValue);
|
|
1762
1782
|
const result = Module.HEAPU8.subarray(address, address + nBytes);
|
|
@@ -1764,37 +1784,37 @@ function Factory(Module) {
|
|
|
1764
1784
|
};
|
|
1765
1785
|
})();
|
|
1766
1786
|
|
|
1767
|
-
sqlite3.value_bytes = (function() {
|
|
1768
|
-
const fname =
|
|
1769
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1770
|
-
return function(pValue) {
|
|
1787
|
+
sqlite3.value_bytes = (function () {
|
|
1788
|
+
const fname = "sqlite3_value_bytes";
|
|
1789
|
+
const f = Module.cwrap(fname, ...decl("n:n"));
|
|
1790
|
+
return function (pValue) {
|
|
1771
1791
|
const result = f(pValue);
|
|
1772
1792
|
return result;
|
|
1773
1793
|
};
|
|
1774
1794
|
})();
|
|
1775
1795
|
|
|
1776
|
-
sqlite3.value_double = (function() {
|
|
1777
|
-
const fname =
|
|
1778
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1779
|
-
return function(pValue) {
|
|
1796
|
+
sqlite3.value_double = (function () {
|
|
1797
|
+
const fname = "sqlite3_value_double";
|
|
1798
|
+
const f = Module.cwrap(fname, ...decl("n:n"));
|
|
1799
|
+
return function (pValue) {
|
|
1780
1800
|
const result = f(pValue);
|
|
1781
1801
|
return result;
|
|
1782
1802
|
};
|
|
1783
1803
|
})();
|
|
1784
1804
|
|
|
1785
|
-
sqlite3.value_int = (function() {
|
|
1786
|
-
const fname =
|
|
1787
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1788
|
-
return function(pValue) {
|
|
1805
|
+
sqlite3.value_int = (function () {
|
|
1806
|
+
const fname = "sqlite3_value_int64";
|
|
1807
|
+
const f = Module.cwrap(fname, ...decl("n:n"));
|
|
1808
|
+
return function (pValue) {
|
|
1789
1809
|
const result = f(pValue);
|
|
1790
1810
|
return result;
|
|
1791
1811
|
};
|
|
1792
1812
|
})();
|
|
1793
1813
|
|
|
1794
|
-
sqlite3.value_int64 = (function() {
|
|
1795
|
-
const fname =
|
|
1796
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1797
|
-
return function(pValue) {
|
|
1814
|
+
sqlite3.value_int64 = (function () {
|
|
1815
|
+
const fname = "sqlite3_value_int64";
|
|
1816
|
+
const f = Module.cwrap(fname, ...decl("n:n"));
|
|
1817
|
+
return function (pValue) {
|
|
1798
1818
|
const lo32 = f(pValue);
|
|
1799
1819
|
const hi32 = Module.getTempRet0();
|
|
1800
1820
|
const result = cvt32x2ToBigInt(lo32, hi32);
|
|
@@ -1802,32 +1822,34 @@ function Factory(Module) {
|
|
|
1802
1822
|
};
|
|
1803
1823
|
})();
|
|
1804
1824
|
|
|
1805
|
-
sqlite3.value_text = (function() {
|
|
1806
|
-
const fname =
|
|
1807
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1808
|
-
return function(pValue) {
|
|
1825
|
+
sqlite3.value_text = (function () {
|
|
1826
|
+
const fname = "sqlite3_value_text";
|
|
1827
|
+
const f = Module.cwrap(fname, ...decl("n:s"));
|
|
1828
|
+
return function (pValue) {
|
|
1809
1829
|
const result = f(pValue);
|
|
1810
1830
|
return result;
|
|
1811
1831
|
};
|
|
1812
1832
|
})();
|
|
1813
1833
|
|
|
1814
|
-
sqlite3.value_type = (function() {
|
|
1815
|
-
const fname =
|
|
1816
|
-
const f = Module.cwrap(fname, ...decl(
|
|
1817
|
-
return function(pValue) {
|
|
1834
|
+
sqlite3.value_type = (function () {
|
|
1835
|
+
const fname = "sqlite3_value_type";
|
|
1836
|
+
const f = Module.cwrap(fname, ...decl("n:n"));
|
|
1837
|
+
return function (pValue) {
|
|
1818
1838
|
const result = f(pValue);
|
|
1819
1839
|
return result;
|
|
1820
1840
|
};
|
|
1821
1841
|
})();
|
|
1822
1842
|
|
|
1823
|
-
sqlite3.vfs_register = function(vfs, makeDefault) {
|
|
1843
|
+
sqlite3.vfs_register = function (vfs, makeDefault) {
|
|
1824
1844
|
const result = Module.vfs_register(vfs, makeDefault);
|
|
1825
|
-
return check(
|
|
1845
|
+
return check("sqlite3_vfs_register", result);
|
|
1826
1846
|
};
|
|
1827
1847
|
|
|
1828
1848
|
function check(fname, result, db = null, allowed = [_sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OK]) {
|
|
1829
1849
|
if (allowed.includes(result)) return result;
|
|
1830
|
-
const message = db
|
|
1850
|
+
const message = db
|
|
1851
|
+
? Module.ccall("sqlite3_errmsg", "string", ["number"], [db])
|
|
1852
|
+
: fname;
|
|
1831
1853
|
throw new SQLiteError(message, result);
|
|
1832
1854
|
}
|
|
1833
1855
|
|
|
@@ -1840,20 +1862,20 @@ function Factory(Module) {
|
|
|
1840
1862
|
// Wait for all pending retry operations to complete. This is
|
|
1841
1863
|
// normally empty on the first loop iteration.
|
|
1842
1864
|
if (Module.retryOps.length) {
|
|
1843
|
-
try {
|
|
1865
|
+
try {
|
|
1844
1866
|
await Promise.all(Module.retryOps);
|
|
1845
1867
|
} finally {
|
|
1846
1868
|
Module.retryOps = [];
|
|
1847
1869
|
}
|
|
1848
1870
|
}
|
|
1849
|
-
|
|
1871
|
+
|
|
1850
1872
|
rc = await f();
|
|
1851
1873
|
if (rc === _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OK || Module.retryOps.length === 0) {
|
|
1852
1874
|
if (Module.pendingOps.length) {
|
|
1853
1875
|
try {
|
|
1854
1876
|
await Promise.all(Module.pendingOps);
|
|
1855
1877
|
} catch (e) {
|
|
1856
|
-
console.error(
|
|
1878
|
+
console.error("Error in pendingOps:", e);
|
|
1857
1879
|
return e.code || _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_ERROR;
|
|
1858
1880
|
} finally {
|
|
1859
1881
|
Module.pendingOps = [];
|
|
@@ -1873,13 +1895,13 @@ function decl(s) {
|
|
|
1873
1895
|
const result = [];
|
|
1874
1896
|
const m = s.match(/([ns@]*):([nsv@])/);
|
|
1875
1897
|
switch (m[2]) {
|
|
1876
|
-
case
|
|
1877
|
-
result.push(
|
|
1898
|
+
case "n":
|
|
1899
|
+
result.push("number");
|
|
1878
1900
|
break;
|
|
1879
|
-
case
|
|
1880
|
-
result.push(
|
|
1901
|
+
case "s":
|
|
1902
|
+
result.push("string");
|
|
1881
1903
|
break;
|
|
1882
|
-
case
|
|
1904
|
+
case "v":
|
|
1883
1905
|
result.push(null);
|
|
1884
1906
|
break;
|
|
1885
1907
|
}
|
|
@@ -1887,11 +1909,11 @@ function decl(s) {
|
|
|
1887
1909
|
const args = [];
|
|
1888
1910
|
for (let c of m[1]) {
|
|
1889
1911
|
switch (c) {
|
|
1890
|
-
case
|
|
1891
|
-
args.push(
|
|
1912
|
+
case "n":
|
|
1913
|
+
args.push("number");
|
|
1892
1914
|
break;
|
|
1893
|
-
case
|
|
1894
|
-
args.push(
|
|
1915
|
+
case "s":
|
|
1916
|
+
args.push("string");
|
|
1895
1917
|
break;
|
|
1896
1918
|
}
|
|
1897
1919
|
}
|
|
@@ -1902,9 +1924,9 @@ function decl(s) {
|
|
|
1902
1924
|
|
|
1903
1925
|
/***/ },
|
|
1904
1926
|
|
|
1905
|
-
/***/ "../../node_modules/.pnpm/@journeyapps+wa-sqlite@0.0.0-dev-
|
|
1927
|
+
/***/ "../../node_modules/.pnpm/@journeyapps+wa-sqlite@0.0.0-dev-20260226145021/node_modules/@journeyapps/wa-sqlite/src/sqlite-constants.js"
|
|
1906
1928
|
/*!********************************************************************************************************************************************!*\
|
|
1907
|
-
!*** ../../node_modules/.pnpm/@journeyapps+wa-sqlite@0.0.0-dev-
|
|
1929
|
+
!*** ../../node_modules/.pnpm/@journeyapps+wa-sqlite@0.0.0-dev-20260226145021/node_modules/@journeyapps/wa-sqlite/src/sqlite-constants.js ***!
|
|
1908
1930
|
\********************************************************************************************************************************************/
|
|
1909
1931
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
1910
1932
|
|
|
@@ -3020,7 +3042,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3020
3042
|
/* harmony export */ WASqliteConnection: () => (/* binding */ WASqliteConnection),
|
|
3021
3043
|
/* harmony export */ needsDedicatedWorker: () => (/* binding */ needsDedicatedWorker)
|
|
3022
3044
|
/* harmony export */ });
|
|
3023
|
-
/* harmony import */ var _journeyapps_wa_sqlite__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @journeyapps/wa-sqlite */ "../../node_modules/.pnpm/@journeyapps+wa-sqlite@0.0.0-dev-
|
|
3045
|
+
/* harmony import */ var _journeyapps_wa_sqlite__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @journeyapps/wa-sqlite */ "../../node_modules/.pnpm/@journeyapps+wa-sqlite@0.0.0-dev-20260226145021/node_modules/@journeyapps/wa-sqlite/src/sqlite-api.js");
|
|
3024
3046
|
/* harmony import */ var _powersync_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @powersync/common */ "../common/dist/bundle.mjs");
|
|
3025
3047
|
/* harmony import */ var async_mutex__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! async-mutex */ "../../node_modules/.pnpm/async-mutex@0.5.0/node_modules/async-mutex/index.mjs");
|
|
3026
3048
|
|
|
@@ -3054,28 +3076,28 @@ function needsDedicatedWorker(vfs) {
|
|
|
3054
3076
|
* @internal
|
|
3055
3077
|
*/
|
|
3056
3078
|
const AsyncWASQLiteModuleFactory = async () => {
|
|
3057
|
-
const { default: factory } = await __webpack_require__.e(/*! import() */ "node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-
|
|
3079
|
+
const { default: factory } = await __webpack_require__.e(/*! import() */ "node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260226145021_node_modules_journeyapps_wa--7ba318").then(__webpack_require__.bind(__webpack_require__, /*! @journeyapps/wa-sqlite/dist/wa-sqlite-async.mjs */ "../../node_modules/.pnpm/@journeyapps+wa-sqlite@0.0.0-dev-20260226145021/node_modules/@journeyapps/wa-sqlite/dist/wa-sqlite-async.mjs"));
|
|
3058
3080
|
return factory();
|
|
3059
3081
|
};
|
|
3060
3082
|
/**
|
|
3061
3083
|
* @internal
|
|
3062
3084
|
*/
|
|
3063
3085
|
const MultiCipherAsyncWASQLiteModuleFactory = async () => {
|
|
3064
|
-
const { default: factory } = await __webpack_require__.e(/*! import() */ "node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-
|
|
3086
|
+
const { default: factory } = await __webpack_require__.e(/*! import() */ "node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260226145021_node_modules_journeyapps_wa--919198").then(__webpack_require__.bind(__webpack_require__, /*! @journeyapps/wa-sqlite/dist/mc-wa-sqlite-async.mjs */ "../../node_modules/.pnpm/@journeyapps+wa-sqlite@0.0.0-dev-20260226145021/node_modules/@journeyapps/wa-sqlite/dist/mc-wa-sqlite-async.mjs"));
|
|
3065
3087
|
return factory();
|
|
3066
3088
|
};
|
|
3067
3089
|
/**
|
|
3068
3090
|
* @internal
|
|
3069
3091
|
*/
|
|
3070
3092
|
const SyncWASQLiteModuleFactory = async () => {
|
|
3071
|
-
const { default: factory } = await __webpack_require__.e(/*! import() */ "node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-
|
|
3093
|
+
const { default: factory } = await __webpack_require__.e(/*! import() */ "node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260226145021_node_modules_journeyapps_wa--4e15a2").then(__webpack_require__.bind(__webpack_require__, /*! @journeyapps/wa-sqlite/dist/wa-sqlite.mjs */ "../../node_modules/.pnpm/@journeyapps+wa-sqlite@0.0.0-dev-20260226145021/node_modules/@journeyapps/wa-sqlite/dist/wa-sqlite.mjs"));
|
|
3072
3094
|
return factory();
|
|
3073
3095
|
};
|
|
3074
3096
|
/**
|
|
3075
3097
|
* @internal
|
|
3076
3098
|
*/
|
|
3077
3099
|
const MultiCipherSyncWASQLiteModuleFactory = async () => {
|
|
3078
|
-
const { default: factory } = await __webpack_require__.e(/*! import() */ "node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-
|
|
3100
|
+
const { default: factory } = await __webpack_require__.e(/*! import() */ "node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260226145021_node_modules_journeyapps_wa--997c14").then(__webpack_require__.bind(__webpack_require__, /*! @journeyapps/wa-sqlite/dist/mc-wa-sqlite.mjs */ "../../node_modules/.pnpm/@journeyapps+wa-sqlite@0.0.0-dev-20260226145021/node_modules/@journeyapps/wa-sqlite/dist/mc-wa-sqlite.mjs"));
|
|
3079
3101
|
return factory();
|
|
3080
3102
|
};
|
|
3081
3103
|
/**
|
|
@@ -3084,7 +3106,7 @@ const MultiCipherSyncWASQLiteModuleFactory = async () => {
|
|
|
3084
3106
|
const DEFAULT_MODULE_FACTORIES = {
|
|
3085
3107
|
[WASQLiteVFS.IDBBatchAtomicVFS]: async (options) => {
|
|
3086
3108
|
const module = await loadModule(true, options);
|
|
3087
|
-
const { IDBBatchAtomicVFS } = await __webpack_require__.e(/*! import() */ "node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-
|
|
3109
|
+
const { IDBBatchAtomicVFS } = await __webpack_require__.e(/*! import() */ "node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260226145021_node_modules_journeyapps_wa--1787c2").then(__webpack_require__.bind(__webpack_require__, /*! @journeyapps/wa-sqlite/src/examples/IDBBatchAtomicVFS.js */ "../../node_modules/.pnpm/@journeyapps+wa-sqlite@0.0.0-dev-20260226145021/node_modules/@journeyapps/wa-sqlite/src/examples/IDBBatchAtomicVFS.js"));
|
|
3088
3110
|
return {
|
|
3089
3111
|
module,
|
|
3090
3112
|
// @ts-expect-error The types for this static method are missing upstream
|
|
@@ -3094,7 +3116,7 @@ const DEFAULT_MODULE_FACTORIES = {
|
|
|
3094
3116
|
[WASQLiteVFS.AccessHandlePoolVFS]: async (options) => {
|
|
3095
3117
|
const module = await loadModule(false, options);
|
|
3096
3118
|
// @ts-expect-error The types for this static method are missing upstream
|
|
3097
|
-
const { AccessHandlePoolVFS } = await __webpack_require__.e(/*! import() */ "node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-
|
|
3119
|
+
const { AccessHandlePoolVFS } = await __webpack_require__.e(/*! import() */ "node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260226145021_node_modules_journeyapps_wa--a6ce73").then(__webpack_require__.bind(__webpack_require__, /*! @journeyapps/wa-sqlite/src/examples/AccessHandlePoolVFS.js */ "../../node_modules/.pnpm/@journeyapps+wa-sqlite@0.0.0-dev-20260226145021/node_modules/@journeyapps/wa-sqlite/src/examples/AccessHandlePoolVFS.js"));
|
|
3098
3120
|
return {
|
|
3099
3121
|
module,
|
|
3100
3122
|
vfs: await AccessHandlePoolVFS.create(options.dbFileName, module)
|
|
@@ -3103,7 +3125,7 @@ const DEFAULT_MODULE_FACTORIES = {
|
|
|
3103
3125
|
[WASQLiteVFS.OPFSCoopSyncVFS]: async (options) => {
|
|
3104
3126
|
const module = await loadModule(false, options);
|
|
3105
3127
|
// @ts-expect-error The types for this static method are missing upstream
|
|
3106
|
-
const { OPFSCoopSyncVFS } = await __webpack_require__.e(/*! import() */ "node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-
|
|
3128
|
+
const { OPFSCoopSyncVFS } = await __webpack_require__.e(/*! import() */ "node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260226145021_node_modules_journeyapps_wa--0e69f0").then(__webpack_require__.bind(__webpack_require__, /*! @journeyapps/wa-sqlite/src/examples/OPFSCoopSyncVFS.js */ "../../node_modules/.pnpm/@journeyapps+wa-sqlite@0.0.0-dev-20260226145021/node_modules/@journeyapps/wa-sqlite/src/examples/OPFSCoopSyncVFS.js"));
|
|
3107
3129
|
const vfs = await OPFSCoopSyncVFS.create(options.dbFileName, module);
|
|
3108
3130
|
return {
|
|
3109
3131
|
module,
|
|
@@ -3113,7 +3135,7 @@ const DEFAULT_MODULE_FACTORIES = {
|
|
|
3113
3135
|
[WASQLiteVFS.OPFSWriteAheadVFS]: async (options) => {
|
|
3114
3136
|
const module = await loadModule(false, options);
|
|
3115
3137
|
// @ts-expect-error The types for this static method are missing upstream
|
|
3116
|
-
const { OPFSWriteAheadVFS } = await __webpack_require__.e(/*! import() */ "node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-
|
|
3138
|
+
const { OPFSWriteAheadVFS } = await __webpack_require__.e(/*! import() */ "node_modules_pnpm_journeyapps_wa-sqlite_0_0_0-dev-20260226145021_node_modules_journeyapps_wa--24f702").then(__webpack_require__.bind(__webpack_require__, /*! @journeyapps/wa-sqlite/src/examples/OPFSWriteAheadVFS.js */ "../../node_modules/.pnpm/@journeyapps+wa-sqlite@0.0.0-dev-20260226145021/node_modules/@journeyapps/wa-sqlite/src/examples/OPFSWriteAheadVFS.js"));
|
|
3117
3139
|
const vfs = await OPFSWriteAheadVFS.create(options.dbFileName, module, {
|
|
3118
3140
|
// TODO: The asyncErrorHandler callback might be interesting to handle IDB failures, but it's not clear how we'd
|
|
3119
3141
|
// do that from here.
|
|
@@ -17535,7 +17557,11 @@ class AbstractPowerSyncDatabase extends BaseObserver {
|
|
|
17535
17557
|
this.logger.warn('Schema validation failed. Unexpected behaviour could occur', ex);
|
|
17536
17558
|
}
|
|
17537
17559
|
this._schema = schema;
|
|
17538
|
-
|
|
17560
|
+
// powersync_replace_schema starts a transaction internally, but we can be more efficient by using BEGIN EXCLUSIVE
|
|
17561
|
+
// on some DB adapters.
|
|
17562
|
+
this.database.writeTransaction((tx) => {
|
|
17563
|
+
return tx.execute('SELECT powersync_replace_schema(?)', [JSON.stringify(this.schema.toJSON())]);
|
|
17564
|
+
});
|
|
17539
17565
|
await this.database.refreshSchema();
|
|
17540
17566
|
this.iterateListeners(async (cb) => cb.schemaChanged?.(schema));
|
|
17541
17567
|
}
|