@delali/sirannon-db 0.3.5 → 0.3.6-next.78
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/backup/index.d.ts +5 -5
- package/dist/backup/index.mjs +5 -3
- package/dist/backup-scheduler/index.d.ts +2 -2
- package/dist/backup-scheduler/index.mjs +2 -2
- package/dist/chunk-22TYGH7J.mjs +55 -0
- package/dist/{chunk-SB3MIFLG.mjs → chunk-2ZQOZFX7.mjs} +29 -6
- package/dist/{chunk-UIDQGPJY.mjs → chunk-4O7WYZHN.mjs} +38 -3
- package/dist/{chunk-ZFFUVYYE.mjs → chunk-5DKWHT6K.mjs} +109 -1
- package/dist/chunk-5O4J6LQQ.mjs +35 -0
- package/dist/{chunk-CZL4D3BM.mjs → chunk-6CABU54O.mjs} +2 -2
- package/dist/{chunk-JAQ2I4OT.mjs → chunk-A5ULJVK7.mjs} +11 -11
- package/dist/{chunk-RLBKZZ24.mjs → chunk-AC7TKWNH.mjs} +1 -0
- package/dist/chunk-BKO4SCEC.mjs +99 -0
- package/dist/{chunk-KOTBP4AW.mjs → chunk-C7E4H6UN.mjs} +24 -4
- package/dist/{chunk-G4AG3ESO.mjs → chunk-FBA7P4ZA.mjs} +114 -149
- package/dist/{chunk-DKML5425.mjs → chunk-GBVB6WSC.mjs} +2 -2
- package/dist/chunk-I4JY5QPA.mjs +51 -0
- package/dist/{chunk-L6EX6K27.mjs → chunk-MO4APBYG.mjs} +54 -13
- package/dist/{chunk-RPWBYASV.mjs → chunk-MTOQ6QIS.mjs} +1 -1
- package/dist/chunk-MX77PGEN.mjs +60 -0
- package/dist/{chunk-BTUD6XQO.mjs → chunk-N3MHZV3B.mjs} +11 -29
- package/dist/{chunk-UHUDPQFI.mjs → chunk-OJXV4L3N.mjs} +1 -3
- package/dist/chunk-QF7WF7RJ.mjs +34 -0
- package/dist/chunk-RLBV4YTB.mjs +22 -0
- package/dist/{chunk-ISDT4RBD.mjs → chunk-ULUZUBON.mjs} +1 -1
- package/dist/{chunk-AP4367HK.mjs → chunk-VGRAAQX3.mjs} +4 -4
- package/dist/chunk-W74HFQFD.mjs +153 -0
- package/dist/chunk-Y4SP7CRF.mjs +9 -0
- package/dist/{chunk-JFVEGN7J.mjs → chunk-ZAUHAJ4G.mjs} +2 -1
- package/dist/{chunk-DDIHBUEN.mjs → chunk-ZWW53O5P.mjs} +19 -7
- package/dist/client/index.d.ts +8 -8
- package/dist/client/topology.d.ts +4 -4
- package/dist/{client-base-Doaqwrx3.d.ts → client-base-DJZbSY55.d.ts} +2 -2
- package/dist/{client-streams-MKPE4MXW.mjs → client-streams-F7IG3PTU.mjs} +13 -16
- package/dist/core/index.d.ts +48 -12
- package/dist/core/index.mjs +1812 -107
- package/dist/core/writer-worker.mjs +28 -4
- package/dist/{database-fz-8CJBP.d.ts → database-BZ96ZzAx.d.ts} +411 -184
- package/dist/{database-backup-BwTNiBm2.d.ts → database-backup-BhM8yJ1A.d.ts} +32 -2
- package/dist/driver/better-sqlite3.d.ts +11 -1
- package/dist/driver/better-sqlite3.mjs +212 -23
- package/dist/driver/bun.d.ts +1 -1
- package/dist/driver/bun.mjs +15 -22
- package/dist/driver/expo.d.ts +1 -1
- package/dist/driver/expo.mjs +185 -16
- package/dist/driver/node.d.ts +1 -1
- package/dist/driver/node.mjs +15 -62
- package/dist/driver/wa-sqlite.d.ts +1 -1
- package/dist/driver/wa-sqlite.mjs +14 -153
- package/dist/{change-tracker-Dpo99EI-.d.ts → errors-DLMAGQFb.d.ts} +200 -2
- package/dist/file-migrations/index.d.ts +1 -1
- package/dist/peer-refusal-RR37UOLV.mjs +1 -0
- package/dist/{protocol-DZSYSv0S.d.ts → protocol-DE10taas.d.ts} +1 -1
- package/dist/replication/coordinator/etcd.mjs +1 -1
- package/dist/replication/index.d.ts +7 -7
- package/dist/replication/index.mjs +66 -9
- package/dist/{restore-options-CcMukOLO.d.ts → restore-options-B6HV_5XT.d.ts} +6 -1
- package/dist/server/index.d.ts +10 -10
- package/dist/server/index.mjs +506 -350
- package/dist/{server-options-B9CsAZp5.d.ts → server-options-Bhdlvehe.d.ts} +14 -1
- package/dist/{server-streams-SBYCHWWM.mjs → server-streams-Q2AZAW3N.mjs} +6 -30
- package/dist/{sirannon-D0CjDULa.d.ts → sirannon-Ba1o2HUQ.d.ts} +5 -5
- package/dist/transport/grpc.d.ts +15 -4
- package/dist/transport/grpc.mjs +34 -37
- package/dist/transport/memory.d.ts +4 -3
- package/dist/transport/memory.mjs +8 -26
- package/dist/{types-DTmi7pXp.d.ts → types-BWyv_N18.d.ts} +189 -1
- package/dist/{types-BlZ9GG1a.d.ts → types-CDnlkVRK.d.ts} +8 -2
- package/package.json +17 -9
- package/dist/chunk-DBN57KVR.mjs +0 -171
- package/dist/chunk-W67A4H2E.mjs +0 -23
- package/dist/chunk-YW7IKQ7T.mjs +0 -62
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { executeGroup } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
1
|
+
import { executeGroup } from '../chunk-ULUZUBON.mjs';
|
|
2
|
+
import '../chunk-ZWW53O5P.mjs';
|
|
3
|
+
import '../chunk-ZAUHAJ4G.mjs';
|
|
4
4
|
import { WORKER_CANCELLED_CODE, serializeError, WORKER_BEGIN_FAILED_CODE, WORKER_COPY_STOPPED_CODE } from '../chunk-75IBRE73.mjs';
|
|
5
5
|
import { addRowCounts, rowCountsOf, withRowCounts } from '../chunk-E2GRX4ZD.mjs';
|
|
6
6
|
import { SirannonError } from '../chunk-KINDFBQP.mjs';
|
|
@@ -70,7 +70,23 @@ async function open(entry, path, options) {
|
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
72
|
const driver = factory(entry.config);
|
|
73
|
-
|
|
73
|
+
const openOptions = options;
|
|
74
|
+
try {
|
|
75
|
+
connection = await driver.open(path, openOptions);
|
|
76
|
+
} finally {
|
|
77
|
+
openOptions?.encryption?.key.fill(0);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function captureCall(call) {
|
|
81
|
+
const conn = requireConnection();
|
|
82
|
+
const member = conn[call];
|
|
83
|
+
if (!member) {
|
|
84
|
+
throw new SirannonError(
|
|
85
|
+
"The driver rebuilt inside the writer worker opens connections that cannot record their changes, so a key change cannot run on it",
|
|
86
|
+
"ENCRYPTION_UNSUPPORTED"
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
return member.bind(conn);
|
|
74
90
|
}
|
|
75
91
|
var runningCopies = /* @__PURE__ */ new Map();
|
|
76
92
|
async function dispatch(req) {
|
|
@@ -161,6 +177,14 @@ async function dispatch(req) {
|
|
|
161
177
|
runningCopies.delete(req.id);
|
|
162
178
|
}
|
|
163
179
|
}
|
|
180
|
+
case "startChangeCapture":
|
|
181
|
+
await captureCall("startChangeCapture")();
|
|
182
|
+
return void 0;
|
|
183
|
+
case "takeCapturedChanges":
|
|
184
|
+
return captureCall("takeCapturedChanges")();
|
|
185
|
+
case "stopChangeCapture":
|
|
186
|
+
await captureCall("stopChangeCapture")();
|
|
187
|
+
return void 0;
|
|
164
188
|
case "close":
|
|
165
189
|
if (connection) await connection.close();
|
|
166
190
|
connection = null;
|