@minnowdb/core 0.2.1 → 0.4.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 (270) hide show
  1. package/README.md +23 -32
  2. package/dist/block-format/block.d.ts +32 -13
  3. package/dist/block-format/block.js +179 -55
  4. package/dist/block-format/checksum.d.ts +2 -1
  5. package/dist/block-format/checksum.js +5 -2
  6. package/dist/block-format/codecs.d.ts +7 -2
  7. package/dist/block-format/codecs.js +53 -12
  8. package/dist/block-format/column.d.ts +3 -2
  9. package/dist/block-format/column.js +96 -30
  10. package/dist/block-format/index.d.ts +2 -2
  11. package/dist/block-format/index.js +2 -2
  12. package/dist/block-format/physical.d.ts +8 -2
  13. package/dist/block-format/physical.js +14 -6
  14. package/dist/block-format/types.d.ts +7 -3
  15. package/dist/block-format/types.js +0 -1
  16. package/dist/block-format/unicode.d.ts +11 -0
  17. package/dist/block-format/unicode.js +46 -0
  18. package/dist/date-value.d.ts +15 -0
  19. package/dist/date-value.js +64 -0
  20. package/dist/engine/artifact-cache.d.ts +2 -1
  21. package/dist/engine/artifact-cache.js +5 -1
  22. package/dist/engine/batch.d.ts +11 -3
  23. package/dist/engine/batch.js +17 -7
  24. package/dist/engine/buffered-writer.d.ts +2 -1
  25. package/dist/engine/buffered-writer.js +34 -9
  26. package/dist/engine/cache-limits.d.ts +25 -0
  27. package/dist/engine/cache-limits.js +25 -0
  28. package/dist/engine/catalog.d.ts +24 -5
  29. package/dist/engine/catalog.js +34 -7
  30. package/dist/engine/client.d.ts +29 -7
  31. package/dist/engine/client.js +216 -40
  32. package/dist/engine/database.d.ts +224 -39
  33. package/dist/engine/database.js +7475 -1539
  34. package/dist/engine/defaults.d.ts +4 -8
  35. package/dist/engine/defaults.js +46 -22
  36. package/dist/engine/errors.d.ts +19 -1
  37. package/dist/engine/errors.js +32 -2
  38. package/dist/engine/fts.d.ts +0 -6
  39. package/dist/engine/fts.js +41 -14
  40. package/dist/engine/group-index.d.ts +0 -1
  41. package/dist/engine/group-index.js +6 -11
  42. package/dist/engine/index.d.ts +16 -10
  43. package/dist/engine/index.js +12 -9
  44. package/dist/engine/join-index.d.ts +0 -1
  45. package/dist/engine/join-index.js +2 -2
  46. package/dist/engine/keyed-live.d.ts +57 -0
  47. package/dist/engine/keyed-live.js +226 -0
  48. package/dist/engine/live-api.d.ts +4 -0
  49. package/dist/engine/live-api.js +4 -0
  50. package/dist/engine/live.d.ts +43 -26
  51. package/dist/engine/live.js +504 -126
  52. package/dist/engine/memory.d.ts +2 -1
  53. package/dist/engine/memory.js +3 -2
  54. package/dist/engine/optimizer.d.ts +0 -1
  55. package/dist/engine/optimizer.js +262 -27
  56. package/dist/engine/query-api.d.ts +3 -0
  57. package/dist/engine/query-api.js +3 -0
  58. package/dist/engine/query-cache.d.ts +1 -2
  59. package/dist/engine/query-cache.js +7 -5
  60. package/dist/engine/query.d.ts +134 -29
  61. package/dist/engine/query.js +1668 -372
  62. package/dist/engine/result-wire.d.ts +0 -1
  63. package/dist/engine/result-wire.js +2 -2
  64. package/dist/engine/schema-wire.d.ts +6 -3
  65. package/dist/engine/schema-wire.js +40 -34
  66. package/dist/engine/schema.d.ts +156 -80
  67. package/dist/engine/schema.js +570 -108
  68. package/dist/engine/sort-keys.d.ts +4 -4
  69. package/dist/engine/sort-keys.js +44 -29
  70. package/dist/engine/sql-domains.d.ts +31 -0
  71. package/dist/engine/sql-domains.js +585 -0
  72. package/dist/engine/sql-driver.d.ts +19 -0
  73. package/dist/engine/sql-driver.js +1 -0
  74. package/dist/engine/sql-json.d.ts +7 -9
  75. package/dist/engine/sql-json.js +75 -15
  76. package/dist/engine/sql-semantics.d.ts +8 -3
  77. package/dist/engine/sql-semantics.js +458 -30
  78. package/dist/engine/typed-live.d.ts +67 -0
  79. package/dist/engine/typed-live.js +349 -0
  80. package/dist/engine/vector.d.ts +12 -2
  81. package/dist/engine/vector.js +635 -119
  82. package/dist/engine/worker-host.d.ts +9 -2
  83. package/dist/engine/worker-host.js +620 -152
  84. package/dist/engine/worker.d.ts +0 -1
  85. package/dist/engine/worker.js +3 -3
  86. package/dist/engine/write-block-planner.d.ts +18 -0
  87. package/dist/engine/write-block-planner.js +112 -0
  88. package/dist/index.d.ts +0 -1
  89. package/dist/index.js +0 -1
  90. package/dist/plan/index.d.ts +3 -4
  91. package/dist/plan/index.js +3 -4
  92. package/dist/storage/index.d.ts +1 -1
  93. package/dist/storage/index.js +1 -1
  94. package/dist/storage/indexeddb.d.ts +99 -51
  95. package/dist/storage/indexeddb.js +13448 -2660
  96. package/dist/storage/memory.d.ts +64 -57
  97. package/dist/storage/memory.js +1042 -128
  98. package/dist/storage/opfs/files.d.ts +18 -7
  99. package/dist/storage/opfs/files.js +115 -28
  100. package/dist/storage/opfs/index.d.ts +1 -1
  101. package/dist/storage/opfs/index.js +1 -1
  102. package/dist/storage/opfs/leader.d.ts +409 -75
  103. package/dist/storage/opfs/leader.js +4621 -650
  104. package/dist/storage/opfs/rpc.d.ts +15 -3
  105. package/dist/storage/opfs/rpc.js +224 -2
  106. package/dist/storage/opfs/snapshot-ledger.d.ts +40 -0
  107. package/dist/storage/opfs/snapshot-ledger.js +281 -0
  108. package/dist/storage/opfs/store.d.ts +33 -99
  109. package/dist/storage/opfs/store.js +453 -364
  110. package/dist/storage/persistence.d.ts +37 -0
  111. package/dist/storage/persistence.js +78 -0
  112. package/dist/storage/snapshot-stream.d.ts +24 -0
  113. package/dist/storage/snapshot-stream.js +897 -0
  114. package/dist/storage/snapshot.d.ts +9 -85
  115. package/dist/storage/snapshot.js +33 -265
  116. package/dist/storage/toolkit/extents.d.ts +41 -7
  117. package/dist/storage/toolkit/extents.js +402 -39
  118. package/dist/storage/toolkit/index.d.ts +4 -5
  119. package/dist/storage/toolkit/index.js +28 -4
  120. package/dist/storage/toolkit/record-core.d.ts +182 -55
  121. package/dist/storage/toolkit/record-core.js +6158 -1331
  122. package/dist/storage/toolkit/sync-file.d.ts +10 -1
  123. package/dist/storage/toolkit/sync-file.js +50 -2
  124. package/dist/storage/toolkit/wal.d.ts +23 -5
  125. package/dist/storage/toolkit/wal.js +89 -27
  126. package/dist/storage/toolkit/wire.d.ts +15 -2
  127. package/dist/storage/toolkit/wire.js +199 -10
  128. package/dist/storage/types.d.ts +1439 -204
  129. package/dist/storage/types.js +1745 -141
  130. package/dist/testing/block-store-conformance.d.ts +0 -1
  131. package/dist/testing/block-store-conformance.js +1009 -119
  132. package/dist/testing/index.d.ts +46 -26
  133. package/dist/testing/index.js +112 -57
  134. package/dist/testing/opfs-shim.d.ts +13 -3
  135. package/dist/testing/opfs-shim.js +40 -6
  136. package/dist/testing/simulator.d.ts +97 -0
  137. package/dist/testing/simulator.js +591 -0
  138. package/dist/testing/sqllogictest.d.ts +89 -0
  139. package/dist/testing/sqllogictest.js +434 -0
  140. package/dist/transactions/index.d.ts +92 -16
  141. package/dist/transactions/index.js +1074 -236
  142. package/dist/worker-protocol/index.d.ts +3 -2
  143. package/dist/worker-protocol/index.js +2 -5
  144. package/package.json +53 -3
  145. package/postgres-feature-profile.json +223 -0
  146. package/sql-feature-matrix.json +172 -252
  147. package/dist/block-format/block.d.ts.map +0 -1
  148. package/dist/block-format/block.js.map +0 -1
  149. package/dist/block-format/checksum.d.ts.map +0 -1
  150. package/dist/block-format/checksum.js.map +0 -1
  151. package/dist/block-format/codecs.d.ts.map +0 -1
  152. package/dist/block-format/codecs.js.map +0 -1
  153. package/dist/block-format/column.d.ts.map +0 -1
  154. package/dist/block-format/column.js.map +0 -1
  155. package/dist/block-format/index.d.ts.map +0 -1
  156. package/dist/block-format/index.js.map +0 -1
  157. package/dist/block-format/physical.d.ts.map +0 -1
  158. package/dist/block-format/physical.js.map +0 -1
  159. package/dist/block-format/types.d.ts.map +0 -1
  160. package/dist/block-format/types.js.map +0 -1
  161. package/dist/engine/artifact-cache.d.ts.map +0 -1
  162. package/dist/engine/artifact-cache.js.map +0 -1
  163. package/dist/engine/batch.d.ts.map +0 -1
  164. package/dist/engine/batch.js.map +0 -1
  165. package/dist/engine/buffered-writer.d.ts.map +0 -1
  166. package/dist/engine/buffered-writer.js.map +0 -1
  167. package/dist/engine/catalog.d.ts.map +0 -1
  168. package/dist/engine/catalog.js.map +0 -1
  169. package/dist/engine/client.d.ts.map +0 -1
  170. package/dist/engine/client.js.map +0 -1
  171. package/dist/engine/coordinator.d.ts +0 -17
  172. package/dist/engine/coordinator.d.ts.map +0 -1
  173. package/dist/engine/coordinator.js +0 -60
  174. package/dist/engine/coordinator.js.map +0 -1
  175. package/dist/engine/database.d.ts.map +0 -1
  176. package/dist/engine/database.js.map +0 -1
  177. package/dist/engine/defaults.d.ts.map +0 -1
  178. package/dist/engine/defaults.js.map +0 -1
  179. package/dist/engine/errors.d.ts.map +0 -1
  180. package/dist/engine/errors.js.map +0 -1
  181. package/dist/engine/fts.d.ts.map +0 -1
  182. package/dist/engine/fts.js.map +0 -1
  183. package/dist/engine/group-index.d.ts.map +0 -1
  184. package/dist/engine/group-index.js.map +0 -1
  185. package/dist/engine/index.d.ts.map +0 -1
  186. package/dist/engine/index.js.map +0 -1
  187. package/dist/engine/join-index.d.ts.map +0 -1
  188. package/dist/engine/join-index.js.map +0 -1
  189. package/dist/engine/live.d.ts.map +0 -1
  190. package/dist/engine/live.js.map +0 -1
  191. package/dist/engine/memory.d.ts.map +0 -1
  192. package/dist/engine/memory.js.map +0 -1
  193. package/dist/engine/optimizer.d.ts.map +0 -1
  194. package/dist/engine/optimizer.js.map +0 -1
  195. package/dist/engine/query-cache.d.ts.map +0 -1
  196. package/dist/engine/query-cache.js.map +0 -1
  197. package/dist/engine/query.d.ts.map +0 -1
  198. package/dist/engine/query.js.map +0 -1
  199. package/dist/engine/result-wire.d.ts.map +0 -1
  200. package/dist/engine/result-wire.js.map +0 -1
  201. package/dist/engine/schema-wire.d.ts.map +0 -1
  202. package/dist/engine/schema-wire.js.map +0 -1
  203. package/dist/engine/schema.d.ts.map +0 -1
  204. package/dist/engine/schema.js.map +0 -1
  205. package/dist/engine/sort-keys.d.ts.map +0 -1
  206. package/dist/engine/sort-keys.js.map +0 -1
  207. package/dist/engine/sql-json.d.ts.map +0 -1
  208. package/dist/engine/sql-json.js.map +0 -1
  209. package/dist/engine/sql-semantics.d.ts.map +0 -1
  210. package/dist/engine/sql-semantics.js.map +0 -1
  211. package/dist/engine/vector.d.ts.map +0 -1
  212. package/dist/engine/vector.js.map +0 -1
  213. package/dist/engine/worker-host.d.ts.map +0 -1
  214. package/dist/engine/worker-host.js.map +0 -1
  215. package/dist/engine/worker.d.ts.map +0 -1
  216. package/dist/engine/worker.js.map +0 -1
  217. package/dist/index.d.ts.map +0 -1
  218. package/dist/index.js.map +0 -1
  219. package/dist/plan/index.d.ts.map +0 -1
  220. package/dist/plan/index.js.map +0 -1
  221. package/dist/storage/fixture-shape.d.ts +0 -42
  222. package/dist/storage/fixture-shape.d.ts.map +0 -1
  223. package/dist/storage/fixture-shape.js +0 -146
  224. package/dist/storage/fixture-shape.js.map +0 -1
  225. package/dist/storage/index.d.ts.map +0 -1
  226. package/dist/storage/index.js.map +0 -1
  227. package/dist/storage/indexeddb.d.ts.map +0 -1
  228. package/dist/storage/indexeddb.js.map +0 -1
  229. package/dist/storage/memory.d.ts.map +0 -1
  230. package/dist/storage/memory.js.map +0 -1
  231. package/dist/storage/opfs/files.d.ts.map +0 -1
  232. package/dist/storage/opfs/files.js.map +0 -1
  233. package/dist/storage/opfs/index.d.ts.map +0 -1
  234. package/dist/storage/opfs/index.js.map +0 -1
  235. package/dist/storage/opfs/leader.d.ts.map +0 -1
  236. package/dist/storage/opfs/leader.js.map +0 -1
  237. package/dist/storage/opfs/rpc.d.ts.map +0 -1
  238. package/dist/storage/opfs/rpc.js.map +0 -1
  239. package/dist/storage/opfs/store.d.ts.map +0 -1
  240. package/dist/storage/opfs/store.js.map +0 -1
  241. package/dist/storage/snapshot.d.ts.map +0 -1
  242. package/dist/storage/snapshot.js.map +0 -1
  243. package/dist/storage/toolkit/extents.d.ts.map +0 -1
  244. package/dist/storage/toolkit/extents.js.map +0 -1
  245. package/dist/storage/toolkit/index.d.ts.map +0 -1
  246. package/dist/storage/toolkit/index.js.map +0 -1
  247. package/dist/storage/toolkit/record-core.d.ts.map +0 -1
  248. package/dist/storage/toolkit/record-core.js.map +0 -1
  249. package/dist/storage/toolkit/sync-file.d.ts.map +0 -1
  250. package/dist/storage/toolkit/sync-file.js.map +0 -1
  251. package/dist/storage/toolkit/wal.d.ts.map +0 -1
  252. package/dist/storage/toolkit/wal.js.map +0 -1
  253. package/dist/storage/toolkit/wire.d.ts.map +0 -1
  254. package/dist/storage/toolkit/wire.js.map +0 -1
  255. package/dist/storage/types.d.ts.map +0 -1
  256. package/dist/storage/types.js.map +0 -1
  257. package/dist/testing/block-store-conformance.d.ts.map +0 -1
  258. package/dist/testing/block-store-conformance.js.map +0 -1
  259. package/dist/testing/index.d.ts.map +0 -1
  260. package/dist/testing/index.js.map +0 -1
  261. package/dist/testing/opfs-shim.d.ts.map +0 -1
  262. package/dist/testing/opfs-shim.js.map +0 -1
  263. package/dist/testing/seeds.d.ts +0 -11
  264. package/dist/testing/seeds.d.ts.map +0 -1
  265. package/dist/testing/seeds.js +0 -50
  266. package/dist/testing/seeds.js.map +0 -1
  267. package/dist/transactions/index.d.ts.map +0 -1
  268. package/dist/transactions/index.js.map +0 -1
  269. package/dist/worker-protocol/index.d.ts.map +0 -1
  270. package/dist/worker-protocol/index.js.map +0 -1
