@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.
Files changed (72) hide show
  1. package/dist/backup/index.d.ts +5 -5
  2. package/dist/backup/index.mjs +5 -3
  3. package/dist/backup-scheduler/index.d.ts +2 -2
  4. package/dist/backup-scheduler/index.mjs +2 -2
  5. package/dist/chunk-22TYGH7J.mjs +55 -0
  6. package/dist/{chunk-SB3MIFLG.mjs → chunk-2ZQOZFX7.mjs} +29 -6
  7. package/dist/{chunk-UIDQGPJY.mjs → chunk-4O7WYZHN.mjs} +38 -3
  8. package/dist/{chunk-ZFFUVYYE.mjs → chunk-5DKWHT6K.mjs} +109 -1
  9. package/dist/chunk-5O4J6LQQ.mjs +35 -0
  10. package/dist/{chunk-CZL4D3BM.mjs → chunk-6CABU54O.mjs} +2 -2
  11. package/dist/{chunk-JAQ2I4OT.mjs → chunk-A5ULJVK7.mjs} +11 -11
  12. package/dist/{chunk-RLBKZZ24.mjs → chunk-AC7TKWNH.mjs} +1 -0
  13. package/dist/chunk-BKO4SCEC.mjs +99 -0
  14. package/dist/{chunk-KOTBP4AW.mjs → chunk-C7E4H6UN.mjs} +24 -4
  15. package/dist/{chunk-G4AG3ESO.mjs → chunk-FBA7P4ZA.mjs} +114 -149
  16. package/dist/{chunk-DKML5425.mjs → chunk-GBVB6WSC.mjs} +2 -2
  17. package/dist/chunk-I4JY5QPA.mjs +51 -0
  18. package/dist/{chunk-L6EX6K27.mjs → chunk-MO4APBYG.mjs} +54 -13
  19. package/dist/{chunk-RPWBYASV.mjs → chunk-MTOQ6QIS.mjs} +1 -1
  20. package/dist/chunk-MX77PGEN.mjs +60 -0
  21. package/dist/{chunk-BTUD6XQO.mjs → chunk-N3MHZV3B.mjs} +11 -29
  22. package/dist/{chunk-UHUDPQFI.mjs → chunk-OJXV4L3N.mjs} +1 -3
  23. package/dist/chunk-QF7WF7RJ.mjs +34 -0
  24. package/dist/chunk-RLBV4YTB.mjs +22 -0
  25. package/dist/{chunk-ISDT4RBD.mjs → chunk-ULUZUBON.mjs} +1 -1
  26. package/dist/{chunk-AP4367HK.mjs → chunk-VGRAAQX3.mjs} +4 -4
  27. package/dist/chunk-W74HFQFD.mjs +153 -0
  28. package/dist/chunk-Y4SP7CRF.mjs +9 -0
  29. package/dist/{chunk-JFVEGN7J.mjs → chunk-ZAUHAJ4G.mjs} +2 -1
  30. package/dist/{chunk-DDIHBUEN.mjs → chunk-ZWW53O5P.mjs} +19 -7
  31. package/dist/client/index.d.ts +8 -8
  32. package/dist/client/topology.d.ts +4 -4
  33. package/dist/{client-base-Doaqwrx3.d.ts → client-base-DJZbSY55.d.ts} +2 -2
  34. package/dist/{client-streams-MKPE4MXW.mjs → client-streams-F7IG3PTU.mjs} +13 -16
  35. package/dist/core/index.d.ts +48 -12
  36. package/dist/core/index.mjs +1812 -107
  37. package/dist/core/writer-worker.mjs +28 -4
  38. package/dist/{database-fz-8CJBP.d.ts → database-BZ96ZzAx.d.ts} +411 -184
  39. package/dist/{database-backup-BwTNiBm2.d.ts → database-backup-BhM8yJ1A.d.ts} +32 -2
  40. package/dist/driver/better-sqlite3.d.ts +11 -1
  41. package/dist/driver/better-sqlite3.mjs +212 -23
  42. package/dist/driver/bun.d.ts +1 -1
  43. package/dist/driver/bun.mjs +15 -22
  44. package/dist/driver/expo.d.ts +1 -1
  45. package/dist/driver/expo.mjs +185 -16
  46. package/dist/driver/node.d.ts +1 -1
  47. package/dist/driver/node.mjs +15 -62
  48. package/dist/driver/wa-sqlite.d.ts +1 -1
  49. package/dist/driver/wa-sqlite.mjs +14 -153
  50. package/dist/{change-tracker-Dpo99EI-.d.ts → errors-DLMAGQFb.d.ts} +200 -2
  51. package/dist/file-migrations/index.d.ts +1 -1
  52. package/dist/peer-refusal-RR37UOLV.mjs +1 -0
  53. package/dist/{protocol-DZSYSv0S.d.ts → protocol-DE10taas.d.ts} +1 -1
  54. package/dist/replication/coordinator/etcd.mjs +1 -1
  55. package/dist/replication/index.d.ts +7 -7
  56. package/dist/replication/index.mjs +66 -9
  57. package/dist/{restore-options-CcMukOLO.d.ts → restore-options-B6HV_5XT.d.ts} +6 -1
  58. package/dist/server/index.d.ts +10 -10
  59. package/dist/server/index.mjs +506 -350
  60. package/dist/{server-options-B9CsAZp5.d.ts → server-options-Bhdlvehe.d.ts} +14 -1
  61. package/dist/{server-streams-SBYCHWWM.mjs → server-streams-Q2AZAW3N.mjs} +6 -30
  62. package/dist/{sirannon-D0CjDULa.d.ts → sirannon-Ba1o2HUQ.d.ts} +5 -5
  63. package/dist/transport/grpc.d.ts +15 -4
  64. package/dist/transport/grpc.mjs +34 -37
  65. package/dist/transport/memory.d.ts +4 -3
  66. package/dist/transport/memory.mjs +8 -26
  67. package/dist/{types-DTmi7pXp.d.ts → types-BWyv_N18.d.ts} +189 -1
  68. package/dist/{types-BlZ9GG1a.d.ts → types-CDnlkVRK.d.ts} +8 -2
  69. package/package.json +17 -9
  70. package/dist/chunk-DBN57KVR.mjs +0 -171
  71. package/dist/chunk-W67A4H2E.mjs +0 -23
  72. package/dist/chunk-YW7IKQ7T.mjs +0 -62
