@minnowdb/core 0.3.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (276) hide show
  1. package/README.md +4 -2
  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 +0 -1
  21. package/dist/engine/artifact-cache.js +0 -1
  22. package/dist/engine/batch.d.ts +5 -2
  23. package/dist/engine/batch.js +0 -1
  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 +5 -6
  29. package/dist/engine/catalog.js +5 -5
  30. package/dist/engine/client.d.ts +27 -7
  31. package/dist/engine/client.js +197 -31
  32. package/dist/engine/database.d.ts +161 -38
  33. package/dist/engine/database.js +4326 -1523
  34. package/dist/engine/defaults.d.ts +0 -1
  35. package/dist/engine/defaults.js +2 -4
  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 +39 -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 -11
  43. package/dist/engine/index.js +12 -10
  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 +499 -129
  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 +4 -4
  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 +0 -1
  59. package/dist/engine/query-cache.js +4 -4
  60. package/dist/engine/query.d.ts +4 -7
  61. package/dist/engine/query.js +348 -155
  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 +1 -2
  65. package/dist/engine/schema-wire.js +0 -1
  66. package/dist/engine/schema.d.ts +3 -8
  67. package/dist/engine/schema.js +41 -24
  68. package/dist/engine/sort-keys.d.ts +0 -1
  69. package/dist/engine/sort-keys.js +2 -2
  70. package/dist/engine/sql-domains.d.ts +6 -1
  71. package/dist/engine/sql-domains.js +209 -45
  72. package/dist/engine/sql-driver.d.ts +2 -2
  73. package/dist/engine/sql-driver.js +0 -1
  74. package/dist/engine/sql-json.d.ts +0 -1
  75. package/dist/engine/sql-json.js +53 -7
  76. package/dist/engine/sql-semantics.d.ts +8 -5
  77. package/dist/engine/sql-semantics.js +427 -65
  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 +7 -1
  81. package/dist/engine/vector.js +202 -58
  82. package/dist/engine/worker-host.d.ts +8 -2
  83. package/dist/engine/worker-host.js +616 -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 +0 -1
  91. package/dist/plan/index.js +0 -1
  92. package/dist/storage/index.d.ts +1 -1
  93. package/dist/storage/index.js +1 -1
  94. package/dist/storage/indexeddb.d.ts +74 -65
  95. package/dist/storage/indexeddb.js +12301 -2076
  96. package/dist/storage/memory.d.ts +56 -66
  97. package/dist/storage/memory.js +1004 -139
  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 +403 -91
  103. package/dist/storage/opfs/leader.js +4318 -602
  104. package/dist/storage/opfs/rpc.d.ts +15 -3
  105. package/dist/storage/opfs/rpc.js +223 -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 +26 -121
  109. package/dist/storage/opfs/store.js +436 -388
  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 -99
  115. package/dist/storage/snapshot.js +33 -309
  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 +3 -4
  119. package/dist/storage/toolkit/index.js +27 -3
  120. package/dist/storage/toolkit/record-core.d.ts +174 -61
  121. package/dist/storage/toolkit/record-core.js +5401 -849
  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 +4 -6
  127. package/dist/storage/toolkit/wire.js +80 -25
  128. package/dist/storage/types.d.ts +1271 -218
  129. package/dist/storage/types.js +1471 -138
  130. package/dist/testing/block-store-conformance.d.ts +0 -1
  131. package/dist/testing/block-store-conformance.js +877 -138
  132. package/dist/testing/index.d.ts +42 -31
  133. package/dist/testing/index.js +100 -68
  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 +0 -1
  137. package/dist/testing/simulator.js +43 -12
  138. package/dist/testing/sqllogictest.d.ts +0 -1
  139. package/dist/testing/sqllogictest.js +0 -1
  140. package/dist/transactions/index.d.ts +81 -20
  141. package/dist/transactions/index.js +1050 -268
  142. package/dist/worker-protocol/index.d.ts +3 -2
  143. package/dist/worker-protocol/index.js +2 -5
  144. package/package.json +49 -1
  145. package/dist/block-format/block.d.ts.map +0 -1
  146. package/dist/block-format/block.js.map +0 -1
  147. package/dist/block-format/checksum.d.ts.map +0 -1
  148. package/dist/block-format/checksum.js.map +0 -1
  149. package/dist/block-format/codecs.d.ts.map +0 -1
  150. package/dist/block-format/codecs.js.map +0 -1
  151. package/dist/block-format/column.d.ts.map +0 -1
  152. package/dist/block-format/column.js.map +0 -1
  153. package/dist/block-format/index.d.ts.map +0 -1
  154. package/dist/block-format/index.js.map +0 -1
  155. package/dist/block-format/physical.d.ts.map +0 -1
  156. package/dist/block-format/physical.js.map +0 -1
  157. package/dist/block-format/types.d.ts.map +0 -1
  158. package/dist/block-format/types.js.map +0 -1
  159. package/dist/engine/artifact-cache.d.ts.map +0 -1
  160. package/dist/engine/artifact-cache.js.map +0 -1
  161. package/dist/engine/batch.d.ts.map +0 -1
  162. package/dist/engine/batch.js.map +0 -1
  163. package/dist/engine/buffered-writer.d.ts.map +0 -1
  164. package/dist/engine/buffered-writer.js.map +0 -1
  165. package/dist/engine/catalog.d.ts.map +0 -1
  166. package/dist/engine/catalog.js.map +0 -1
  167. package/dist/engine/client.d.ts.map +0 -1
  168. package/dist/engine/client.js.map +0 -1
  169. package/dist/engine/coordinator.d.ts +0 -17
  170. package/dist/engine/coordinator.d.ts.map +0 -1
  171. package/dist/engine/coordinator.js +0 -60
  172. package/dist/engine/coordinator.js.map +0 -1
  173. package/dist/engine/database.d.ts.map +0 -1
  174. package/dist/engine/database.js.map +0 -1
  175. package/dist/engine/defaults.d.ts.map +0 -1
  176. package/dist/engine/defaults.js.map +0 -1
  177. package/dist/engine/errors.d.ts.map +0 -1
  178. package/dist/engine/errors.js.map +0 -1
  179. package/dist/engine/fts.d.ts.map +0 -1
  180. package/dist/engine/fts.js.map +0 -1
  181. package/dist/engine/group-index.d.ts.map +0 -1
  182. package/dist/engine/group-index.js.map +0 -1
  183. package/dist/engine/index.d.ts.map +0 -1
  184. package/dist/engine/index.js.map +0 -1
  185. package/dist/engine/join-index.d.ts.map +0 -1
  186. package/dist/engine/join-index.js.map +0 -1
  187. package/dist/engine/live.d.ts.map +0 -1
  188. package/dist/engine/live.js.map +0 -1
  189. package/dist/engine/memory.d.ts.map +0 -1
  190. package/dist/engine/memory.js.map +0 -1
  191. package/dist/engine/optimizer.d.ts.map +0 -1
  192. package/dist/engine/optimizer.js.map +0 -1
  193. package/dist/engine/query-cache.d.ts.map +0 -1
  194. package/dist/engine/query-cache.js.map +0 -1
  195. package/dist/engine/query.d.ts.map +0 -1
  196. package/dist/engine/query.js.map +0 -1
  197. package/dist/engine/result-wire.d.ts.map +0 -1
  198. package/dist/engine/result-wire.js.map +0 -1
  199. package/dist/engine/schema-wire.d.ts.map +0 -1
  200. package/dist/engine/schema-wire.js.map +0 -1
  201. package/dist/engine/schema.d.ts.map +0 -1
  202. package/dist/engine/schema.js.map +0 -1
  203. package/dist/engine/sort-keys.d.ts.map +0 -1
  204. package/dist/engine/sort-keys.js.map +0 -1
  205. package/dist/engine/sql-domains.d.ts.map +0 -1
  206. package/dist/engine/sql-domains.js.map +0 -1
  207. package/dist/engine/sql-driver.d.ts.map +0 -1
  208. package/dist/engine/sql-driver.js.map +0 -1
  209. package/dist/engine/sql-json.d.ts.map +0 -1
  210. package/dist/engine/sql-json.js.map +0 -1
  211. package/dist/engine/sql-semantics.d.ts.map +0 -1
  212. package/dist/engine/sql-semantics.js.map +0 -1
  213. package/dist/engine/vector.d.ts.map +0 -1
  214. package/dist/engine/vector.js.map +0 -1
  215. package/dist/engine/worker-host.d.ts.map +0 -1
  216. package/dist/engine/worker-host.js.map +0 -1
  217. package/dist/engine/worker.d.ts.map +0 -1
  218. package/dist/engine/worker.js.map +0 -1
  219. package/dist/index.d.ts.map +0 -1
  220. package/dist/index.js.map +0 -1
  221. package/dist/plan/index.d.ts.map +0 -1
  222. package/dist/plan/index.js.map +0 -1
  223. package/dist/storage/fixture-shape.d.ts +0 -42
  224. package/dist/storage/fixture-shape.d.ts.map +0 -1
  225. package/dist/storage/fixture-shape.js +0 -146
  226. package/dist/storage/fixture-shape.js.map +0 -1
  227. package/dist/storage/index.d.ts.map +0 -1
  228. package/dist/storage/index.js.map +0 -1
  229. package/dist/storage/indexeddb.d.ts.map +0 -1
  230. package/dist/storage/indexeddb.js.map +0 -1
  231. package/dist/storage/memory.d.ts.map +0 -1
  232. package/dist/storage/memory.js.map +0 -1
  233. package/dist/storage/opfs/files.d.ts.map +0 -1
  234. package/dist/storage/opfs/files.js.map +0 -1
  235. package/dist/storage/opfs/index.d.ts.map +0 -1
  236. package/dist/storage/opfs/index.js.map +0 -1
  237. package/dist/storage/opfs/leader.d.ts.map +0 -1
  238. package/dist/storage/opfs/leader.js.map +0 -1
  239. package/dist/storage/opfs/rpc.d.ts.map +0 -1
  240. package/dist/storage/opfs/rpc.js.map +0 -1
  241. package/dist/storage/opfs/store.d.ts.map +0 -1
  242. package/dist/storage/opfs/store.js.map +0 -1
  243. package/dist/storage/snapshot.d.ts.map +0 -1
  244. package/dist/storage/snapshot.js.map +0 -1
  245. package/dist/storage/toolkit/extents.d.ts.map +0 -1
  246. package/dist/storage/toolkit/extents.js.map +0 -1
  247. package/dist/storage/toolkit/index.d.ts.map +0 -1
  248. package/dist/storage/toolkit/index.js.map +0 -1
  249. package/dist/storage/toolkit/record-core.d.ts.map +0 -1
  250. package/dist/storage/toolkit/record-core.js.map +0 -1
  251. package/dist/storage/toolkit/sync-file.d.ts.map +0 -1
  252. package/dist/storage/toolkit/sync-file.js.map +0 -1
  253. package/dist/storage/toolkit/wal.d.ts.map +0 -1
  254. package/dist/storage/toolkit/wal.js.map +0 -1
  255. package/dist/storage/toolkit/wire.d.ts.map +0 -1
  256. package/dist/storage/toolkit/wire.js.map +0 -1
  257. package/dist/storage/types.d.ts.map +0 -1
  258. package/dist/storage/types.js.map +0 -1
  259. package/dist/testing/block-store-conformance.d.ts.map +0 -1
  260. package/dist/testing/block-store-conformance.js.map +0 -1
  261. package/dist/testing/index.d.ts.map +0 -1
  262. package/dist/testing/index.js.map +0 -1
  263. package/dist/testing/opfs-shim.d.ts.map +0 -1
  264. package/dist/testing/opfs-shim.js.map +0 -1
  265. package/dist/testing/seeds.d.ts +0 -11
  266. package/dist/testing/seeds.d.ts.map +0 -1
  267. package/dist/testing/seeds.js +0 -50
  268. package/dist/testing/seeds.js.map +0 -1
  269. package/dist/testing/simulator.d.ts.map +0 -1
  270. package/dist/testing/simulator.js.map +0 -1
  271. package/dist/testing/sqllogictest.d.ts.map +0 -1
  272. package/dist/testing/sqllogictest.js.map +0 -1
  273. package/dist/transactions/index.d.ts.map +0 -1
  274. package/dist/transactions/index.js.map +0 -1
  275. package/dist/worker-protocol/index.d.ts.map +0 -1
  276. package/dist/worker-protocol/index.js.map +0 -1