@@ -1,18 +1,20 @@
1
- import { type BeginTransactionInput, type BeginTransactionResult, type BlockStore, type BlockWrite, type CatalogProbe, type CommitTransactionInput, type CompactionJobRecord, type CompactionJobRecordUpdate, type CreateGarbageCollectionJobInput, type FtsCandidates, type FtsColumnIndexRecord, type GarbageCollectionJobRecord, type GarbageCollectionStepResult, type LeaseRecord, type Manifest, type ManifestSummary, type PublishManifestInput, type QueryCatalogState, type RowIdRange, type RunGarbageCollectionStepInput, type SegmentRecord, type StageTransactionArtifactsInput, type StoragePage, type TableColumnRecord, type TableRecord, type TempOwnerRecord, type TempRunPage, type TransactionRecord, type TransactionRecordUpdate, type TriggerRecord, type FtsPosting, type WriteTransactionInput } from "../types.js";
2
- import type { DatabaseSnapshot, SnapshotLoadProgress } from "../snapshot.js";
1
+ import { type BlockStore, type TempRunPage } from "../types.js";
3
2
  export interface OpfsBlockStoreOptions {
4
3
  /** Databases live under `minnowdb/<name>` in the origin's private file system. */
5
4
  name: string;
6
5
  /**
7
- * `"relaxed"` (the default, matching the IndexedDB store) lets the operating system
8
- * schedule the final flush to disk; `"strict"` flushes every log frame and payload write
9
- * before the operation resolves.
6
+ * `"strict"` (the default) flushes the payload before flushing its publishing WAL frame,
7
+ * both before the operation resolves. `"relaxed"` writes the complete payload and
8
+ * WAL frame before resolving but lets the operating system schedule their final flush; a
9
+ * power loss may roll back a fully consistent suffix.
10
10
  */
11
11
  durability?: "relaxed" | "strict";
12
12
  /** The storage root; defaults to `navigator.storage.getDirectory()`. Tests inject a shim. */
13
13
  root?: FileSystemDirectoryHandle;
14
14
  /** @internal Test seam: checkpoint after this many WAL entries (default 1024). */
15
15
  checkpointEntries?: number;
16
+ /** @internal Test seam: cleanup-debt backpressure limit (default 64 MiB). */
17
+ cleanupLimitBytes?: number;
16
18
  /** @internal Test seam: how long a follower waits for the leader (default 1000ms). */
17
19
  rpcTimeoutMs?: number;
18
20
  }