@@ -1,19 +1,24 @@
1
- import { nodeResolveExtensionPath, asyncLocalWriterContext, createStatementCache, nodeBackupEngine, nodeStreamingSupport, WriterWorker, loadThroughRuntime, bindableParams, narrowSafeBigInt, narrowRowIntegers, narrowRowsIntegers } from '../chunk-G4AG3ESO.mjs';
1
+ import { assertHoldsStatement } from '../chunk-22TYGH7J.mjs';
2
+ import { nodeResolveExtensionPath, createStatementCache, nodeBackupEngine, nodeStreamingSupport, WriterWorker } from '../chunk-FBA7P4ZA.mjs';
2
3
  import '../chunk-DX4WGJL7.mjs';
3
- import '../chunk-BTUD6XQO.mjs';
4
- import { defineDriver } from '../chunk-JAQ2I4OT.mjs';
5
- import '../chunk-W67A4H2E.mjs';
4
+ import '../chunk-N3MHZV3B.mjs';
5
+ import { asyncLocalWriterContext, loadThroughRuntime } from '../chunk-RLBV4YTB.mjs';
6
+ import { bindableParams, narrowSafeBigInt, narrowRowIntegers, narrowRowsIntegers } from '../chunk-MX77PGEN.mjs';
7
+ import '../chunk-Y4SP7CRF.mjs';
8
+ import '../chunk-I4JY5QPA.mjs';
6
9
  import '../chunk-K43WJORM.mjs';
10
+ import { defineDriver } from '../chunk-A5ULJVK7.mjs';
7
11
  import '../chunk-75IBRE73.mjs';
8
12
  import '../chunk-E2GRX4ZD.mjs';
9
- import '../chunk-UHUDPQFI.mjs';
13
+ import '../chunk-OJXV4L3N.mjs';
10
14
  import '../chunk-QGVRRKB2.mjs';
11
15
  import '../chunk-AHCMO4YL.mjs';
12
16
  import '../chunk-BUWJH3D3.mjs';
13
- import { synchronousPragmaValue } from '../chunk-YCMB6GR4.mjs';
14
- import '../chunk-CZL4D3BM.mjs';
17
+ import '../chunk-6CABU54O.mjs';
15
18
  import '../chunk-BGJ5JVYL.mjs';
16
19
  import '../chunk-HO2XTXVX.mjs';
