@archildata/sqlite 0.0.0 → 0.0.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/index.cjs CHANGED
@@ -1,39 +1,12 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/index.ts
21
- var index_exports = {};
22
- __export(index_exports, {
23
- ArchilSQLiteError: () => ArchilSQLiteError,
24
- createDatabase: () => createDatabase,
25
- getDatabase: () => getDatabase
26
- });
27
- module.exports = __toCommonJS(index_exports);
28
- var import_disk = require("disk");
29
-
30
- // src/adapter.ts
31
- var import_node_buffer = require("buffer");
32
- var DEFAULT_TIMEOUT_MS = 5e3;
33
- var WRITE_MOUNT_QUEUE_MS = 5e3;
34
- var RESULT_PREFIX = "ARCHIL_SQLITE_RESULT:";
35
- var DISK_EXEC_MOUNT_PATH = "/mnt/archil/disk";
36
- var REMOTE_RUNNER = `
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ let disk = require("disk");
3
+ let node_buffer = require("node:buffer");
4
+ //#region src/adapter.ts
5
+ const DEFAULT_TIMEOUT_MS = 5e3;
6
+ const WRITE_MOUNT_QUEUE_MS = 5e3;
7
+ const RESULT_PREFIX = "ARCHIL_SQLITE_RESULT:";
8
+ const DISK_EXEC_MOUNT_PATH = "/mnt/archil/disk";
9
+ const REMOTE_RUNNER = `
37
10
  const { Buffer } = require("node:buffer");
38
11
  const { DatabaseSync } = require("node:sqlite");
39
12
  const fs = require("node:fs");
@@ -144,314 +117,284 @@ try {
144
117
  }
