@vibeorm/adapter-sqlite 2.2.1 → 3.0.0
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/LICENSE +21 -0
- package/README.md +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.js +156 -44
- package/dist/index.js.map +5 -5
- package/dist/queue.d.ts +4 -1
- package/package.json +6 -4
- package/dist/errors.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/params.d.ts.map +0 -1
- package/dist/prepared-sql.d.ts.map +0 -1
- package/dist/queue.d.ts.map +0 -1
- package/dist/transaction-options.d.ts.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 VibeORM contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -33,7 +33,7 @@ await db.$disconnect();
|
|
|
33
33
|
| `readonly` | `boolean` | `false` | Open the file read-only. Writes fail with `SQLITE_READONLY`, mapped to `VIBE_ADAPTER`. The WAL pragma is skipped. |
|
|
34
34
|
| `busyTimeoutMs` | `number` | `5000` | `PRAGMA busy_timeout` in milliseconds. Must be a non-negative integer, validated eagerly (`VIBE_VALIDATION`). |
|
|
35
35
|
| `wal` | `boolean` | `true` | Switch file databases to `PRAGMA journal_mode = WAL`. Skipped for in-memory, read-only and injected databases. |
|
|
36
|
-
| `database` | `Database` (from `bun:sqlite`) | — | Run on an already-open database. It is never closed (`disconnect()`
|
|
36
|
+
| `database` | `Database` (from `bun:sqlite`) | — | Run on an already-open database. It is never closed (`disconnect()` only ends the adapter; later calls refuse with `VIBE_ADAPTER_CLOSED`) and its journal mode is left alone; `PRAGMA foreign_keys = ON` is still applied. |
|
|
37
37
|
|
|
38
38
|
Every transaction opens with `BEGIN IMMEDIATE`, so the write lock is taken up front and a write after a read cannot deadlock on a lock upgrade. Nested transactions become savepoints, and a nested call that passes `isolationLevel` or `timeout` is refused with `VIBE_VALIDATION`.
|
|
39
39
|
|
package/dist/index.d.ts
CHANGED
|
@@ -64,7 +64,7 @@ export type SqliteAdapterOptions = {
|
|
|
64
64
|
/**
|
|
65
65
|
* An already-open `bun:sqlite` Database to run on — sharing one in-memory
|
|
66
66
|
* database across adapters makes multi-adapter tests trivial. The adapter
|
|
67
|
-
* never closes an injected instance (`disconnect()`
|
|
67
|
+
* never closes an injected instance (`disconnect()` only ends this adapter), never
|
|
68
68
|
* changes its journal mode, and still applies `PRAGMA foreign_keys = ON`
|
|
69
69
|
* (the ORM requires it). For lossless >2^53 BigInt reads the adapter sets
|
|
70
70
|
* statement-level safeIntegers on every statement it prepares, so an
|
|
@@ -90,9 +90,10 @@ export type SqliteAdapterOptions = {
|
|
|
90
90
|
* const shared = sqliteAdapter({ database: existingDatabase });
|
|
91
91
|
* ```
|
|
92
92
|
*
|
|
93
|
-
* `disconnect()`
|
|
94
|
-
*
|
|
95
|
-
*
|
|
93
|
+
* `disconnect()` ends the adapter for good: it waits for admitted work, closes
|
|
94
|
+
* a database the adapter opened (never a provided `database`), and every later
|
|
95
|
+
* call refuses with `VIBE_ADAPTER_CLOSED`. Create a new adapter to connect
|
|
96
|
+
* again; with the default `":memory:"` filename that is a new, empty database.
|
|
96
97
|
*
|
|
97
98
|
* @throws VibeError `VIBE_VALIDATION` when `busyTimeoutMs` is not a
|
|
98
99
|
* non-negative integer — validated eagerly, the value lands in PRAGMA text.
|
package/dist/index.js
CHANGED
|
@@ -3,17 +3,18 @@
|
|
|
3
3
|
import { Database } from "bun:sqlite";
|
|
4
4
|
import { VibeError as VibeError4, internalError } from "@vibeorm/schema";
|
|
5
5
|
import {
|
|
6
|
+
createAdapterLifecycleGate,
|
|
6
7
|
runSqliteSession,
|
|
8
|
+
transactionLifecycleRefusal,
|
|
7
9
|
dispatchSynchronousRowChanges,
|
|
8
10
|
readRowChanges,
|
|
9
11
|
statementRowChanges,
|
|
10
12
|
createSavepointScope,
|
|
11
|
-
isTransactionDeadlineError,
|
|
12
13
|
runNestedSavepoint,
|
|
13
14
|
runRootScope,
|
|
14
15
|
scopeTurn,
|
|
16
|
+
settleFailedTransaction,
|
|
15
17
|
startTransactionBudget,
|
|
16
|
-
transactionOutcomeUnknownError,
|
|
17
18
|
validateTransactionDeadline
|
|
18
19
|
} from "@vibeorm/runtime/adapter-kit";
|
|
19
20
|
|
|
@@ -225,7 +226,17 @@ function connectionOwnership(params) {
|
|
|
225
226
|
const existing = params.database === undefined ? undefined : INJECTED_OWNERSHIP.get(params.database);
|
|
226
227
|
if (existing !== undefined)
|
|
227
228
|
return existing;
|
|
228
|
-
const
|
|
229
|
+
const txContext = new AsyncLocalStorage;
|
|
230
|
+
const ownership = {
|
|
231
|
+
queue: createOperationQueue(),
|
|
232
|
+
txContext,
|
|
233
|
+
runInCallback(run) {
|
|
234
|
+
const token = { active: true };
|
|
235
|
+
return txContext.run(token, run).finally(() => {
|
|
236
|
+
token.active = false;
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
};
|
|
229
240
|
if (params.database !== undefined)
|
|
230
241
|
INJECTED_OWNERSHIP.set(params.database, ownership);
|
|
231
242
|
return ownership;
|
|
@@ -266,6 +277,13 @@ function validateTransactionOptions(params) {
|
|
|
266
277
|
meta: { dialect: "sqlite", timeout: options.timeout }
|
|
267
278
|
});
|
|
268
279
|
}
|
|
280
|
+
if (options.accessMode !== undefined) {
|
|
281
|
+
throw new VibeError3({
|
|
282
|
+
code: "VIBE_UNSUPPORTED_CAPABILITY",
|
|
283
|
+
message: "sqlite has no read-only transaction mode (PRAGMA query_only is connection-scoped, not transaction-scoped), so `accessMode` cannot be honored \u2014 remove the option",
|
|
284
|
+
meta: { dialect: "sqlite", feature: "transactionAccessMode", accessMode: options.accessMode }
|
|
285
|
+
});
|
|
286
|
+
}
|
|
269
287
|
}
|
|
270
288
|
|
|
271
289
|
// packages/adapter-sqlite/src/index.ts
|
|
@@ -273,20 +291,22 @@ import { createSavepointCounter, nextSavepointName } from "@vibeorm/runtime/adap
|
|
|
273
291
|
import {
|
|
274
292
|
DEFAULT_DEADLINE_CLOCK,
|
|
275
293
|
engineStatementBudgetMs,
|
|
276
|
-
isTransactionDeadlineError
|
|
294
|
+
isTransactionDeadlineError,
|
|
277
295
|
startTransactionBudget as startTransactionBudget2,
|
|
278
296
|
transactionClosedError,
|
|
279
297
|
transactionDeadlineError,
|
|
280
|
-
transactionOutcomeUnknownError
|
|
298
|
+
transactionOutcomeUnknownError,
|
|
281
299
|
validateTransactionDeadline as validateTransactionDeadline2
|
|
282
300
|
} from "@vibeorm/runtime/adapter-kit";
|
|
283
301
|
var DIALECT = "sqlite";
|
|
284
302
|
var PROVIDER = "sqlite";
|
|
285
303
|
var WIRE = Object.freeze({ dateTime: "text", json: "text", numbers: "native" });
|
|
304
|
+
var ROUND_TRIPS = "in-process";
|
|
286
305
|
var BUDGETS = Object.freeze({
|
|
287
306
|
acquireTimeout: false,
|
|
288
307
|
statementTimeout: "unsupported",
|
|
289
|
-
transactionDeadline: "between-statements"
|
|
308
|
+
transactionDeadline: "between-statements",
|
|
309
|
+
accessModes: Object.freeze([])
|
|
290
310
|
});
|
|
291
311
|
var DEFAULT_BUSY_TIMEOUT_MS = 5000;
|
|
292
312
|
function isMemoryFilename(params) {
|
|
@@ -308,11 +328,11 @@ function sqliteAdapter(options) {
|
|
|
308
328
|
meta: { busyTimeoutMs }
|
|
309
329
|
});
|
|
310
330
|
}
|
|
311
|
-
const { queue, txContext } = connectionOwnership({ database: options?.database });
|
|
331
|
+
const { queue, txContext, runInCallback } = connectionOwnership({ database: options?.database });
|
|
312
332
|
const ownsDatabase = options?.database === undefined;
|
|
313
333
|
const filename = options?.filename ?? ":memory:";
|
|
314
334
|
function assertNotInsideTransaction() {
|
|
315
|
-
if (txContext.getStore() === true) {
|
|
335
|
+
if (txContext.getStore()?.active === true) {
|
|
316
336
|
throw new VibeError4({
|
|
317
337
|
code: "VIBE_TRANSACTION",
|
|
318
338
|
message: "root client used inside a transaction callback \u2014 use the tx client the callback receives; the root connection would deadlock behind the open transaction",
|
|
@@ -322,6 +342,7 @@ function sqliteAdapter(options) {
|
|
|
322
342
|
}
|
|
323
343
|
let database = options?.database ?? null;
|
|
324
344
|
let configured = false;
|
|
345
|
+
const checkedAffectedStatements = new WeakSet;
|
|
325
346
|
function applyPragmas(params) {
|
|
326
347
|
const { db } = params;
|
|
327
348
|
db.run("PRAGMA foreign_keys = ON");
|
|
@@ -368,6 +389,35 @@ function sqliteAdapter(options) {
|
|
|
368
389
|
return normalizeRows({ rows });
|
|
369
390
|
});
|
|
370
391
|
}
|
|
392
|
+
function runExecuteAffected(params) {
|
|
393
|
+
return runMapped(() => {
|
|
394
|
+
const { db, text, values, scope, effect } = params;
|
|
395
|
+
const statement = withSafeIntegers(db.query(text));
|
|
396
|
+
if (!checkedAffectedStatements.has(statement)) {
|
|
397
|
+
assertSinglePreparedStatement({ text, expanded: statement.toString() });
|
|
398
|
+
checkedAffectedStatements.add(statement);
|
|
399
|
+
}
|
|
400
|
+
if (statement.columnNames.length > 0) {
|
|
401
|
+
const rows = dispatchSynchronousRowChanges({
|
|
402
|
+
scope,
|
|
403
|
+
effect,
|
|
404
|
+
run: () => statement.all(...asBindings(values)),
|
|
405
|
+
count: () => statementRowChanges({ effect, count: effect === "write" ? directChanges({ db }) : undefined })
|
|
406
|
+
});
|
|
407
|
+
return { rows: normalizeRows({ rows }), affectedRows: rows.length };
|
|
408
|
+
}
|
|
409
|
+
const affectedRows = dispatchSynchronousRowChanges({
|
|
410
|
+
scope,
|
|
411
|
+
effect,
|
|
412
|
+
run: () => {
|
|
413
|
+
const result = statement.run(...asBindings(values));
|
|
414
|
+
return result.changes === 0 ? 0 : directChanges({ db });
|
|
415
|
+
},
|
|
416
|
+
count: (count) => statementRowChanges({ effect, count })
|
|
417
|
+
});
|
|
418
|
+
return { rows: [], affectedRows };
|
|
419
|
+
});
|
|
420
|
+
}
|
|
371
421
|
function runExecuteUnsafe(params) {
|
|
372
422
|
return runMapped(() => {
|
|
373
423
|
const { db, text, values, scope, effect } = params;
|
|
@@ -407,6 +457,7 @@ function sqliteAdapter(options) {
|
|
|
407
457
|
provider: PROVIDER,
|
|
408
458
|
wire: WIRE,
|
|
409
459
|
budgets: BUDGETS,
|
|
460
|
+
roundTrips: ROUND_TRIPS,
|
|
410
461
|
rowChanges: () => {
|
|
411
462
|
budget.assertUsable({ stage: "statement" });
|
|
412
463
|
return readRowChanges({ scope });
|
|
@@ -418,6 +469,16 @@ function sqliteAdapter(options) {
|
|
|
418
469
|
budget.assertUsable({ stage: "statement" });
|
|
419
470
|
return runExecute({ db, scope, ...execParams });
|
|
420
471
|
},
|
|
472
|
+
async executeAffected(execParams) {
|
|
473
|
+
const turn = scopeTurn({ scope });
|
|
474
|
+
if (turn !== undefined)
|
|
475
|
+
await turn;
|
|
476
|
+
budget.assertUsable({ stage: "statement" });
|
|
477
|
+
return runExecuteAffected({ db, scope, ...execParams });
|
|
478
|
+
},
|
|
479
|
+
async executeRawBound(execParams) {
|
|
480
|
+
return this.executeUnsafe(execParams);
|
|
481
|
+
},
|
|
421
482
|
async executeUnsafe(execParams) {
|
|
422
483
|
const turn = scopeTurn({ scope });
|
|
423
484
|
if (turn !== undefined)
|
|
@@ -434,8 +495,14 @@ function sqliteAdapter(options) {
|
|
|
434
495
|
body: (child) => fn(createTransactionAdapter({ db, scope: child, budget }))
|
|
435
496
|
});
|
|
436
497
|
},
|
|
437
|
-
async connect() {
|
|
438
|
-
|
|
498
|
+
async connect() {
|
|
499
|
+
budget.assertUsable({ stage: "statement" });
|
|
500
|
+
throw transactionLifecycleRefusal({ method: "connect" });
|
|
501
|
+
},
|
|
502
|
+
async disconnect() {
|
|
503
|
+
budget.assertUsable({ stage: "statement" });
|
|
504
|
+
throw transactionLifecycleRefusal({ method: "disconnect" });
|
|
505
|
+
},
|
|
439
506
|
formatArrayParam(values) {
|
|
440
507
|
throw arrayParamBug({ values });
|
|
441
508
|
}
|
|
@@ -447,16 +514,28 @@ function sqliteAdapter(options) {
|
|
|
447
514
|
meta: { provider: PROVIDER, valueCount: params.values.length }
|
|
448
515
|
});
|
|
449
516
|
}
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
517
|
+
const lifecycle = createAdapterLifecycleGate({
|
|
518
|
+
driver: "sqlite",
|
|
519
|
+
isConnectionReentrant: () => txContext.getStore()?.active === true,
|
|
520
|
+
cleanup: async () => {
|
|
521
|
+
if (!ownsDatabase)
|
|
522
|
+
return;
|
|
523
|
+
await queue.run(async () => {
|
|
524
|
+
if (database === null)
|
|
525
|
+
return;
|
|
526
|
+
const closing = database;
|
|
527
|
+
database = null;
|
|
528
|
+
configured = false;
|
|
529
|
+
runMapped(() => closing.close());
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
});
|
|
533
|
+
const root = {
|
|
455
534
|
async withSession({ run }) {
|
|
456
535
|
assertNotInsideTransaction();
|
|
457
536
|
return queue.run(async () => {
|
|
458
537
|
const db = getDatabase();
|
|
459
|
-
return
|
|
538
|
+
return runInCallback(() => runSqliteSession({
|
|
460
539
|
run,
|
|
461
540
|
execute: async (query) => runExecuteUnsafe({ db, ...query }).rows,
|
|
462
541
|
inTransaction: () => db.inTransaction
|
|
@@ -467,6 +546,10 @@ function sqliteAdapter(options) {
|
|
|
467
546
|
assertNotInsideTransaction();
|
|
468
547
|
return queue.run(async () => runExecute({ db: getDatabase(), ...params }));
|
|
469
548
|
},
|
|
549
|
+
async executeAffected(params) {
|
|
550
|
+
assertNotInsideTransaction();
|
|
551
|
+
return queue.run(async () => runExecuteAffected({ db: getDatabase(), ...params }));
|
|
552
|
+
},
|
|
470
553
|
async executeUnsafe(params) {
|
|
471
554
|
assertNotInsideTransaction();
|
|
472
555
|
return queue.run(async () => runExecuteUnsafe({ db: getDatabase(), ...params }));
|
|
@@ -483,28 +566,38 @@ function sqliteAdapter(options) {
|
|
|
483
566
|
const db = getDatabase();
|
|
484
567
|
const scope = createSavepointScope();
|
|
485
568
|
const budget = startTransactionBudget({ options: transactionOptions, provider: PROVIDER });
|
|
486
|
-
|
|
569
|
+
const commit = { progress: "not-sent" };
|
|
570
|
+
let opened = false;
|
|
487
571
|
try {
|
|
488
|
-
|
|
572
|
+
runMapped(() => db.run("BEGIN IMMEDIATE"));
|
|
573
|
+
opened = true;
|
|
574
|
+
const result = await runInCallback(() => runRootScope({ scope, body: () => fn(createTransactionAdapter({ db, scope, budget })) }));
|
|
489
575
|
budget.assertUsable({ stage: "commit" });
|
|
576
|
+
commit.progress = "sent";
|
|
490
577
|
runMapped(() => db.run("COMMIT"));
|
|
491
578
|
budget.close({ outcome: "committed" });
|
|
492
579
|
return result;
|
|
493
580
|
} catch (error) {
|
|
581
|
+
if (commit.progress === "sent")
|
|
582
|
+
commit.progress = "answered";
|
|
583
|
+
let rollback = "not-needed";
|
|
494
584
|
try {
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
budget.close({ outcome: "unknown" });
|
|
499
|
-
if (budget.totalMs !== null && isTransactionDeadlineError(error)) {
|
|
500
|
-
throw transactionOutcomeUnknownError({
|
|
501
|
-
provider: PROVIDER,
|
|
502
|
-
totalMs: budget.totalMs,
|
|
503
|
-
cause: error
|
|
504
|
-
});
|
|
585
|
+
if (opened) {
|
|
586
|
+
db.run("ROLLBACK");
|
|
587
|
+
rollback = "acknowledged";
|
|
505
588
|
}
|
|
589
|
+
} catch {
|
|
590
|
+
rollback = "failed";
|
|
506
591
|
}
|
|
507
|
-
throw
|
|
592
|
+
throw settleFailedTransaction({
|
|
593
|
+
error,
|
|
594
|
+
provider: PROVIDER,
|
|
595
|
+
budget,
|
|
596
|
+
scope,
|
|
597
|
+
commit: commit.progress,
|
|
598
|
+
rollback,
|
|
599
|
+
connection: "returned"
|
|
600
|
+
});
|
|
508
601
|
}
|
|
509
602
|
});
|
|
510
603
|
},
|
|
@@ -513,19 +606,38 @@ function sqliteAdapter(options) {
|
|
|
513
606
|
await queue.run(async () => {
|
|
514
607
|
getDatabase();
|
|
515
608
|
});
|
|
609
|
+
}
|
|
610
|
+
};
|
|
611
|
+
return {
|
|
612
|
+
dialect: DIALECT,
|
|
613
|
+
provider: PROVIDER,
|
|
614
|
+
wire: WIRE,
|
|
615
|
+
budgets: BUDGETS,
|
|
616
|
+
roundTrips: ROUND_TRIPS,
|
|
617
|
+
transactionOutcome: "reported",
|
|
618
|
+
withSession({ run }) {
|
|
619
|
+
return lifecycle.admit({ run: () => root.withSession({ run }) });
|
|
516
620
|
},
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
621
|
+
execute(params) {
|
|
622
|
+
return lifecycle.admit({ run: () => root.execute(params) });
|
|
623
|
+
},
|
|
624
|
+
executeAffected(params) {
|
|
625
|
+
return lifecycle.admit({ run: () => root.executeAffected(params) });
|
|
626
|
+
},
|
|
627
|
+
executeRawBound(params) {
|
|
628
|
+
return lifecycle.admit({ run: () => root.executeUnsafe(params) });
|
|
629
|
+
},
|
|
630
|
+
executeUnsafe(params) {
|
|
631
|
+
return lifecycle.admit({ run: () => root.executeUnsafe(params) });
|
|
632
|
+
},
|
|
633
|
+
transaction(fn, transactionOptions) {
|
|
634
|
+
return lifecycle.admit({ run: () => root.transaction(fn, transactionOptions) });
|
|
635
|
+
},
|
|
636
|
+
connect() {
|
|
637
|
+
return lifecycle.admit({ run: () => root.connect() });
|
|
638
|
+
},
|
|
639
|
+
disconnect() {
|
|
640
|
+
return lifecycle.disconnect();
|
|
529
641
|
},
|
|
530
642
|
formatArrayParam(values) {
|
|
531
643
|
throw arrayParamBug({ values });
|
|
@@ -539,7 +651,7 @@ export {
|
|
|
539
651
|
createOperationQueue,
|
|
540
652
|
createSavepointCounter,
|
|
541
653
|
engineStatementBudgetMs,
|
|
542
|
-
|
|
654
|
+
isTransactionDeadlineError,
|
|
543
655
|
mapSqliteDriverError,
|
|
544
656
|
nextSavepointName,
|
|
545
657
|
normalizeRow,
|
|
@@ -552,9 +664,9 @@ export {
|
|
|
552
664
|
startTransactionBudget2 as startTransactionBudget,
|
|
553
665
|
transactionClosedError,
|
|
554
666
|
transactionDeadlineError,
|
|
555
|
-
|
|
667
|
+
transactionOutcomeUnknownError,
|
|
556
668
|
validateTransactionDeadline2 as validateTransactionDeadline,
|
|
557
669
|
validateTransactionOptions
|
|
558
670
|
};
|
|
559
671
|
|
|
560
|
-
//# debugId=
|
|
672
|
+
//# debugId=87B07C0D798BC04F64756E2164756E21
|
package/dist/index.js.map
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts", "../src/errors.ts", "../src/params.ts", "../src/prepared-sql.ts", "../src/queue.ts", "../src/transaction-options.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"/**\n * @vibeorm/adapter-sqlite — bun:sqlite (embedded SQLite) adapter for\n * VibeORM v2.\n *\n * bun:sqlite is a *synchronous* single-connection driver, so every call\n * completes without I/O waits and the adapter wraps results in\n * already-resolved promises — the cheapest possible `execute`. Like PGlite,\n * one connection means every operation runs through one serial queue:\n * a whole `transaction()` holds the queue until it commits or rolls back, so\n * concurrent client calls can never interleave into an open transaction.\n *\n * INTEGER WIDTH (the BigInt story): SQLite INTEGER columns are 64-bit, but JS\n * numbers are only exact to ±(2^53−1) — a plain read of a large BigInt column\n * silently corrupts (pinned on Bun 1.3.14: `SELECT 9007199254740993` returns\n * `9007199254740992` without safeIntegers). The adapter therefore ALWAYS reads\n * through bun:sqlite's `safeIntegers` (database-level for connections it\n * opens, statement-level `stmt.safeIntegers(true)` for every statement it\n * prepares, which also covers injected databases), then normalizes rows:\n * bigints inside the safe range become `number`, larger ones stay `bigint`.\n * That is exactly the shape the runtime's `SQLITE_CODECS` expect — Int and\n * Boolean columns arrive as numbers, and >2^53 BigInt columns round-trip\n * losslessly as bigint. See params.ts for the full reasoning.\n *\n * PRAGMAS applied on open (each documented on {@link SqliteAdapterOptions}):\n * `foreign_keys = ON` (mandatory — SQLite defaults OFF and the ORM's FK\n * semantics depend on it), `busy_timeout` (lock-wait bound), and\n * `journal_mode = WAL` for file databases (readers no longer block the\n * writer). Transactions open with `BEGIN IMMEDIATE`: the write lock is taken\n * up front, so a write after a read inside the transaction can never hit the\n * SQLITE_BUSY deadlock that lock *upgrades* are prone to.\n */\n\nimport { Database } from \"bun:sqlite\";\nimport type { SQLQueryBindings } from \"bun:sqlite\";\nimport { VibeError, internalError } from \"@vibeorm/schema\";\nimport type { Dialect, Provider } from \"@vibeorm/schema\";\nimport type {\n AdapterBudgetSupport,\n DatabaseAdapter,\n QueryResult,\n RowChangeCount,\n StatementEffect,\n TransactionOptions,\n WireFidelity,\n} from \"@vibeorm/runtime\";\nimport {\n runSqliteSession,\n dispatchSynchronousRowChanges,\n readRowChanges,\n statementRowChanges,\n createSavepointScope,\n isTransactionDeadlineError,\n runNestedSavepoint,\n runRootScope,\n type SavepointScope,\n scopeTurn,\n startTransactionBudget,\n type TransactionBudget,\n transactionOutcomeUnknownError,\n validateTransactionDeadline,\n} from \"@vibeorm/runtime/adapter-kit\";\nimport { mapSqliteDriverError, runMapped } from \"./errors.ts\";\nimport { normalizeRows, serializeParamsRaw } from \"./params.ts\";\nimport { assertSinglePreparedStatement } from \"./prepared-sql.ts\";\nimport { connectionOwnership } from \"./queue.ts\";\nimport { refuseNestedTransactionOptions, validateTransactionOptions } from \"./transaction-options.ts\";\n\n// ─── Options ──────────────────────────────────────────────────────\n\n/** Options for {@link sqliteAdapter}. (Factories are the documented exception allowed a plain options object.) */\nexport type SqliteAdapterOptions = {\n /**\n * Database file to open. Defaults to `\":memory:\"` — a fresh private\n * in-memory database, the usual choice for tests. Ignored when `database`\n * is injected.\n */\n readonly filename?: string;\n /**\n * Open the file read-only (`SQLITE_READONLY` errors on writes, mapped to\n * `VIBE_ADAPTER`). The WAL pragma is skipped on read-only connections —\n * switching journal modes is a write. Ignored when `database` is injected.\n */\n readonly readonly?: boolean;\n /**\n * `PRAGMA busy_timeout` in milliseconds — how long a statement blocks on a\n * competing lock before failing with SQLITE_BUSY (mapped to\n * `VIBE_TRANSACTION`, `meta.reason: \"busy\"`). Default 5000. On an injected\n * `database` the pragma is applied only when this option is passed\n * explicitly, so the adapter never silently overrides the owner's setting.\n */\n readonly busyTimeoutMs?: number;\n /**\n * Switch file databases to `PRAGMA journal_mode = WAL` on open (default\n * true): readers stop blocking the writer, the sane default for anything\n * long-lived. Skipped for `\":memory:\"` databases (they have no WAL),\n * read-only connections, and injected `database` instances (the owner\n * decides their journal mode).\n */\n readonly wal?: boolean;\n /**\n * An already-open `bun:sqlite` Database to run on — sharing one in-memory\n * database across adapters makes multi-adapter tests trivial. The adapter\n * never closes an injected instance (`disconnect()` is a no-op), never\n * changes its journal mode, and still applies `PRAGMA foreign_keys = ON`\n * (the ORM requires it). For lossless >2^53 BigInt reads the adapter sets\n * statement-level safeIntegers on every statement it prepares, so an\n * injected database needs no special construction flags. Wrappers sharing\n * the same Database also share transaction exclusion. Initialization refuses\n * if foreign keys remain OFF (for example, inside the owner's transaction);\n * retry after that transaction ends. FK-ON active handles remain supported.\n */\n readonly database?: Database;\n};\n\n// ─── Internals ────────────────────────────────────────────────────\n\nconst DIALECT: Dialect = \"sqlite\";\nconst PROVIDER: Provider = \"sqlite\";\n\n/**\n * bun:sqlite wire (board #30, live-verified): INTEGER/REAL → numbers (large\n * INTEGER → native `bigint`, which every decoder passes through); DateTime and\n * Json ride TEXT, so their decoders do real work and are declared \"text\"\n * (prunes nothing — the declaration is the honest record).\n */\nconst WIRE: WireFidelity = Object.freeze({ dateTime: \"text\", json: \"text\", numbers: \"native\" } as const);\n\n/**\n * Timing budgets this adapter genuinely enforces (EPIC 6).\n *\n * - `acquireTimeout: false` — bun:sqlite is ONE synchronous connection behind\n * an in-process queue. There is no pool to exhaust and no wait to bound.\n * - `statementTimeout: \"unsupported\"` — sqlite has no per-statement timeout;\n * `busy_timeout` bounds LOCK acquisition only, which is why the `timeout`\n * option is already refused outright (./transaction-options.ts).\n * - `transactionDeadline: \"between-statements\"` — an expired budget stops the\n * next statement and the commit, which is real enforcement. It is NOT\n * cancellation: bun:sqlite runs statements synchronously on the JS thread, so\n * a long statement blocks the event loop and no timer of any kind can fire\n * while it runs. Asking for `\"cancel-running-statements\"` is refused.\n */\nconst BUDGETS: AdapterBudgetSupport = Object.freeze({\n acquireTimeout: false,\n statementTimeout: \"unsupported\",\n transactionDeadline: \"between-statements\",\n} as const);\nconst DEFAULT_BUSY_TIMEOUT_MS = 5000;\n\n/** `\":memory:\"` (also in URI form) and `\"\"` (anonymous temp) have no WAL. */\nfunction isMemoryFilename(params: { filename: string }): boolean {\n return params.filename === \"\" || params.filename.includes(\":memory:\");\n}\n\n/**\n * The one cast at the driver boundary. ORM-path values were encoded by the\n * runtime codec table into driver-native shapes; raw-path values went through\n * `serializeParamsRaw`. Verified by the param-passthrough unit tests.\n */\nfunction asBindings(values: readonly unknown[]): SQLQueryBindings[] {\n return values as SQLQueryBindings[];\n}\n\n/**\n * `Statement.safeIntegers()` exists at runtime since Bun 1.1.14 (pinned by\n * the integer-width unit tests: it returns the statement and applies to\n * cached statements too) but is missing from the installed @types/bun — this\n * minimal structural view bridges the gap without `any`.\n */\ntype SafeIntegersStatement = { safeIntegers(toggle: boolean): unknown };\n\n/** Flip a prepared statement to lossless 64-bit integer reads (see module doc). */\nfunction withSafeIntegers<S>(statement: S): S {\n (statement as unknown as SafeIntegersStatement).safeIntegers(true);\n return statement;\n}\n\n// ─── Adapter ──────────────────────────────────────────────────────\n\n/**\n * Create a VibeORM adapter backed by bun:sqlite.\n *\n * @example In-memory database (tests)\n * ```ts\n * const adapter = sqliteAdapter();\n * await adapter.executeUnsafe({ text: `CREATE TABLE \"User\" (\"id\" INTEGER PRIMARY KEY)` });\n * ```\n *\n * @example File database / shared instance\n * ```ts\n * const file = sqliteAdapter({ filename: \"./app.db\" });\n * const shared = sqliteAdapter({ database: existingDatabase });\n * ```\n *\n * `disconnect()` closes a database the adapter opened; a later call opens a\n * fresh one (lazy reconnect, matching the pool-backed adapters). With the\n * default `\":memory:\"` filename that fresh database is a new, empty one.\n *\n * @throws VibeError `VIBE_VALIDATION` when `busyTimeoutMs` is not a\n * non-negative integer — validated eagerly, the value lands in PRAGMA text.\n */\nexport function sqliteAdapter(options?: SqliteAdapterOptions): DatabaseAdapter {\n const busyTimeoutMs = options?.busyTimeoutMs;\n if (busyTimeoutMs !== undefined && (!Number.isInteger(busyTimeoutMs) || busyTimeoutMs < 0)) {\n throw new VibeError({\n code: \"VIBE_VALIDATION\",\n message: `busyTimeoutMs must be a non-negative integer of milliseconds, received ${String(busyTimeoutMs)}`,\n meta: { busyTimeoutMs },\n });\n }\n\n const { queue, txContext } = connectionOwnership({ database: options?.database });\n const ownsDatabase = options?.database === undefined;\n const filename = options?.filename ?? \":memory:\";\n\n /**\n * Deadlock guard (the pglite F6 lesson): a whole transaction holds the\n * operation queue, so a ROOT-adapter call issued from inside a\n * `transaction()` callback would queue behind the very transaction it is\n * running in and hang forever. Root entry points refuse instead; the\n * tx-bound adapter bypasses the queue and stays fully usable.\n */\n function assertNotInsideTransaction(): void {\n if (txContext.getStore() === true) {\n throw new VibeError({\n code: \"VIBE_TRANSACTION\",\n message:\n \"root client used inside a transaction callback — use the tx client the callback receives; the root connection would deadlock behind the open transaction\",\n meta: { provider: PROVIDER },\n });\n }\n }\n\n let database: Database | null = options?.database ?? null;\n let configured = false;\n\n /**\n * Session pragmas, applied once per opened connection (see module doc).\n * On an injected database only `foreign_keys` is unconditional; the\n * busy timeout is applied only when explicitly configured, and the journal\n * mode is never touched.\n */\n function applyPragmas(params: { db: Database }): void {\n const { db } = params;\n // MANDATORY: sqlite ships with foreign-key enforcement OFF; every FK\n // semantic the ORM promises (RESTRICT errors, ON DELETE CASCADE) needs it.\n db.run(\"PRAGMA foreign_keys = ON\");\n const foreignKeys = db.query(\"PRAGMA foreign_keys\").get() as { foreign_keys: number | bigint };\n if (foreignKeys.foreign_keys !== 1 && foreignKeys.foreign_keys !== 1n) {\n throw new VibeError({\n code: \"VIBE_ADAPTER\",\n message: \"SQLite foreign-key enforcement is disabled; finish the injected database transaction before connecting\",\n meta: { provider: PROVIDER, reason: \"foreign-keys-disabled\" },\n });\n }\n if (ownsDatabase || busyTimeoutMs !== undefined) {\n db.run(`PRAGMA busy_timeout = ${busyTimeoutMs ?? DEFAULT_BUSY_TIMEOUT_MS}`);\n }\n if (\n ownsDatabase &&\n options?.wal !== false &&\n options?.readonly !== true &&\n !isMemoryFilename({ filename })\n ) {\n db.run(\"PRAGMA journal_mode = WAL\");\n }\n }\n\n /** Open (or reuse) the connection lazily; sync because the driver is. */\n function getDatabase(): Database {\n if (database === null) {\n database = runMapped(\n () =>\n new Database(\n filename,\n options?.readonly === true\n ? { readonly: true, safeIntegers: true }\n : { create: true, readwrite: true, safeIntegers: true },\n ),\n );\n configured = false;\n }\n if (!configured) {\n runMapped(() => applyPragmas({ db: database as Database }));\n configured = true;\n }\n return database;\n }\n\n /**\n * ORM hot path: `db.query()` prepares through bun:sqlite's built-in\n * per-connection statement cache (pinned: same text ⇒ same Statement\n * object), so no adapter-side LRU is needed. Values bind verbatim — the\n * runtime codec table already encoded them (params.ts).\n */\n /** SQLite's connection-local direct DML metadata, sampled synchronously after statement completion. */\n function directChanges(params: { db: Database }): unknown {\n const statement = withSafeIntegers(params.db.query(\"SELECT changes() AS n\"));\n const row = statement.get() as { n: number | bigint };\n return typeof row.n === \"bigint\" ? Number(row.n) : row.n;\n }\n\n function runExecute(params: {\n db: Database;\n text: string;\n values: unknown[];\n scope?: SavepointScope;\n effect?: StatementEffect;\n }): Record<string, unknown>[] {\n return runMapped(() => {\n const statement = withSafeIntegers(params.db.query(params.text));\n const rows = dispatchSynchronousRowChanges({\n scope: params.scope,\n effect: params.effect,\n run: () => statement.all(...asBindings(params.values)) as Record<string, unknown>[],\n count: () => statementRowChanges({ effect: params.effect, count: params.effect === \"write\" ? directChanges({ db: params.db }) : undefined }),\n });\n return normalizeRows({ rows });\n });\n }\n\n /**\n * Raw path — uncached (`db.prepare`), finalized after use, raw-path\n * serialization for user-supplied values.\n *\n * With `values` present the text must be a SINGLE statement: bun:sqlite's\n * prepare SILENTLY DROPS everything after the first statement, so the\n * compiled boundary is checked before binding or stepping the statement.\n * Rows come from `all()` when the statement has result columns\n * (`columnNames`), with `affectedRows` = the row count (exact for\n * DML…RETURNING); otherwise from `run()`, whose driver-reported `changes`\n * is exact for UPDATE/DELETE/INSERT.\n *\n * With `values` absent the text runs as a multi-statement batch through\n * `db.run()` — the shape @vibeorm/migrate emits for DDL. The driver executes\n * every statement and reports cumulative changes; rows are always `[]` on\n * this path (the sync driver cannot both batch and read), so callers that\n * want rows from a single statement pass `values: []` — the runtime's\n * `$queryRawUnsafe` always does.\n */\n function runExecuteUnsafe(params: { db: Database; text: string; values?: unknown[]; scope?: SavepointScope; effect?: StatementEffect }): QueryResult {\n return runMapped(() => {\n const { db, text, values, scope, effect } = params;\n if (values === undefined) {\n const changes = dispatchSynchronousRowChanges({ scope, effect, run: () => db.run(text), count: () => (effect === \"read\" ? 0 : \"unknown\") });\n return { rows: [], affectedRows: changes.changes };\n }\n const statement = withSafeIntegers(db.prepare(text));\n try {\n assertSinglePreparedStatement({ text, expanded: statement.toString() });\n const bound = asBindings(serializeParamsRaw({ values }));\n if (statement.columnNames.length > 0) {\n const rows = dispatchSynchronousRowChanges({\n scope,\n effect,\n run: () => statement.all(...bound) as Record<string, unknown>[],\n count: () => statementRowChanges({ effect, count: effect === \"write\" ? directChanges({ db }) : undefined }),\n });\n return { rows: normalizeRows({ rows }), affectedRows: rows.length };\n }\n const result = dispatchSynchronousRowChanges({\n scope,\n effect,\n run: () => statement.run(...bound),\n count: (run) => statementRowChanges({ effect, count: run.changes }),\n });\n return { rows: [], affectedRows: result.changes };\n } finally {\n statement.finalize();\n }\n });\n }\n\n /**\n * Adapter bound to an open transaction. It never re-enters the queue — the\n * enclosing `transaction()` call already owns the connection — and nested\n * `transaction()` calls become savepoints whose LIFETIMES are serialized by\n * the savepoint gate (F14): overlapping siblings would share one savepoint\n * stack, and the earlier one's rollback would erase the later one's work.\n */\n function createTransactionAdapter(params: {\n db: Database;\n scope: SavepointScope;\n budget: TransactionBudget;\n }): DatabaseAdapter {\n const { db, scope, budget } = params;\n\n return {\n dialect: DIALECT,\n provider: PROVIDER,\n wire: WIRE,\n budgets: BUDGETS,\n rowChanges: (): RowChangeCount => { budget.assertUsable({ stage: \"statement\" }); return readRowChanges({ scope }); },\n\n async execute(execParams) {\n const turn = scopeTurn({ scope });\n if (turn !== undefined) await turn;\n // After the turn, not before: waiting for a sibling savepoint spends\n // the same budget the statement is about to run against.\n budget.assertUsable({ stage: \"statement\" });\n return runExecute({ db, scope, ...execParams });\n },\n\n async executeUnsafe(execParams) {\n const turn = scopeTurn({ scope });\n if (turn !== undefined) await turn;\n budget.assertUsable({ stage: \"statement\" });\n return runExecuteUnsafe({ db, scope, ...execParams });\n },\n\n async transaction<T>(\n fn: (txAdapter: DatabaseAdapter) => Promise<T>,\n nestedOptions?: TransactionOptions,\n ): Promise<T> {\n refuseNestedTransactionOptions({ options: nestedOptions, provider: PROVIDER });\n budget.assertUsable({ stage: \"nested\" });\n return runNestedSavepoint({\n scope,\n execute: (statement) => runMapped(() => db.run(statement)),\n // The child shares the ROOT budget by reference: a savepoint never\n // gets an independent clock or session setting.\n body: (child) => fn(createTransactionAdapter({ db, scope: child, budget })),\n });\n },\n\n async connect(): Promise<void> {\n // Already connected — this adapter is bound to an open transaction.\n },\n\n async disconnect(): Promise<void> {\n // The database outlives the transaction; closing here would be wrong.\n },\n\n formatArrayParam(values: unknown[]): unknown {\n throw arrayParamBug({ values });\n },\n };\n }\n\n /**\n * sqlite has no array parameters — the sqlite dialect declares\n * `scalarArrays: false` and expands `IN` lists to individual placeholders\n * (`inArrayStrategy: \"expand\"`), so this method being reached means an\n * upstream runtime bug routed an array here.\n */\n function arrayParamBug(params: { values: unknown[] }): VibeError {\n return internalError({\n message:\n \"formatArrayParam called on the sqlite adapter — sqlite has no array parameters; the dialect expands IN lists to individual placeholders, so this call is an upstream runtime bug\",\n meta: { provider: PROVIDER, valueCount: params.values.length },\n });\n }\n\n return {\n dialect: DIALECT,\n provider: PROVIDER,\n wire: WIRE,\n budgets: BUDGETS,\n\n async withSession({ run }) {\n assertNotInsideTransaction();\n return queue.run(async () => {\n const db = getDatabase();\n return txContext.run(true, () => runSqliteSession({\n run,\n execute: async (query) => runExecuteUnsafe({ db, ...query }).rows,\n inTransaction: () => db.inTransaction,\n }));\n });\n },\n\n async execute(params) {\n assertNotInsideTransaction();\n return queue.run(async () => runExecute({ db: getDatabase(), ...params }));\n },\n\n async executeUnsafe(params) {\n assertNotInsideTransaction();\n return queue.run(async () => runExecuteUnsafe({ db: getDatabase(), ...params }));\n },\n\n async transaction<T>(\n fn: (txAdapter: DatabaseAdapter) => Promise<T>,\n transactionOptions?: TransactionOptions,\n ): Promise<T> {\n assertNotInsideTransaction();\n // Refuse unsupportable options BEFORE taking the queue or issuing BEGIN,\n // so a bad option fails fast and leaves no transaction open.\n validateTransactionOptions({ options: transactionOptions });\n validateTransactionDeadline({\n options: transactionOptions,\n support: BUDGETS.transactionDeadline,\n provider: PROVIDER,\n });\n\n return queue.run(async () => {\n const db = getDatabase();\n const scope = createSavepointScope();\n // The deadline clock starts here — after the queue turn, immediately\n // before BEGIN. Waiting for the connection is not charged to it.\n const budget = startTransactionBudget({ options: transactionOptions, provider: PROVIDER });\n // Write-intent lock up front — see module doc on BEGIN IMMEDIATE.\n runMapped(() => db.run(\"BEGIN IMMEDIATE\"));\n try {\n const result = await txContext.run(true, () =>\n runRootScope({ scope, body: () => fn(createTransactionAdapter({ db, scope, budget })) }),\n );\n // An expired budget must never commit, however the callback ended.\n budget.assertUsable({ stage: \"commit\" });\n runMapped(() => db.run(\"COMMIT\"));\n budget.close({ outcome: \"committed\" });\n return result;\n } catch (error) {\n // Best effort: never mask the original failure (the user callback's\n // own error, or a failed COMMIT) with a rollback failure.\n try {\n db.run(\"ROLLBACK\");\n budget.close({ outcome: scope.state.poisoned === null ? \"rolled-back\" : \"unknown\" });\n } catch {\n // The rollback that should have cleaned up failed: the commit state\n // is genuinely unknown, and saying \"rolled back\" would be a lie.\n budget.close({ outcome: \"unknown\" });\n if (budget.totalMs !== null && isTransactionDeadlineError(error)) {\n throw transactionOutcomeUnknownError({\n provider: PROVIDER,\n totalMs: budget.totalMs,\n cause: error,\n });\n }\n }\n throw error;\n }\n });\n },\n\n async connect(): Promise<void> {\n assertNotInsideTransaction();\n await queue.run(async () => { getDatabase(); });\n },\n\n /**\n * ONE ordered lifecycle (F15): the reference is cleared and the handle\n * closed INSIDE the queue, so work this adapter already accepted runs on\n * the database it was accepted against. Clearing `database` up front — as\n * this did — sent that queued work through `getDatabase()` with nothing in\n * hand, silently opening a FRESH (for `\":memory:\"`, empty) database while\n * the close went to the old handle.\n *\n * Refuses inside a transaction callback for the same reason the other entry\n * points do: the close would queue behind the transaction that is waiting\n * for it. Before this guard that call hung forever.\n */\n async disconnect(): Promise<void> {\n assertNotInsideTransaction();\n if (!ownsDatabase) return;\n await queue.run(async () => {\n if (database === null) return;\n const closing = database;\n database = null;\n configured = false;\n runMapped(() => closing.close());\n });\n },\n\n formatArrayParam(values: unknown[]): unknown {\n throw arrayParamBug({ values });\n },\n };\n}\n\n// ─── Re-exports (driver-error table, helpers) ─────────────────────\n\nexport {\n SQLITE_ERROR_CODES,\n SQLITE_ERROR_REASONS,\n mapSqliteDriverError,\n runMapped,\n sqliteErrorCode,\n} from \"./errors.ts\";\nexport { normalizeRow, normalizeRows, serializeParamsRaw } from \"./params.ts\";\nexport { createOperationQueue } from \"./queue.ts\";\nexport type { OperationQueue } from \"./queue.ts\";\nexport { createSavepointCounter, nextSavepointName } from \"@vibeorm/runtime/adapter-kit\";\nexport type { SavepointCounter } from \"@vibeorm/runtime/adapter-kit\";\nexport { refuseNestedTransactionOptions, validateTransactionOptions } from \"./transaction-options.ts\";\n// ─── EPIC 6: transaction budgets (shared, @vibeorm/runtime/adapter-kit) ───\nexport {\n DEFAULT_DEADLINE_CLOCK,\n engineStatementBudgetMs,\n isTransactionDeadlineError,\n startTransactionBudget,\n transactionClosedError,\n transactionDeadlineError,\n transactionOutcomeUnknownError,\n validateTransactionDeadline,\n} from \"@vibeorm/runtime/adapter-kit\";\nexport type { BudgetStage, DeadlineClock, TransactionBudget, TransactionOutcome } from \"@vibeorm/runtime/adapter-kit\";\n",
|
|
5
|
+
"/**\n * @vibeorm/adapter-sqlite — bun:sqlite (embedded SQLite) adapter for\n * VibeORM v2.\n *\n * bun:sqlite is a *synchronous* single-connection driver, so every call\n * completes without I/O waits and the adapter wraps results in\n * already-resolved promises — the cheapest possible `execute`. Like PGlite,\n * one connection means every operation runs through one serial queue:\n * a whole `transaction()` holds the queue until it commits or rolls back, so\n * concurrent client calls can never interleave into an open transaction.\n *\n * INTEGER WIDTH (the BigInt story): SQLite INTEGER columns are 64-bit, but JS\n * numbers are only exact to ±(2^53−1) — a plain read of a large BigInt column\n * silently corrupts (pinned on Bun 1.3.14: `SELECT 9007199254740993` returns\n * `9007199254740992` without safeIntegers). The adapter therefore ALWAYS reads\n * through bun:sqlite's `safeIntegers` (database-level for connections it\n * opens, statement-level `stmt.safeIntegers(true)` for every statement it\n * prepares, which also covers injected databases), then normalizes rows:\n * bigints inside the safe range become `number`, larger ones stay `bigint`.\n * That is exactly the shape the runtime's `SQLITE_CODECS` expect — Int and\n * Boolean columns arrive as numbers, and >2^53 BigInt columns round-trip\n * losslessly as bigint. See params.ts for the full reasoning.\n *\n * PRAGMAS applied on open (each documented on {@link SqliteAdapterOptions}):\n * `foreign_keys = ON` (mandatory — SQLite defaults OFF and the ORM's FK\n * semantics depend on it), `busy_timeout` (lock-wait bound), and\n * `journal_mode = WAL` for file databases (readers no longer block the\n * writer). Transactions open with `BEGIN IMMEDIATE`: the write lock is taken\n * up front, so a write after a read inside the transaction can never hit the\n * SQLITE_BUSY deadlock that lock *upgrades* are prone to.\n */\n\nimport { Database } from \"bun:sqlite\";\nimport type { SQLQueryBindings } from \"bun:sqlite\";\nimport { VibeError, internalError } from \"@vibeorm/schema\";\nimport type { Dialect, Provider } from \"@vibeorm/schema\";\nimport type {\n AdapterBudgetSupport,\n DatabaseAdapter,\n QueryResult,\n RowChangeCount,\n StatementEffect,\n TransactionOptions,\n WireFidelity,\n} from \"@vibeorm/runtime\";\nimport {\n createAdapterLifecycleGate,\n runSqliteSession,\n transactionLifecycleRefusal,\n dispatchSynchronousRowChanges,\n readRowChanges,\n statementRowChanges,\n type CommitProgress,\n createSavepointScope,\n type RollbackOutcome,\n runNestedSavepoint,\n runRootScope,\n type SavepointScope,\n scopeTurn,\n settleFailedTransaction,\n startTransactionBudget,\n type TransactionBudget,\n validateTransactionDeadline,\n} from \"@vibeorm/runtime/adapter-kit\";\nimport { mapSqliteDriverError, runMapped } from \"./errors.ts\";\nimport { normalizeRows, serializeParamsRaw } from \"./params.ts\";\nimport { assertSinglePreparedStatement } from \"./prepared-sql.ts\";\nimport { connectionOwnership } from \"./queue.ts\";\nimport { refuseNestedTransactionOptions, validateTransactionOptions } from \"./transaction-options.ts\";\n\n// ─── Options ──────────────────────────────────────────────────────\n\n/** Options for {@link sqliteAdapter}. (Factories are the documented exception allowed a plain options object.) */\nexport type SqliteAdapterOptions = {\n /**\n * Database file to open. Defaults to `\":memory:\"` — a fresh private\n * in-memory database, the usual choice for tests. Ignored when `database`\n * is injected.\n */\n readonly filename?: string;\n /**\n * Open the file read-only (`SQLITE_READONLY` errors on writes, mapped to\n * `VIBE_ADAPTER`). The WAL pragma is skipped on read-only connections —\n * switching journal modes is a write. Ignored when `database` is injected.\n */\n readonly readonly?: boolean;\n /**\n * `PRAGMA busy_timeout` in milliseconds — how long a statement blocks on a\n * competing lock before failing with SQLITE_BUSY (mapped to\n * `VIBE_TRANSACTION`, `meta.reason: \"busy\"`). Default 5000. On an injected\n * `database` the pragma is applied only when this option is passed\n * explicitly, so the adapter never silently overrides the owner's setting.\n */\n readonly busyTimeoutMs?: number;\n /**\n * Switch file databases to `PRAGMA journal_mode = WAL` on open (default\n * true): readers stop blocking the writer, the sane default for anything\n * long-lived. Skipped for `\":memory:\"` databases (they have no WAL),\n * read-only connections, and injected `database` instances (the owner\n * decides their journal mode).\n */\n readonly wal?: boolean;\n /**\n * An already-open `bun:sqlite` Database to run on — sharing one in-memory\n * database across adapters makes multi-adapter tests trivial. The adapter\n * never closes an injected instance (`disconnect()` only ends this adapter), never\n * changes its journal mode, and still applies `PRAGMA foreign_keys = ON`\n * (the ORM requires it). For lossless >2^53 BigInt reads the adapter sets\n * statement-level safeIntegers on every statement it prepares, so an\n * injected database needs no special construction flags. Wrappers sharing\n * the same Database also share transaction exclusion. Initialization refuses\n * if foreign keys remain OFF (for example, inside the owner's transaction);\n * retry after that transaction ends. FK-ON active handles remain supported.\n */\n readonly database?: Database;\n};\n\n// ─── Internals ────────────────────────────────────────────────────\n\nconst DIALECT: Dialect = \"sqlite\";\nconst PROVIDER: Provider = \"sqlite\";\n\n/**\n * bun:sqlite wire (board #30, live-verified): INTEGER/REAL → numbers (large\n * INTEGER → native `bigint`, which every decoder passes through); DateTime and\n * Json ride TEXT, so their decoders do real work and are declared \"text\"\n * (prunes nothing — the declaration is the honest record).\n */\nconst WIRE: WireFidelity = Object.freeze({ dateTime: \"text\", json: \"text\", numbers: \"native\" } as const);\n\n/**\n * bun:sqlite runs inside this process: a round trip crosses no network, so the\n * runtime keeps its multi-statement paths instead of the one-statement folds.\n * The transaction facades carry the same declaration.\n */\nconst ROUND_TRIPS: NonNullable<DatabaseAdapter[\"roundTrips\"]> = \"in-process\";\n\n/**\n * Timing budgets this adapter genuinely enforces (EPIC 6).\n *\n * - `acquireTimeout: false` — bun:sqlite is ONE synchronous connection behind\n * an in-process queue. There is no pool to exhaust and no wait to bound.\n * - `statementTimeout: \"unsupported\"` — sqlite has no per-statement timeout;\n * `busy_timeout` bounds LOCK acquisition only, which is why the `timeout`\n * option is already refused outright (./transaction-options.ts).\n * - `transactionDeadline: \"between-statements\"` — an expired budget stops the\n * next statement and the commit, which is real enforcement. It is NOT\n * cancellation: bun:sqlite runs statements synchronously on the JS thread, so\n * a long statement blocks the event loop and no timer of any kind can fire\n * while it runs. Asking for `\"cancel-running-statements\"` is refused.\n */\nconst BUDGETS: AdapterBudgetSupport = Object.freeze({\n acquireTimeout: false,\n statementTimeout: \"unsupported\",\n transactionDeadline: \"between-statements\",\n // SQLite has no read-only transaction mode (`PRAGMA query_only` is per connection).\n accessModes: Object.freeze([]),\n} as const);\nconst DEFAULT_BUSY_TIMEOUT_MS = 5000;\n\n/** `\":memory:\"` (also in URI form) and `\"\"` (anonymous temp) have no WAL. */\nfunction isMemoryFilename(params: { filename: string }): boolean {\n return params.filename === \"\" || params.filename.includes(\":memory:\");\n}\n\n/**\n * The one cast at the driver boundary. ORM-path values were encoded by the\n * runtime codec table into driver-native shapes; raw-path values went through\n * `serializeParamsRaw`. Verified by the param-passthrough unit tests.\n */\nfunction asBindings(values: readonly unknown[]): SQLQueryBindings[] {\n return values as SQLQueryBindings[];\n}\n\n/**\n * `Statement.safeIntegers()` exists at runtime since Bun 1.1.14 (pinned by\n * the integer-width unit tests: it returns the statement and applies to\n * cached statements too) but is missing from the installed @types/bun — this\n * minimal structural view bridges the gap without `any`.\n */\ntype SafeIntegersStatement = { safeIntegers(toggle: boolean): unknown };\n\n/** Flip a prepared statement to lossless 64-bit integer reads (see module doc). */\nfunction withSafeIntegers<S>(statement: S): S {\n (statement as unknown as SafeIntegersStatement).safeIntegers(true);\n return statement;\n}\n\n// ─── Adapter ──────────────────────────────────────────────────────\n\n/**\n * Create a VibeORM adapter backed by bun:sqlite.\n *\n * @example In-memory database (tests)\n * ```ts\n * const adapter = sqliteAdapter();\n * await adapter.executeUnsafe({ text: `CREATE TABLE \"User\" (\"id\" INTEGER PRIMARY KEY)` });\n * ```\n *\n * @example File database / shared instance\n * ```ts\n * const file = sqliteAdapter({ filename: \"./app.db\" });\n * const shared = sqliteAdapter({ database: existingDatabase });\n * ```\n *\n * `disconnect()` ends the adapter for good: it waits for admitted work, closes\n * a database the adapter opened (never a provided `database`), and every later\n * call refuses with `VIBE_ADAPTER_CLOSED`. Create a new adapter to connect\n * again; with the default `\":memory:\"` filename that is a new, empty database.\n *\n * @throws VibeError `VIBE_VALIDATION` when `busyTimeoutMs` is not a\n * non-negative integer — validated eagerly, the value lands in PRAGMA text.\n */\nexport function sqliteAdapter(options?: SqliteAdapterOptions): DatabaseAdapter {\n const busyTimeoutMs = options?.busyTimeoutMs;\n if (busyTimeoutMs !== undefined && (!Number.isInteger(busyTimeoutMs) || busyTimeoutMs < 0)) {\n throw new VibeError({\n code: \"VIBE_VALIDATION\",\n message: `busyTimeoutMs must be a non-negative integer of milliseconds, received ${String(busyTimeoutMs)}`,\n meta: { busyTimeoutMs },\n });\n }\n\n const { queue, txContext, runInCallback } = connectionOwnership({ database: options?.database });\n const ownsDatabase = options?.database === undefined;\n const filename = options?.filename ?? \":memory:\";\n\n /**\n * Deadlock guard (the pglite F6 lesson): a whole transaction holds the\n * operation queue, so a ROOT-adapter call issued from inside a\n * `transaction()` callback would queue behind the very transaction it is\n * running in and hang forever. Root entry points refuse instead; the\n * tx-bound adapter bypasses the queue and stays fully usable.\n */\n function assertNotInsideTransaction(): void {\n if (txContext.getStore()?.active === true) {\n throw new VibeError({\n code: \"VIBE_TRANSACTION\",\n message:\n \"root client used inside a transaction callback — use the tx client the callback receives; the root connection would deadlock behind the open transaction\",\n meta: { provider: PROVIDER },\n });\n }\n }\n\n let database: Database | null = options?.database ?? null;\n let configured = false;\n const checkedAffectedStatements = new WeakSet<object>();\n\n /**\n * Session pragmas, applied once per opened connection (see module doc).\n * On an injected database only `foreign_keys` is unconditional; the\n * busy timeout is applied only when explicitly configured, and the journal\n * mode is never touched.\n */\n function applyPragmas(params: { db: Database }): void {\n const { db } = params;\n // MANDATORY: sqlite ships with foreign-key enforcement OFF; every FK\n // semantic the ORM promises (RESTRICT errors, ON DELETE CASCADE) needs it.\n db.run(\"PRAGMA foreign_keys = ON\");\n const foreignKeys = db.query(\"PRAGMA foreign_keys\").get() as { foreign_keys: number | bigint };\n if (foreignKeys.foreign_keys !== 1 && foreignKeys.foreign_keys !== 1n) {\n throw new VibeError({\n code: \"VIBE_ADAPTER\",\n message: \"SQLite foreign-key enforcement is disabled; finish the injected database transaction before connecting\",\n meta: { provider: PROVIDER, reason: \"foreign-keys-disabled\" },\n });\n }\n if (ownsDatabase || busyTimeoutMs !== undefined) {\n db.run(`PRAGMA busy_timeout = ${busyTimeoutMs ?? DEFAULT_BUSY_TIMEOUT_MS}`);\n }\n if (\n ownsDatabase &&\n options?.wal !== false &&\n options?.readonly !== true &&\n !isMemoryFilename({ filename })\n ) {\n db.run(\"PRAGMA journal_mode = WAL\");\n }\n }\n\n /** Open (or reuse) the connection lazily; sync because the driver is. */\n function getDatabase(): Database {\n if (database === null) {\n database = runMapped(\n () =>\n new Database(\n filename,\n options?.readonly === true\n ? { readonly: true, safeIntegers: true }\n : { create: true, readwrite: true, safeIntegers: true },\n ),\n );\n configured = false;\n }\n if (!configured) {\n runMapped(() => applyPragmas({ db: database as Database }));\n configured = true;\n }\n return database;\n }\n\n /**\n * ORM hot path: `db.query()` prepares through bun:sqlite's built-in\n * per-connection statement cache (pinned: same text ⇒ same Statement\n * object), so no adapter-side LRU is needed. Values bind verbatim — the\n * runtime codec table already encoded them (params.ts).\n */\n /** SQLite's connection-local direct DML metadata, sampled synchronously after statement completion. */\n function directChanges(params: { db: Database }): number {\n const statement = withSafeIntegers(params.db.query(\"SELECT changes() AS n\"));\n const row = statement.get() as { n: number | bigint };\n return typeof row.n === \"bigint\" ? Number(row.n) : row.n;\n }\n\n function runExecute(params: {\n db: Database;\n text: string;\n values: unknown[];\n scope?: SavepointScope;\n effect?: StatementEffect;\n }): Record<string, unknown>[] {\n return runMapped(() => {\n const statement = withSafeIntegers(params.db.query(params.text));\n const rows = dispatchSynchronousRowChanges({\n scope: params.scope,\n effect: params.effect,\n run: () => statement.all(...asBindings(params.values)) as Record<string, unknown>[],\n count: () => statementRowChanges({ effect: params.effect, count: params.effect === \"write\" ? directChanges({ db: params.db }) : undefined }),\n });\n return normalizeRows({ rows });\n });\n }\n\n /** Cached bound ORM execution with direct, trigger-excluding affected counts. */\n function runExecuteAffected(params: {\n db: Database;\n text: string;\n values: unknown[];\n scope?: SavepointScope;\n effect?: StatementEffect;\n }): QueryResult {\n return runMapped(() => {\n const { db, text, values, scope, effect } = params;\n const statement = withSafeIntegers(db.query(text));\n if (!checkedAffectedStatements.has(statement)) {\n assertSinglePreparedStatement({ text, expanded: statement.toString() });\n checkedAffectedStatements.add(statement);\n }\n if (statement.columnNames.length > 0) {\n const rows = dispatchSynchronousRowChanges({\n scope,\n effect,\n run: () => statement.all(...asBindings(values)) as Record<string, unknown>[],\n count: () => statementRowChanges({ effect, count: effect === \"write\" ? directChanges({ db }) : undefined }),\n });\n return { rows: normalizeRows({ rows }), affectedRows: rows.length };\n }\n const affectedRows = dispatchSynchronousRowChanges({\n scope,\n effect,\n run: () => {\n const result = statement.run(...asBindings(values));\n // Bun's native changes can include trigger effects. A zero delta also\n // protects DDL from the stale value SQLite leaves in changes(). The\n // positive case needs SQL direct metadata even when the tally is unknown:\n // this count is returned to the caller, not merely folded into the tally.\n return result.changes === 0 ? 0 : directChanges({ db });\n },\n count: (count) => statementRowChanges({ effect, count }),\n });\n return { rows: [], affectedRows };\n });\n }\n\n /**\n * Raw path — uncached (`db.prepare`), finalized after use, raw-path\n * serialization for user-supplied values.\n *\n * With `values` present the text must be a SINGLE statement: bun:sqlite's\n * prepare SILENTLY DROPS everything after the first statement, so the\n * compiled boundary is checked before binding or stepping the statement.\n * Rows come from `all()` when the statement has result columns\n * (`columnNames`), with `affectedRows` = the row count (exact for\n * DML…RETURNING); otherwise from `run()`, whose driver-reported `changes`\n * retains the driver's legacy raw count.\n *\n * With `values` absent the text runs as a multi-statement batch through\n * `db.run()` — the shape @vibeorm/migrate emits for DDL. The driver executes\n * every statement and reports cumulative changes; rows are always `[]` on\n * this path (the sync driver cannot both batch and read), so callers that\n * want rows from a single statement pass `values: []` — the runtime's\n * `$queryRawUnsafe` always does.\n */\n function runExecuteUnsafe(params: { db: Database; text: string; values?: unknown[]; scope?: SavepointScope; effect?: StatementEffect }): QueryResult {\n return runMapped(() => {\n const { db, text, values, scope, effect } = params;\n if (values === undefined) {\n const changes = dispatchSynchronousRowChanges({ scope, effect, run: () => db.run(text), count: () => (effect === \"read\" ? 0 : \"unknown\") });\n return { rows: [], affectedRows: changes.changes };\n }\n const statement = withSafeIntegers(db.prepare(text));\n try {\n assertSinglePreparedStatement({ text, expanded: statement.toString() });\n const bound = asBindings(serializeParamsRaw({ values }));\n if (statement.columnNames.length > 0) {\n const rows = dispatchSynchronousRowChanges({\n scope,\n effect,\n run: () => statement.all(...bound) as Record<string, unknown>[],\n count: () => statementRowChanges({ effect, count: effect === \"write\" ? directChanges({ db }) : undefined }),\n });\n return { rows: normalizeRows({ rows }), affectedRows: rows.length };\n }\n const result = dispatchSynchronousRowChanges({\n scope,\n effect,\n run: () => statement.run(...bound),\n count: (run) => statementRowChanges({ effect, count: run.changes }),\n });\n return { rows: [], affectedRows: result.changes };\n } finally {\n statement.finalize();\n }\n });\n }\n\n /**\n * Adapter bound to an open transaction. It never re-enters the queue — the\n * enclosing `transaction()` call already owns the connection — and nested\n * `transaction()` calls become savepoints whose LIFETIMES are serialized by\n * the savepoint gate (F14): overlapping siblings would share one savepoint\n * stack, and the earlier one's rollback would erase the later one's work.\n */\n function createTransactionAdapter(params: {\n db: Database;\n scope: SavepointScope;\n budget: TransactionBudget;\n }): DatabaseAdapter {\n const { db, scope, budget } = params;\n\n return {\n dialect: DIALECT,\n provider: PROVIDER,\n wire: WIRE,\n budgets: BUDGETS,\n roundTrips: ROUND_TRIPS,\n rowChanges: (): RowChangeCount => { budget.assertUsable({ stage: \"statement\" }); return readRowChanges({ scope }); },\n\n async execute(execParams) {\n const turn = scopeTurn({ scope });\n if (turn !== undefined) await turn;\n // After the turn, not before: waiting for a sibling savepoint spends\n // the same budget the statement is about to run against.\n budget.assertUsable({ stage: \"statement\" });\n return runExecute({ db, scope, ...execParams });\n },\n\n async executeAffected(execParams) {\n const turn = scopeTurn({ scope });\n if (turn !== undefined) await turn;\n budget.assertUsable({ stage: \"statement\" });\n return runExecuteAffected({ db, scope, ...execParams });\n },\n\n async executeRawBound(execParams) {\n return this.executeUnsafe(execParams);\n },\n\n async executeUnsafe(execParams) {\n const turn = scopeTurn({ scope });\n if (turn !== undefined) await turn;\n budget.assertUsable({ stage: \"statement\" });\n return runExecuteUnsafe({ db, scope, ...execParams });\n },\n\n async transaction<T>(\n fn: (txAdapter: DatabaseAdapter) => Promise<T>,\n nestedOptions?: TransactionOptions,\n ): Promise<T> {\n refuseNestedTransactionOptions({ options: nestedOptions, provider: PROVIDER });\n budget.assertUsable({ stage: \"nested\" });\n return runNestedSavepoint({\n scope,\n execute: (statement) => runMapped(() => db.run(statement)),\n // The child shares the ROOT budget by reference: a savepoint never\n // gets an independent clock or session setting.\n body: (child) => fn(createTransactionAdapter({ db, scope: child, budget })),\n });\n },\n\n // The open transaction owns this connection: neither call may act on it.\n // An expired handle keeps its own refusal (the budget check comes first).\n async connect(): Promise<void> {\n budget.assertUsable({ stage: \"statement\" });\n throw transactionLifecycleRefusal({ method: \"connect\" });\n },\n\n async disconnect(): Promise<void> {\n budget.assertUsable({ stage: \"statement\" });\n throw transactionLifecycleRefusal({ method: \"disconnect\" });\n },\n\n formatArrayParam(values: unknown[]): unknown {\n throw arrayParamBug({ values });\n },\n };\n }\n\n /**\n * sqlite has no array parameters — the sqlite dialect declares\n * `scalarArrays: false` and expands `IN` lists to individual placeholders\n * (`inArrayStrategy: \"expand\"`), so this method being reached means an\n * upstream runtime bug routed an array here.\n */\n function arrayParamBug(params: { values: unknown[] }): VibeError {\n return internalError({\n message:\n \"formatArrayParam called on the sqlite adapter — sqlite has no array parameters; the dialect expands IN lists to individual placeholders, so this call is an upstream runtime bug\",\n meta: { provider: PROVIDER, valueCount: params.values.length },\n });\n }\n\n /**\n * Terminal lifetime (EPIC A2). The cleanup runs ONCE, after every admitted\n * operation settled, and closes a database the adapter opened — never an\n * injected one — inside the queue (F15). A running callback of the shared\n * connection (this wrapper's or another wrapper's over the same injected\n * database) cannot disconnect: the close would wait behind the transaction\n * that is waiting for it.\n */\n const lifecycle = createAdapterLifecycleGate({\n driver: \"sqlite\",\n isConnectionReentrant: () => txContext.getStore()?.active === true,\n cleanup: async () => {\n if (!ownsDatabase) return;\n await queue.run(async () => {\n if (database === null) return;\n const closing = database;\n database = null;\n configured = false;\n runMapped(() => closing.close());\n });\n },\n });\n\n /** The root operations; the adapter below admits each one through {@link lifecycle}. */\n const root: Pick<Required<DatabaseAdapter>, \"withSession\" | \"execute\" | \"executeAffected\" | \"executeUnsafe\" | \"transaction\" | \"connect\"> = {\n async withSession({ run }) {\n assertNotInsideTransaction();\n return queue.run(async () => {\n const db = getDatabase();\n return runInCallback( () => runSqliteSession({\n run,\n execute: async (query) => runExecuteUnsafe({ db, ...query }).rows,\n inTransaction: () => db.inTransaction,\n }));\n });\n },\n\n async execute(params) {\n assertNotInsideTransaction();\n return queue.run(async () => runExecute({ db: getDatabase(), ...params }));\n },\n\n async executeAffected(params) {\n assertNotInsideTransaction();\n return queue.run(async () => runExecuteAffected({ db: getDatabase(), ...params }));\n },\n\n async executeUnsafe(params) {\n assertNotInsideTransaction();\n return queue.run(async () => runExecuteUnsafe({ db: getDatabase(), ...params }));\n },\n\n async transaction<T>(\n fn: (txAdapter: DatabaseAdapter) => Promise<T>,\n transactionOptions?: TransactionOptions,\n ): Promise<T> {\n assertNotInsideTransaction();\n // Refuse unsupportable options BEFORE taking the queue or issuing BEGIN,\n // so a bad option fails fast and leaves no transaction open.\n validateTransactionOptions({ options: transactionOptions });\n validateTransactionDeadline({\n options: transactionOptions,\n support: BUDGETS.transactionDeadline,\n provider: PROVIDER,\n });\n\n return queue.run(async () => {\n const db = getDatabase();\n const scope = createSavepointScope();\n // The deadline clock starts here — after the queue turn, immediately\n // before BEGIN. Waiting for the connection is not charged to it.\n const budget = startTransactionBudget({ options: transactionOptions, provider: PROVIDER });\n // Write-intent lock up front — see module doc on BEGIN IMMEDIATE.\n /** How far COMMIT got — the only input of the commit outcome (EPIC T). */\n const commit: { progress: CommitProgress } = { progress: \"not-sent\" };\n /** Whether BEGIN succeeded: before it there is nothing of OURS to roll back. */\n let opened = false;\n try {\n runMapped(() => db.run(\"BEGIN IMMEDIATE\"));\n opened = true;\n const result = await runInCallback( () =>\n runRootScope({ scope, body: () => fn(createTransactionAdapter({ db, scope, budget })) }),\n );\n // An expired budget must never commit, however the callback ended.\n budget.assertUsable({ stage: \"commit\" });\n commit.progress = \"sent\";\n runMapped(() => db.run(\"COMMIT\"));\n budget.close({ outcome: \"committed\" });\n return result;\n } catch (error) {\n // The engine runs in-process and answers synchronously: a COMMIT that\n // was sent and failed was ANSWERED with that failure.\n if (commit.progress === \"sent\") commit.progress = \"answered\";\n // Best effort: never mask the original failure (the user callback's\n // own error, or a failed COMMIT) with a rollback failure. After a\n // failed BEGIN no ROLLBACK is sent: on a shared (injected) database\n // it would end ANOTHER owner's transaction.\n let rollback: RollbackOutcome = \"not-needed\";\n try {\n if (opened) {\n db.run(\"ROLLBACK\");\n rollback = \"acknowledged\";\n }\n } catch {\n // The rollback that should have cleaned up failed. The commit\n // outcome does not change: it follows from how far COMMIT got.\n rollback = \"failed\";\n }\n // EPIC T: the same error, with the facts recorded beside it. The one\n // database handle is kept — there is no pool to discard it from.\n throw settleFailedTransaction({\n error,\n provider: PROVIDER,\n budget,\n scope,\n commit: commit.progress,\n rollback,\n connection: \"returned\",\n });\n }\n });\n },\n\n async connect(): Promise<void> {\n assertNotInsideTransaction();\n await queue.run(async () => { getDatabase(); });\n },\n };\n\n return {\n dialect: DIALECT,\n provider: PROVIDER,\n wire: WIRE,\n budgets: BUDGETS,\n roundTrips: ROUND_TRIPS,\n transactionOutcome: \"reported\",\n\n withSession({ run }) {\n return lifecycle.admit({ run: () => root.withSession({ run }) });\n },\n\n execute(params) {\n return lifecycle.admit({ run: () => root.execute(params) });\n },\n\n executeAffected(params) {\n return lifecycle.admit({ run: () => root.executeAffected(params) });\n },\n\n executeRawBound(params) {\n return lifecycle.admit({ run: () => root.executeUnsafe(params) });\n },\n\n executeUnsafe(params) {\n return lifecycle.admit({ run: () => root.executeUnsafe(params) });\n },\n\n transaction<T>(\n fn: (txAdapter: DatabaseAdapter) => Promise<T>,\n transactionOptions?: TransactionOptions,\n ): Promise<T> {\n return lifecycle.admit({ run: () => root.transaction(fn, transactionOptions) });\n },\n\n connect(): Promise<void> {\n return lifecycle.admit({ run: () => root.connect() });\n },\n\n /**\n * Terminal (EPIC A2): refuses new work at once, waits for admitted work —\n * queued statements and whole transaction/session callbacks — then closes\n * a database the adapter opened, once (inside the queue, F15). Repeated\n * calls share that completion. A new adapter is the only way to connect\n * again; for `\":memory:\"` that is a new, empty database.\n */\n disconnect(): Promise<void> {\n return lifecycle.disconnect();\n },\n\n formatArrayParam(values: unknown[]): unknown {\n throw arrayParamBug({ values });\n },\n };\n}\n\n// ─── Re-exports (driver-error table, helpers) ─────────────────────\n\nexport {\n SQLITE_ERROR_CODES,\n SQLITE_ERROR_REASONS,\n mapSqliteDriverError,\n runMapped,\n sqliteErrorCode,\n} from \"./errors.ts\";\nexport { normalizeRow, normalizeRows, serializeParamsRaw } from \"./params.ts\";\nexport { createOperationQueue } from \"./queue.ts\";\nexport type { OperationQueue } from \"./queue.ts\";\nexport { createSavepointCounter, nextSavepointName } from \"@vibeorm/runtime/adapter-kit\";\nexport type { SavepointCounter } from \"@vibeorm/runtime/adapter-kit\";\nexport { refuseNestedTransactionOptions, validateTransactionOptions } from \"./transaction-options.ts\";\n// ─── EPIC 6: transaction budgets (shared, @vibeorm/runtime/adapter-kit) ───\nexport {\n DEFAULT_DEADLINE_CLOCK,\n engineStatementBudgetMs,\n isTransactionDeadlineError,\n startTransactionBudget,\n transactionClosedError,\n transactionDeadlineError,\n transactionOutcomeUnknownError,\n validateTransactionDeadline,\n} from \"@vibeorm/runtime/adapter-kit\";\nexport type { BudgetStage, DeadlineClock, TransactionBudget, TransactionOutcome } from \"@vibeorm/runtime/adapter-kit\";\n",
|
|
6
6
|
"/**\n * Driver-error mapping for `bun:sqlite`.\n *\n * bun:sqlite throws `SQLiteError` carrying the SQLite *extended* result-code\n * name in `code` (e.g. `\"SQLITE_CONSTRAINT_UNIQUE\"`) and the numeric extended\n * result code in `errno` (e.g. `2067`). Real shapes pinned against Bun 1.3.14:\n *\n * unique → code \"SQLITE_CONSTRAINT_UNIQUE\" errno 2067\n * pk → code \"SQLITE_CONSTRAINT_PRIMARYKEY\" errno 1555\n * notnull → code \"SQLITE_CONSTRAINT_NOTNULL\" errno 1299\n * check → code \"SQLITE_CONSTRAINT_CHECK\" errno 275\n * fk → code \"SQLITE_CONSTRAINT_FOREIGNKEY\" errno 787\n * busy → code \"SQLITE_BUSY\" errno 5\n *\n * Constitution rule 5: only `VibeError` escapes the adapter.\n */\n\nimport { VibeError, type VibeErrorCode } from \"@vibeorm/schema\";\n\n// ─── Result-code table ────────────────────────────────────────────\n\n/**\n * SQLite extended result-code name → stable VibeError code. Frozen and\n * mirrored by tests; anything absent from this table maps to `VIBE_ADAPTER`.\n */\nexport const SQLITE_ERROR_CODES: Readonly<Record<string, VibeErrorCode>> = Object.freeze({\n /** UNIQUE constraint failed on a declared unique index. */\n SQLITE_CONSTRAINT_UNIQUE: \"VIBE_UNIQUE_VIOLATION\",\n /** UNIQUE constraint failed on the primary key. */\n SQLITE_CONSTRAINT_PRIMARYKEY: \"VIBE_UNIQUE_VIOLATION\",\n /** rowid collision — the rowid alias flavour of a PK violation. */\n SQLITE_CONSTRAINT_ROWID: \"VIBE_UNIQUE_VIOLATION\",\n /** FOREIGN KEY constraint failed (requires `PRAGMA foreign_keys = ON`). */\n SQLITE_CONSTRAINT_FOREIGNKEY: \"VIBE_FK_VIOLATION\",\n /** NOT NULL constraint failed. */\n SQLITE_CONSTRAINT_NOTNULL: \"VIBE_VALIDATION\",\n /** CHECK constraint failed (enum emulation uses CHECK on sqlite). */\n SQLITE_CONSTRAINT_CHECK: \"VIBE_VALIDATION\",\n /** STRICT-table type mismatch. */\n SQLITE_CONSTRAINT_DATATYPE: \"VIBE_VALIDATION\",\n /** Another connection holds a conflicting lock. */\n SQLITE_BUSY: \"VIBE_TRANSACTION\",\n /** WAL snapshot invalidated by a concurrent writer. */\n SQLITE_BUSY_SNAPSHOT: \"VIBE_TRANSACTION\",\n /** Locked while another connection recovers the WAL. */\n SQLITE_BUSY_RECOVERY: \"VIBE_TRANSACTION\",\n /** busy_timeout elapsed while blocking (sqlite ≥3.41 setlk timeouts). */\n SQLITE_BUSY_TIMEOUT: \"VIBE_TRANSACTION\",\n /** Conflict on the same connection (e.g. dropping a table mid-read). */\n SQLITE_LOCKED: \"VIBE_TRANSACTION\",\n /** Shared-cache lock contention. */\n SQLITE_LOCKED_SHAREDCACHE: \"VIBE_TRANSACTION\",\n});\n\n/**\n * Result codes that additionally explain themselves through `meta.reason`.\n *\n * `VIBE_LOCK_NOT_AVAILABLE` deliberately does NOT appear here. sqlite has no\n * locking-read clause — `SELECT … FOR UPDATE` is a syntax error, and the ORM\n * refuses the request before any SQL is built — so no lock REQUEST can fail.\n * `SQLITE_BUSY` is transaction contention on the database file, which is what\n * `VIBE_TRANSACTION` / `\"busy\"` has always meant here; re-coding it would\n * change an unrelated, established contract.\n */\nexport const SQLITE_ERROR_REASONS: Readonly<Record<string, string>> = Object.freeze({\n SQLITE_BUSY: \"busy\",\n SQLITE_BUSY_SNAPSHOT: \"busy\",\n SQLITE_BUSY_RECOVERY: \"busy\",\n SQLITE_BUSY_TIMEOUT: \"busy\",\n SQLITE_LOCKED: \"busy\",\n SQLITE_LOCKED_SHAREDCACHE: \"busy\",\n});\n\n// ─── Reading driver errors ────────────────────────────────────────\n\n/** bun:sqlite result-code names are SCREAMING_SNAKE with the SQLITE_ prefix. */\nconst RESULT_CODE_PATTERN = /^SQLITE_[A-Z0-9_]+$/;\n\nfunction readStringField(params: { source: Record<string, unknown>; key: string }): string | undefined {\n const value = params.source[params.key];\n return typeof value === \"string\" && value.length > 0 ? value : undefined;\n}\n\n/**\n * Extract the SQLite result-code name from a bun:sqlite error. Failures raised\n * outside the database engine (a closed handle, a bad filename) may carry no\n * `SQLITE_*` code and yield `undefined`.\n */\nexport function sqliteErrorCode(params: { error: unknown }): string | undefined {\n const { error } = params;\n if (error === null || typeof error !== \"object\") return undefined;\n const code = readStringField({ source: error as Record<string, unknown>, key: \"code\" });\n return code !== undefined && RESULT_CODE_PATTERN.test(code) ? code : undefined;\n}\n\n// ─── Mapping ──────────────────────────────────────────────────────\n\n/**\n * Map any error thrown by bun:sqlite onto a `VibeError`.\n *\n * A `VibeError` passes through unchanged, so an error raised deeper inside the\n * ORM (or by a nested adapter call) is never re-wrapped. Everything else keeps\n * the original error as `cause` and carries `{ code, errno }` in `meta`.\n */\nexport function mapSqliteDriverError(params: { error: unknown }): VibeError {\n const { error } = params;\n if (error instanceof VibeError) return error;\n\n const source: Record<string, unknown> =\n error !== null && typeof error === \"object\" ? (error as Record<string, unknown>) : {};\n const driverCode = sqliteErrorCode({ error });\n const code: VibeErrorCode =\n (driverCode === undefined ? undefined : SQLITE_ERROR_CODES[driverCode]) ?? \"VIBE_ADAPTER\";\n\n const meta: Record<string, unknown> = {};\n if (driverCode !== undefined) meta.code = driverCode;\n const errno = source.errno;\n if (typeof errno === \"number\") meta.errno = errno;\n const reason = driverCode === undefined ? undefined : SQLITE_ERROR_REASONS[driverCode];\n if (reason !== undefined) meta.reason = reason;\n\n const message =\n readStringField({ source, key: \"message\" }) ??\n (typeof error === \"string\" ? error : \"unknown bun:sqlite driver error\");\n\n return new VibeError({ code, message, meta, cause: error });\n}\n\n/**\n * Run a driver call, mapping anything it throws onto a `VibeError`. Synchronous\n * because bun:sqlite is a synchronous driver — the adapter's async surface\n * wraps results in already-resolved promises.\n */\nexport function runMapped<T>(fn: () => T): T {\n try {\n return fn();\n } catch (error) {\n throw mapSqliteDriverError({ error });\n }\n}\n",
|
|
7
7
|
"/**\n * Parameter serialization and row normalization for bun:sqlite.\n *\n * TWO SERIALIZATION PATHS (LEARNINGS.md — raw vs ORM differ):\n *\n * ORM hot path — NO conversion at all. The runtime codec table\n * (`SQLITE_CODECS` in @vibeorm/runtime) already encoded every parameter:\n * booleans are 0/1, Dates are ISO-8601 text, Json is stringified, BigInt is\n * decimal text. Converting again here would be exactly the double-coercion\n * v1's constitution rule 6 forbids, so `execute` binds values verbatim.\n *\n * Raw path (`$queryRaw*` / `$executeRaw*` / DDL) — user-supplied values that\n * never met a codec. bun:sqlite silently binds JS values it does not\n * understand as NULL (pinned on Bun 1.3.14: a `Date` and a plain object both\n * arrive as NULL), so {@link serializeParamsRaw} converts them explicitly\n * instead of letting data vanish.\n *\n * ROW NORMALIZATION: the adapter always reads INTEGER columns with\n * `safeIntegers` (see index.ts), so the driver hands back `bigint` for every\n * integer value. {@link normalizeRows} converts each bigint that fits the\n * IEEE-754 safe range back to `number`, and keeps the rest as `bigint`:\n *\n * - Int columns arrive as `number` (the Int codec passes numbers through),\n * - Boolean 0/1 arrive as `number` → decoded to boolean by the codec,\n * - BigInt columns ≤ 2^53−1 arrive as `number` → `BigInt(value)` (lossless),\n * - BigInt columns > 2^53−1 STAY `bigint` → codec passes them through — the\n * round-trip is lossless where plain number reads would silently corrupt.\n */\n\n// ─── Raw-path serialization ───────────────────────────────────────\n\n/**\n * Serialize raw-path parameters into values bun:sqlite binds faithfully:\n * `Date` → ISO-8601 text (matches the DateTime column encoding), `boolean` →\n * 1/0 (matches the Boolean column encoding), plain objects **and arrays** →\n * JSON text (sqlite has no array parameters — a JS array can only be a JSON\n * value here), `undefined` → NULL. Strings, numbers, bigints, NULL and binary\n * views pass through untouched.\n */\nexport function serializeParamsRaw(params: { values: readonly unknown[] }): unknown[] {\n return params.values.map((value) => {\n if (value === undefined) return null;\n if (typeof value === \"boolean\") return value ? 1 : 0;\n if (value === null || typeof value !== \"object\") return value;\n if (value instanceof Date) return value.toISOString();\n if (ArrayBuffer.isView(value) || value instanceof ArrayBuffer) return value;\n return JSON.stringify(value);\n });\n}\n\n// ─── Row normalization (safeIntegers → JS expectations) ───────────\n\nconst MAX_SAFE: bigint = BigInt(Number.MAX_SAFE_INTEGER);\nconst MIN_SAFE: bigint = -MAX_SAFE;\n\n/**\n * Downcast every lossless `bigint` in a row to `number`, in place. Values\n * outside ±(2^53−1) stay `bigint` so oversized BigInt columns round-trip\n * exactly (see the module doc for why this matches the runtime codec table).\n */\nexport function normalizeRow(params: { row: Record<string, unknown> }): Record<string, unknown> {\n const { row } = params;\n for (const key of Object.keys(row)) {\n const value = row[key];\n if (typeof value === \"bigint\" && value <= MAX_SAFE && value >= MIN_SAFE) {\n row[key] = Number(value);\n }\n }\n return row;\n}\n\n/** {@link normalizeRow} over a result set (mutates and returns the same array). */\nexport function normalizeRows(params: { rows: Record<string, unknown>[] }): Record<string, unknown>[] {\n for (const row of params.rows) normalizeRow({ row });\n return params.rows;\n}\n",
|
|
8
8
|
"import { VibeError } from \"@vibeorm/schema\";\n\nconst SPACE = /[\\t\\n\\v\\f\\r ]/;\nconst IDENTIFIER = /[A-Za-z0-9_$\\u0080-\\uffff]/;\n\n/** End of a SQLite comment, or undefined when this is not a comment. */\nfunction commentEnd(params: { text: string; offset: number }): number | undefined {\n const { text, offset } = params;\n if (text.startsWith(\"--\", offset)) {\n const end = text.indexOf(\"\\n\", offset + 2);\n return end < 0 ? text.length : end + 1;\n }\n if (text.startsWith(\"/*\", offset)) {\n const end = text.indexOf(\"*/\", offset + 2);\n return end < 0 ? text.length : end + 2;\n }\n return undefined;\n}\n\n/** Locate terminators, not statements: SQLite itself parses compound trigger bodies. */\nfunction terminators(params: { text: string }): number[] {\n const { text } = params;\n const offsets: number[] = [];\n for (let i = 0; i < text.length;) {\n const end = commentEnd({ text, offset: i });\n if (end !== undefined) { i = end; continue; }\n const char = text[i]!;\n if (char === \"'\" || char === '\"' || char === \"`\" || char === \"[\") {\n const quote = char === \"[\" ? \"]\" : char;\n i++;\n while (i < text.length) {\n if (text[i++] !== quote) continue;\n if (quote !== \"]\" && text[i] === quote) { i++; continue; }\n break;\n }\n continue;\n }\n // SQLite's Tcl-style variable suffix can itself contain semicolons or\n // quote/comment characters. sqlite3_expanded_sql replaces the WHOLE token.\n if (char === \"$\" || char === \":\" || char === \"@\" || char === \"#\") {\n i++;\n while (i < text.length) {\n if (IDENTIFIER.test(text[i]!)) { i++; continue; }\n if (text.startsWith(\"::\", i)) { i += 2; continue; }\n if (text[i] === \"(\") {\n i++;\n while (i < text.length && text[i] !== \")\" && !SPACE.test(text[i]!)) i++;\n if (text[i] === \")\") i++;\n }\n break;\n }\n continue;\n }\n // A dollar sign inside an ordinary identifier is not a parameter prefix.\n if (IDENTIFIER.test(char)) {\n while (i < text.length && IDENTIFIER.test(text[i]!)) i++;\n continue;\n }\n if (char === \";\") offsets.push(i);\n i++;\n }\n return offsets;\n}\n\n/**\n * Reject a prepared tail before stepping the statement. Bun's documented\n * Statement.toString() is sqlite3_expanded_sql: it contains only the compiled\n * first statement. Called BEFORE binding, expansion replaces parameters with\n * NULL, preserving every real terminator (including those inside a trigger).\n * Map its terminator count back to the original text, then allow only SQLite\n * whitespace, empty separators and comments. Script execution never calls this.\n */\nexport function assertSinglePreparedStatement(params: { text: string; expanded: string }): void {\n const { text, expanded } = params;\n if (text.includes(\"\\0\")) throw preparedTailError();\n const count = terminators({ text: expanded }).length;\n if (count === 0) return;\n const boundary = terminators({ text })[count - 1];\n if (boundary === undefined) throw preparedTailError();\n for (let i = boundary + 1; i < text.length;) {\n if (SPACE.test(text[i]!) || text[i] === \";\") { i++; continue; }\n const end = commentEnd({ text, offset: i });\n if (end === undefined) throw preparedTailError();\n i = end;\n }\n}\n\nfunction preparedTailError(): VibeError {\n return new VibeError({\n code: \"VIBE_ADAPTER\",\n message: \"Prepared SQLite SQL must contain one statement; omit values only when intentionally executing a script\",\n meta: { provider: \"sqlite\", reason: \"prepared-statement-tail\" },\n });\n}\n",
|
|
9
|
-
"/**\n * Operation queue for bun:sqlite.\n *\n * The driver itself is synchronous — a single statement can never interleave —\n * but a `transaction()` callback is async: while it awaits, a concurrent root\n * adapter call would run on the SAME connection and silently join the open\n * transaction. Every adapter entry point therefore runs through one serial\n * chain — including whole `transaction()` calls, which occupy the chain until\n * they commit or roll back (mirroring adapter-pglite).\n */\n\nimport { AsyncLocalStorage } from \"node:async_hooks\";\n\n/** A serial chain: jobs run one at a time, in the order they were queued. */\nexport type OperationQueue = {\n /** Queue `job`, resolving with its result once every earlier job has settled. */\n run<T>(job: () => Promise<T>): Promise<T>;\n};\n\n/** Connection-wide exclusion, including callback reentry through another wrapper. */\nexport type ConnectionOwnership = {\n readonly queue: OperationQueue;\n readonly txContext: AsyncLocalStorage<
|
|
10
|
-
"/**\n * Transaction-option validation for sqlite — dialect honesty (constitution\n * rule 4): what sqlite cannot honor is refused loudly at the earliest knowable\n * moment, before `BEGIN` is ever issued, instead of being silently ignored.\n *\n * - SQLite transactions are always serializable. `Serializable` (and omitting\n * the option) is accepted; `ReadCommitted` / `RepeatableRead` would be a\n * silent upgrade the caller did not ask for, so they throw `VIBE_VALIDATION`.\n * - SQLite has no per-statement timeout. `busy_timeout` only bounds LOCK\n * ACQUISITION, not statement runtime, so it is NOT an honest implementation\n * of the contract's transaction-scoped `timeout` — the option throws\n * `VIBE_VALIDATION`.\n * - NESTED transactions are savepoints: no adapter can change the isolation\n * level mid-transaction or enforce a nested timeout, so nested options are\n * refused with `VIBE_VALIDATION` on EVERY adapter (the shared contract in\n * @vibeorm/runtime's adapter.ts).\n */\n\nimport type { TransactionOptions } from \"@vibeorm/runtime\";\nimport { VibeError } from \"@vibeorm/schema\";\n\n/**\n * Validate `$transaction` options against what sqlite can actually honor.\n *\n * @throws VibeError `VIBE_VALIDATION` for `ReadCommitted` / `RepeatableRead`\n * isolation or any `timeout` (see module doc).\n */\nexport function validateTransactionOptions(params: { options?: TransactionOptions }): void {\n const { options } = params;\n if (options === undefined) return;\n\n if (options.isolationLevel !== undefined && options.isolationLevel !== \"Serializable\") {\n throw new VibeError({\n code: \"VIBE_VALIDATION\",\n message: `sqlite transactions are always serializable — isolationLevel \"${options.isolationLevel}\" cannot be honored; pass \"Serializable\" or omit the option`,\n meta: { dialect: \"sqlite\", isolationLevel: options.isolationLevel },\n });\n }\n\n if (options.timeout !== undefined) {\n throw new VibeError({\n code: \"VIBE_VALIDATION\",\n message:\n \"sqlite has no per-statement timeout, so a transaction `timeout` cannot be enforced database-side (busy_timeout only bounds lock acquisition, not statement runtime) — remove the option\",\n meta: { dialect: \"sqlite\", timeout: options.timeout },\n });\n }\n}\n\n// The NESTED option refusal is ONE copy, shared by every adapter through the\n// runtime's adapter-kit; re-exported here so this adapter's surface is unchanged.\nexport { refuseNestedTransactionOptions } from \"@vibeorm/runtime/adapter-kit\";\n"
|
|
9
|
+
"/**\n * Operation queue for bun:sqlite.\n *\n * The driver itself is synchronous — a single statement can never interleave —\n * but a `transaction()` callback is async: while it awaits, a concurrent root\n * adapter call would run on the SAME connection and silently join the open\n * transaction. Every adapter entry point therefore runs through one serial\n * chain — including whole `transaction()` calls, which occupy the chain until\n * they commit or roll back (mirroring adapter-pglite).\n */\n\nimport { AsyncLocalStorage } from \"node:async_hooks\";\n\n/** A serial chain: jobs run one at a time, in the order they were queued. */\nexport type OperationQueue = {\n /** Queue `job`, resolving with its result once every earlier job has settled. */\n run<T>(job: () => Promise<T>): Promise<T>;\n};\n\n/** Connection-wide exclusion, including callback reentry through another wrapper. */\nexport type ConnectionOwnership = {\n readonly queue: OperationQueue;\n readonly txContext: AsyncLocalStorage<{ active: boolean }>;\n readonly runInCallback: <T>(run: () => Promise<T>) => Promise<T>;\n};\n\nconst INJECTED_OWNERSHIP: WeakMap<object, ConnectionOwnership> = new WeakMap();\n\n/** Share ownership by injected handle identity without retaining closed databases. */\nexport function connectionOwnership(params: { database?: object }): ConnectionOwnership {\n const existing = params.database === undefined ? undefined : INJECTED_OWNERSHIP.get(params.database);\n if (existing !== undefined) return existing;\n const txContext = new AsyncLocalStorage<{ active: boolean }>();\n const ownership: ConnectionOwnership = { queue: createOperationQueue(), txContext,\n runInCallback<T>(run: () => Promise<T>): Promise<T> {\n const token = { active: true };\n return txContext.run(token, run).finally(() => { token.active = false; });\n },\n };\n if (params.database !== undefined) INJECTED_OWNERSHIP.set(params.database, ownership);\n return ownership;\n}\n\n/** Create an empty operation queue. */\nexport function createOperationQueue(): OperationQueue {\n let tail: Promise<unknown> = Promise.resolve();\n\n return {\n run<T>(job: () => Promise<T>): Promise<T> {\n // Run after the previous job settles, whether it resolved or rejected.\n const result = tail.then(job, job);\n // Keep the chain alive: a rejected job must not reject every later job.\n tail = result.then(\n () => undefined,\n () => undefined,\n );\n return result;\n },\n };\n}\n",
|
|
10
|
+
"/**\n * Transaction-option validation for sqlite — dialect honesty (constitution\n * rule 4): what sqlite cannot honor is refused loudly at the earliest knowable\n * moment, before `BEGIN` is ever issued, instead of being silently ignored.\n *\n * - SQLite transactions are always serializable. `Serializable` (and omitting\n * the option) is accepted; `ReadCommitted` / `RepeatableRead` would be a\n * silent upgrade the caller did not ask for, so they throw `VIBE_VALIDATION`.\n * - SQLite has no per-statement timeout. `busy_timeout` only bounds LOCK\n * ACQUISITION, not statement runtime, so it is NOT an honest implementation\n * of the contract's transaction-scoped `timeout` — the option throws\n * `VIBE_VALIDATION`.\n * - NESTED transactions are savepoints: no adapter can change the isolation\n * level mid-transaction or enforce a nested timeout, so nested options are\n * refused with `VIBE_VALIDATION` on EVERY adapter (the shared contract in\n * @vibeorm/runtime's adapter.ts).\n */\n\nimport type { TransactionOptions } from \"@vibeorm/runtime\";\nimport { VibeError } from \"@vibeorm/schema\";\n\n/**\n * Validate `$transaction` options against what sqlite can actually honor.\n *\n * @throws VibeError `VIBE_VALIDATION` for `ReadCommitted` / `RepeatableRead`\n * isolation or any `timeout` (see module doc).\n */\nexport function validateTransactionOptions(params: { options?: TransactionOptions }): void {\n const { options } = params;\n if (options === undefined) return;\n\n if (options.isolationLevel !== undefined && options.isolationLevel !== \"Serializable\") {\n throw new VibeError({\n code: \"VIBE_VALIDATION\",\n message: `sqlite transactions are always serializable — isolationLevel \"${options.isolationLevel}\" cannot be honored; pass \"Serializable\" or omit the option`,\n meta: { dialect: \"sqlite\", isolationLevel: options.isolationLevel },\n });\n }\n\n if (options.timeout !== undefined) {\n throw new VibeError({\n code: \"VIBE_VALIDATION\",\n message:\n \"sqlite has no per-statement timeout, so a transaction `timeout` cannot be enforced database-side (busy_timeout only bounds lock acquisition, not statement runtime) — remove the option\",\n meta: { dialect: \"sqlite\", timeout: options.timeout },\n });\n }\n\n // `PRAGMA query_only` is connection-scoped, not a transaction mode, so it is\n // not an exact equivalent of a READ ONLY transaction: refuse loudly.\n if (options.accessMode !== undefined) {\n throw new VibeError({\n code: \"VIBE_UNSUPPORTED_CAPABILITY\",\n message:\n \"sqlite has no read-only transaction mode (PRAGMA query_only is connection-scoped, not transaction-scoped), so `accessMode` cannot be honored — remove the option\",\n meta: { dialect: \"sqlite\", feature: \"transactionAccessMode\", accessMode: options.accessMode },\n });\n }\n}\n\n// The NESTED option refusal is ONE copy, shared by every adapter through the\n// runtime's adapter-kit; re-exported here so this adapter's surface is unchanged.\nexport { refuseNestedTransactionOptions } from \"@vibeorm/runtime/adapter-kit\";\n"
|
|
11
11
|
],
|
|
12
|
-
"mappings": ";;AAgCA;AAEA,sBAAS;AAWT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;AC5BA;AAQO,IAAM,qBAA8D,OAAO,OAAO;AAAA,EAEvF,0BAA0B;AAAA,EAE1B,8BAA8B;AAAA,EAE9B,yBAAyB;AAAA,EAEzB,8BAA8B;AAAA,EAE9B,2BAA2B;AAAA,EAE3B,yBAAyB;AAAA,EAEzB,4BAA4B;AAAA,EAE5B,aAAa;AAAA,EAEb,sBAAsB;AAAA,EAEtB,sBAAsB;AAAA,EAEtB,qBAAqB;AAAA,EAErB,eAAe;AAAA,EAEf,2BAA2B;AAC7B,CAAC;AAYM,IAAM,uBAAyD,OAAO,OAAO;AAAA,EAClF,aAAa;AAAA,EACb,sBAAsB;AAAA,EACtB,sBAAsB;AAAA,EACtB,qBAAqB;AAAA,EACrB,eAAe;AAAA,EACf,2BAA2B;AAC7B,CAAC;AAKD,IAAM,sBAAsB;A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K,YAAY,IAAI,kBAAkB,EAAE,CAAC;AAAA;AAAA,IAGhF,OAAO,GAAkB;AAAA,MACvB,OAAO,UAAU,MAAM,EAAE,KAAK,MAAM,KAAK,QAAQ,EAAE,CAAC;AAAA;AAAA,IAUtD,UAAU,GAAkB;AAAA,MAC1B,OAAO,UAAU,WAAW;AAAA;AAAA,IAG9B,gBAAgB,CAAC,QAA4B;AAAA,MAC3C,MAAM,cAAc,EAAE,OAAO,CAAC;AAAA;AAAA,EAElC;AAAA;",
|
|
13
|
+
"debugId": "87B07C0D798BC04F64756E2164756E21",
|
|
14
14
|
"names": []
|
|
15
15
|
}
|
package/dist/queue.d.ts
CHANGED
|
@@ -17,7 +17,10 @@ export type OperationQueue = {
|
|
|
17
17
|
/** Connection-wide exclusion, including callback reentry through another wrapper. */
|
|
18
18
|
export type ConnectionOwnership = {
|
|
19
19
|
readonly queue: OperationQueue;
|
|
20
|
-
readonly txContext: AsyncLocalStorage<
|
|
20
|
+
readonly txContext: AsyncLocalStorage<{
|
|
21
|
+
active: boolean;
|
|
22
|
+
}>;
|
|
23
|
+
readonly runInCallback: <T>(run: () => Promise<T>) => Promise<T>;
|
|
21
24
|
};
|
|
22
25
|
/** Share ownership by injected handle identity without retaining closed databases. */
|
|
23
26
|
export declare function connectionOwnership(params: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibeorm/adapter-sqlite",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "bun:sqlite adapter for VibeORM v2",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"orm",
|
|
@@ -35,14 +35,16 @@
|
|
|
35
35
|
},
|
|
36
36
|
"files": [
|
|
37
37
|
"dist",
|
|
38
|
-
"
|
|
38
|
+
"!dist/**/*.d.ts.map",
|
|
39
|
+
"README.md",
|
|
40
|
+
"LICENSE"
|
|
39
41
|
],
|
|
40
42
|
"engines": {
|
|
41
43
|
"bun": ">=1.2.0"
|
|
42
44
|
},
|
|
43
45
|
"dependencies": {
|
|
44
|
-
"@vibeorm/runtime": "
|
|
45
|
-
"@vibeorm/schema": "
|
|
46
|
+
"@vibeorm/runtime": "3.0.0",
|
|
47
|
+
"@vibeorm/schema": "3.0.0"
|
|
46
48
|
},
|
|
47
49
|
"publishConfig": {
|
|
48
50
|
"access": "public"
|
package/dist/errors.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIhE;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CA2BrE,CAAC;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAOhE,CAAC;AAYH;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,GAAG,SAAS,CAK9E;AAID;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,CAsB1E;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAM3C"}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;A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BAAiB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC"}
|
package/dist/params.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"params.d.ts","sourceRoot":"","sources":["../src/params.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAIH;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE;IAAE,MAAM,EAAE,SAAS,OAAO,EAAE,CAAA;CAAE,GAAG,OAAO,EAAE,CASpF;AAOD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAS9F;AAED,mFAAmF;AACnF,wBAAgB,aAAa,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;CAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAGpG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prepared-sql.d.ts","sourceRoot":"","sources":["../src/prepared-sql.ts"],"names":[],"mappings":"AAgEA;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAa9F"}
|
package/dist/queue.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../src/queue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,6EAA6E;AAC7E,MAAM,MAAM,cAAc,GAAG;IAC3B,iFAAiF;IACjF,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CAC3C,CAAC;AAEF,qFAAqF;AACrF,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAC/B,QAAQ,CAAC,SAAS,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAC;CAC7C,CAAC;AAIF,sFAAsF;AACtF,wBAAgB,mBAAmB,CAAC,MAAM,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,mBAAmB,CAMtF;AAED,uCAAuC;AACvC,wBAAgB,oBAAoB,IAAI,cAAc,CAerD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transaction-options.d.ts","sourceRoot":"","sources":["../src/transaction-options.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAG3D;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE;IAAE,OAAO,CAAC,EAAE,kBAAkB,CAAA;CAAE,GAAG,IAAI,CAoBzF;AAID,OAAO,EAAE,8BAA8B,EAAE,MAAM,8BAA8B,CAAC"}
|