20
+ import { synchronousPragmaValue } from '../chunk-YCMB6GR4.mjs';
21
+ import { refuseEncryptedOpen } from '../chunk-5O4J6LQQ.mjs';
17
22
  import { ExtensionError, BackupError, SirannonError } from '../chunk-KINDFBQP.mjs';
18
23
  import { createRequire } from 'module';
19
24
 
@@ -37,60 +42,6 @@ async function copyDatabaseWithNodeSqlite(db, request) {
37
42
  return final;
38
43
  }
39
44
 
40
- // src/core/driver/statement-text.ts
41
- var SPACE = 32;
42
- var TAB = 9;
43
- var LINE_FEED = 10;
44
- var VERTICAL_TAB = 11;
45
- var FORM_FEED = 12;
46
- var CARRIAGE_RETURN = 13;
47
- var SEMICOLON = 59;
48
- var HYPHEN = 45;
49
- var SLASH = 47;
50
- var ASTERISK = 42;
51
- var NO_STATEMENT_MESSAGE = "The supplied SQL string contains no statements";
52
- function startsSqliteSpace(code) {
53
- return code === SPACE || code === TAB || code === LINE_FEED || code === FORM_FEED || code === CARRIAGE_RETURN;
54
- }
55
- function continuesSqliteSpace(code) {
56
- return startsSqliteSpace(code) || code === VERTICAL_TAB;
57
- }
58
- function holdsNoStatement(sql) {
59
- const firstNul = sql.indexOf("\0");
60
- const text = firstNul === -1 ? sql : sql.slice(0, firstNul);
61
- let index = 0;
62
- while (index < text.length) {
63
- const code = text.charCodeAt(index);
64
- if (startsSqliteSpace(code)) {
65
- index++;
66
- while (index < text.length && continuesSqliteSpace(text.charCodeAt(index))) index++;
67
- continue;
68
- }
69
- if (code === SEMICOLON) {
70
- index++;
71
- continue;
72
- }
73
- const next = text.charCodeAt(index + 1);
74
- if (code === HYPHEN && next === HYPHEN) {
75
- const lineEnd = text.indexOf("\n", index + 2);
76
- if (lineEnd === -1) return true;
77
- index = lineEnd;
78
- continue;
79
- }
80
- if (code === SLASH && next === ASTERISK && index + 2 < text.length) {
81
- const commentEnd = text.indexOf("*/", index + 2);
82
- if (commentEnd === -1) return true;
83
- index = commentEnd + 2;
84
- continue;
85
- }
86
- return false;
87
- }
88
- return true;
89
- }
90
- function assertHoldsStatement(sql) {
91
- if (holdsNoStatement(sql)) throw new RangeError(NO_STATEMENT_MESSAGE);
92
- }
93
-
94
45
  // src/drivers/node/statement-text.ts