145
118
  `;
146
119
  var ArchilSQLiteError = class extends Error {
147
- code;
148
- remoteStack;
149
- constructor(message, opts = {}) {
150
- super(message);
151
- this.name = "ArchilSQLiteError";
152
- this.code = opts.code;
153
- this.remoteStack = opts.remoteStack;
154
- }
120
+ code;
121
+ remoteStack;
122
+ constructor(message, opts = {}) {
123
+ super(message);
124
+ this.name = "ArchilSQLiteError";
125
+ this.code = opts.code;
126
+ this.remoteStack = opts.remoteStack;
127
+ }
155
128
  };
156
- var operationStates = /* @__PURE__ */ new WeakMap();
129
+ const operationStates = /* @__PURE__ */ new WeakMap();
157
130
  function deferredPromise() {
158
- let resolve;
159
- let reject;
160
- const promise = new Promise((promiseResolve, promiseReject) => {
161
- resolve = promiseResolve;
162
- reject = promiseReject;
163
- });
164
- promise.catch(() => {
165
- });
166
- return { promise, resolve, reject };
131
+ let resolve;
132
+ let reject;
133
+ const promise = new Promise((promiseResolve, promiseReject) => {
134
+ resolve = promiseResolve;
135
+ reject = promiseReject;
136
+ });
137
+ promise.catch(() => {});
138
+ return {
139
+ promise,
140
+ resolve,
141
+ reject
142
+ };
167
143
  }
168
144
  var SQLiteOperationImpl = class {
169
- constructor(executeRequest, request) {
170
- this.executeRequest = executeRequest;
171
- operationStates.set(this, {
172
- executeRequest,
173
- request
174
- });
175
- }
176
- executeRequest;
177
- execute() {
178
- const state = operationStates.get(this);
179
- if (!state) {
180
- throw new TypeError("unknown SQLite operation");
181
- }
182
- state.promise ??= this.executeRequest(state.request);
183
- return state.promise;
184
- }
185
- then(onfulfilled, onrejected) {
186
- return this.execute().then(onfulfilled, onrejected);
187
- }
145
+ executeRequest;
146
+ constructor(executeRequest, request) {
147
+ this.executeRequest = executeRequest;
148
+ operationStates.set(this, {
149
+ executeRequest,
150
+ request
151
+ });
152
+ }
153
+ execute() {
154
+ const state = operationStates.get(this);
155
+ if (!state) throw new TypeError("unknown SQLite operation");
156
+ state.promise ??= this.executeRequest(state.request);
157
+ return state.promise;
158
+ }
159
+ then(onfulfilled, onrejected) {
160
+ return this.execute().then(onfulfilled, onrejected);
161
+ }
188
162
  };
189
163
  var SQLiteQueryImpl = class {
190
- constructor(executeRequest, request) {
191
- this.executeRequest = executeRequest;
192
- this.request = request;
193
- }
194
- executeRequest;
195
- request;
196
- get() {
197
- return new SQLiteOperationImpl(this.executeRequest, {
198
- ...this.request,
199
- method: "get"
200
- });
201
- }
202
- all() {
203
- return new SQLiteOperationImpl(this.executeRequest, {
204
- ...this.request,
205
- method: "all"
206
- });
207
- }
208
- run() {
209
- return new SQLiteOperationImpl(this.executeRequest, {
210
- ...this.request,
211
- method: "run"
212
- });
213
- }
164
+ executeRequest;
165
+ request;
166
+ constructor(executeRequest, request) {
167
+ this.executeRequest = executeRequest;
168
+ this.request = request;
169
+ }
170
+ get() {
171
+ return new SQLiteOperationImpl(this.executeRequest, {
172
+ ...this.request,
173
+ method: "get"
174
+ });
175
+ }
176
+ all() {
177
+ return new SQLiteOperationImpl(this.executeRequest, {
178
+ ...this.request,
179
+ method: "all"
180
+ });
181
+ }
182
+ run() {
183
+ return new SQLiteOperationImpl(this.executeRequest, {
184
+ ...this.request,
185
+ method: "run"
186
+ });
187
+ }
214
188
  };
215
189
  var SQLiteAdapter = class {
216
- constructor(exec, disk, database, options = {}) {
217
- this.exec = exec;
218
- this.disk = disk;
219
- this.database = database;
220
- this.timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
221
- this.readBigInts = options.readBigInts ?? false;
222
- this.returnArrays = options.returnArrays ?? false;
223
- }
224
- exec;
225
- disk;
226
- database;
227
- timeoutMs;
228
- readBigInts;
229
- returnArrays;
230
- read(strings, ...values) {
231
- return new SQLiteQueryImpl((request) => this.executeSingle(request), {
232
- kind: "read",
233
- sql: templateToSql(strings),
234
- params: values.map(encodeParameter)
235
- });
236
- }
237
- write(strings, ...values) {
238
- return new SQLiteQueryImpl((request) => this.executeSingle(request), {
239
- kind: "write",
240
- sql: templateToSql(strings),
241
- params: values.map(encodeParameter)
242
- });
243
- }
244
- async transaction(operations) {
245
- const states = operations.map((operation) => {
246
- const state = operationStates.get(operation);
247
- if (!state) {
248
- throw new TypeError("unknown SQLite operation");
249
- }
250
- return state;
251
- });
252
- const seen = /* @__PURE__ */ new Set();
253
- for (const state of states) {
254
- if (state.promise) {
255
- throw new TypeError("SQLite operation has already started");
256
- }
257
- if (seen.has(state)) {
258
- throw new TypeError("SQLite operation cannot be used more than once in a transaction");
259
- }
260
- seen.add(state);
261
- }
262
- const requests = states.map((state) => state.request);
263
- const readOnly = requests.every((request) => request.kind === "read");
264
- const deferreds = states.map(() => deferredPromise());
265
- states.forEach((state, index) => {
266
- state.promise = deferreds[index].promise;
267
- });
268
- try {
269
- const results = await this.executeRemote(requests, { transaction: true, readOnly });
270
- results.forEach((result, index) => {
271
- deferreds[index].resolve(result);
272
- });
273
- return results;
274
- } catch (err) {
275
- deferreds.forEach((deferred) => {
276
- deferred.reject(err);
277
- });
278
- throw err;
279
- }
280
- }
281
- executeSingle(request) {
282
- return this.executeRemote([request], {
283
- transaction: false,
284
- readOnly: request.kind === "read"
285
- }).then((results) => results[0]);
286
- }
287
- async executeRemote(operations, opts) {
288
- const payload = {
289
- databasePath: `${DISK_EXEC_MOUNT_PATH}/${this.database.path}`,
290
- displayPath: this.database.path,
291
- timeoutMs: this.timeoutMs,
292
- readBigInts: this.readBigInts,
293
- returnArrays: this.returnArrays,
294
- readOnly: opts.readOnly,
295
- transaction: opts.transaction,
296
- operations
297
- };
298
- const checkoutPaths = opts.readOnly || !this.database.directory ? void 0 : [this.database.directory];
299
- const queueMs = opts.readOnly ? void 0 : WRITE_MOUNT_QUEUE_MS;
300
- const mount = {
301
- disk: this.disk.id,
302
- readOnly: opts.readOnly,
303
- checkoutPaths,
304
- queueMs
305
- };
306
- const command = buildCommand(payload);
307
- const result = await this.exec({
308
- command,
309
- disks: { disk: mount }
310
- });
311
- const decoded = parseExecResult(result);
312
- return opts.transaction ? decoded : [decoded];
313
- }
190
+ exec;
191
+ disk;
192
+ database;
193
+ timeoutMs;
194
+ readBigInts;
195
+ returnArrays;
196
+ constructor(exec, disk, database, options = {}) {
197
+ this.exec = exec;
198
+ this.disk = disk;
199
+ this.database = database;
200
+ this.timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
201
+ this.readBigInts = options.readBigInts ?? false;
202
+ this.returnArrays = options.returnArrays ?? false;
203
+ }
204
+ read(strings, ...values) {
205
+ return new SQLiteQueryImpl((request) => this.executeSingle(request), {
206
+ kind: "read",
207
+ sql: templateToSql(strings),
208
+ params: values.map(encodeParameter)
209
+ });
210
+ }
211
+ write(strings, ...values) {
212
+ return new SQLiteQueryImpl((request) => this.executeSingle(request), {
213
+ kind: "write",
214
+ sql: templateToSql(strings),
215
+ params: values.map(encodeParameter)
216
+ });
217
+ }
218
+ async transaction(operations) {
219
+ const states = operations.map((operation) => {
220
+ const state = operationStates.get(operation);
221
+ if (!state) throw new TypeError("unknown SQLite operation");
222
+ return state;
223
+ });
224
+ const seen = /* @__PURE__ */ new Set();
225
+ for (const state of states) {
226
+ if (state.promise) throw new TypeError("SQLite operation has already started");
227
+ if (seen.has(state)) throw new TypeError("SQLite operation cannot be used more than once in a transaction");
228
+ seen.add(state);
229
+ }
230
+ const requests = states.map((state) => state.request);
231
+ const readOnly = requests.every((request) => request.kind === "read");
232
+ const deferreds = states.map(() => deferredPromise());
233
+ states.forEach((state, index) => {
234
+ state.promise = deferreds[index].promise;
235
+ });
236
+ try {
237
+ const results = await this.executeRemote(requests, {
238
+ transaction: true,
239
+ readOnly
240
+ });
241
+ results.forEach((result, index) => {
242
+ deferreds[index].resolve(result);
243
+ });
244
+ return results;
245
+ } catch (err) {
246
+ deferreds.forEach((deferred) => {
247
+ deferred.reject(err);
248
+ });
249
+ throw err;
250
+ }
251
+ }
252
+ executeSingle(request) {
253
+ return this.executeRemote([request], {
254
+ transaction: false,
255
+ readOnly: request.kind === "read"
256
+ }).then((results) => results[0]);
257
+ }
258
+ async executeRemote(operations, opts) {
259
+ const payload = {
260
+ databasePath: `${DISK_EXEC_MOUNT_PATH}/${this.database.path}`,
261
+ displayPath: this.database.path,
262
+ timeoutMs: this.timeoutMs,
263
+ readBigInts: this.readBigInts,
264
+ returnArrays: this.returnArrays,
265
+ readOnly: opts.readOnly,
266
+ transaction: opts.transaction,
267
+ operations
268
+ };
269
+ const checkoutPaths = opts.readOnly || !this.database.directory ? void 0 : [this.database.directory];
270
+ const queueMs = opts.readOnly ? void 0 : WRITE_MOUNT_QUEUE_MS;
271
+ const mount = {
272
+ disk: this.disk.id,
273
+ readOnly: opts.readOnly,
274
+ checkoutPaths,
275
+ queueMs
276
+ };
277
+ const command = buildCommand(payload);
278
+ const decoded = parseExecResult(await this.exec({
279
+ command,
280
+ disks: { disk: mount }
281
+ }));
282
+ return opts.transaction ? decoded : [decoded];
283
+ }
314
284
  };
315
285
  function createSQLiteAdapter(exec) {
316
- return {
317
- async createDatabase(disk, databasePath, options = {}) {
318
- const database = normalizeDatabasePath(databasePath);
319
- const rootDirectory = database.directory ? `${DISK_EXEC_MOUNT_PATH}/${database.directory}` : DISK_EXEC_MOUNT_PATH;
320
- const mountedDatabasePath = `${rootDirectory}/${database.filename}`;
321
- const command = `mkdir -p ${shellQuote(rootDirectory)} && node --no-warnings -e ${shellQuote(CREATE_DATABASE_RUNNER)} ${shellQuote(mountedDatabasePath)}`;
322
- const result = await exec({
323
- command,
324
- disks: {
325
- disk: {
326
- disk: disk.id,
327
- readOnly: false,
328
- queueMs: WRITE_MOUNT_QUEUE_MS
329
- }
330
- }
331
- });
332
- if (result.exitCode !== 0) {
333
- throw new ArchilSQLiteError(
334
- `SQLite database creation failed with exit code ${result.exitCode}: ${result.stderr || result.stdout}`
335
- );
336
- }
337
- return new SQLiteAdapter(exec, disk, database, options);
338
- },
339
- async getDatabase(disk, databasePath, options = {}) {
340
- const database = normalizeDatabasePath(databasePath);
341
- return new SQLiteAdapter(exec, disk, database, options);
342
- }
343
- };
286
+ return {
287
+ async createDatabase(disk, databasePath, options = {}) {
288
+ const database = normalizeDatabasePath(databasePath);
289
+ const rootDirectory = database.directory ? `${DISK_EXEC_MOUNT_PATH}/${database.directory}` : DISK_EXEC_MOUNT_PATH;
290
+ const mountedDatabasePath = `${rootDirectory}/${database.filename}`;
291
+ const result = await exec({
292
+ command: `mkdir -p ${shellQuote(rootDirectory)} && node --no-warnings -e ${shellQuote(CREATE_DATABASE_RUNNER)} ${shellQuote(mountedDatabasePath)}`,
293
+ disks: { disk: {
294
+ disk: disk.id,
295
+ readOnly: false,
296
+ queueMs: WRITE_MOUNT_QUEUE_MS
297
+ } }
298
+ });
299
+ if (result.exitCode !== 0) throw new ArchilSQLiteError(`SQLite database creation failed with exit code ${result.exitCode}: ${result.stderr || result.stdout}`);
300
+ return new SQLiteAdapter(exec, disk, database, options);
301
+ },
302
+ async getDatabase(disk, databasePath, options = {}) {
303
+ return new SQLiteAdapter(exec, disk, normalizeDatabasePath(databasePath), options);
304
+ }
305
+ };
344
306
  }
345
307
  function templateToSql(strings) {
346
- let sql = strings[0] ?? "";
347
- for (let i = 1; i < strings.length; i++) {
348
- sql += "?" + strings[i];
349
- }
350
- return sql;
308
+ let sql = strings[0] ?? "";
309
+ for (let i = 1; i < strings.length; i++) sql += "?" + strings[i];
310
+ return sql;
351
311
  }
352
312
  function normalizeDatabasePath(path) {
353
- if (path.endsWith("/")) {
354
- throw new TypeError("database path must include a file name and not end with '/'");
355
- }
356
- const segments = path.split("/").filter((segment) => segment.length > 0 && segment !== ".");
357
- if (segments.length === 0 || segments.some((segment) => segment === "..")) {
358
- throw new TypeError("database path must be a non-empty relative file path without '..'");
359
- }
360
- const filename = segments[segments.length - 1];
361
- const directorySegments = segments.slice(0, -1);
362
- return {
363
- path: segments.join("/"),
364
- directory: directorySegments.length > 0 ? directorySegments.join("/") : void 0,
365
- filename
366
- };
313
+ if (path.endsWith("/")) throw new TypeError("database path must include a file name and not end with '/'");
314
+ const segments = path.split("/").filter((segment) => segment.length > 0 && segment !== ".");
315
+ if (segments.length === 0 || segments.some((segment) => segment === "..")) throw new TypeError("database path must be a non-empty relative file path without '..'");
316
+ const filename = segments[segments.length - 1];
317
+ const directorySegments = segments.slice(0, -1);
318
+ return {
319
+ path: segments.join("/"),
320
+ directory: directorySegments.length > 0 ? directorySegments.join("/") : void 0,
321
+ filename
322
+ };
367
323
  }
368
- var CREATE_DATABASE_RUNNER = `
324
+ const CREATE_DATABASE_RUNNER = `
369
325
  const { DatabaseSync } = require("node:sqlite");
370
326
  const db = new DatabaseSync(process.argv[1]);
371
327
  db.close();
372
328
  `;