@@ -31,118 +33,51 @@ export interface OpfsBlockStoreOptions {
31
33
  * Leadership is the write-ahead log's own exclusive sync-access handle — enforced by the
32
34
  * browser against the actual resource, released the instant its holder dies. Elections are
33
35
  * simply attempts to open it. Correctness never rides on a message: an operation is
34
- * acknowledged only after the leader's WAL holds it, a lost message costs a retry (request
35
- * ids deduplicate retries while the same leader serves), and a dead leader costs a failover
36
- * in which the next acquirer replays checkpoint-plus-WAL. A retry that crosses a failover is
37
- * the one case a duplicate can execute the same "committed but the response was lost"
38
- * class the IndexedDB store has and it resolves the same way: compare-and-swap operations
39
- * surface a conflict the engine's recovery already reconciles. The channel affects how fast
40
- * multi-tab work moves, never whether it is right.
36
+ * acknowledged only after the leader's WAL holds it. Request ids deduplicate delivery retries
37
+ * while the same leader serves. A dead leader costs a failover in which the next acquirer
38
+ * replays checkpoint-plus-WAL; an in-flight read moves to it, while an in-flight mutation fails
39
+ * with `OpfsUncertainOutcomeError` instead of risking a second execution after a lost reply.
40
+ * The channel affects how fast multi-tab work moves, never whether it is right.
41
41
  *