95
46
  function prepareStatement(db, sql) {
96
47
  assertHoldsStatement(sql);
@@ -118,7 +69,8 @@ function nodeSqlite(driverOptions) {
118
69
  multipleConnections: true,
119
70
  extensions: true,
120
71
  steppedCopy: carriesSteppedBackupCall(),
121
- rowCounts: false
72
+ rowCounts: false,
73
+ encryption: false
122
74
  },
123
75
  worker: workerEntry,
124
76
  startWriterHost: async (path, options, hostOptions) => {
@@ -135,6 +87,7 @@ function nodeSqlite(driverOptions) {
135
87
  ),
136
88
  resolveExtensionPath: nodeResolveExtensionPath,
137
89
  async open(path, options) {
90
+ refuseEncryptedOpen("node:sqlite", options);
138
91
  const { DatabaseSync } = await import('node:sqlite');
139
92
  const db = new DatabaseSync(path, { readOnly: options?.readonly ?? false, allowExtension: true });
140
93
  db.enableLoadExtension?.(false);
@@ -1,4 +1,4 @@
1
- import { S as SQLiteDriver } from '../types-DTmi7pXp.js';
1
+ import { S as SQLiteDriver } from '../types-BWyv_N18.js';
2
2
  import '../query-types-5B02ixH0.js';
3
3
 
4
4
  /**
@@ -1,155 +1,9 @@
1
- // src/core/errors.ts
2
- var SirannonError = class extends Error {
3
- constructor(message, code) {
4
- super(message);
5
- this.code = code;
6
- this.name = "SirannonError";
7
- }
8
- };
9
- var ExtensionError = class extends SirannonError {
10
- constructor(path, cause) {
11
- super(
12
- cause ? `Failed to load extension '${path}': ${cause}` : `Failed to load extension '${path}'`,
13
- "EXTENSION_ERROR"
14
- );
15
- this.name = "ExtensionError";
16
- }
17
- };
18
-
19
- // src/core/driver/define.ts
20
- function defineDriver(config) {
21
- if (!config.capabilities || typeof config.open !== "function") {
22
- throw new SirannonError("Driver must define capabilities and open()", "INVALID_DRIVER");
23
- }
24
- if (config.worker !== void 0 && typeof config.worker.specifier !== "string") {
25
- throw new SirannonError("Driver worker entry must define a string specifier", "INVALID_DRIVER");
26
- }
27
- return Object.freeze({
28
- capabilities: Object.freeze({ ...config.capabilities }),
29
- open: config.open.bind(config),
30
- ...config.worker ? { worker: Object.freeze({ ...config.worker }) } : {},
31
- ...config.startWriterHost ? { startWriterHost: config.startWriterHost.bind(config) } : {},
32
- ...config.createWriterContext ? { createWriterContext: config.createWriterContext.bind(config) } : {},
33
- ...config.createBackupEngine ? { createBackupEngine: config.createBackupEngine.bind(config) } : {},
34
- ...config.resolveExtensionPath ? { resolveExtensionPath: config.resolveExtensionPath.bind(config) } : {}
35
- });
36
- }
37
-
38
- // src/core/driver/statement-text.ts
39
- var SPACE = 32;
40
- var TAB = 9;
41
- var LINE_FEED = 10;
42
- var VERTICAL_TAB = 11;
43
- var FORM_FEED = 12;
44
- var CARRIAGE_RETURN = 13;
45
- var SEMICOLON = 59;
46
- var HYPHEN = 45;
47
- var SLASH = 47;
48
- var ASTERISK = 42;
49
- var NO_STATEMENT_MESSAGE = "The supplied SQL string contains no statements";
50
- function startsSqliteSpace(code) {
51
- return code === SPACE || code === TAB || code === LINE_FEED || code === FORM_FEED || code === CARRIAGE_RETURN;
52
- }
53
- function continuesSqliteSpace(code) {
54
- return startsSqliteSpace(code) || code === VERTICAL_TAB;
55
- }
56
- function holdsNoStatement(sql) {
57
- const firstNul = sql.indexOf("\0");
58
- const text = firstNul === -1 ? sql : sql.slice(0, firstNul);
59
- let index = 0;
60
- while (index < text.length) {
61
- const code = text.charCodeAt(index);
62
- if (startsSqliteSpace(code)) {
63
- index++;
64
- while (index < text.length && continuesSqliteSpace(text.charCodeAt(index))) index++;
65
- continue;
66
- }
67
- if (code === SEMICOLON) {
68
- index++;
69
- continue;
70
- }
71
- const next = text.charCodeAt(index + 1);
72
- if (code === HYPHEN && next === HYPHEN) {
73
- const lineEnd = text.indexOf("\n", index + 2);
74
- if (lineEnd === -1) return true;
75
- index = lineEnd;
76
- continue;
77
- }
78
- if (code === SLASH && next === ASTERISK && index + 2 < text.length) {
79
- const commentEnd = text.indexOf("*/", index + 2);
80
- if (commentEnd === -1) return true;
81
- index = commentEnd + 2;
82
- continue;
83
- }
84
- return false;
85
- }
86
- return true;
87
- }
88
- function assertHoldsStatement(sql) {
89
- if (holdsNoStatement(sql)) throw new RangeError(NO_STATEMENT_MESSAGE);
90
- }
91
-
92
- // src/core/driver/synchronous.ts
93
- var DEFAULT_SYNCHRONOUS = "normal";
94
- var SYNCHRONOUS_PRAGMA_VALUES = {
95
- off: "OFF",
96
- normal: "NORMAL",
97
- full: "FULL",
98
- extra: "EXTRA"
99
- };
100
- function synchronousPragmaValue(level) {
101
- const resolved = level ?? DEFAULT_SYNCHRONOUS;
102
- const value = SYNCHRONOUS_PRAGMA_VALUES[resolved];
103
- if (value === void 0) {
104
- throw new SirannonError(
105
- `Invalid synchronous level '${String(resolved)}': expected 'off', 'normal', 'full', or 'extra'`,
106
- "INVALID_SYNCHRONOUS"
107
- );
108
- }
109
- return value;
110
- }
111
-
112
- // src/core/driver/values.ts
113
- var SAFE_INT_BOUND = 9007199254740991n;
114
- function narrowSafeBigInt(value) {
115
- if (typeof value === "bigint" && value >= -SAFE_INT_BOUND && value <= SAFE_INT_BOUND) {
116
- return Number(value);
117
- }
118
- return value;
119
- }
120
- var EMPTY_BLOB_WITH_ALLOCATED_STORAGE = new Uint8Array(new ArrayBuffer(1), 0, 0);
121
- function bindableValue(value) {
122
- if (typeof value === "boolean") return value ? 1n : 0n;
123
- if (ArrayBuffer.isView(value) && value.byteLength === 0) return EMPTY_BLOB_WITH_ALLOCATED_STORAGE;
124
- return value;
125
- }
126
- function isNamedParams(value) {
127
- if (value === null || typeof value !== "object") return false;
128
- const prototype = Object.getPrototypeOf(value);
129
- return prototype === Object.prototype || prototype === null;
130
- }
131
- function bindableNamedParams(params) {
132
- let bound;
133
- for (const key of Object.keys(params)) {
134
- const value = params[key];
135
- const replacement = bindableValue(value);
136
- if (replacement === value) continue;
137
- bound ??= { ...params };
138
- bound[key] = replacement;
139
- }
140
- return bound ?? params;
141
- }
142
- function bindableParams(params) {
143
- let bound;
144
- for (let index = 0; index < params.length; index++) {
145
- const value = params[index];
146
- const replacement = isNamedParams(value) ? bindableNamedParams(value) : bindableValue(value);
147
- if (replacement === value) continue;
148
- bound ??= [...params];
149
- bound[index] = replacement;
150
- }
151
- return bound ?? params;
152
- }
1
+ import { assertHoldsStatement } from '../chunk-22TYGH7J.mjs';
2
+ import { bindableParams, isNamedParams, narrowSafeBigInt } from '../chunk-MX77PGEN.mjs';
3
+ import { defineDriver } from '../chunk-A5ULJVK7.mjs';
4
+ import { synchronousPragmaValue } from '../chunk-YCMB6GR4.mjs';
5
+ import { refuseEncryptedOpen } from '../chunk-5O4J6LQQ.mjs';
6
+ import { ExtensionError } from '../chunk-KINDFBQP.mjs';
153
7
 