@@ -1,5 +1,4 @@
1
- import { type BeginTransactionInput, type BeginTransactionResult, type CommitTransactionInput, type CompactionJobRecord, type CompactionJobRecordUpdate, type CreateGarbageCollectionJobInput, type BlockStore, type CatalogProbe, type TriggerRecord, type BlockWrite, type FtsCandidates, type FtsColumnIndexRecord, type FtsPostingQuery, type FtsPosting, 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 SecondaryIndexRecord, type TempOwnerRecord, type TempRunPage, type TransactionRecord, type TransactionRecordUpdate, type WriteTransactionInput } from "./types.js";
2
- import type { DatabaseSnapshot, SnapshotLoadProgress } from "./snapshot.js";
1
+ import { type BeginSnapshotFrameExportInput, type SnapshotFrameExportSession, type ReadSnapshotExportFrameInput, type BeginSnapshotFrameImportInput, type SnapshotFrameImportSession, type RenewSnapshotFrameImportInput, type AppendSnapshotImportFramesInput, type FinishSnapshotFrameImportInput, type SnapshotFrame, type BeginTransactionInput, type BeginTransactionResult, type AbortTransactionIfExpiredInput, type CommitTransactionInput, type CloseSnapshotExportInput, type CompactionJobRecord, type CompactionJobRecordUpdate, type CreateGarbageCollectionJobInput, type UpdateGarbageCollectionPlanningInput, type DropTableColumnInput, type DropTableInput, type BlockStore, type AdoptAbortedSegmentInput, type CatalogProbe, type QueryCatalogState, type CatalogMutationOptions, type CancelSnapshotImportInput, type FtsCandidates, type FtsPostingQuery, type FtsPosting, type BeginPostingBuildInput, type RenewPostingBuildInput, type AppendPostingBuildChunkInput, type FinishPostingBuildInput, type AbortPostingBuildInput, type GarbageCollectionJobRecord, type GarbageCollectionStepResult, type LeaseRecord, type MoveLeaseInput, type Manifest, type ManifestSummary, type RowIdRange, type RollbackTransactionArtifactsInput, type RenewLeaseInput, type RenewTempOwnerInput, type RenewTransactionInput, type RunGarbageCollectionStepInput, type SegmentRecord, type InterruptedSnapshotImport, type InterruptedSnapshotImportAbortResult, type StageTransactionArtifactsInput, type StoragePage, type StorageStats, type TableRecord, type TableRecordUpdate, type TempOwnerRecord, type TempRunPage, type TransactionRecord, type TransactionRecordUpdate, type WriteTransactionInput, type BeginUniqueKeyBuildInput, type RenewUniqueKeyBuildInput, type AppendUniqueKeyBuildChunkInput, type FinishUniqueKeyBuildInput, type AbortUniqueKeyBuildInput, type UniqueKeyBuildRecord } from "./types.js";
3
2
  /**
4
3
  * The in-process store: record semantics live in `RecordCore` (shared with the OPFS store),
5
4
  * block and temp-page bytes live in Maps here, and atomicity comes from running every mutating
@@ -8,12 +7,10 @@ import type { DatabaseSnapshot, SnapshotLoadProgress } from "./snapshot.js";
8
7
  */