373
329
  function encodeParameter(value) {
374
- if (value === null) return { type: "null" };
375
- if (typeof value === "number") return { type: "number", value };
376
- if (typeof value === "string") return { type: "string", value };
377
- if (typeof value === "bigint") return { type: "bigint", value: value.toString() };
378
- if (value instanceof Uint8Array) {
379
- return {
380
- type: "bytes",
381
- value: import_node_buffer.Buffer.from(value.buffer, value.byteOffset, value.byteLength).toString("base64")
382
- };
383
- }
384
- if (value instanceof ArrayBuffer) {
385
- return { type: "bytes", value: import_node_buffer.Buffer.from(value).toString("base64") };
386
- }
387
- throw new TypeError(`unsupported SQLite parameter type: ${typeof value}`);
330
+ if (value === null) return { type: "null" };
331
+ if (typeof value === "number") return {
332
+ type: "number",
333
+ value
334
+ };
335
+ if (typeof value === "string") return {
336
+ type: "string",
337
+ value
338
+ };
339
+ if (typeof value === "bigint") return {
340
+ type: "bigint",
341
+ value: value.toString()
342
+ };
343
+ if (value instanceof Uint8Array) return {
344
+ type: "bytes",
345
+ value: node_buffer.Buffer.from(value.buffer, value.byteOffset, value.byteLength).toString("base64")
346
+ };
347
+ if (value instanceof ArrayBuffer) return {
348
+ type: "bytes",
349
+ value: node_buffer.Buffer.from(value).toString("base64")
350
+ };
351
+ throw new TypeError(`unsupported SQLite parameter type: ${typeof value}`);
388
352
  }