154
8
  // src/drivers/wa-sqlite/bind.ts
155
9
  var SQLITE_OK = 0;
@@ -263,8 +117,15 @@ function readColumn(sqlite3, memory, stmt, index) {
263
117
  var SQLITE_ROW = 100;
264
118
  function waSqlite(driverOptions) {
265
119
  return defineDriver({
266
- capabilities: { multipleConnections: false, extensions: false, steppedCopy: false, rowCounts: false },
120
+ capabilities: {
121
+ multipleConnections: false,
122
+ extensions: false,
123
+ steppedCopy: false,
124
+ rowCounts: false,
125
+ encryption: false
126
+ },
267
127
  async open(path, options) {
128
+ refuseEncryptedOpen("wa-sqlite", options);
268
129
  const { default: SQLiteESMFactory } = await import('wa-sqlite/dist/wa-sqlite-async.mjs');
269
130
  const { Factory } = await import('wa-sqlite');
270
131
  const module = await SQLiteESMFactory();
@@ -1,4 +1,4 @@
1
- import { J as SQLiteConnection } from './types-DTmi7pXp.js';
1
+ import { L as SQLiteConnection } from './types-BWyv_N18.js';
2
2
  import { C as ChangeEvent } from './query-types-5B02ixH0.js';
3
3
 
4
4
  type PruneBoundarySource = 'device-sync' | 'device-push-cursor' | 'replication' | 'device-cursors';
@@ -142,4 +142,202 @@ declare class ChangeTracker {
142
142
  private markUnwatched;
143
143
  }
144
144
 
145
- export { ChangeTracker as C, type PruneBoundarySource as P, type ChangeTrackerOptions as a };
145
+ /**
146
+ * The base class for every sirannon-db error, which has a machine-readable
147
+ * {@link SirannonError.code}. Extend it to define an error of your own.
148
+ *
149
+ * @public
150
+ */
151
+ declare class SirannonError extends Error {
152
+ /**
153
+ * The machine-readable code that the server maps to an HTTP status.
154
+ */
155
+ readonly code: string;
156
+ constructor(message: string,
157
+ /**
158
+ * The machine-readable code that the server maps to an HTTP status.
159
+ */
160
+ code: string);
161
+ }
162
+ /**
163
+ * Thrown when the registry has no open database under an identifier, because
164
+ * the database was never opened or is already closed.
165
+ *
166
+ * @public
167
+ */
168
+ declare class DatabaseNotFoundError extends SirannonError {
169
+ constructor(id: string);
170
+ }
171
+ /**
172
+ * Thrown when a caller opens a database under an identifier that the registry
173
+ * already uses, since each identifier names one database.
174
+ *
175
+ * @public
176
+ */
177
+ declare class DatabaseAlreadyExistsError extends SirannonError {
178
+ constructor(id: string);
179
+ }
180
+ /**
181
+ * Thrown when a caller writes to a database that is open in read-only mode.
182
+ *
183
+ * @public
184
+ */
185
+ declare class ReadOnlyError extends SirannonError {
186
+ constructor(id: string);
187
+ }
188
+ /**
189
+ * Thrown when SQLite fails to execute a statement, with that statement in
190
+ * {@link QueryError.sql} for your logs.
191
+ *
192
+ * @public
193
+ */
194
+ declare class QueryError extends SirannonError {
195
+ /**
196
+ * The statement that failed.
197
+ */
198
+ readonly sql: string;
199
+ constructor(message: string,
200
+ /**
201
+ * The statement that failed.
202
+ */
203
+ sql: string);
204
+ }
205
+ /**
206
+ * Sirannon raises this error when SQLite refuses to commit a transaction whose
207
+ * statements all succeeded, such as on a deferred foreign key; `cause` holds
208
+ * SQLite's own error. The server responds to its `TRANSACTION_ERROR` code with status 400.
209
+ *
210
+ * @public
211
+ */
212
+ declare class TransactionError extends SirannonError {
213
+ constructor(message: string, cause?: unknown);
214
+ }
215
+ /**
216
+ * Thrown when a migration fails, with the version of that migration in
217
+ * {@link MigrationError.version}.
218
+ *
219
+ * @public
220
+ */
221
+ declare class MigrationError extends SirannonError {
222
+ /**
223
+ * The version of the migration that failed.
224
+ */
225
+ readonly version: number;
226
+ constructor(message: string,
227
+ /**
228
+ * The version of the migration that failed.
229
+ */
230
+ version: number, code?: string);
231
+ }
232
+ /**
233
+ * An error that a before-hook can throw to reject an operation, which the
234
+ * server responds to with status 403. The message includes the optional
235
+ * `reason`, so that a caller can tell one hook policy from another.
236
+ *
237
+ * @public
238
+ */
239
+ declare class HookDeniedError extends SirannonError {
240
+ constructor(hookName: string, reason?: string);
241
+ }
242
+ /**
243
+ * Rejects one request with a status of your own; throw it from an authenticate hook or a registered operation.
244
+ *
245
+ * @public
246
+ */
247
+ declare class RequestDeniedError extends SirannonError {
248
+ /**
249
+ * The HTTP status that the server responds to the rejected request with.
250
+ */
251
+ readonly status: number;
252
+ constructor(status: number, code: string, message: string);
253
+ }
254
+ /**
255
+ * Thrown when change capture cannot proceed, for example when a caller watches
256
+ * a table that does not exist, when Sirannon cannot read the change-log epoch
257
+ * or the node identity, or when a live query uses a statement that Sirannon
258
+ * cannot keep current.
259
+ *
260
+ * @public
261
+ */
262
+ declare class CDCError extends SirannonError {
263
+ constructor(message: string);
264
+ }
265
+ /**
266
+ * Thrown when a statement through the query API names a `_sirannon` table,
267
+ * modifies a `sqlite_` table, contains ATTACH or DETACH, or sets
268
+ * `PRAGMA writable_schema`. Sirannon rejects these statements to keep its
269
+ * change log, its replication ledger, and SQLite's schema catalogue out of the
270
+ * caller's reach.
271
+ *
272
+ * @public
273
+ */
274
+ declare class ForbiddenSqlError extends SirannonError {
275
+ constructor(message: string);
276
+ }
277
+ /**
278
+ * Thrown when a copy to a file or a scheduled backup fails, or when its path,
279
+ * cron expression, or time zone is invalid.
280
+ *
281
+ * @public
282
+ */
283
+ declare class BackupError extends SirannonError {
284
+ constructor(message: string);
285
+ }
286
+ /**
287
+ * Thrown when a caller asks a closed or empty connection pool for a connection, asks a
288
+ * read-only pool for the writer, or closes a pool and one of its connections
289
+ * fails to close.
290
+ *
291
+ * @public
292
+ */
293
+ declare class ConnectionPoolError extends SirannonError {
294
+ constructor(message: string);
295
+ }
296
+ /**
297
+ * Thrown when the lifecycle resolver would open a database past `maxOpen`, and
298
+ * evicting the least recently used database frees no slot. Close a database
299
+ * before you open another one.
300
+ *
301
+ * @public
302
+ */
303
+ declare class MaxDatabasesError extends SirannonError {
304
+ constructor(max: number);
305
+ }
306
+ /**
307
+ * Thrown when more writes are pending than the writer-worker limit allows, so
308
+ * that the database sheds load. The server responds to it with status 503 and
309
+ * a `Retry-After` header.
310
+ *
311
+ * @public
312
+ */
313
+ declare class WriteOverloadError extends SirannonError {
314
+ /**
315
+ * The number of pending writes that the database accepts before it rejects more.
316
+ */
317
+ readonly limit: number;
318
+ /**
319
+ * The number of milliseconds that the caller should wait before it retries.
320
+ */
321
+ readonly retryAfterMs: number;
322
+ constructor(
323
+ /**
324
+ * The number of pending writes that the database accepts before it rejects more.
325
+ */
326
+ limit: number,
327
+ /**
328
+ * The number of milliseconds that the caller should wait before it retries.
329
+ */
330
+ retryAfterMs: number);
331
+ }
332
+ /**
333
+ * Thrown when Sirannon cannot load a compiled SQLite extension. The message
334
+ * names the extension path, and the optional `cause` gives the reason that
335
+ * SQLite or Sirannon reported.
336
+ *
337
+ * @public
338
+ */
339
+ declare class ExtensionError extends SirannonError {
340
+ constructor(path: string, cause?: string);
341
+ }
342
+
343
+ export { BackupError as B, ChangeTracker as C, DatabaseAlreadyExistsError as D, ExtensionError as E, ForbiddenSqlError as F, HookDeniedError as H, MaxDatabasesError as M, type PruneBoundarySource as P, QueryError as Q, ReadOnlyError as R, SirannonError as S, TransactionError as T, WriteOverloadError as W, CDCError as a, type ChangeTrackerOptions as b, ConnectionPoolError as c, DatabaseNotFoundError as d, MigrationError as e, RequestDeniedError as f };
@@ -1,5 +1,5 @@
1
1
  import { B as BaselineFileOption } from '../baseline-Co3iIsN_.js';
2
- import { M as Migration } from '../types-DTmi7pXp.js';
2
+ import { M as Migration } from '../types-BWyv_N18.js';
3
3
  import '../query-types-5B02ixH0.js';
4
4
 
5
5
  /**
@@ -0,0 +1 @@
1
+ export { ERROR_CODE_TRAILER, refusalCodeOf, refusePeerStreams } from './chunk-QF7WF7RJ.mjs';
@@ -1,5 +1,5 @@
1
1
  import { W as WriteConcern, R as ReadConcern, E as ExecuteResult } from './query-types-5B02ixH0.js';
2
- import { B as BulkLoadDurability, a as BulkLoadResult } from './server-options-B9CsAZp5.js';
2
+ import { B as BulkLoadDurability, a as BulkLoadResult } from './server-options-Bhdlvehe.js';
3
3
 
4
4
  /**
5
5
  * Body of `POST /db/{id}/query`.
@@ -1,6 +1,6 @@
1
1
  import { assertNonEmpty, assertPositiveTtl, cloneMetadata, cloneCompatibility, buildReplicationGroupState, cloneReplicationGroupState, assertNonNegativeTerm, assertPrimaryInGroup, markDisplacedPrimaryForRepair, assertNonNegativeSeq, normaliseNodeIds, nextInSyncSetState, nextAdmittedInSyncState, nextMaintenanceState, MIN_AUTOMATIC_FAILOVER_VOTERS, isEligiblePromotionSession, isGroupMember, removeNodeId, setMembership, sameNodeIdSet } from '../../chunk-PJRCMG7L.mjs';
2
2
  import { CoordinatorError, NoSafePrimaryError } from '../../chunk-KU32OT4H.mjs';
3
- import { array, string, pipe, regex, object, number, optional, nullable, safeParse, getDotPath } from '../../chunk-ZFFUVYYE.mjs';
3
+ import { array, string, pipe, regex, object, number, optional, nullable, safeParse, getDotPath } from '../../chunk-5DKWHT6K.mjs';
4
4
  import '../../chunk-BLMRNSUG.mjs';
5
5
  import { optionalDependencyError } from '../../chunk-WOMADPM4.mjs';
6
6
  import '../../chunk-KINDFBQP.mjs';
@@ -1,17 +1,17 @@
1
1
  export { F as FieldMergeResolver, L as LWWResolver, P as PrimaryWinsResolver } from '../primary-wins-BnNAEjwB.js';
2
- import { r as HLC, D as Database, S as SirannonError } from '../database-fz-8CJBP.js';
3
- import { J as SQLiteConnection, s as BackupGroupSource, a4 as ClusterReadEndpointInfo, I as ClusterStatusInfo, T as Transaction } from '../types-DTmi7pXp.js';
2
+ import { k as HLC, D as Database } from '../database-BZ96ZzAx.js';
3
+ import { L as SQLiteConnection, s as BackupGroupSource, a6 as ClusterReadEndpointInfo, K as ClusterStatusInfo, T as Transaction } from '../types-BWyv_N18.js';
4
4
  import { C as ClusterCoordinator, c as CoordinatorWatchDisposer, o as CoordinatorLease, e as ReplicationGroupState } from '../types-MczwKtul.js';
5
5
  export { A as AcquireControllerLeaseInput, a as AcquireControllerLeaseResult, l as AdmitNodeToInSyncSetInput, j as CompareAndAdvancePrimaryTermInput, k as CompareAndAdvancePrimaryTermResult, b as ControllerLeaseWatcher, n as CoordinatorCompatibilityMetadata, d as CoordinatorNodeSession, p as CoordinatorPrimary, N as NodeSessionWatcher, P as PromoteEligibleReplicaInput, R as RegisterNodeSessionInput, i as ReplicationGroupWatcher, S as SetReplicationGroupStateInput, U as UpdateInSyncSetInput, m as UpdateNodeMaintenanceInput } from '../types-MczwKtul.js';
6
- import { f as ReplicationStatusInfo } from '../server-options-B9CsAZp5.js';
7
- import { C as CoordinatorRuntimeStatus, g as ReplicationStatus, h as SyncPhase, I as InFlightBatch, P as PeerState, a as ForwardedTransactionResult, b as SyncBatch, c as SyncComplete, d as SyncAck, S as SyncRequest, i as ReplicationConfig, j as SyncState, k as ReplicationErrorEvent, R as ReplicationAck, l as Topology, f as TopologyRole } from '../types-BlZ9GG1a.js';
8
- export { F as ForwardedTransaction, N as NodeInfo, e as ReplicationTransport, m as SyncHistoryPoint, T as TransportConfig } from '../types-BlZ9GG1a.js';
6
+ import { f as ReplicationStatusInfo } from '../server-options-Bhdlvehe.js';
7
+ import { C as CoordinatorRuntimeStatus, g as ReplicationStatus, h as SyncPhase, I as InFlightBatch, P as PeerState, a as ForwardedTransactionResult, b as SyncBatch, c as SyncComplete, d as SyncAck, S as SyncRequest, i as ReplicationConfig, j as SyncState, k as ReplicationErrorEvent, R as ReplicationAck, l as Topology, f as TopologyRole } from '../types-CDnlkVRK.js';
8
+ export { F as ForwardedTransaction, N as NodeInfo, e as ReplicationTransport, m as SyncHistoryPoint, T as TransportConfig } from '../types-CDnlkVRK.js';
9
9
  import { EventEmitter } from 'node:events';
10
- import { C as ChangeTracker } from '../change-tracker-Dpo99EI-.js';
10
+ import { C as ChangeTracker, S as SirannonError } from '../errors-DLMAGQFb.js';
11
11
  import { P as Params, Q as QueryOptions, E as ExecuteResult, W as WriteConcern } from '../query-types-5B02ixH0.js';
12
12
  import { R as ReplicationBatch, C as ConflictResolver, A as ApplyResult, S as SyncTableManifest } from '../types-BG31TtrQ.js';
13
13
  export { a as ConflictContext, b as ConflictResolution, H as HLCTimestamp, c as ReplicationChange } from '../types-BG31TtrQ.js';
14
- import '../database-backup-BwTNiBm2.js';
14
+ import '../database-backup-BhM8yJ1A.js';
15
15
  import '../types-CEJG0eFS.js';
16
16
  import '../operation-registry-CGhNT-Sn.js';
17
17