9
8
  export declare class MemoryBlockStore implements BlockStore {
10
9
  #private;
11
- addBlock(id: string, bytes: Uint8Array): Promise<void>;
12
- addBlocks(blocks: readonly BlockWrite[]): Promise<void>;
13
10
  getBlock(id: string): Promise<Uint8Array | undefined>;
14
11
  getBlocks(ids: readonly string[]): Promise<Array<Uint8Array | undefined>>;
15
- removeBlock(id: string): Promise<void>;
16
- listBlockIds(): Promise<string[]>;
12
+ readManifestBlock(version: number | null, id: string): Promise<Uint8Array | undefined>;
13
+ hasManifestBlocks(version: number | null, ids: readonly string[]): Promise<boolean[]>;
17
14
  putTempRunPage(page: TempRunPage): Promise<void>;
18
15
  putTempRunPages(pages: readonly TempRunPage[]): Promise<void>;
19
16
  getTempRunPage(ownerId: string, runId: string, pageIndex: number): Promise<Uint8Array | undefined>;
@@ -21,121 +18,114 @@ export declare class MemoryBlockStore implements BlockStore {
21
18
  removeTempOwner(ownerId: string): Promise<void>;
22
19
  createTempOwner(record: TempOwnerRecord): Promise<void>;
23
20
  getTempOwner(ownerId: string): Promise<TempOwnerRecord | undefined>;
24
- renewTempOwner(ownerId: string, expectedRevision: number, expiresAt: string): Promise<TempOwnerRecord>;
21
+ renewTempOwner(input: RenewTempOwnerInput): Promise<TempOwnerRecord>;
25
22
  removeTempOwnerIfExpired(ownerId: string, expiresAtCutoff: string): Promise<boolean>;
26
23
  listTempOwnerIdsPage(afterOwnerId: string | null, limit: number): Promise<StoragePage<string, string>>;
27
- addTable(record: TableRecord): Promise<void>;
24
+ listExpiredTempOwnerPage(expiresAtCutoff: string, afterCursor: string | null, limit: number): Promise<StoragePage<string, string>>;
25
+ addTable(record: TableRecord, options?: CatalogMutationOptions): Promise<void>;
28
26
  getTable(id: string): Promise<TableRecord | undefined>;
29
- updateTable(id: string, expectedRevision: number, update: {
30
- columns?: TableColumnRecord[];
31
- ftsColumns?: Record<string, FtsColumnIndexRecord> | null;
32
- secondaryIndexes?: Record<string, SecondaryIndexRecord> | null;
33
- expectedManifestVersion?: {
34
- value: number | null;
35
- };
36
- uniqueKeySeed?: {
37
- namespaceId: string;
38
- keyTokens: readonly string[];
39
- };
40
- triggers?: TriggerRecord[] | null;
41
- }): Promise<TableRecord>;
42
- removeTable(id: string, expectedRevision: number): Promise<void>;
27
+ updateTable(id: string, expectedRevision: number, update: TableRecordUpdate): Promise<TableRecord>;
28
+ removeTable(id: string, expectedRevision: number, options?: CatalogMutationOptions): Promise<void>;
29
+ dropTable(input: DropTableInput): Promise<ManifestSummary>;
30
+ dropTableColumn(input: DropTableColumnInput): Promise<ManifestSummary>;
43
31
  writeFtsBase(tableId: string, columnId: string, input: {
44
32
  coversVersion: number;
45
33
  chunks: FtsPosting[][];
46
34
  totalTokens: number;
47
35
  }): Promise<void>;
48
36
  removeFtsColumn(tableId: string, columnId: string): Promise<void>;
49
- beginFtsBaseBuild(tableId: string, columnId: string, buildId: string): Promise<void>;
50
- writeFtsBaseBuildChunk(tableId: string, columnId: string, buildId: string, ordinal: number, chunk: FtsPosting[]): Promise<void>;
51
- finishFtsBaseBuild(tableId: string, columnId: string, buildId: string, input: {
52
- coversVersion: number;
53
- chunkCount: number;
54
- totalTokens: number;
55
- }): Promise<void>;
56
- abortFtsBaseBuild(tableId: string, columnId: string, buildId: string): Promise<void>;
57
- readFtsCandidates(tableId: string, columnId: string, terms: readonly FtsPostingQuery[], upToVersion: number): Promise<FtsCandidates & {
37
+ beginFtsBaseBuild(input: BeginPostingBuildInput): Promise<void>;
38
+ renewFtsBaseBuild(input: RenewPostingBuildInput): Promise<void>;
39
+ writeFtsBaseBuildChunk(input: AppendPostingBuildChunkInput): Promise<void>;
40
+ finishFtsBaseBuild(input: FinishPostingBuildInput): Promise<void>;
41
+ abortFtsBaseBuild(input: AbortPostingBuildInput): Promise<void>;
42
+ readFtsCandidates(tableId: string, columnId: string, terms: readonly FtsPostingQuery[], upToVersion: number, maxRowIds?: number): Promise<FtsCandidates & {
58
43
  deltaChunkCount: number;
59
44
  totalTokens: number;
60
45
  coversVersion: number;
61
46
  hasBase: boolean;
62
47
  }>;
63
- readFtsPostings(tableId: string, columnId: string, upToVersion: number): Promise<{
48
+ readFtsPostings(tableId: string, columnId: string, upToVersion: number, maxRowIds?: number, maxRetainedBytes?: number): Promise<{
64
49
  postings: FtsPosting[];
50
+ overflow: boolean;
65
51
  deltaChunkCount: number;
66
52
  coversVersion: number;
67
53
  hasBase: boolean;
68
54
  }>;
69
55
  getTableByName(name: string): Promise<TableRecord | undefined>;
70
56
  listTables(): Promise<TableRecord[]>;
71
- addSegment(record: SegmentRecord): Promise<void>;
72
57
  getSegment(id: string): Promise<SegmentRecord | undefined>;
73
- listSegments(tableId?: string): Promise<SegmentRecord[]>;
74
58
  listSegmentPage(afterId: string | null, limit: number): Promise<StoragePage<SegmentRecord, string>>;
75
- removeSegment(id: string): Promise<void>;
59
+ listTableSegmentPage(tableId: string, afterId: string | null, limit: number): Promise<StoragePage<SegmentRecord, string>>;
60
+ removeAbortedSegment(id: string, expectedTransactionId: string): Promise<boolean>;
61
+ adoptAbortedSegment(input: AdoptAbortedSegmentInput): Promise<TransactionRecord>;
76
62
  reserveRowIds(tableId: string, count: number): Promise<RowIdRange>;
77
63
  reserveAutoIncrement(tableId: string, columnId: string, count: number, atLeast?: bigint): Promise<RowIdRange>;
78
64
  getExistingUniqueKeys(tableId: string, keyTokens: readonly string[]): Promise<string[]>;
65
+ beginUniqueKeyBuild(input: BeginUniqueKeyBuildInput): Promise<UniqueKeyBuildRecord>;
66
+ getUniqueKeyBuild(buildId: string): Promise<UniqueKeyBuildRecord | undefined>;
67
+ renewUniqueKeyBuild(input: RenewUniqueKeyBuildInput): Promise<UniqueKeyBuildRecord>;
68
+ appendUniqueKeyBuildChunk(input: AppendUniqueKeyBuildChunkInput): Promise<UniqueKeyBuildRecord>;
69
+ finishUniqueKeyBuild(input: FinishUniqueKeyBuildInput): Promise<TableRecord>;
70
+ abortUniqueKeyBuild(input: AbortUniqueKeyBuildInput): Promise<boolean>;
79
71
  getCurrentManifestVersion(): Promise<number | null>;
80
72
  getCatalogProbe(): Promise<CatalogProbe>;
81
- getQueryCatalogState(tableNames: readonly string[]): Promise<QueryCatalogState>;
73
+ getQueryCatalogState(names: readonly string[]): Promise<QueryCatalogState>;
82
74
  getCurrentManifest(): Promise<Manifest | undefined>;
83
75
  getManifest(version: number): Promise<Manifest | undefined>;
84
- listManifests(): Promise<Manifest[]>;
85
- listManifestPage(afterVersion: number | null, limit: number): Promise<StoragePage<Manifest, number>>;
86
- publishManifest(input: PublishManifestInput): Promise<Manifest>;
76
+ listManifestBlockPage(input: Parameters<BlockStore["listManifestBlockPage"]>[0]): Promise<import("./types.js").ManifestBlockPage>;
77
+ listRetiredManifestBlockPage(input: Parameters<BlockStore["listRetiredManifestBlockPage"]>[0]): Promise<import("./types.js").ManifestBlockPage>;
78
+ listManifestPage(afterVersion: number | null, limit: number): Promise<StoragePage<ManifestSummary, number>>;
87
79
  beginTransaction(input: BeginTransactionInput): Promise<BeginTransactionResult>;
88
80
  createTransaction(record: TransactionRecord): Promise<void>;
89
81
  getTransaction(id: string): Promise<TransactionRecord | undefined>;
90
82
  getTransactions(ids: readonly string[]): Promise<Array<TransactionRecord | undefined>>;
91
- listTransactions(): Promise<TransactionRecord[]>;
92
83
  listTransactionPage(afterId: string | null, limit: number): Promise<StoragePage<TransactionRecord, string>>;
93
84
  updateTransaction(id: string, expectedRevision: number, update: TransactionRecordUpdate): Promise<TransactionRecord>;
85
+ renewTransaction(input: RenewTransactionInput): Promise<boolean>;
86
+ abortTransactionIfExpired(input: AbortTransactionIfExpiredInput): Promise<TransactionRecord | undefined>;
94
87
  stageTransactionArtifacts(input: StageTransactionArtifactsInput): Promise<TransactionRecord>;
88
+ rollbackTransactionArtifacts(input: RollbackTransactionArtifactsInput): Promise<TransactionRecord>;
95
89
  commitTransaction(input: CommitTransactionInput): Promise<ManifestSummary>;
96
90
  writeTransaction(input: WriteTransactionInput): Promise<ManifestSummary>;
97
91
  createLease(record: LeaseRecord): Promise<void>;
98
92
  getLease(id: string): Promise<LeaseRecord | undefined>;
99
93
  listLeases(): Promise<LeaseRecord[]>;
100
- renewLease(id: string, expectedRevision: number, expiresAt: string): Promise<LeaseRecord>;
101
- moveLease(id: string, expectedRevision: number, manifestVersion: number | null, expiresAt: string): Promise<LeaseRecord>;
94
+ listExpiredLeasePage(expiresAtCutoff: string, afterCursor: string | null, limit: number): Promise<StoragePage<LeaseRecord, string>>;
95
+ renewLease(input: RenewLeaseInput): Promise<LeaseRecord>;
96
+ moveLease(input: MoveLeaseInput): Promise<LeaseRecord>;
102
97
  removeLeaseIfExpired(id: string, expectedRevision: number, expiresAtCutoff: string): Promise<boolean>;
103
- removeLease(id: string): Promise<void>;
98
+ removeLease(input: {
99
+ id: string;
100
+ ownerId: string;
101
+ }): Promise<boolean>;
104
102
  createCompactionJob(record: CompactionJobRecord): Promise<void>;
105
103
  getCompactionJob(id: string): Promise<CompactionJobRecord | undefined>;
106
104
  listCompactionJobs(tableId?: string): Promise<CompactionJobRecord[]>;
107
105
  listCompactionJobPage(afterId: string | null, limit: number): Promise<StoragePage<CompactionJobRecord, string>>;
108
106
  updateCompactionJob(id: string, expectedRevision: number, update: CompactionJobRecordUpdate): Promise<CompactionJobRecord>;
109
107
  cancelCompactionJob(id: string, expectedRevision: number, cancelledAt: string): Promise<CompactionJobRecord>;
110
- removeCompactionJob(id: string): Promise<void>;
108
+ removeCompactionJob(id: string): Promise<boolean>;
111
109
  createGarbageCollectionJob(input: CreateGarbageCollectionJobInput): Promise<GarbageCollectionJobRecord>;
110
+ updateGarbageCollectionPlanning(input: UpdateGarbageCollectionPlanningInput): Promise<GarbageCollectionJobRecord>;
112
111
  getGarbageCollectionJob(id: string): Promise<GarbageCollectionJobRecord | undefined>;
113
112
  listGarbageCollectionJobs(): Promise<GarbageCollectionJobRecord[]>;
113
+ listGarbageCollectionJobPage(afterId: string | null, limit: number): Promise<StoragePage<GarbageCollectionJobRecord, string>>;
114
114
  runGarbageCollectionStep(input: RunGarbageCollectionStepInput): Promise<GarbageCollectionStepResult>;
115
- removePrunedManifestRecords(): Promise<number>;
115
+ removePrunedManifestRecords(maxItems: number): Promise<number>;
116
116
  removeGarbageCollectionJob(id: string): Promise<void>;
117
- /**
118
- * Copies the current version out as a portable snapshot. Runs on the commit queue, so it sees
119
- * one consistent version rather than a commit in progress. What the snapshot carries and
120
- * drops is `RecordCore.exportSnapshot`'s contract.
121
- */
122
- exportSnapshot(): Promise<DatabaseSnapshot>;
123
- /**
124
- * Loads a snapshot into this store, which must be empty — the same contract as the IndexedDB
125
- * store, so a caller holding a `BlockStore` can restore into either without asking which it
126
- * has. The load runs on the commit queue, so it cannot interleave with a commit.
127
- *
128
- * Progress is reported for parity with the IndexedDB store rather than because it is needed:
129
- * an in-memory load is a handful of map writes with no transaction to break it into, so it
130
- * reports the start and then the end.
131
- */
132
- importSnapshot(snapshot: DatabaseSnapshot, options?: {
133
- onProgress?: (progress: SnapshotLoadProgress) => void;
134
- }): Promise<void>;
135
- /** Builds a store holding exactly what the snapshot captured. */
136
- static fromSnapshot(snapshot: DatabaseSnapshot): MemoryBlockStore;
117
+ beginSnapshotFrameExport(input: BeginSnapshotFrameExportInput): Promise<SnapshotFrameExportSession>;
118
+ readSnapshotExportFrame(input: ReadSnapshotExportFrameInput): Promise<SnapshotFrame | undefined>;
119
+ closeSnapshotFrameExport(input: CloseSnapshotExportInput): Promise<boolean>;
120
+ beginSnapshotFrameImport(input: BeginSnapshotFrameImportInput): Promise<SnapshotFrameImportSession>;
121
+ renewSnapshotFrameImport(input: RenewSnapshotFrameImportInput): Promise<SnapshotFrameImportSession>;
122
+ appendSnapshotImportFrames(input: AppendSnapshotImportFramesInput): Promise<SnapshotFrameImportSession>;
123
+ finishSnapshotFrameImport(input: FinishSnapshotFrameImportInput): Promise<void>;
124
+ cancelSnapshotFrameImport(input: CancelSnapshotImportInput): Promise<InterruptedSnapshotImportAbortResult>;
125
+ inspectInterruptedImport(): Promise<InterruptedSnapshotImport | null>;
126
+ abortInterruptedImport(identity: string): Promise<InterruptedSnapshotImportAbortResult>;
137
127
  /** Block and spill bytes held; the record maps are negligible beside them. */
138
128
  getLogicalStorageBytes(): Promise<number>;
129
+ getStorageStats(): Promise<StorageStats>;
139
130
  close(): void;
140
131
  }
141
- //# sourceMappingURL=memory.d.ts.map