@jini-ai/sqlite 0.1.2 → 0.5.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.
Files changed (103) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +23 -0
  3. package/dist/index.d.ts +17 -9
  4. package/dist/index.js +12 -9
  5. package/package.json +13 -7
  6. package/dist/backend-config.d.ts +0 -42
  7. package/dist/backend-config.d.ts.map +0 -1
  8. package/dist/backend-config.js +0 -57
  9. package/dist/backend-config.js.map +0 -1
  10. package/dist/db/agent-sessions/agent-sessions.d.ts +0 -79
  11. package/dist/db/agent-sessions/agent-sessions.d.ts.map +0 -1
  12. package/dist/db/agent-sessions/agent-sessions.js +0 -121
  13. package/dist/db/agent-sessions/agent-sessions.js.map +0 -1
  14. package/dist/db/agent-sessions/index.d.ts +0 -6
  15. package/dist/db/agent-sessions/index.d.ts.map +0 -1
  16. package/dist/db/agent-sessions/index.js +0 -6
  17. package/dist/db/agent-sessions/index.js.map +0 -1
  18. package/dist/db/capabilities/capabilities.d.ts +0 -39
  19. package/dist/db/capabilities/capabilities.d.ts.map +0 -1
  20. package/dist/db/capabilities/capabilities.js +0 -54
  21. package/dist/db/capabilities/capabilities.js.map +0 -1
  22. package/dist/db/capabilities/index.d.ts +0 -4
  23. package/dist/db/capabilities/index.d.ts.map +0 -1
  24. package/dist/db/capabilities/index.js +0 -4
  25. package/dist/db/capabilities/index.js.map +0 -1
  26. package/dist/db/connection/connection.d.ts +0 -18
  27. package/dist/db/connection/connection.d.ts.map +0 -1
  28. package/dist/db/connection/connection.js +0 -48
  29. package/dist/db/connection/connection.js.map +0 -1
  30. package/dist/db/connection/index.d.ts +0 -3
  31. package/dist/db/connection/index.d.ts.map +0 -1
  32. package/dist/db/connection/index.js +0 -3
  33. package/dist/db/connection/index.js.map +0 -1
  34. package/dist/db/conversations/conversations.d.ts +0 -109
  35. package/dist/db/conversations/conversations.d.ts.map +0 -1
  36. package/dist/db/conversations/conversations.js +0 -274
  37. package/dist/db/conversations/conversations.js.map +0 -1
  38. package/dist/db/conversations/index.d.ts +0 -3
  39. package/dist/db/conversations/index.d.ts.map +0 -1
  40. package/dist/db/conversations/index.js +0 -3
  41. package/dist/db/conversations/index.js.map +0 -1
  42. package/dist/db/core/index.d.ts +0 -6
  43. package/dist/db/core/index.d.ts.map +0 -1
  44. package/dist/db/core/index.js +0 -6
  45. package/dist/db/core/index.js.map +0 -1
  46. package/dist/db/core/json.d.ts +0 -13
  47. package/dist/db/core/json.d.ts.map +0 -1
  48. package/dist/db/core/json.js +0 -22
  49. package/dist/db/core/json.js.map +0 -1
  50. package/dist/db/core/rows.d.ts +0 -18
  51. package/dist/db/core/rows.d.ts.map +0 -1
  52. package/dist/db/core/rows.js +0 -17
  53. package/dist/db/core/rows.js.map +0 -1
  54. package/dist/db/core/types.d.ts +0 -14
  55. package/dist/db/core/types.d.ts.map +0 -1
  56. package/dist/db/core/types.js +0 -2
  57. package/dist/db/core/types.js.map +0 -1
  58. package/dist/db/index.d.ts +0 -18
  59. package/dist/db/index.d.ts.map +0 -1
  60. package/dist/db/index.js +0 -16
  61. package/dist/db/index.js.map +0 -1
  62. package/dist/db/messages/index.d.ts +0 -4
  63. package/dist/db/messages/index.d.ts.map +0 -1
  64. package/dist/db/messages/index.js +0 -4
  65. package/dist/db/messages/index.js.map +0 -1
  66. package/dist/db/messages/messages.d.ts +0 -129
  67. package/dist/db/messages/messages.d.ts.map +0 -1
  68. package/dist/db/messages/messages.js +0 -246
  69. package/dist/db/messages/messages.js.map +0 -1
  70. package/dist/db/projects/index.d.ts +0 -4
  71. package/dist/db/projects/index.d.ts.map +0 -1
  72. package/dist/db/projects/index.js +0 -4
  73. package/dist/db/projects/index.js.map +0 -1
  74. package/dist/db/projects/projects.d.ts +0 -122
  75. package/dist/db/projects/projects.d.ts.map +0 -1
  76. package/dist/db/projects/projects.js +0 -311
  77. package/dist/db/projects/projects.js.map +0 -1
  78. package/dist/db/schema/index.d.ts +0 -3
  79. package/dist/db/schema/index.d.ts.map +0 -1
  80. package/dist/db/schema/index.js +0 -3
  81. package/dist/db/schema/index.js.map +0 -1
  82. package/dist/db/schema/migrate.d.ts +0 -29
  83. package/dist/db/schema/migrate.d.ts.map +0 -1
  84. package/dist/db/schema/migrate.js +0 -78
  85. package/dist/db/schema/migrate.js.map +0 -1
  86. package/dist/db/tool-catalog/index.d.ts +0 -6
  87. package/dist/db/tool-catalog/index.d.ts.map +0 -1
  88. package/dist/db/tool-catalog/index.js +0 -6
  89. package/dist/db/tool-catalog/index.js.map +0 -1
  90. package/dist/db/tool-catalog/tool-catalog.d.ts +0 -70
  91. package/dist/db/tool-catalog/tool-catalog.d.ts.map +0 -1
  92. package/dist/db/tool-catalog/tool-catalog.js +0 -87
  93. package/dist/db/tool-catalog/tool-catalog.js.map +0 -1
  94. package/dist/db-inspect.d.ts +0 -62
  95. package/dist/db-inspect.d.ts.map +0 -1
  96. package/dist/db-inspect.js +0 -153
  97. package/dist/db-inspect.js.map +0 -1
  98. package/dist/event-log.d.ts +0 -33
  99. package/dist/event-log.d.ts.map +0 -1
  100. package/dist/event-log.js +0 -191
  101. package/dist/event-log.js.map +0 -1
  102. package/dist/index.d.ts.map +0 -1
  103. package/dist/index.js.map +0 -1