389
353
  function decodeWireValue(value) {
390
- switch (value.type) {
391
- case "undefined":
392
- return void 0;
393
- case "null":
394
- return null;
395
- case "number":
396
- case "string":
397
- return value.value;
398
- case "bigint":
399
- return BigInt(value.value);
400
- case "bytes":
401
- return Uint8Array.from(import_node_buffer.Buffer.from(value.value, "base64"));
402
- case "array":
403
- return value.value.map(decodeWireValue);
404
- case "object":
405
- return Object.fromEntries(
406
- Object.entries(value.value).map(([key, entry]) => [key, decodeWireValue(entry)])
407
- );
408
- }
354
+ switch (value.type) {
355
+ case "undefined": return;
356
+ case "null": return null;
357
+ case "number":
358
+ case "string": return value.value;
359
+ case "bigint": return BigInt(value.value);
360
+ case "bytes": return Uint8Array.from(node_buffer.Buffer.from(value.value, "base64"));
361
+ case "array": return value.value.map(decodeWireValue);
362
+ case "object": return Object.fromEntries(Object.entries(value.value).map(([key, entry]) => [key, decodeWireValue(entry)]));
363
+ }
409
364
  }
410
365
  function buildCommand(payload) {
411
- const encodedPayload = import_node_buffer.Buffer.from(JSON.stringify(payload), "utf8").toString("base64");
412
- return `node --no-warnings -e ${shellQuote(REMOTE_RUNNER)} ${shellQuote(encodedPayload)}`;
366
+ const encodedPayload = node_buffer.Buffer.from(JSON.stringify(payload), "utf8").toString("base64");
367
+ return `node --no-warnings -e ${shellQuote(REMOTE_RUNNER)} ${shellQuote(encodedPayload)}`;
413
368
  }