42
42
  * `setForeground(true)` marks this connection as the one the user is looking at; a background
43
43
  * leader yields to a foreground bidder, so the tab doing the work is normally the tab holding
44
44
  * the microsecond-fast path.
45
45
  */
46
- export declare class OpfsBlockStore implements BlockStore {
46
+ export interface OpfsBlockStore extends Required<BlockStore> {
47
+ }
48
+ export declare class OpfsBlockStore {
47
49
  #private;
50
+ readonly liveQueryChannelName: string;
48
51
  private constructor();
49
52
  static open(options: OpfsBlockStoreOptions): Promise<OpfsBlockStore>;
50
53
  /** Marks this connection as the one the user is looking at — a leadership preference. */
51
54
  setForeground(foreground: boolean): void;
52
- addBlock(id: string, bytes: Uint8Array): Promise<void>;
53
- addBlocks(blocks: readonly BlockWrite[]): Promise<void>;
54
- getBlock(id: string): Promise<Uint8Array | undefined>;
55
- getBlocks(ids: readonly string[]): Promise<Array<Uint8Array | undefined>>;
56
- removeBlock(id: string): Promise<void>;
57
- listBlockIds(): Promise<string[]>;
58
55
  putTempRunPage(page: TempRunPage): Promise<void>;
59
56
  putTempRunPages(pages: readonly TempRunPage[]): Promise<void>;
60
57
  getTempRunPage(ownerId: string, runId: string, pageIndex: number): Promise<Uint8Array | undefined>;
61
58
  removeTempRun(ownerId: string, runId: string): Promise<void>;
62
- removeTempOwner(ownerId: string): Promise<void>;
63
- createTempOwner(record: TempOwnerRecord): Promise<void>;
64
- getTempOwner(ownerId: string): Promise<TempOwnerRecord | undefined>;
65
- renewTempOwner(ownerId: string, expectedRevision: number, expiresAt: string): Promise<TempOwnerRecord>;
66
- removeTempOwnerIfExpired(ownerId: string, expiresAtCutoff: string): Promise<boolean>;
67
- listTempOwnerIdsPage(afterOwnerId: string | null, limit: number): Promise<StoragePage<string, string>>;
68
- addTable(record: TableRecord): Promise<void>;
69
- getTable(id: string): Promise<TableRecord | undefined>;
70
- getTableByName(name: string): Promise<TableRecord | undefined>;
71
- listTables(): Promise<TableRecord[]>;
72
- updateTable(id: string, expectedRevision: number, update: {
73
- columns?: TableColumnRecord[];
74
- ftsColumns?: Record<string, FtsColumnIndexRecord> | null;
75
- triggers?: TriggerRecord[] | null;
76
- }): Promise<TableRecord>;
77
- removeTable(id: string, expectedRevision: number): Promise<void>;
78
- writeFtsBase(tableId: string, columnId: string, input: {
79
- coversVersion: number;
80
- chunks: FtsPosting[][];
81
- totalTokens: number;
82
- }): Promise<void>;
83
- readFtsCandidates(tableId: string, columnId: string, terms: ReadonlyArray<{
84
- term: string;
85
- prefix: boolean;
86
- }>, upToVersion: number): Promise<FtsCandidates & {
87
- deltaChunkCount: number;
88
- totalTokens: number;
89
- coversVersion: number;
90
- }>;
91
- addSegment(record: SegmentRecord): Promise<void>;
92
- getSegment(id: string): Promise<SegmentRecord | undefined>;
93
- listSegments(tableId?: string): Promise<SegmentRecord[]>;
94
- removeSegment(id: string): Promise<void>;
95
- reserveRowIds(tableId: string, count: number): Promise<RowIdRange>;
96
- reserveAutoIncrement(tableId: string, columnId: string, count: number, atLeast?: bigint): Promise<RowIdRange>;
97
- getExistingUniqueKeys(tableId: string, keyTokens: readonly string[]): Promise<string[]>;
98
- getCurrentManifest(): Promise<Manifest | undefined>;
99
- getCurrentManifestVersion(): Promise<number | null>;
100
- getCatalogProbe(): Promise<CatalogProbe>;
101
- getQueryCatalogState(tableNames: readonly string[]): Promise<QueryCatalogState>;
102
- getManifest(version: number): Promise<Manifest | undefined>;
103
- listManifests(): Promise<Manifest[]>;
104
- listManifestPage(afterVersion: number | null, limit: number): Promise<StoragePage<Manifest, number>>;
105
- publishManifest(input: PublishManifestInput): Promise<Manifest>;
106
- createTransaction(record: TransactionRecord): Promise<void>;
107
- beginTransaction(input: BeginTransactionInput): Promise<BeginTransactionResult>;
108
- getTransaction(id: string): Promise<TransactionRecord | undefined>;
109
- getTransactions(ids: readonly string[]): Promise<Array<TransactionRecord | undefined>>;
110
- listTransactions(): Promise<TransactionRecord[]>;
111
- listTransactionPage(afterId: string | null, limit: number): Promise<StoragePage<TransactionRecord, string>>;
112
- updateTransaction(id: string, expectedRevision: number, update: TransactionRecordUpdate): Promise<TransactionRecord>;
113
- stageTransactionArtifacts(input: StageTransactionArtifactsInput): Promise<TransactionRecord>;
114
- commitTransaction(input: CommitTransactionInput): Promise<ManifestSummary>;
115
- writeTransaction(input: WriteTransactionInput): Promise<ManifestSummary>;
116
- createLease(record: LeaseRecord): Promise<void>;
117
- getLease(id: string): Promise<LeaseRecord | undefined>;
118
- listLeases(): Promise<LeaseRecord[]>;
119
- renewLease(id: string, expectedRevision: number, expiresAt: string): Promise<LeaseRecord>;
120
- moveLease(id: string, expectedRevision: number, manifestVersion: number | null, expiresAt: string): Promise<LeaseRecord>;
121
- removeLeaseIfExpired(id: string, expectedRevision: number, expiresAtCutoff: string): Promise<boolean>;
122
- removeLease(id: string): Promise<void>;
123
- createCompactionJob(record: CompactionJobRecord): Promise<void>;
124
- getCompactionJob(id: string): Promise<CompactionJobRecord | undefined>;
125
- listCompactionJobs(tableId?: string): Promise<CompactionJobRecord[]>;
126
- listCompactionJobPage(afterId: string | null, limit: number): Promise<StoragePage<CompactionJobRecord, string>>;
127
- updateCompactionJob(id: string, expectedRevision: number, update: CompactionJobRecordUpdate): Promise<CompactionJobRecord>;
128
- cancelCompactionJob(id: string, expectedRevision: number, cancelledAt: string): Promise<CompactionJobRecord>;
129
- removeCompactionJob(id: string): Promise<void>;
130
- createGarbageCollectionJob(input: CreateGarbageCollectionJobInput): Promise<GarbageCollectionJobRecord>;
131
- getGarbageCollectionJob(id: string): Promise<GarbageCollectionJobRecord | undefined>;
132
- listGarbageCollectionJobs(): Promise<GarbageCollectionJobRecord[]>;
133
- runGarbageCollectionStep(input: RunGarbageCollectionStepInput): Promise<GarbageCollectionStepResult>;
134
- removeGarbageCollectionJob(id: string): Promise<void>;
135
- removePrunedManifestRecords(): Promise<number>;
136
- getLogicalStorageBytes(): Promise<number>;
137
- exportSnapshot(): Promise<DatabaseSnapshot>;
138
- importSnapshot(snapshot: DatabaseSnapshot, options?: {
139
- onProgress?: (progress: SnapshotLoadProgress) => void;
140
- }): Promise<void>;
59
+ /** @internal Shared implementation installed for every ordinary RPC method below. */
60
+ _dispatchGenerated(method: string, args: unknown[]): Promise<unknown>;
141
61
  close(): void;
142
62
  /** Test-only: whether this connection currently holds the database's handles. */
143
63
  _isLeaderForTests(): boolean;
144
64
  /** Test-only: the id that names this connection's inbox channel. */
145
65
  _instanceIdForTests(): string;
66
+ /** Test-only: simulates an acknowledgement lost after the served operation settles. */
67
+ _dropNextRpcResultForTests(): void;
68
+ /** Test-only: holds newly admitted served mutations until the returned release is called. */
69
+ _holdServedMutationsForTests(): () => void;
70
+ /** Test-only: retransmits the oldest request with its stable deduplication identity. */
71
+ _resendOldestPendingForTests(): void;
72
+ /** Test-only counters that pin the connection's bounded RPC state and close-time cleanup. */
73
+ _residentStateForTests(): {
74
+ answerChannels: number;
75
+ dedupeEntries: number;
76
+ inFlightMutations: number;
77
+ pendingRequests: number;
78
+ retainedRpcBytes: number;
79
+ closed: boolean;
80
+ };
146
81
  /** Test-only: what tab death looks like — locks release, nothing flushes, no goodbyes. */
147
82
  _crashForTests(): void;
148
83
  }
@@ -151,4 +86,3 @@ export declare function deleteOpfsDatabase(options: {
151
86
  name: string;
152
87
  root?: FileSystemDirectoryHandle;
153
88
  }): Promise<void>;
154
- //# sourceMappingURL=store.d.ts.map