@delali/sirannon-db 0.3.4-next.62 → 0.3.4
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/README.md +79 -56
- package/dist/backup/index.d.ts +44 -45
- package/dist/backup/index.mjs +7 -7
- package/dist/backup-scheduler/index.d.ts +42 -41
- package/dist/backup-scheduler/index.mjs +4 -4
- package/dist/baseline-Co3iIsN_.d.ts +19 -0
- package/dist/change-tracker-DqCdeEyx.d.ts +128 -0
- package/dist/{chunk-VOSJBZ6Q.mjs → chunk-2ES3DT4A.mjs} +71 -33
- package/dist/{chunk-6CMCO7S4.mjs → chunk-2O3PP4CF.mjs} +1 -1
- package/dist/{chunk-E7Q7HE46.mjs → chunk-3BZLZ47R.mjs} +26 -26
- package/dist/chunk-4KASJKKK.mjs +2501 -0
- package/dist/{chunk-MYNI2WFS.mjs → chunk-52XW3Z76.mjs} +40 -8
- package/dist/chunk-55YRLSM2.mjs +57 -0
- package/dist/{chunk-KDAHYFW7.mjs → chunk-6AOJCNRU.mjs} +5 -5
- package/dist/{chunk-KXTYR2OQ.mjs → chunk-A3PHCO6W.mjs} +39 -111
- package/dist/chunk-ADNWEHGZ.mjs +299 -0
- package/dist/{chunk-2QLXDHAP.mjs → chunk-BLMRNSUG.mjs} +11 -2
- package/dist/chunk-BVMZJOVM.mjs +5 -0
- package/dist/{chunk-IWGIYDMZ.mjs → chunk-BZWDPF4G.mjs} +1 -1
- package/dist/{chunk-YVF2ZJTE.mjs → chunk-CZL4D3BM.mjs} +1 -1
- package/dist/{chunk-7SC2TZAS.mjs → chunk-DX4WGJL7.mjs} +2 -2
- package/dist/{chunk-45MKELYA.mjs → chunk-ESTZZPT5.mjs} +132 -13
- package/dist/{chunk-QP5L5DFJ.mjs → chunk-FJPR2CJX.mjs} +3 -3
- package/dist/chunk-HR7K3GZW.mjs +36 -0
- package/dist/{chunk-LXCGPZPA.mjs → chunk-IEKIYO4V.mjs} +1 -1
- package/dist/{chunk-TUD5CJ76.mjs → chunk-KB4OLJAD.mjs} +26 -19
- package/dist/{chunk-PBRXXISQ.mjs → chunk-KINDFBQP.mjs} +3 -2
- package/dist/{chunk-E6IMX7RS.mjs → chunk-KJLNYOOL.mjs} +2 -2
- package/dist/{chunk-BTTFW4Z4.mjs → chunk-KU32OT4H.mjs} +2 -10
- package/dist/{chunk-JQWGHSEH.mjs → chunk-NVSQ2T5Q.mjs} +71 -70
- package/dist/{chunk-W4EUTJNT.mjs → chunk-NZGSDALX.mjs} +94 -96
- package/dist/{chunk-U445A3C4.mjs → chunk-QGVRRKB2.mjs} +1 -1
- package/dist/{chunk-GYCEJNU4.mjs → chunk-R7GBXNTO.mjs} +1 -1
- package/dist/{chunk-7C36BCSN.mjs → chunk-VDN6FHU4.mjs} +1 -1
- package/dist/{chunk-6IYS4WLH.mjs → chunk-VO3ZWA2G.mjs} +142 -115
- package/dist/chunk-WOMADPM4.mjs +12 -0
- package/dist/{chunk-OUSWVNWT.mjs → chunk-YCMB6GR4.mjs} +1 -1
- package/dist/{chunk-YNTDOFTN.mjs → chunk-YW7IKQ7T.mjs} +1 -1
- package/dist/{chunk-M2BEAH5I.mjs → chunk-ZN4HI5FK.mjs} +126 -72
- package/dist/{chunk-SBL6GN43.mjs → chunk-ZYWI45EN.mjs} +1 -1
- package/dist/client/index.d.ts +135 -137
- package/dist/client/index.mjs +177 -82
- package/dist/client/topology.d.ts +31 -31
- package/dist/client/topology.mjs +42 -23
- package/dist/client-base-BxTocU1x.d.ts +398 -0
- package/dist/client-streams-YKANXMWO.mjs +112 -0
- package/dist/codegen/cli.mjs +4 -4
- package/dist/codegen/index.d.ts +36 -29
- package/dist/codegen/index.mjs +4 -4
- package/dist/core/index.d.ts +130 -115
- package/dist/core/index.mjs +387 -297
- package/dist/core/writer-worker.mjs +3 -3
- package/dist/database-CGDsXW1K.d.ts +959 -0
- package/dist/database-backup-DcLhxoa1.d.ts +143 -0
- package/dist/driver/better-sqlite3.d.ts +11 -10
- package/dist/driver/better-sqlite3.mjs +11 -11
- package/dist/driver/bun.d.ts +9 -8
- package/dist/driver/expo.d.ts +6 -7
- package/dist/driver/node.d.ts +11 -10
- package/dist/driver/node.mjs +13 -11
- package/dist/driver/wa-sqlite.d.ts +6 -6
- package/dist/errors-CJUkQ-KL.d.ts +199 -0
- package/dist/file-migrations/index.d.ts +20 -18
- package/dist/file-migrations/index.mjs +3 -3
- package/dist/forward-rpc-VRWFZXHN.mjs +44 -0
- package/dist/operation-registry-CGhNT-Sn.d.ts +96 -0
- package/dist/primary-wins-CHNOYuN7.d.ts +81 -0
- package/dist/protocol-DFpNNsIT.d.ts +153 -0
- package/dist/query-types-5B02ixH0.d.ts +129 -0
- package/dist/react/index.d.ts +22 -22
- package/dist/replication/coordinator/etcd.d.ts +37 -31
- package/dist/replication/coordinator/etcd.mjs +296 -131
- package/dist/replication/index.d.ts +201 -161
- package/dist/replication/index.mjs +630 -529
- package/dist/restore-options-CH8mE-Tb.d.ts +84 -0
- package/dist/server/index.d.ts +201 -191
- package/dist/server/index.mjs +736 -619
- package/dist/server-options-aYtCkefX.d.ts +317 -0
- package/dist/server-streams-24XL4T43.mjs +254 -0
- package/dist/sirannon-J3EgPVD7.d.ts +179 -0
- package/dist/transport/grpc.d.ts +37 -24
- package/dist/transport/grpc.mjs +83 -3199
- package/dist/transport/memory.d.ts +25 -26
- package/dist/transport/memory.mjs +18 -9
- package/dist/types-BrAiDGOb.d.ts +505 -0
- package/dist/types-CEJG0eFS.d.ts +88 -0
- package/dist/types-Dc8oWlxj.d.ts +1580 -0
- package/dist/types-DqODKeOq.d.ts +123 -0
- package/dist/types-guEKSzMr.d.ts +367 -0
- package/package.json +7 -7
- package/dist/baseline-D93hcIEE.d.ts +0 -17
- package/dist/change-tracker-CjRFuZdB.d.ts +0 -144
- package/dist/client-base-Cmd9EVme.d.ts +0 -397
- package/dist/database-BLQvqjsw.d.ts +0 -917
- package/dist/database-backup-B7oszQ2n.d.ts +0 -141
- package/dist/errors-Dei4GdBb.d.ts +0 -196
- package/dist/operation-registry-oiPuSYI6.d.ts +0 -94
- package/dist/primary-wins-B0np8JS3.d.ts +0 -85
- package/dist/protocol-HI-nY8DD.d.ts +0 -152
- package/dist/query-types-p1liOP-b.d.ts +0 -127
- package/dist/restore-options-CksYsH1l.d.ts +0 -83
- package/dist/server-options-Bj5iJnjx.d.ts +0 -292
- package/dist/sirannon-BPxC5tC2.d.ts +0 -178
- package/dist/types-B0EhgDbr.d.ts +0 -340
- package/dist/types-CbjfRwrK.d.ts +0 -499
- package/dist/types-CjhxcjhA.d.ts +0 -123
- package/dist/types-DPSmjU54.d.ts +0 -1518
- package/dist/types-DTO4CYhW.d.ts +0 -88
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { B as BackupDestination, S as SQLiteDriver } from './types-Dc8oWlxj.js';
|
|
2
|
+
|
|
3
|
+
/** The progress of one restore, which Sirannon reports after every piece that it fetches and after every batch.
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
interface BackupRestoreProgress {
|
|
7
|
+
/** Whether Sirannon is fetching the full copy or applying the change pieces on top of it. */
|
|
8
|
+
phase: 'full-copy' | 'changes';
|
|
9
|
+
/** The number of pieces fetched so far. */
|
|
10
|
+
piecesFetched: number;
|
|
11
|
+
/** The number of bytes fetched so far. */
|
|
12
|
+
bytesFetched: number;
|
|
13
|
+
/** The number of change pieces applied so far. */
|
|
14
|
+
changesApplied: number;
|
|
15
|
+
/** The total number of change pieces in the plan. */
|
|
16
|
+
changesTotal: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The settings for rebuilding a database at a moment that you name.
|
|
20
|
+
*
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
interface BackupRestoreOptions {
|
|
24
|
+
/** The destination that holds the backups and their records. */
|
|
25
|
+
destination: BackupDestination;
|
|
26
|
+
/** The driver that Sirannon opens the rebuilt database through, so that it can checkpoint each batch of changes into the file. */
|
|
27
|
+
driver: SQLiteDriver;
|
|
28
|
+
/** The path that Sirannon writes the rebuilt database to. A file at that path stops the restore unless you set {@link BackupRestoreOptions.replaceExisting}. */
|
|
29
|
+
destPath: string;
|
|
30
|
+
/**
|
|
31
|
+
* Whether to replace a database that already exists at that path. Defaults to
|
|
32
|
+
* false, because a restore can delete the write-ahead log next to that path,
|
|
33
|
+
* and with it any commit that the log still holds. Set this when you intend
|
|
34
|
+
* to restore over a database that you no longer need.
|
|
35
|
+
*/
|
|
36
|
+
replaceExisting?: boolean;
|
|
37
|
+
/** The moment to restore to, in epoch milliseconds. Defaults to now, which restores the newest backup at the destination. */
|
|
38
|
+
moment?: number;
|
|
39
|
+
/** The name that Sirannon stores the list of chains under. Defaults to `sirannon-backup-chain`. */
|
|
40
|
+
chainName?: string;
|
|
41
|
+
/**
|
|
42
|
+
* The number of change pieces to apply between one checkpoint and the next.
|
|
43
|
+
* Defaults to 16, with a maximum of 4096. This number sets the upper limit on
|
|
44
|
+
* the log that the restore writes next to the database, so lower it where
|
|
45
|
+
* disk space is short, and raise it where a long chain needs too many
|
|
46
|
+
* checkpoints.
|
|
47
|
+
*/
|
|
48
|
+
batchSize?: number;
|
|
49
|
+
/** The number of milliseconds that one call to the destination can take before Sirannon fails the restore. Defaults to 10 minutes, and zero removes the deadline. */
|
|
50
|
+
destinationTimeoutMs?: number;
|
|
51
|
+
/** Called after every piece that Sirannon fetches, and after every batch. */
|
|
52
|
+
onProgress?: (progress: BackupRestoreProgress) => void;
|
|
53
|
+
}
|
|
54
|
+
/** The report of one finished restore.
|
|
55
|
+
* @public
|
|
56
|
+
*/
|
|
57
|
+
interface BackupRestoreReport {
|
|
58
|
+
/** The chain that Sirannon restores from. */
|
|
59
|
+
chainId: string;
|
|
60
|
+
/** The path of the rebuilt database. */
|
|
61
|
+
destPath: string;
|
|
62
|
+
/** The name that Sirannon stores the full copy of the chain under. */
|
|
63
|
+
baseName: string;
|
|
64
|
+
/** The moment, in epoch milliseconds, that the rebuilt database reflects, which is the capture time of the last change piece applied, or the finish time of the full copy where Sirannon applies none. */
|
|
65
|
+
restoresTo: number;
|
|
66
|
+
/** The number of stored pieces that Sirannon fetches, for the full copy and every change piece. */
|
|
67
|
+
pieceCount: number;
|
|
68
|
+
/** The number of bytes that Sirannon fetches. */
|
|
69
|
+
bytesFetched: number;
|
|
70
|
+
/** The number of change pieces that Sirannon applies. */
|
|
71
|
+
changesApplied: number;
|
|
72
|
+
/** The number of log frames in those pieces. */
|
|
73
|
+
framesApplied: number;
|
|
74
|
+
/** The number of batches that Sirannon applies the change pieces in, each with a checkpoint of its own. */
|
|
75
|
+
batchCount: number;
|
|
76
|
+
/** The moment, in epoch milliseconds, that the restore started. */
|
|
77
|
+
startedAt: number;
|
|
78
|
+
/** The moment, in epoch milliseconds, that the restore finished. */
|
|
79
|
+
finishedAt: number;
|
|
80
|
+
/** The length of the restore, in milliseconds. */
|
|
81
|
+
durationMs: number;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export type { BackupRestoreOptions as B, BackupRestoreReport as a, BackupRestoreProgress as b };
|