@delali/sirannon-db 0.2.0 → 0.2.1
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-scheduler/index.d.ts +15 -1
- package/dist/backup-scheduler/index.mjs +2 -2
- package/dist/baseline-D93hcIEE.d.ts +17 -0
- package/dist/{change-tracker-DKRVUC3l.d.ts → change-tracker-DDmXB754.d.ts} +56 -8
- package/dist/{chunk-5NOIGN5Y.mjs → chunk-2QLXDHAP.mjs} +1 -1
- package/dist/{chunk-LNY2VVHE.mjs → chunk-7C36BCSN.mjs} +1 -1
- package/dist/{chunk-NVQS53NT.mjs → chunk-7FQRQH5Z.mjs} +53 -64
- package/dist/{chunk-D7LAYTKN.mjs → chunk-7R4ER4FB.mjs} +1 -1
- package/dist/{chunk-FHWTZFI4.mjs → chunk-BQFQ65OL.mjs} +1 -1
- package/dist/{chunk-O7SLN3GI.mjs → chunk-BTTFW4Z4.mjs} +1 -1
- package/dist/{chunk-H6PIVVDN.mjs → chunk-CCZK6LCB.mjs} +38 -25
- package/dist/{chunk-JZGINXTN.mjs → chunk-HCCGEIZ2.mjs} +2 -2
- package/dist/{chunk-67M7KAH6.mjs → chunk-IWGIYDMZ.mjs} +1 -1
- package/dist/{chunk-LFZ37BSX.mjs → chunk-OUSWVNWT.mjs} +1 -1
- package/dist/{chunk-HR5CWTLC.mjs → chunk-P2VJYRVY.mjs} +60 -7
- package/dist/{chunk-UC3SCMIN.mjs → chunk-PBRXXISQ.mjs} +3 -0
- package/dist/{chunk-JU64Y7HM.mjs → chunk-SBL6GN43.mjs} +1 -1
- package/dist/{chunk-EBJXPQQO.mjs → chunk-UPKKSUPA.mjs} +2 -2
- package/dist/{chunk-TJF5GZSV.mjs → chunk-VOSJBZ6Q.mjs} +1 -1
- package/dist/{chunk-PIKHN33N.mjs → chunk-VOYGMAU7.mjs} +9 -1
- package/dist/{chunk-H237TXZW.mjs → chunk-WJ67DTD6.mjs} +48 -6
- package/dist/{chunk-OQVZBEBY.mjs → chunk-XF2HH5E6.mjs} +4 -61
- package/dist/client/index.d.ts +211 -12
- package/dist/client/index.mjs +155 -67
- package/dist/client/topology.d.ts +55 -7
- package/dist/client/topology.mjs +20 -1
- package/dist/{client-base-CLWmH5Ln.d.ts → client-base-CmZO0v3m.d.ts} +133 -24
- package/dist/codegen/cli.mjs +3 -3
- package/dist/codegen/index.d.ts +92 -2
- package/dist/codegen/index.mjs +3 -3
- package/dist/core/index.d.ts +177 -15
- package/dist/core/index.mjs +2481 -2226
- package/dist/core/writer-worker.mjs +3 -3
- package/dist/database-B5Qv1-cU.d.ts +380 -0
- package/dist/driver/better-sqlite3.d.ts +18 -1
- package/dist/driver/better-sqlite3.mjs +5 -5
- package/dist/driver/bun.d.ts +28 -0
- package/dist/driver/expo.d.ts +17 -0
- package/dist/driver/node.d.ts +18 -1
- package/dist/driver/node.mjs +5 -5
- package/dist/driver/wa-sqlite.d.ts +18 -1
- package/dist/{errors-Bw5MdNCu.d.ts → errors-Dei4GdBb.d.ts} +80 -7
- package/dist/file-migrations/index.d.ts +54 -2
- package/dist/file-migrations/index.mjs +3 -3
- package/dist/{operation-registry-9DcvxcE5.d.ts → operation-registry-hlbhqu7q.d.ts} +50 -1
- package/dist/{primary-wins-DPAm2AKG.d.ts → primary-wins-B0np8JS3.d.ts} +25 -1
- package/dist/protocol-rqANt-9Q.d.ts +152 -0
- package/dist/query-types-DL3LtPvY.d.ts +95 -0
- package/dist/react/index.d.ts +58 -3
- package/dist/replication/coordinator/etcd.d.ts +63 -3
- package/dist/replication/coordinator/etcd.mjs +82 -46
- package/dist/replication/index.d.ts +329 -95
- package/dist/replication/index.mjs +256 -141
- package/dist/server/index.d.ts +230 -12
- package/dist/server/index.mjs +63 -50
- package/dist/{server-options-1JHu8pid.d.ts → server-options-Dab_Jvd_.d.ts} +96 -12
- package/dist/sirannon-CMhiJa5Y.d.ts +111 -0
- package/dist/transport/grpc.d.ts +93 -9
- package/dist/transport/grpc.mjs +63 -20
- package/dist/transport/memory.d.ts +50 -20
- package/dist/transport/memory.mjs +25 -0
- package/dist/{types-CL6piSnD.d.ts → types-BCejqzNA.d.ts} +20 -0
- package/dist/types-CMBcFPhb.d.ts +336 -0
- package/dist/types-CjhxcjhA.d.ts +123 -0
- package/dist/types-DyrCiWuc.d.ts +499 -0
- package/dist/types-rVZKnKN-.d.ts +591 -0
- package/package.json +7 -1
- package/dist/baseline-Br77Fnhb.d.ts +0 -6
- package/dist/database-BY0L5Q2n.d.ts +0 -172
- package/dist/protocol-6KrSq2Hy.d.ts +0 -66
- package/dist/sirannon-DaQSyhbJ.d.ts +0 -36
- package/dist/types-B7gmEsZW.d.ts +0 -221
- package/dist/types-BsVabqSI.d.ts +0 -139
- package/dist/types-C_D8IhpO.d.ts +0 -60
- package/dist/types-zhnRXrsb.d.ts +0 -384
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import { i as QueryHookContext, j as ConnectionHookContext, k as BeforeSubscribeHook, H as HookConfig, l as MetricsConfig, m as QueryMetrics, n as ConnectionMetrics, o as CDCMetrics, h as ChangeEvent, a as SQLiteDriver, D as DatabaseOptions, P as Params, Q as QueryOptions, E as ExecuteResult, T as Transaction, e as SQLiteConnection, p as SubscriptionBuilder, M as Migration, q as MigrationResult, r as RollbackResult, f as BackupScheduleOptions, B as BeforeQueryHook, A as AfterQueryHook } from './types-zhnRXrsb.js';
|
|
2
|
-
import { c as ReplicationChange, C as ConflictResolver, A as ApplyResult, R as ReplicationBatch } from './types-C_D8IhpO.js';
|
|
3
|
-
import { A as AppliedMigrationRow, b as BulkLoadOptions, a as BulkLoadResult } from './server-options-1JHu8pid.js';
|
|
4
|
-
import { L as LiveQueryOptions, a as LiveQuery } from './types-CL6piSnD.js';
|
|
5
|
-
|
|
6
|
-
type HookEvent = 'beforeQuery' | 'afterQuery' | 'beforeConnect' | 'databaseOpen' | 'databaseClose' | 'beforeSubscribe';
|
|
7
|
-
type SubscribeHookContext = Parameters<BeforeSubscribeHook>[0];
|
|
8
|
-
interface HookEventContextMap {
|
|
9
|
-
beforeQuery: QueryHookContext;
|
|
10
|
-
afterQuery: QueryHookContext & {
|
|
11
|
-
durationMs: number;
|
|
12
|
-
};
|
|
13
|
-
beforeConnect: ConnectionHookContext;
|
|
14
|
-
databaseOpen: ConnectionHookContext;
|
|
15
|
-
databaseClose: ConnectionHookContext;
|
|
16
|
-
beforeSubscribe: SubscribeHookContext;
|
|
17
|
-
}
|
|
18
|
-
type HookHandler<E extends HookEvent> = (ctx: HookEventContextMap[E]) => void | Promise<void>;
|
|
19
|
-
type HookDispose = () => void;
|
|
20
|
-
|
|
21
|
-
declare class HookRegistry {
|
|
22
|
-
private hooks;
|
|
23
|
-
constructor(config?: HookConfig);
|
|
24
|
-
register<E extends HookEvent>(event: E, hook: HookHandler<E>): HookDispose;
|
|
25
|
-
invoke<E extends HookEvent>(event: E, ctx: HookEventContextMap[E]): Promise<void>;
|
|
26
|
-
invokeSync<E extends HookEvent>(event: E, ctx: HookEventContextMap[E]): void;
|
|
27
|
-
has(event: HookEvent): boolean;
|
|
28
|
-
count(event: HookEvent): number;
|
|
29
|
-
clear(event?: HookEvent): void;
|
|
30
|
-
private addHook;
|
|
31
|
-
private loadConfig;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
declare class MetricsCollector {
|
|
35
|
-
private config;
|
|
36
|
-
constructor(config?: MetricsConfig);
|
|
37
|
-
trackQuery<T>(fn: () => Promise<T>, context: Omit<QueryMetrics, 'durationMs' | 'error'>): Promise<T>;
|
|
38
|
-
trackConnection(metrics: ConnectionMetrics): void;
|
|
39
|
-
trackCDCEvent(metrics: CDCMetrics): void;
|
|
40
|
-
get active(): boolean;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
interface StagedRecovery {
|
|
44
|
-
resumeSeq: bigint | null;
|
|
45
|
-
appliedSeq: bigint | null;
|
|
46
|
-
/**
|
|
47
|
-
* The failure that stopped the recovery apply, or null. The staged rows
|
|
48
|
-
* are untouched by the failure and the resume watermark still covers
|
|
49
|
-
* them, so the caller opens the subscription anyway: a schema-gate refusal
|
|
50
|
-
* there is what tells a device it must migrate before this apply can
|
|
51
|
-
* succeed. The caller must then retry the recovery, because the resume
|
|
52
|
-
* watermark is past the transaction this apply left unapplied, so the
|
|
53
|
-
* server sends nothing that would prompt another attempt.
|
|
54
|
-
*/
|
|
55
|
-
applyError: unknown | null;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
interface DeviceSyncPullState {
|
|
59
|
-
seq: bigint;
|
|
60
|
-
epoch: string | undefined;
|
|
61
|
-
}
|
|
62
|
-
interface DeviceSyncPort {
|
|
63
|
-
identity(): Promise<{
|
|
64
|
-
nodeId: string;
|
|
65
|
-
}>;
|
|
66
|
-
applyPulledTransaction(changes: readonly ReplicationChange[], pullSeq: bigint, resolver?: ConflictResolver | ((table: string) => ConflictResolver)): Promise<ApplyResult>;
|
|
67
|
-
stagePulledChanges(events: readonly ChangeEvent[]): Promise<bigint | null>;
|
|
68
|
-
applyStagedPull(resolver?: ConflictResolver | ((table: string) => ConflictResolver), onChange?: (event: ChangeEvent) => void): Promise<bigint | null>;
|
|
69
|
-
recoverStagedPull(resolver?: ConflictResolver | ((table: string) => ConflictResolver), onChange?: (event: ChangeEvent) => void): Promise<StagedRecovery>;
|
|
70
|
-
readOutboxBatch(afterSeq: bigint, limit: number): Promise<ReplicationBatch | null>;
|
|
71
|
-
countOutboxPending(afterSeq: bigint): Promise<number>;
|
|
72
|
-
getPushCursor(): Promise<bigint>;
|
|
73
|
-
setPushCursor(seq: bigint): Promise<void>;
|
|
74
|
-
getPullState(): Promise<DeviceSyncPullState | null>;
|
|
75
|
-
getResyncRequired(): Promise<boolean>;
|
|
76
|
-
setResyncRequired(required: boolean): Promise<void>;
|
|
77
|
-
setPullState(seq: bigint, epoch?: string): Promise<void>;
|
|
78
|
-
protectUnpushedChanges(pushedSeq: bigint): void;
|
|
79
|
-
snapshotLoadPending(): Promise<boolean>;
|
|
80
|
-
beginSnapshotLoad(tables: readonly string[]): Promise<void>;
|
|
81
|
-
applySnapshotSchema(schema: readonly string[]): Promise<void>;
|
|
82
|
-
loadSnapshotPage(table: string, rows: readonly Record<string, unknown>[]): Promise<void>;
|
|
83
|
-
replaceMigrationHistory(rows: readonly AppliedMigrationRow[]): Promise<void>;
|
|
84
|
-
endSnapshotLoad(tables: readonly string[]): Promise<void>;
|
|
85
|
-
abortSnapshotLoad(): Promise<void>;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
interface DatabaseInternals {
|
|
89
|
-
parentHooks?: HookRegistry;
|
|
90
|
-
metrics?: MetricsCollector;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
declare class Database {
|
|
94
|
-
readonly id: string;
|
|
95
|
-
readonly path: string;
|
|
96
|
-
readonly readOnly: boolean;
|
|
97
|
-
private readonly pool;
|
|
98
|
-
private readonly driver;
|
|
99
|
-
private readonly synchronous;
|
|
100
|
-
private readonly walMode;
|
|
101
|
-
private readonly writerLock;
|
|
102
|
-
private readonly writeGate;
|
|
103
|
-
private readonly groupCommitter;
|
|
104
|
-
private readonly closeListeners;
|
|
105
|
-
private _closed;
|
|
106
|
-
private readonly cdc;
|
|
107
|
-
private readonly sync;
|
|
108
|
-
private readonly hookRegistry;
|
|
109
|
-
private readonly observer;
|
|
110
|
-
private readonly backups;
|
|
111
|
-
private readonly reads;
|
|
112
|
-
private constructor();
|
|
113
|
-
static create(id: string, path: string, driver: SQLiteDriver, options?: DatabaseOptions, internals?: DatabaseInternals): Promise<Database>;
|
|
114
|
-
applyChanges(batch: ReplicationBatch, resolver?: ConflictResolver | ((table: string) => ConflictResolver)): Promise<ApplyResult>;
|
|
115
|
-
deviceSync(): DeviceSyncPort;
|
|
116
|
-
query<T = Record<string, unknown>>(sql: string, params?: Params, options?: QueryOptions): Promise<T[]>;
|
|
117
|
-
queryForWire(sql: string, params?: Params, options?: QueryOptions): Promise<unknown[]>;
|
|
118
|
-
queryOne<T = Record<string, unknown>>(sql: string, params?: Params, options?: QueryOptions): Promise<T | undefined>;
|
|
119
|
-
execute(sql: string, params?: Params, options?: QueryOptions): Promise<ExecuteResult>;
|
|
120
|
-
executeBatch(sql: string, paramsBatch: Params[], options?: QueryOptions): Promise<ExecuteResult[]>;
|
|
121
|
-
private runInTransaction;
|
|
122
|
-
/**
|
|
123
|
-
* Load rows with relaxed writer durability. The load holds the writer lock
|
|
124
|
-
* for its whole duration, so no other write commits under the relaxed level
|
|
125
|
-
* and no two loads race on the shared `synchronous` setting; the configured
|
|
126
|
-
* level is restored before this resolves, whether the load succeeds or
|
|
127
|
-
* fails. The load runs in one transaction, so one commit and one durability
|
|
128
|
-
* barrier cover the whole batch. Rows are summed rather than returned
|
|
129
|
-
* per-row to bound memory on large loads. Like `execute` and `transaction`,
|
|
130
|
-
* this writes only to the local database; under replication the server routes
|
|
131
|
-
* loads through the engine, not through this method.
|
|
132
|
-
*/
|
|
133
|
-
bulkLoad(sql: string, paramsBatch: Params[], options?: BulkLoadOptions): Promise<BulkLoadResult>;
|
|
134
|
-
/**
|
|
135
|
-
* Takes the statements up front rather than a callback, since a group cannot wait on an
|
|
136
|
-
* arbitrary caller-supplied callback without delaying every transaction beside it.
|
|
137
|
-
*/
|
|
138
|
-
executeTransaction(statements: readonly {
|
|
139
|
-
sql: string;
|
|
140
|
-
params?: Params;
|
|
141
|
-
}[]): Promise<ExecuteResult[]>;
|
|
142
|
-
private runStatementsAlone;
|
|
143
|
-
transaction<T>(fn: (tx: Transaction) => Promise<T>): Promise<T>;
|
|
144
|
-
watch(table: string): Promise<void>;
|
|
145
|
-
/**
|
|
146
|
-
* Runs a CDC maintenance write (change-log pruning) on the shared writer
|
|
147
|
-
* under the writer lock. Serialising it with application writes keeps it
|
|
148
|
-
* from becoming a second writer that contends for SQLite's single write
|
|
149
|
-
* lock and stalls the event loop on `busy_timeout`.
|
|
150
|
-
*/
|
|
151
|
-
runCdcMaintenance(op: (writer: SQLiteConnection) => Promise<unknown>): Promise<void>;
|
|
152
|
-
ensureChangeStamping(): Promise<void>;
|
|
153
|
-
unwatch(table: string): Promise<void>;
|
|
154
|
-
on(table: string): SubscriptionBuilder;
|
|
155
|
-
live<T = Record<string, unknown>>(sql: string, params?: Params, options?: LiveQueryOptions): Promise<LiveQuery<T>>;
|
|
156
|
-
migrate(migrations: Migration[]): Promise<MigrationResult>;
|
|
157
|
-
appliedMigrations(): Promise<AppliedMigrationRow[]>;
|
|
158
|
-
rollback(migrations: Migration[], version?: number): Promise<RollbackResult>;
|
|
159
|
-
backup(destPath: string): Promise<void>;
|
|
160
|
-
scheduleBackup(options: BackupScheduleOptions): void;
|
|
161
|
-
loadExtension(extensionPath: string): Promise<void>;
|
|
162
|
-
onBeforeQuery(hook: BeforeQueryHook): void;
|
|
163
|
-
onAfterQuery(hook: AfterQueryHook): void;
|
|
164
|
-
addCloseListener(fn: () => void | Promise<void>): void;
|
|
165
|
-
close(): Promise<void>;
|
|
166
|
-
get closed(): boolean;
|
|
167
|
-
get readerCount(): number;
|
|
168
|
-
private ensureOpen;
|
|
169
|
-
private ensureNotClosed;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
export { Database as D, type HookDispose as H, MetricsCollector as M, type SubscribeHookContext as S, type HookEvent as a, type HookEventContextMap as b, type HookHandler as c, HookRegistry as d, type DeviceSyncPort as e };
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { W as WriteConcern, R as ReadConcern, E as ExecuteResult } from './types-zhnRXrsb.js';
|
|
2
|
-
import { B as BulkLoadDurability, a as BulkLoadResult } from './server-options-1JHu8pid.js';
|
|
3
|
-
|
|
4
|
-
interface QueryRequest {
|
|
5
|
-
sql: string;
|
|
6
|
-
params?: Record<string, unknown> | unknown[];
|
|
7
|
-
readConcern?: ReadConcern;
|
|
8
|
-
}
|
|
9
|
-
interface ExecuteRequest {
|
|
10
|
-
sql: string;
|
|
11
|
-
params?: Record<string, unknown> | unknown[];
|
|
12
|
-
writeConcern?: WriteConcern;
|
|
13
|
-
}
|
|
14
|
-
interface TransactionStatement {
|
|
15
|
-
sql: string;
|
|
16
|
-
params?: Record<string, unknown> | unknown[];
|
|
17
|
-
}
|
|
18
|
-
interface TransactionRequest {
|
|
19
|
-
statements: TransactionStatement[];
|
|
20
|
-
writeConcern?: WriteConcern;
|
|
21
|
-
}
|
|
22
|
-
/** The whole batch commits atomically in one server-side transaction with one fsync. */
|
|
23
|
-
interface BatchRequest {
|
|
24
|
-
sql: string;
|
|
25
|
-
paramsBatch: (Record<string, unknown> | unknown[])[];
|
|
26
|
-
writeConcern?: WriteConcern;
|
|
27
|
-
}
|
|
28
|
-
interface QueryResponse {
|
|
29
|
-
rows: Record<string, unknown>[];
|
|
30
|
-
}
|
|
31
|
-
interface ExecuteResponse {
|
|
32
|
-
changes: number;
|
|
33
|
-
lastInsertRowId: number | string;
|
|
34
|
-
}
|
|
35
|
-
interface TransactionResponse {
|
|
36
|
-
results: ExecuteResponse[];
|
|
37
|
-
}
|
|
38
|
-
interface BatchResponse {
|
|
39
|
-
results: ExecuteResponse[];
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Loads rows with relaxed writer durability; the configured durability is
|
|
43
|
-
* restored before the response is sent, and a load interrupted by a crash is
|
|
44
|
-
* recovered by re-running it.
|
|
45
|
-
*/
|
|
46
|
-
interface LoadRequest {
|
|
47
|
-
sql: string;
|
|
48
|
-
paramsBatch: (Record<string, unknown> | unknown[])[];
|
|
49
|
-
durability?: BulkLoadDurability;
|
|
50
|
-
checkpoint?: boolean;
|
|
51
|
-
}
|
|
52
|
-
type LoadResponse = BulkLoadResult;
|
|
53
|
-
interface AckResponse {
|
|
54
|
-
acked: boolean;
|
|
55
|
-
seq: string;
|
|
56
|
-
}
|
|
57
|
-
interface ErrorResponse {
|
|
58
|
-
error: {
|
|
59
|
-
code: string;
|
|
60
|
-
message: string;
|
|
61
|
-
details?: Record<string, unknown>;
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
declare function toExecuteResponse(result: ExecuteResult): ExecuteResponse;
|
|
65
|
-
|
|
66
|
-
export { type AckResponse as A, type BatchResponse as B, type ExecuteResponse as E, type LoadResponse as L, type QueryResponse as Q, type TransactionStatement as T, type TransactionResponse as a, type BatchRequest as b, type ErrorResponse as c, type ExecuteRequest as d, type LoadRequest as e, type QueryRequest as f, type TransactionRequest as g, toExecuteResponse as t };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { D as Database } from './database-BY0L5Q2n.js';
|
|
2
|
-
import { S as SirannonOptions, a as SQLiteDriver, D as DatabaseOptions, M as Migration, B as BeforeQueryHook, A as AfterQueryHook, b as BeforeConnectHook, c as DatabaseOpenHook, d as DatabaseCloseHook } from './types-zhnRXrsb.js';
|
|
3
|
-
|
|
4
|
-
declare class Sirannon {
|
|
5
|
-
readonly options: SirannonOptions;
|
|
6
|
-
private readonly dbs;
|
|
7
|
-
private readonly opening;
|
|
8
|
-
private readonly resolving;
|
|
9
|
-
private migrationSet;
|
|
10
|
-
private _shutdown;
|
|
11
|
-
private readonly _driver;
|
|
12
|
-
private readonly hookRegistry;
|
|
13
|
-
private readonly metricsCollector;
|
|
14
|
-
private readonly lifecycleManager;
|
|
15
|
-
constructor(options: SirannonOptions);
|
|
16
|
-
get driver(): SQLiteDriver;
|
|
17
|
-
open(id: string, path: string, options?: DatabaseOptions): Promise<Database>;
|
|
18
|
-
private withRegistryDefaults;
|
|
19
|
-
close(id: string): Promise<void>;
|
|
20
|
-
get(id: string): Database | undefined;
|
|
21
|
-
resolve(id: string): Promise<Database | undefined>;
|
|
22
|
-
registryMigrations(): Promise<Migration[]>;
|
|
23
|
-
private applyRegistryMigrations;
|
|
24
|
-
private loadMigrationSet;
|
|
25
|
-
has(id: string): boolean;
|
|
26
|
-
databases(): Map<string, Database>;
|
|
27
|
-
shutdown(): Promise<void>;
|
|
28
|
-
onBeforeQuery(hook: BeforeQueryHook): void;
|
|
29
|
-
onAfterQuery(hook: AfterQueryHook): void;
|
|
30
|
-
onBeforeConnect(hook: BeforeConnectHook): void;
|
|
31
|
-
onDatabaseOpen(hook: DatabaseOpenHook): void;
|
|
32
|
-
onDatabaseClose(hook: DatabaseCloseHook): void;
|
|
33
|
-
private ensureRunning;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export { Sirannon as S };
|
package/dist/types-B7gmEsZW.d.ts
DELETED
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
import { C as ChangeTracker } from './change-tracker-DKRVUC3l.js';
|
|
2
|
-
import { e as SQLiteConnection, N as NodeHealth } from './types-zhnRXrsb.js';
|
|
3
|
-
import { R as ReplicationBatch, S as SyncTableManifest, C as ConflictResolver } from './types-C_D8IhpO.js';
|
|
4
|
-
import { C as ClusterCoordinator, a as CoordinatorCompatibilityMetadata, R as ReplicationGroupState } from './types-BsVabqSI.js';
|
|
5
|
-
|
|
6
|
-
interface NodeInfo {
|
|
7
|
-
id: string;
|
|
8
|
-
groupId?: string;
|
|
9
|
-
role: 'primary' | 'replica';
|
|
10
|
-
primaryTerm?: bigint;
|
|
11
|
-
protocolVersion?: string;
|
|
12
|
-
joinedAt: number;
|
|
13
|
-
lastSeenAt: number;
|
|
14
|
-
lastAckedSeq: bigint;
|
|
15
|
-
metadata?: Record<string, unknown>;
|
|
16
|
-
}
|
|
17
|
-
interface ReplicationAck {
|
|
18
|
-
batchId: string;
|
|
19
|
-
ackedSeq: bigint;
|
|
20
|
-
nodeId: string;
|
|
21
|
-
groupId?: string;
|
|
22
|
-
primaryTerm?: bigint;
|
|
23
|
-
}
|
|
24
|
-
interface ForwardedTransaction {
|
|
25
|
-
statements: Array<{
|
|
26
|
-
sql: string;
|
|
27
|
-
params?: Record<string, unknown> | unknown[];
|
|
28
|
-
}>;
|
|
29
|
-
requestId: string;
|
|
30
|
-
groupId?: string;
|
|
31
|
-
primaryTerm?: bigint;
|
|
32
|
-
}
|
|
33
|
-
interface ForwardedTransactionResult {
|
|
34
|
-
results: Array<{
|
|
35
|
-
changes: number;
|
|
36
|
-
lastInsertRowId: number | string;
|
|
37
|
-
}>;
|
|
38
|
-
requestId: string;
|
|
39
|
-
groupId?: string;
|
|
40
|
-
primaryTerm?: bigint;
|
|
41
|
-
}
|
|
42
|
-
type TopologyRole = 'primary' | 'replica';
|
|
43
|
-
interface Topology {
|
|
44
|
-
role: TopologyRole;
|
|
45
|
-
canWrite(): boolean;
|
|
46
|
-
shouldReplicateTo(peerId: string, peerRole: TopologyRole): boolean;
|
|
47
|
-
shouldAcceptFrom(peerId: string, peerRole: TopologyRole): boolean;
|
|
48
|
-
requiresConflictResolution(): boolean;
|
|
49
|
-
}
|
|
50
|
-
interface TransportConfig {
|
|
51
|
-
endpoints?: string[];
|
|
52
|
-
localRole?: TopologyRole;
|
|
53
|
-
groupId?: string;
|
|
54
|
-
primaryTerm?: bigint;
|
|
55
|
-
protocolVersion?: string;
|
|
56
|
-
metadata?: Record<string, unknown>;
|
|
57
|
-
}
|
|
58
|
-
interface ReplicationTransport {
|
|
59
|
-
connect(localNodeId: string, config: TransportConfig): Promise<void>;
|
|
60
|
-
disconnect(): Promise<void>;
|
|
61
|
-
send(peerId: string, batch: ReplicationBatch): Promise<void>;
|
|
62
|
-
broadcast(batch: ReplicationBatch): Promise<void>;
|
|
63
|
-
sendAck(peerId: string, ack: ReplicationAck): Promise<void>;
|
|
64
|
-
forward(peerId: string, request: ForwardedTransaction): Promise<ForwardedTransactionResult>;
|
|
65
|
-
requestSync(peerId: string, request: SyncRequest): Promise<void>;
|
|
66
|
-
sendSyncBatch(peerId: string, batch: SyncBatch): Promise<void>;
|
|
67
|
-
sendSyncComplete(peerId: string, complete: SyncComplete): Promise<void>;
|
|
68
|
-
sendSyncAck(peerId: string, ack: SyncAck): Promise<void>;
|
|
69
|
-
onBatchReceived(handler: (batch: ReplicationBatch, fromPeerId: string) => Promise<void>): void;
|
|
70
|
-
onAckReceived(handler: (ack: ReplicationAck, fromPeerId: string) => void): void;
|
|
71
|
-
onForwardReceived(handler: (request: ForwardedTransaction, fromPeerId: string) => Promise<ForwardedTransactionResult>): void;
|
|
72
|
-
onSyncRequested(handler: (request: SyncRequest, fromPeerId: string) => Promise<void>): void;
|
|
73
|
-
onSyncBatchReceived(handler: (batch: SyncBatch, fromPeerId: string) => Promise<void>): void;
|
|
74
|
-
onSyncCompleteReceived(handler: (complete: SyncComplete, fromPeerId: string) => Promise<void>): void;
|
|
75
|
-
onSyncAckReceived(handler: (ack: SyncAck, fromPeerId: string) => void): void;
|
|
76
|
-
onPeerConnected(handler: (peer: NodeInfo) => void): void;
|
|
77
|
-
onPeerDisconnected(handler: (peerId: string) => void): void;
|
|
78
|
-
peers(): ReadonlyMap<string, NodeInfo>;
|
|
79
|
-
}
|
|
80
|
-
interface InFlightBatch {
|
|
81
|
-
batchId: string;
|
|
82
|
-
fromSeq: bigint;
|
|
83
|
-
toSeq: bigint;
|
|
84
|
-
sentAt: number;
|
|
85
|
-
}
|
|
86
|
-
interface PeerState {
|
|
87
|
-
nodeId: string;
|
|
88
|
-
lastAckedSeq: bigint;
|
|
89
|
-
lastSentSeq: bigint;
|
|
90
|
-
lastReceivedHlc: string;
|
|
91
|
-
connected: boolean;
|
|
92
|
-
pendingBatches: number;
|
|
93
|
-
inFlightBatches: InFlightBatch[];
|
|
94
|
-
}
|
|
95
|
-
interface CoordinatorControllerConfig {
|
|
96
|
-
enabled?: boolean;
|
|
97
|
-
holderId?: string;
|
|
98
|
-
leaseTtlMs?: number;
|
|
99
|
-
tickIntervalMs?: number;
|
|
100
|
-
}
|
|
101
|
-
interface CoordinatorModeConfig {
|
|
102
|
-
clusterId: string;
|
|
103
|
-
groupId: string;
|
|
104
|
-
endpoint?: string;
|
|
105
|
-
votingDataBearingNodeIds?: string[];
|
|
106
|
-
coordinator: ClusterCoordinator;
|
|
107
|
-
sessionTtlMs?: number;
|
|
108
|
-
controller?: boolean | CoordinatorControllerConfig;
|
|
109
|
-
compatibility?: CoordinatorCompatibilityMetadata;
|
|
110
|
-
}
|
|
111
|
-
interface ReplicationConfig {
|
|
112
|
-
nodeId?: string;
|
|
113
|
-
topology: Topology;
|
|
114
|
-
transport: ReplicationTransport;
|
|
115
|
-
transportConfig?: TransportConfig;
|
|
116
|
-
writeForwarding?: boolean;
|
|
117
|
-
conflictResolvers?: Record<string, ConflictResolver>;
|
|
118
|
-
defaultConflictResolver?: ConflictResolver;
|
|
119
|
-
batchSize?: number;
|
|
120
|
-
batchIntervalMs?: number;
|
|
121
|
-
maxPendingBatches?: number;
|
|
122
|
-
snapshotThreshold?: number;
|
|
123
|
-
maxClockDriftMs?: number;
|
|
124
|
-
maxBatchChanges?: number;
|
|
125
|
-
ackTimeoutMs?: number;
|
|
126
|
-
onBeforeForwardedQuery?: (sql: string, params?: unknown[] | Record<string, unknown>) => void;
|
|
127
|
-
flowControl?: {
|
|
128
|
-
maxLagSeconds?: number;
|
|
129
|
-
onLagExceeded?: (peerId: string, lagMs: number) => void;
|
|
130
|
-
};
|
|
131
|
-
initialSync?: boolean;
|
|
132
|
-
syncBatchSize?: number;
|
|
133
|
-
maxConcurrentSyncs?: number;
|
|
134
|
-
maxSyncDurationMs?: number;
|
|
135
|
-
maxSyncLagBeforeReady?: number;
|
|
136
|
-
syncAckTimeoutMs?: number;
|
|
137
|
-
catchUpDeadlineMs?: number;
|
|
138
|
-
resumeFromSeq?: bigint;
|
|
139
|
-
snapshotConnectionFactory?: () => Promise<SQLiteConnection>;
|
|
140
|
-
changeTracker?: ChangeTracker;
|
|
141
|
-
coordinator?: CoordinatorModeConfig;
|
|
142
|
-
}
|
|
143
|
-
interface ReplicationStatus {
|
|
144
|
-
nodeId: string;
|
|
145
|
-
role: TopologyRole;
|
|
146
|
-
peers: PeerState[];
|
|
147
|
-
localSeq: bigint;
|
|
148
|
-
replicating: boolean;
|
|
149
|
-
health: NodeHealth;
|
|
150
|
-
syncState?: SyncState;
|
|
151
|
-
coordinator?: CoordinatorRuntimeStatus;
|
|
152
|
-
}
|
|
153
|
-
interface CoordinatorRuntimeStatus {
|
|
154
|
-
clusterId: string;
|
|
155
|
-
groupId: string;
|
|
156
|
-
currentPrimary: ReplicationGroupState['currentPrimary'];
|
|
157
|
-
primaryTerm: bigint;
|
|
158
|
-
inSyncNodeIds: string[];
|
|
159
|
-
drainingNodeIds: string[];
|
|
160
|
-
repairingNodeIds: string[];
|
|
161
|
-
faultedNodeIds: string[];
|
|
162
|
-
votingDataBearingNodeIds: string[];
|
|
163
|
-
authority: boolean;
|
|
164
|
-
connected: boolean;
|
|
165
|
-
controllerState: 'disabled' | 'standby' | 'active' | 'lost';
|
|
166
|
-
}
|
|
167
|
-
type SyncPhase = 'pending' | 'syncing' | 'catching-up' | 'ready';
|
|
168
|
-
interface SyncState {
|
|
169
|
-
phase: SyncPhase;
|
|
170
|
-
sourcePeerId: string | null;
|
|
171
|
-
snapshotSeq: bigint | null;
|
|
172
|
-
completedTables: string[];
|
|
173
|
-
totalTables: number;
|
|
174
|
-
startedAt: number | null;
|
|
175
|
-
error: string | null;
|
|
176
|
-
}
|
|
177
|
-
interface SyncRequest {
|
|
178
|
-
requestId: string;
|
|
179
|
-
joinerNodeId: string;
|
|
180
|
-
completedTables: string[];
|
|
181
|
-
supportsStreamVerification?: boolean;
|
|
182
|
-
groupId?: string;
|
|
183
|
-
primaryTerm?: bigint;
|
|
184
|
-
}
|
|
185
|
-
interface SyncBatch {
|
|
186
|
-
requestId: string;
|
|
187
|
-
table: string;
|
|
188
|
-
batchIndex: number;
|
|
189
|
-
rows: Record<string, unknown>[];
|
|
190
|
-
schema?: string[];
|
|
191
|
-
checksum: string;
|
|
192
|
-
isLastBatchForTable: boolean;
|
|
193
|
-
totalTables?: number;
|
|
194
|
-
groupId?: string;
|
|
195
|
-
primaryTerm?: bigint;
|
|
196
|
-
}
|
|
197
|
-
interface SyncComplete {
|
|
198
|
-
requestId: string;
|
|
199
|
-
snapshotSeq: bigint;
|
|
200
|
-
manifests: SyncTableManifest[];
|
|
201
|
-
groupId?: string;
|
|
202
|
-
primaryTerm?: bigint;
|
|
203
|
-
}
|
|
204
|
-
interface SyncAck {
|
|
205
|
-
requestId: string;
|
|
206
|
-
joinerNodeId: string;
|
|
207
|
-
table: string;
|
|
208
|
-
batchIndex: number;
|
|
209
|
-
success: boolean;
|
|
210
|
-
error?: string;
|
|
211
|
-
groupId?: string;
|
|
212
|
-
primaryTerm?: bigint;
|
|
213
|
-
}
|
|
214
|
-
interface ReplicationErrorEvent {
|
|
215
|
-
error: Error;
|
|
216
|
-
operation: string;
|
|
217
|
-
peerId?: string;
|
|
218
|
-
recoverable: boolean;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
export type { ForwardedTransaction as F, InFlightBatch as I, NodeInfo as N, PeerState as P, ReplicationAck as R, SyncRequest as S, TransportConfig as T, ForwardedTransactionResult as a, SyncBatch as b, SyncComplete as c, SyncAck as d, ReplicationTransport as e, TopologyRole as f, SyncPhase as g, ReplicationConfig as h, SyncState as i, ReplicationStatus as j, ReplicationErrorEvent as k, Topology as l };
|
package/dist/types-BsVabqSI.d.ts
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
type CoordinatorLeaseKind = 'controller' | 'node-session';
|
|
2
|
-
type CoordinatorWatchDisposer = () => void | Promise<void>;
|
|
3
|
-
interface CoordinatorLease {
|
|
4
|
-
id: string;
|
|
5
|
-
kind: CoordinatorLeaseKind;
|
|
6
|
-
clusterId: string;
|
|
7
|
-
holderId: string;
|
|
8
|
-
ttlMs: number;
|
|
9
|
-
grantedAtMs: number;
|
|
10
|
-
expiresAtMs: number;
|
|
11
|
-
metadata?: Record<string, unknown>;
|
|
12
|
-
}
|
|
13
|
-
interface AcquireControllerLeaseInput {
|
|
14
|
-
clusterId: string;
|
|
15
|
-
holderId: string;
|
|
16
|
-
ttlMs: number;
|
|
17
|
-
metadata?: Record<string, unknown>;
|
|
18
|
-
}
|
|
19
|
-
type AcquireControllerLeaseResult = {
|
|
20
|
-
acquired: true;
|
|
21
|
-
lease: CoordinatorLease;
|
|
22
|
-
} | {
|
|
23
|
-
acquired: false;
|
|
24
|
-
lease: CoordinatorLease | null;
|
|
25
|
-
};
|
|
26
|
-
interface CoordinatorCompatibilityMetadata {
|
|
27
|
-
packageVersion?: string;
|
|
28
|
-
specVersion?: string;
|
|
29
|
-
protocolVersion?: string;
|
|
30
|
-
}
|
|
31
|
-
interface RegisterNodeSessionInput {
|
|
32
|
-
clusterId: string;
|
|
33
|
-
nodeId: string;
|
|
34
|
-
ttlMs: number;
|
|
35
|
-
endpoint?: string;
|
|
36
|
-
groupIds?: string[];
|
|
37
|
-
dataBearing?: boolean;
|
|
38
|
-
voting?: boolean;
|
|
39
|
-
compatibility?: CoordinatorCompatibilityMetadata;
|
|
40
|
-
metadata?: Record<string, unknown>;
|
|
41
|
-
}
|
|
42
|
-
interface CoordinatorNodeSession {
|
|
43
|
-
clusterId: string;
|
|
44
|
-
nodeId: string;
|
|
45
|
-
lease: CoordinatorLease;
|
|
46
|
-
endpoint?: string;
|
|
47
|
-
groupIds: string[];
|
|
48
|
-
dataBearing: boolean;
|
|
49
|
-
voting: boolean;
|
|
50
|
-
compatibility?: CoordinatorCompatibilityMetadata;
|
|
51
|
-
metadata?: Record<string, unknown>;
|
|
52
|
-
}
|
|
53
|
-
interface CoordinatorPrimary {
|
|
54
|
-
nodeId: string;
|
|
55
|
-
endpoint?: string;
|
|
56
|
-
}
|
|
57
|
-
interface ReplicationGroupState {
|
|
58
|
-
clusterId: string;
|
|
59
|
-
groupId: string;
|
|
60
|
-
votingDataBearingNodeIds: string[];
|
|
61
|
-
currentPrimary: CoordinatorPrimary | null;
|
|
62
|
-
primaryTerm: bigint;
|
|
63
|
-
durabilityPointSeq: bigint;
|
|
64
|
-
inSyncNodeIds: string[];
|
|
65
|
-
drainingNodeIds: string[];
|
|
66
|
-
repairingNodeIds: string[];
|
|
67
|
-
faultedNodeIds: string[];
|
|
68
|
-
compatibility?: CoordinatorCompatibilityMetadata;
|
|
69
|
-
updatedAtMs: number;
|
|
70
|
-
}
|
|
71
|
-
interface SetReplicationGroupStateInput {
|
|
72
|
-
clusterId: string;
|
|
73
|
-
groupId: string;
|
|
74
|
-
votingDataBearingNodeIds: string[];
|
|
75
|
-
currentPrimary?: CoordinatorPrimary | null;
|
|
76
|
-
primaryTerm?: bigint;
|
|
77
|
-
durabilityPointSeq?: bigint;
|
|
78
|
-
inSyncNodeIds?: string[];
|
|
79
|
-
drainingNodeIds?: string[];
|
|
80
|
-
repairingNodeIds?: string[];
|
|
81
|
-
faultedNodeIds?: string[];
|
|
82
|
-
compatibility?: CoordinatorCompatibilityMetadata;
|
|
83
|
-
}
|
|
84
|
-
interface CompareAndAdvancePrimaryTermInput {
|
|
85
|
-
clusterId: string;
|
|
86
|
-
groupId: string;
|
|
87
|
-
expectedPrimaryTerm: bigint;
|
|
88
|
-
nextPrimary: CoordinatorPrimary;
|
|
89
|
-
}
|
|
90
|
-
interface CompareAndAdvancePrimaryTermResult {
|
|
91
|
-
advanced: boolean;
|
|
92
|
-
state: ReplicationGroupState | null;
|
|
93
|
-
}
|
|
94
|
-
interface UpdateInSyncSetInput {
|
|
95
|
-
clusterId: string;
|
|
96
|
-
groupId: string;
|
|
97
|
-
inSyncNodeIds: string[];
|
|
98
|
-
durabilityPointSeq?: bigint;
|
|
99
|
-
}
|
|
100
|
-
interface AdmitNodeToInSyncSetInput {
|
|
101
|
-
clusterId: string;
|
|
102
|
-
groupId: string;
|
|
103
|
-
nodeId: string;
|
|
104
|
-
sourceNodeId: string;
|
|
105
|
-
appliedSeq: bigint;
|
|
106
|
-
}
|
|
107
|
-
interface UpdateNodeMaintenanceInput {
|
|
108
|
-
clusterId: string;
|
|
109
|
-
groupId: string;
|
|
110
|
-
nodeId: string;
|
|
111
|
-
draining?: boolean;
|
|
112
|
-
repairing?: boolean;
|
|
113
|
-
faulted?: boolean;
|
|
114
|
-
}
|
|
115
|
-
interface PromoteEligibleReplicaInput {
|
|
116
|
-
clusterId: string;
|
|
117
|
-
groupId: string;
|
|
118
|
-
excludeNodeIds?: string[];
|
|
119
|
-
}
|
|
120
|
-
type ReplicationGroupWatcher = (state: ReplicationGroupState) => void;
|
|
121
|
-
interface ClusterCoordinator {
|
|
122
|
-
tryAcquireControllerLease(input: AcquireControllerLeaseInput): Promise<AcquireControllerLeaseResult>;
|
|
123
|
-
renewLease(leaseId: string, ttlMs: number): Promise<boolean>;
|
|
124
|
-
releaseLease(leaseId: string): Promise<boolean>;
|
|
125
|
-
registerNodeSession(input: RegisterNodeSessionInput): Promise<CoordinatorNodeSession>;
|
|
126
|
-
getLiveNodeSession(clusterId: string, nodeId: string): Promise<CoordinatorNodeSession | null>;
|
|
127
|
-
deregisterNodeSession(clusterId: string, nodeId: string): Promise<void>;
|
|
128
|
-
setReplicationGroupState(input: SetReplicationGroupStateInput): Promise<ReplicationGroupState>;
|
|
129
|
-
getReplicationGroupState(clusterId: string, groupId: string): Promise<ReplicationGroupState | null>;
|
|
130
|
-
watchReplicationGroup(clusterId: string, groupId: string, watcher: ReplicationGroupWatcher): CoordinatorWatchDisposer | Promise<CoordinatorWatchDisposer>;
|
|
131
|
-
compareAndAdvancePrimaryTerm(input: CompareAndAdvancePrimaryTermInput): Promise<CompareAndAdvancePrimaryTermResult>;
|
|
132
|
-
updateInSyncSet(input: UpdateInSyncSetInput): Promise<ReplicationGroupState | null>;
|
|
133
|
-
admitNodeToInSyncSet(input: AdmitNodeToInSyncSetInput): Promise<ReplicationGroupState | null>;
|
|
134
|
-
updateNodeMaintenance(input: UpdateNodeMaintenanceInput): Promise<ReplicationGroupState | null>;
|
|
135
|
-
promoteEligibleReplica(input: PromoteEligibleReplicaInput): Promise<ReplicationGroupState>;
|
|
136
|
-
close?(): Promise<void>;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
export type { AcquireControllerLeaseInput as A, ClusterCoordinator as C, PromoteEligibleReplicaInput as P, ReplicationGroupState as R, SetReplicationGroupStateInput as S, UpdateInSyncSetInput as U, CoordinatorCompatibilityMetadata as a, AcquireControllerLeaseResult as b, RegisterNodeSessionInput as c, CoordinatorNodeSession as d, ReplicationGroupWatcher as e, CoordinatorWatchDisposer as f, CompareAndAdvancePrimaryTermInput as g, CompareAndAdvancePrimaryTermResult as h, AdmitNodeToInSyncSetInput as i, UpdateNodeMaintenanceInput as j, CoordinatorLease as k, CoordinatorPrimary as l };
|
package/dist/types-C_D8IhpO.d.ts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
interface HLCTimestamp {
|
|
2
|
-
wallMs: number;
|
|
3
|
-
logical: number;
|
|
4
|
-
nodeId: string;
|
|
5
|
-
}
|
|
6
|
-
interface ReplicationChange {
|
|
7
|
-
table: string;
|
|
8
|
-
operation: 'insert' | 'update' | 'delete' | 'ddl';
|
|
9
|
-
rowId: string;
|
|
10
|
-
primaryKey: Record<string, unknown>;
|
|
11
|
-
hlc: string;
|
|
12
|
-
txId: string;
|
|
13
|
-
nodeId: string;
|
|
14
|
-
newData: Record<string, unknown> | null;
|
|
15
|
-
oldData: Record<string, unknown> | null;
|
|
16
|
-
ddlStatement?: string;
|
|
17
|
-
}
|
|
18
|
-
interface ReplicationBatch {
|
|
19
|
-
sourceNodeId: string;
|
|
20
|
-
batchId: string;
|
|
21
|
-
fromSeq: bigint;
|
|
22
|
-
toSeq: bigint;
|
|
23
|
-
hlcRange: {
|
|
24
|
-
min: string;
|
|
25
|
-
max: string;
|
|
26
|
-
};
|
|
27
|
-
changes: ReplicationChange[];
|
|
28
|
-
checksum: string;
|
|
29
|
-
groupId?: string;
|
|
30
|
-
primaryTerm?: bigint;
|
|
31
|
-
}
|
|
32
|
-
interface ConflictContext {
|
|
33
|
-
table: string;
|
|
34
|
-
rowId: string;
|
|
35
|
-
localChange: ReplicationChange | null;
|
|
36
|
-
remoteChange: ReplicationChange;
|
|
37
|
-
localHlc: string | null;
|
|
38
|
-
remoteHlc: string;
|
|
39
|
-
}
|
|
40
|
-
interface ConflictResolution {
|
|
41
|
-
action: 'accept_remote' | 'keep_local' | 'merge';
|
|
42
|
-
mergedData?: Record<string, unknown>;
|
|
43
|
-
}
|
|
44
|
-
interface ConflictResolver {
|
|
45
|
-
resolve(ctx: ConflictContext): ConflictResolution | Promise<ConflictResolution>;
|
|
46
|
-
}
|
|
47
|
-
interface ApplyResult {
|
|
48
|
-
applied: number;
|
|
49
|
-
skipped: number;
|
|
50
|
-
conflicts: number;
|
|
51
|
-
droppedTables: string[];
|
|
52
|
-
}
|
|
53
|
-
interface SyncTableManifest {
|
|
54
|
-
table: string;
|
|
55
|
-
rowCount: number;
|
|
56
|
-
pkHash?: string;
|
|
57
|
-
batchDigest?: string;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export type { ApplyResult as A, ConflictResolver as C, HLCTimestamp as H, ReplicationBatch as R, SyncTableManifest as S, ConflictContext as a, ConflictResolution as b, ReplicationChange as c };
|