414
369
  function shellQuote(value) {
415
- return `'${value.replace(/'/g, "'\\''")}'`;
370
+ return `'${value.replace(/'/g, "'\\''")}'`;
416
371
  }
417
372
  function parseExecResult(result) {
418
- if (result.exitCode !== 0) {
419
- throw new ArchilSQLiteError(
420
- `SQLite serverless execution failed with exit code ${result.exitCode}: ${result.stderr || result.stdout}`
421
- );
422
- }
423
- const line = result.stdout.split(/\r?\n/).reverse().find((entry) => entry.startsWith(RESULT_PREFIX));
424
- if (!line) {
425
- throw new ArchilSQLiteError("SQLite serverless execution did not return a result payload");
426
- }
427
- let parsed;
428
- try {
429
- parsed = JSON.parse(
430
- import_node_buffer.Buffer.from(line.slice(RESULT_PREFIX.length), "base64").toString("utf8")
431
- );
432
- } catch (err) {
433
- throw new ArchilSQLiteError(`SQLite serverless execution returned invalid JSON: ${err}`);
434
- }
435
- if (!parsed.ok) {
436
- throw new ArchilSQLiteError(parsed.error.message ?? "SQLite serverless execution failed", {
437
- code: parsed.error.code,
438
- remoteStack: parsed.error.stack
439
- });
440
- }
441
- return decodeWireValue(parsed.result);
373
+ if (result.exitCode !== 0) throw new ArchilSQLiteError(`SQLite serverless execution failed with exit code ${result.exitCode}: ${result.stderr || result.stdout}`);
374
+ const line = result.stdout.split(/\r?\n/).reverse().find((entry) => entry.startsWith(RESULT_PREFIX));
375
+ if (!line) throw new ArchilSQLiteError("SQLite serverless execution did not return a result payload");
376
+ let parsed;
377
+ try {
378
+ parsed = JSON.parse(node_buffer.Buffer.from(line.slice(21), "base64").toString("utf8"));
379
+ } catch (err) {
380
+ throw new ArchilSQLiteError(`SQLite serverless execution returned invalid JSON: ${err}`);
381
+ }
382
+ if (!parsed.ok) throw new ArchilSQLiteError(parsed.error.message ?? "SQLite serverless execution failed", {
383
+ code: parsed.error.code,
384
+ remoteStack: parsed.error.stack
385
+ });
386
+ return decodeWireValue(parsed.result);
442
387
  }
443
-
444
- // src/index.ts
445
- var sqlite = createSQLiteAdapter((opts) => (0, import_disk.exec)(opts));
446
- function createDatabase(disk, databasePath, options) {
447
- return sqlite.createDatabase(disk, databasePath, options);
388
+ //#endregion
389
+ //#region src/index.ts
390
+ const sqlite = createSQLiteAdapter((opts) => (0, disk.exec)(opts));
391
+ function createDatabase(disk$1, databasePath, options) {
392
+ return sqlite.createDatabase(disk$1, databasePath, options);
448
393
  }
449
- function getDatabase(disk, databasePath, options) {
450
- return sqlite.getDatabase(disk, databasePath, options);
394
+ function getDatabase(disk$2, databasePath, options) {
395
+ return sqlite.getDatabase(disk$2, databasePath, options);
451
396
  }
452
- // Annotate the CommonJS export names for ESM import in node:
453
- 0 && (module.exports = {
454
- ArchilSQLiteError,
455
- createDatabase,
456
- getDatabase
457
- });
397
+ //#endregion
398
+ exports.ArchilSQLiteError = ArchilSQLiteError;
399
+ exports.createDatabase = createDatabase;
400
+ exports.getDatabase = getDatabase;