@@ -1,62 +0,0 @@
1
- import type Database from 'better-sqlite3';
2
- type SqliteDb = Database.Database;
3
- export interface DaemonDbTableInfo {
4
- name: string;
5
- rowCount: number;
6
- }
7
- export interface DaemonDbStatusReport {
8
- kind: 'sqlite' | 'postgres';
9
- /** Absolute path on disk (sqlite); connection identifier (postgres, e.g. `'host:port/db'`). */
10
- location: string;
11
- /**
12
- * Total bytes the DB file occupies. Sums the primary file plus `-wal`/`-shm`
13
- * so the report matches `du -h` rather than just the primary file.
14
- */
15
- sizeBytes: number;
16
- schemaVersion: number | null;
17
- tables: DaemonDbTableInfo[];
18
- generatedAt: number;
19
- }
20
- /**
21
- * Builds a structured inventory of a `better-sqlite3` database: schema version,
22
- * per-table row counts (system tables excluded), and total on-disk size
23
- * (primary file + `-wal` + `-shm`).
24
- *
25
- * @param input - The open database handle and its on-disk file path.
26
- * @returns The status report. Never throws — schema-read and per-table failures
27
- * degrade to `null`/`0`/an empty list rather than failing the whole report.
28
- */
29
- export declare function inspectSqliteDatabase(input: {
30
- db: SqliteDb;
31
- file: string;
32
- }): Promise<DaemonDbStatusReport>;
33
- export type DbIntegrityIssueKind = 'integrity' | 'foreign_key';
34
- export interface DbIntegrityIssue {
35
- kind: DbIntegrityIssueKind;
36
- message: string;
37
- }
38
- export interface DbIntegrityReport {
39
- ok: boolean;
40
- /** `'integrity_check'` (default) or `'quick_check'` — quick is faster but skips the index-content check. */
41
- mode: 'integrity_check' | 'quick_check';
42
- issues: DbIntegrityIssue[];
43
- elapsedMs: number;
44
- generatedAt: number;
45
- }
46
- export interface VerifyDbOptions {
47
- db: SqliteDb;
48
- quick?: boolean;
49
- }
50
- /**
51
- * Runs `PRAGMA integrity_check` (or `quick_check`) plus `PRAGMA foreign_key_check`
52
- * against an open database and returns a structured report so a CLI can
53
- * pretty-print it and automation can parse the JSON.
54
- *
55
- * @param opts - The open database handle and whether to use the faster `quick_check` variant.
56
- * @returns `{ ok: true }` when both pragmas report clean; otherwise the list of issues found.
57
- * A pragma that throws is itself recorded as one `integrity`/`foreign_key` issue rather than
58
- * propagating — a caller polling DB health should always get a report, not an exception.
59
- */
60
- export declare function verifySqliteIntegrity(opts: VerifyDbOptions): DbIntegrityReport;
61
- export {};
62
- //# sourceMappingURL=db-inspect.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"db-inspect.d.ts","sourceRoot":"","sources":["../src/db-inspect.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,KAAK,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC;AAElC,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,QAAQ,GAAG,UAAU,CAAC;IAC5B,+FAA+F;IAC/F,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;CACrB;AAQD;;;;;;;;GAQG;AACH,wBAAsB,qBAAqB,CAAC,KAAK,EAAE;IAAE,EAAE,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CA+ChH;AAsBD,MAAM,MAAM,oBAAoB,GAAG,WAAW,GAAG,aAAa,CAAC;AAE/D,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,oBAAoB,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,OAAO,CAAC;IACZ,4GAA4G;IAC5G,IAAI,EAAE,iBAAiB,GAAG,aAAa,CAAC;IACxC,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,QAAQ,CAAC;IACb,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,eAAe,GAAG,iBAAiB,CAkD9E"}
@@ -1,153 +0,0 @@
1
- /**
2
- * @module db-inspect
3
- *
4
- * Pure `better-sqlite3` inspection helpers: a structured inventory (file size,
5
- * table list, per-table row count, `user_version` schema pragma) and an
6
- * integrity check (`PRAGMA integrity_check`/`quick_check` + `foreign_key_check`).
7
- * Useful behind a host daemon's own ops CLI (a `db status` subcommand) or a
8
- * diagnostics aggregator that folds the summary in without re-implementing the
9
- * SQLite read.
10
- *
11
- * Pure relative to its inputs: callers pass the SQLite handle + the on-disk
12
- * file path. Neither function opens a new connection or mutates state.
13
- */
14
- import { promises as fsp } from 'node:fs';
15
- const SYSTEM_TABLE_PREFIXES = ['sqlite_', 'better_sqlite3_'];
16
- function isSystemTable(name) {
17
- return SYSTEM_TABLE_PREFIXES.some((p) => name.startsWith(p));
18
- }
19
- /**
20
- * Builds a structured inventory of a `better-sqlite3` database: schema version,
21
- * per-table row counts (system tables excluded), and total on-disk size
22
- * (primary file + `-wal` + `-shm`).
23
- *
24
- * @param input - The open database handle and its on-disk file path.
25
- * @returns The status report. Never throws — schema-read and per-table failures
26
- * degrade to `null`/`0`/an empty list rather than failing the whole report.
27
- */
28
- export async function inspectSqliteDatabase(input) {
29
- const { db, file } = input;
30
- // 1. Schema version (user_version pragma).
31
- let schemaVersion = null;
32
- try {
33
- const v = db.pragma('user_version', { simple: true });
34
- schemaVersion = typeof v === 'number' ? v : Number(v);
35
- if (!Number.isFinite(schemaVersion))
36
- schemaVersion = null;
37
- }
38
- catch {
39
- schemaVersion = null;
40
- }
41
- // 2. Table list with row counts.
42
- const tables = [];
43
- try {
44
- const names = db.prepare(`SELECT name FROM sqlite_master WHERE type='table' ORDER BY name`).all();
45
- for (const { name } of names) {
46
- if (isSystemTable(name))
47
- continue;
48
- try {
49
- const safe = sanitizeTableName(name);
50
- if (!safe)
51
- continue;
52
- const row = db.prepare(`SELECT count(*) AS c FROM "${safe}"`).get();
53
- tables.push({ name: safe, rowCount: row?.c ?? 0 });
54
- }
55
- catch {
56
- // A malformed view / corrupted table shouldn't fail the whole report; record 0 rows.
57
- tables.push({ name, rowCount: 0 });
58
- }
59
- }
60
- }
61
- catch {
62
- // ignore — empty tables[] surfaces "cannot read schema" to the caller (a CLI shows 0 tables,
63
- // which is itself a useful signal).
64
- }
65
- // 3. File size = primary + -wal + -shm so the number matches du.
66
- const sizeBytes = await sumFileSizes([file, `${file}-wal`, `${file}-shm`]);
67
- return {
68
- kind: 'sqlite',
69
- location: file,
70
- sizeBytes,
71
- schemaVersion,
72
- tables,
73
- generatedAt: Date.now(),
74
- };
75
- }
76
- async function sumFileSizes(paths) {
77
- let total = 0;
78
- for (const p of paths) {
79
- try {
80
- const stat = await fsp.stat(p);
81
- total += stat.size;
82
- }
83
- catch {
84
- // missing -wal / -shm is normal when the DB hasn't been written since open.
85
- }
86
- }
87
- return total;
88
- }
89
- function sanitizeTableName(name) {
90
- // Allow ASCII alphanumerics + underscore; SQLite identifier sanity check. Prevents accidental
91
- // SQL injection if a malicious migration ever invents a hostile table name.
92
- if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(name))
93
- return null;
94
- return name;
95
- }
96
- /**
97
- * Runs `PRAGMA integrity_check` (or `quick_check`) plus `PRAGMA foreign_key_check`
98
- * against an open database and returns a structured report so a CLI can
99
- * pretty-print it and automation can parse the JSON.
100
- *
101
- * @param opts - The open database handle and whether to use the faster `quick_check` variant.
102
- * @returns `{ ok: true }` when both pragmas report clean; otherwise the list of issues found.
103
- * A pragma that throws is itself recorded as one `integrity`/`foreign_key` issue rather than
104
- * propagating — a caller polling DB health should always get a report, not an exception.
105
- */
106
- export function verifySqliteIntegrity(opts) {
107
- const { db, quick = false } = opts;
108
- const startedAt = Date.now();
109
- const issues = [];
110
- // 1. integrity_check / quick_check.
111
- const pragma = quick ? 'quick_check' : 'integrity_check';
112
- try {
113
- const rows = db.pragma(pragma);
114
- for (const row of rows) {
115
- // SQLite returns the string under either `integrity_check`, `quick_check`, or just the
116
- // first column. Normalise to the first string-valued field.
117
- const message = (row[pragma] ?? Object.values(row)[0]);
118
- if (typeof message !== 'string')
119
- continue;
120
- if (message.toLowerCase() === 'ok')
121
- continue;
122
- issues.push({ kind: 'integrity', message });
123
- }
124
- }
125
- catch (err) {
126
- issues.push({ kind: 'integrity', message: `pragma ${pragma} threw: ${err.message}` });
127
- }
128
- // 2. foreign_key_check.
129
- try {
130
- const rows = db.pragma('foreign_key_check');
131
- for (const row of rows) {
132
- const tbl = row.table ?? '?';
133
- const parent = row.parent ?? '?';
134
- const fkid = row.fkid ?? '?';
135
- const rowid = row.rowid ?? '?';
136
- issues.push({
137
- kind: 'foreign_key',
138
- message: `FK violation in ${tbl} (rowid=${rowid}) referencing ${parent} (fkid=${fkid})`,
139
- });
140
- }
141
- }
142
- catch (err) {
143
- issues.push({ kind: 'foreign_key', message: `pragma foreign_key_check threw: ${err.message}` });
144
- }
145
- return {
146
- ok: issues.length === 0,
147
- mode: quick ? 'quick_check' : 'integrity_check',
148
- issues,
149
- elapsedMs: Date.now() - startedAt,
150
- generatedAt: Date.now(),
151
- };
152
- }
153
- //# sourceMappingURL=db-inspect.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"db-inspect.js","sourceRoot":"","sources":["../src/db-inspect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,QAAQ,IAAI,GAAG,EAAE,MAAM,SAAS,CAAC;AAwB1C,MAAM,qBAAqB,GAAG,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC;AAE7D,SAAS,aAAa,CAAC,IAAY;IACjC,OAAO,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,KAAqC;IAC/E,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IAE3B,2CAA2C;IAC3C,IAAI,aAAa,GAAkB,IAAI,CAAC;IACxC,IAAI,CAAC;QACH,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,cAAc,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;QACtD,aAAa,GAAG,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,C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C,aAAa,CAAC,CAAC,CAAC,iBAAiB;QAC/C,MAAM;QACN,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS;QACjC,WAAW,EAAE,IAAI,CAAC,GAAG,EAAE;KACxB,CAAC;AACJ,CAAC"}
@@ -1,33 +0,0 @@
1
- import type { EventLog } from '@jini-ai/daemon';
2
- /**
3
- * Default per-run retention cap applied when `SqliteEventLogOptions.maxEntriesPerRun` is
4
- * omitted — see that option's doc for why a durable adapter defaults to a bound instead of
5
- * mirroring the in-memory reference adapter's unbounded-by-default behavior.
6
- */
7
- export declare const DEFAULT_MAX_ENTRIES_PER_RUN = 2000;
8
- export interface SqliteEventLogOptions {
9
- /**
10
- * Maximum entries retained per run before the oldest are evicted. Defaults to
11
- * {@link DEFAULT_MAX_ENTRIES_PER_RUN} (2000) when omitted — unlike the in-memory reference
12
- * adapter (`@jini-ai/daemon`'s `createInMemoryEventLog`), where an omitted cap means unbounded,
13
- * a durable on-disk store defaults to a bounded retention window because unbounded persistent
14
- * growth is a real, unattended operational risk (disk exhaustion across long-lived runs) in a
15
- * way an in-process, GC'd, process-lifetime-bounded structure is not. Pass an explicit value
16
- * (larger, smaller, or `0`) to override the default in either direction — the caller then
17
- * owns that tradeoff explicitly. Must be a non-negative safe integer; anything else (negative,
18
- * fractional, `NaN`, `Infinity`) throws at construction time.
19
- */
20
- readonly maxEntriesPerRun?: number;
21
- }
22
- /** A `@jini-ai/daemon` `EventLog` backed by a `better-sqlite3` database, plus a `close()` to release the file handle. */
23
- export interface SqliteEventLog extends EventLog {
24
- close(): Promise<void>;
25
- }
26
- /**
27
- * Opens (creating if absent) a `better-sqlite3` database at `dbPath` and returns an `EventLog`
28
- * backed by it. Pass `':memory:'` for a non-durable in-process database (useful in tests that
29
- * want SQL semantics without a file). Schema creation is idempotent (`CREATE TABLE IF NOT
30
- * EXISTS`), so re-opening the same file resumes from whatever was durably committed.
31
- */
32
- export declare function createSqliteEventLog(dbPath: string, options?: SqliteEventLogOptions): SqliteEventLog;
33
- //# sourceMappingURL=event-log.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"event-log.d.ts","sourceRoot":"","sources":["../src/event-log.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EACV,QAAQ,EAIT,MAAM,iBAAiB,CAAC;AAEzB;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,OAAO,CAAC;AAEhD,MAAM,WAAW,qBAAqB;IACpC;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CACpC;AAwBD,yHAAyH;AACzH,MAAM,WAAW,cAAe,SAAQ,QAAQ;IAC9C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAyBD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,qBAA0B,GAClC,cAAc,CAuKhB"}
package/dist/event-log.js DELETED
@@ -1,191 +0,0 @@
1
- /**
2
- * `createSqliteEventLog` — the durable `EventLog` adapter (extraction-plan §8 task 8,
3
- * §2.6: "`@jini-ai/sqlite` is the default adapter... an adapter conformance suite covers
4
- * transactions/ordering/cursor-durability/cancellation/migrations").
5
- *
6
- * Implements `@jini-ai/daemon`'s `EventLog` port exactly (same method signatures, same
7
- * `dedupeKey` idempotency semantics, same distinguishable `'replay-gap'` result,
8
- * same never-reused monotonic per-run cursor allocation, same FIFO eviction at
9
- * `maxEntriesPerRun`) — see `createInMemoryEventLog` in `@jini-ai/daemon` for the
10
- * reference behavior this mirrors. `better-sqlite3` is synchronous; every public
11
- * method still returns a `Promise` per extraction-plan §2.6 ("ports are async-only
12
- * from day one... a real persistent adapter is a drop-in swap"), and every
13
- * multi-statement operation (`append`'s dedupe-check + insert + eviction) runs
14
- * inside a `better-sqlite3` transaction for atomicity.
15
- *
16
- * Two deliberate divergences from the in-memory reference adapter, both scoped to this durable
17
- * adapter only: (1) `maxEntriesPerRun` defaults to {@link DEFAULT_MAX_ENTRIES_PER_RUN} (2000)
18
- * instead of unbounded — see `SqliteEventLogOptions.maxEntriesPerRun`'s doc; (2) `replay`'s
19
- * `afterCursor` is validated up front and throws for anything other than `null` or a
20
- * non-negative-safe-integer string, instead of returning a `'invalid-cursor'` result — see
21
- * `assertValidReplayCursor`.
22
- */
23
- import Database from 'better-sqlite3';
24
- /**
25
- * Default per-run retention cap applied when `SqliteEventLogOptions.maxEntriesPerRun` is
26
- * omitted — see that option's doc for why a durable adapter defaults to a bound instead of
27
- * mirroring the in-memory reference adapter's unbounded-by-default behavior.
28
- */
29
- export const DEFAULT_MAX_ENTRIES_PER_RUN = 2000;
30
- /** @internal Validates and resolves `options.maxEntriesPerRun`, applying the documented default. */
31
- function resolveMaxEntriesPerRun(value) {
32
- if (value === undefined)
33
- return DEFAULT_MAX_ENTRIES_PER_RUN;
34
- if (!Number.isSafeInteger(value) || value < 0) {
35
- throw new Error(`createSqliteEventLog: options.maxEntriesPerRun must be a non-negative safe integer, got ${value}`);
36
- }
37
- return value;
38
- }
39
- /** @internal Validates a `replay(runId, afterCursor)` cursor. `null` ("from the beginning") is always valid. */
40
- function assertValidReplayCursor(afterCursor) {
41
- if (afterCursor === null)
42
- return;
43
- const n = Number(afterCursor);
44
- if (!Number.isSafeInteger(n) || n < 0) {
45
- throw new Error(`createSqliteEventLog: invalid replay cursor ${JSON.stringify(afterCursor)} — must be a non-negative safe integer string`);
46
- }
47
- }
48
- function rowToEntry(row) {
49
- return {
50
- id: String(row.cursor),
51
- event: row.event,
52
- data: JSON.parse(row.data),
53
- recordedAt: row.recorded_at,
54
- };
55
- }
56
- /**
57
- * Opens (creating if absent) a `better-sqlite3` database at `dbPath` and returns an `EventLog`
58
- * backed by it. Pass `':memory:'` for a non-durable in-process database (useful in tests that
59
- * want SQL semantics without a file). Schema creation is idempotent (`CREATE TABLE IF NOT
60
- * EXISTS`), so re-opening the same file resumes from whatever was durably committed.
61
- */
62
- export function createSqliteEventLog(dbPath, options = {}) {
63
- const maxEntriesPerRun = resolveMaxEntriesPerRun(options.maxEntriesPerRun);
64
- const db = new Database(dbPath);
65
- db.pragma('journal_mode = WAL');
66
- db.exec(`
67
- CREATE TABLE IF NOT EXISTS jini_event_log_runs (
68
- run_id TEXT PRIMARY KEY,
69
- next_cursor INTEGER NOT NULL
70
- );
71
-
72
- CREATE TABLE IF NOT EXISTS jini_event_log_entries (
73
- run_id TEXT NOT NULL,
74
- cursor INTEGER NOT NULL,
75
- event TEXT NOT NULL,
76
- data TEXT NOT NULL,
77
- recorded_at INTEGER NOT NULL,
78
- dedupe_key TEXT,
79
- PRIMARY KEY (run_id, cursor)
80
- );
81
-
82
- CREATE INDEX IF NOT EXISTS idx_jini_event_log_entries_dedupe
83
- ON jini_event_log_entries (run_id, dedupe_key)
84
- WHERE dedupe_key IS NOT NULL;
85
- `);
86
- const getRunStmt = db.prepare('SELECT run_id, next_cursor FROM jini_event_log_runs WHERE run_id = ?');
87
- const insertRunStmt = db.prepare('INSERT INTO jini_event_log_runs (run_id, next_cursor) VALUES (?, ?)');
88
- const updateNextCursorStmt = db.prepare('UPDATE jini_event_log_runs SET next_cursor = ? WHERE run_id = ?');
89
- const getByDedupeStmt = db.prepare('SELECT * FROM jini_event_log_entries WHERE run_id = ? AND dedupe_key = ?');
90
- const insertEntryStmt = db.prepare('INSERT INTO jini_event_log_entries (run_id, cursor, event, data, recorded_at, dedupe_key) VALUES (?, ?, ?, ?, ?, ?)');
91
- const countEntriesStmt = db.prepare('SELECT COUNT(*) AS count FROM jini_event_log_entries WHERE run_id = ?');
92
- const evictOldestStmt = db.prepare(`
93
- DELETE FROM jini_event_log_entries
94
- WHERE run_id = ? AND cursor IN (
95
- SELECT cursor FROM jini_event_log_entries WHERE run_id = ? ORDER BY cursor ASC LIMIT ?
96
- )
97
- `);
98
- const selectAllStmt = db.prepare('SELECT * FROM jini_event_log_entries WHERE run_id = ? ORDER BY cursor ASC');
99
- const selectAfterStmt = db.prepare('SELECT * FROM jini_event_log_entries WHERE run_id = ? AND cursor > ? ORDER BY cursor ASC');
100
- const selectOldestStmt = db.prepare('SELECT * FROM jini_event_log_entries WHERE run_id = ? ORDER BY cursor ASC LIMIT 1');
101
- const selectRunIdsStmt = db.prepare('SELECT run_id FROM jini_event_log_runs ORDER BY run_id ASC');
102
- const deleteRunEntriesStmt = db.prepare('DELETE FROM jini_event_log_entries WHERE run_id = ?');
103
- const deleteRunStmt = db.prepare('DELETE FROM jini_event_log_runs WHERE run_id = ?');
104
- // `db.transaction()` does not preserve a wrapped callback's own generic parameter (the
105
- // returned `Transaction` type is non-generic), so this runs on `unknown` payloads and the
106
- // public `append<Payload>` method below casts at the boundary — the same pattern
107
- // `createInMemoryEventLog` uses for its dedupe-hit early return.
108
- const appendTxn = db.transaction((input) => {
109
- let runRow = getRunStmt.get(input.runId);
110
- if (!runRow) {
111
- insertRunStmt.run(input.runId, 1);
112
- runRow = { run_id: input.runId, next_cursor: 1 };
113
- }
114
- if (input.dedupeKey !== undefined) {
115
- const existing = getByDedupeStmt.get(input.runId, input.dedupeKey);
116
- if (existing) {
117
- return rowToEntry(existing);
118
- }
119
- }
120
- const cursor = runRow.next_cursor;
121
- const recordedAt = Date.now();
122
- insertEntryStmt.run(input.runId, cursor, input.event, JSON.stringify(input.data ?? null), recordedAt, input.dedupeKey ?? null);
123
- updateNextCursorStmt.run(cursor + 1, input.runId);
124
- const { count } = countEntriesStmt.get(input.runId);
125
- if (count > maxEntriesPerRun) {
126
- evictOldestStmt.run(input.runId, input.runId, count - maxEntriesPerRun);
127
- }
128
- return {
129
- id: String(cursor),
130
- event: input.event,
131
- data: input.data,
132
- recordedAt,
133
- };
134
- });
135
- function replaySync(runId, afterCursor) {
136
- // Validated up front, independent of whether `runId` is known: a malformed cursor is a
137
- // caller/transport bug regardless of run state, so it throws rather than being folded into
138
- // (or masked by) an `'unknown-run'`/`'replay-gap'` result.
139
- assertValidReplayCursor(afterCursor);
140
- const runRow = getRunStmt.get(runId);
141
- if (!runRow) {
142
- return { kind: 'unknown-run' };
143
- }
144
- if (afterCursor === null) {
145
- const oldestRow = selectOldestStmt.get(runId);
146
- const truncated = oldestRow !== undefined && oldestRow.cursor > 1;
147
- return {
148
- kind: 'ok',
149
- entries: selectAllStmt.all(runId).map(rowToEntry),
150
- ...(truncated ? { truncated: true } : {}),
151
- };
152
- }
153
- // Safe: assertValidReplayCursor already proved this parses to a non-negative safe integer.
154
- const afterCursorNum = Number(afterCursor);
155
- const oldestRow = selectOldestStmt.get(runId);
156
- const oldestRetainedId = oldestRow ? oldestRow.cursor : runRow.next_cursor;
157
- if (afterCursorNum < oldestRetainedId - 1) {
158
- return {
159
- kind: 'replay-gap',
160
- requestedCursor: afterCursor,
161
- oldestAvailableCursor: oldestRow ? String(oldestRow.cursor) : null,
162
- };
163
- }
164
- return {
165
- kind: 'ok',
166
- entries: selectAfterStmt.all(runId, afterCursorNum).map(rowToEntry),
167
- };
168
- }
169
- const dropTxn = db.transaction((runId) => {
170
- deleteRunEntriesStmt.run(runId);
171
- deleteRunStmt.run(runId);
172
- });
173
- return {
174
- async append(input) {
175
- return appendTxn(input);
176
- },
177
- async replay(runId, afterCursor) {
178
- return replaySync(runId, afterCursor);
179
- },
180
- async listRunIds() {
181
- return selectRunIdsStmt.all().map((row) => row.run_id);
182
- },
183
- async drop(runId) {
184
- dropTxn(runId);
185
- },
186
- async close() {
187
- db.close();
188
- },
189
- };
190
- }
191
- //# sourceMappingURL=event-log.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"event-log.js","sourceRoot":"","sources":["../src/event-log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAQtC;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,CAAC;AAiBhD,oGAAoG;AACpG,SAAS,uBAAuB,CAAC,KAAyB;IACxD,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,2BAA2B,CAA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AC;IACJ,CAAC;IAED,MAAM,OAAO,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC,KAAa,EAAE,EAAE;QAC/C,oBAAoB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAChC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,KAAK,CAAC,MAAM,CAAU,KAAmC;YACvD,OAAO,SAAS,CAAC,KAAqC,CAA2B,CAAC;QACpF,CAAC;QACD,KAAK,CAAC,MAAM,CAAC,KAAa,EAAE,WAA0B;YACpD,OAAO,UAAU,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QACxC,CAAC;QACD,KAAK,CAAC,UAAU;YACd,OAAO,gBAAgB,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACzD,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,KAAa;YACtB,OAAO,CAAC,KAAK,CAAC,CAAC;QACjB,CAAC;QACD,KAAK,CAAC,KAAK;YACT,EAAE,CAAC,KAAK,EAAE,CAAC;QACb,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC"}
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC"}