@minnowdb/core 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/block-format/block.js +254 -325
- package/dist/block-format/checksum.js +30 -52
- package/dist/block-format/codecs.js +112 -125
- package/dist/block-format/column.js +187 -205
- package/dist/block-format/index.js +5 -1
- package/dist/block-format/physical.js +371 -387
- package/dist/block-format/types.js +4 -1
- package/dist/block-format/unicode.js +30 -39
- package/dist/date-value.js +67 -78
- package/dist/engine/artifact-cache.js +106 -116
- package/dist/engine/batch.js +36 -44
- package/dist/engine/buffered-writer.js +156 -158
- package/dist/engine/byte-estimates.js +20 -22
- package/dist/engine/cache-limits.js +24 -25
- package/dist/engine/cancellation.js +5 -3
- package/dist/engine/catalog.js +64 -73
- package/dist/engine/client.js +715 -780
- package/dist/engine/database.js +15941 -19313
- package/dist/engine/defaults.js +104 -111
- package/dist/engine/errors.js +113 -128
- package/dist/engine/fts.js +233 -280
- package/dist/engine/group-index.js +287 -321
- package/dist/engine/index.js +23 -12
- package/dist/engine/join-index.js +177 -186
- package/dist/engine/keyed-live.js +168 -173
- package/dist/engine/live-api.js +0 -1
- package/dist/engine/live-equal.js +32 -37
- package/dist/engine/live.js +603 -647
- package/dist/engine/memory.js +109 -111
- package/dist/engine/optimizer.d.ts +19 -1
- package/dist/engine/optimizer.js +2633 -2934
- package/dist/engine/point-read.js +122 -182
- package/dist/engine/query-api.js +12 -3
- package/dist/engine/query-cache.js +61 -69
- package/dist/engine/query.d.ts +6 -0
- package/dist/engine/query.js +8503 -9980
- package/dist/engine/result-wire.js +221 -252
- package/dist/engine/schema-wire.js +97 -112
- package/dist/engine/schema.js +1099 -1254
- package/dist/engine/sort-keys.js +315 -389
- package/dist/engine/sql-domains.js +646 -769
- package/dist/engine/sql-driver.js +0 -1
- package/dist/engine/sql-functions.js +1031 -1125
- package/dist/engine/sql-json.js +199 -218
- package/dist/engine/sql-semantics.js +572 -639
- package/dist/engine/typed-live.js +271 -293
- package/dist/engine/vector.js +4484 -5145
- package/dist/engine/worker-host.d.ts +8 -63
- package/dist/engine/worker-host.js +28 -1130
- package/dist/engine/worker-indexeddb.d.ts +1 -0
- package/dist/engine/worker-indexeddb.js +3 -0
- package/dist/engine/worker-memory.d.ts +1 -0
- package/dist/engine/worker-memory.js +3 -0
- package/dist/engine/worker-opfs.d.ts +1 -0
- package/dist/engine/worker-opfs.js +3 -0
- package/dist/engine/worker-server.d.ts +93 -0
- package/dist/engine/worker-server.js +999 -0
- package/dist/engine/worker-store-indexeddb.d.ts +2 -0
- package/dist/engine/worker-store-indexeddb.js +11 -0
- package/dist/engine/worker-store-memory.d.ts +2 -0
- package/dist/engine/worker-store-memory.js +6 -0
- package/dist/engine/worker-store-opfs.d.ts +2 -0
- package/dist/engine/worker-store-opfs.js +9 -0
- package/dist/engine/worker.js +0 -12
- package/dist/engine/write-block-planner.js +93 -100
- package/dist/plan/index.js +15 -16
- package/dist/plan/model.d.ts +6 -0
- package/dist/plan/model.js +20 -27
- package/dist/storage/index.js +0 -12
- package/dist/storage/indexeddb.js +11776 -13171
- package/dist/storage/memory.js +1198 -1241
- package/dist/storage/opfs/files.js +238 -295
- package/dist/storage/opfs/index.js +9 -3
- package/dist/storage/opfs/leader.js +4386 -4856
- package/dist/storage/opfs/rpc.js +223 -259
- package/dist/storage/opfs/snapshot-ledger.js +219 -260
- package/dist/storage/opfs/store.js +884 -1003
- package/dist/storage/persistence.js +59 -74
- package/dist/storage/snapshot-stream.js +788 -826
- package/dist/storage/snapshot.js +36 -37
- package/dist/storage/toolkit/extents.js +444 -520
- package/dist/storage/toolkit/index.js +28 -29
- package/dist/storage/toolkit/record-core.js +5792 -6377
- package/dist/storage/toolkit/sync-file.js +34 -42
- package/dist/storage/toolkit/wal.js +92 -127
- package/dist/storage/toolkit/wire.js +232 -256
- package/dist/storage/types.js +2948 -3250
- package/dist/testing/block-store-conformance.js +1556 -1629
- package/dist/testing/index.js +310 -291
- package/dist/testing/opfs-shim.js +280 -312
- package/dist/testing/simulator.js +496 -534
- package/dist/testing/sqllogictest.js +425 -365
- package/dist/transactions/index.js +1464 -1712
- package/dist/worker-protocol/index.js +70 -69
- package/package.json +20 -2
|
@@ -1,69 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* against a database you construct yourself; attachDatabaseWorker() additionally owns
|
|
5
|
-
* construction, building the store from the cloneable descriptor in the client's init frame. The
|
|
6
|
-
* ready-made worker entry (`@minnowdb/core/worker`) is one line over the latter.
|
|
7
|
-
*
|
|
8
|
-
* Dispatch is a whitelist per target: the root database and each issued handle accept only the
|
|
9
|
-
* methods listed here, so arbitrary property access never crosses the channel.
|
|
10
|
-
*/
|
|
11
|
-
export type StoreDescriptor = {
|
|
12
|
-
kind: "memory";
|
|
13
|
-
} | {
|
|
14
|
-
kind: "indexeddb";
|
|
15
|
-
name: string;
|
|
16
|
-
durability?: IDBTransactionDurability;
|
|
17
|
-
uniqueKeyCacheBytes?: number;
|
|
18
|
-
} | {
|
|
19
|
-
kind: "opfs";
|
|
20
|
-
name: string;
|
|
21
|
-
durability?: "relaxed" | "strict";
|
|
22
|
-
};
|
|
23
|
-
/** The cloneable subset of MinnowDatabaseOptions; function-valued seams stay worker-side. */
|
|
24
|
-
export type WireDatabaseOptions = Pick<MinnowDatabaseOptions, "compression" | "targetBlockBytes" | "rowsPerBlock" | "maxCommitRetries" | "spillOwnerLeaseMs" | "transactionOwnerLeaseMs" | "transactionIdleTimeoutMs" | "bufferPoolBytes" | "executionMemoryBudgetBytes" | "autoCollectDebtLimitCommits" | "autoCollect" | "autoCompact">;
|
|
25
|
-
export interface DatabaseInitPayload {
|
|
26
|
-
store: StoreDescriptor;
|
|
27
|
-
options?: WireDatabaseOptions;
|
|
28
|
-
}
|
|
29
|
-
/** The slice of DedicatedWorkerGlobalScope (or MessagePort) the host needs. */
|
|
30
|
-
export interface RpcScope {
|
|
31
|
-
addEventListener(type: "message", listener: (event: MessageEvent<unknown>) => void): void;
|
|
1
|
+
import { type RpcScope, type WorkerStoreFactory, type WorkerStoreOptions } from "./worker-server.js";
|
|
2
|
+
export { exposeDatabase, singleStoreFactory, MAX_WORKER_HANDLES_PER_CONNECTION, type DatabaseInitPayload, type ExposeDatabaseOptions, type RpcScope, type StoreDescriptor, type WireDatabaseOptions, type WorkerStoreFactory, type WorkerStoreOptions, } from "./worker-server.js";
|
|
3
|
+
export interface AttachDatabaseWorkerOptions extends WorkerStoreOptions {
|
|
32
4
|
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
5
|
+
* Replaces the stock store factory. `singleStoreFactory()` builds one that opens a single
|
|
6
|
+
* kind and refuses the rest, the way the `@minnowdb/core/worker/{indexeddb,opfs,memory}`
|
|
7
|
+
* entries do — though a custom entry importing this module still carries every adapter the
|
|
8
|
+
* stock factory names unless its bundler splits worker code.
|
|
35
9
|
*/
|
|
36
|
-
|
|
37
|
-
transfer: ArrayBuffer[];
|
|
38
|
-
}): void;
|
|
10
|
+
createStore?: WorkerStoreFactory;
|
|
39
11
|
}
|
|
40
|
-
export interface ExposeDatabaseOptions {
|
|
41
|
-
/** Called when the client sends its dispose frame, after every handle has been closed. */
|
|
42
|
-
onDispose?: () => void | Promise<void>;
|
|
43
|
-
/**
|
|
44
|
-
* Rolls back a worker write handle after this long without a handle RPC. Match the constructed
|
|
45
|
-
* database's `transactionIdleTimeoutMs` when it is customized. Defaults to 30 seconds.
|
|
46
|
-
*/
|
|
47
|
-
writeHandleIdleTimeoutMs?: number;
|
|
48
|
-
/**
|
|
49
|
-
* Called when the main thread reports its page visibility. The stock entry forwards this to
|
|
50
|
-
* the store's `setForeground` when it has one — the OPFS store uses it to keep leadership
|
|
51
|
-
* on the tab the user is looking at.
|
|
52
|
-
*/
|
|
53
|
-
onVisibility?: (visible: boolean) => void;
|
|
54
|
-
}
|
|
55
|
-
export interface AttachDatabaseWorkerOptions {
|
|
56
|
-
/** Test seam for environments without a global IndexedDB (e.g. fake-indexeddb). */
|
|
57
|
-
indexedDB?: IDBFactory;
|
|
58
|
-
}
|
|
59
|
-
/** Hard per-connection ceiling for resident worker resources abandoned by a client. */
|
|
60
|
-
export declare const MAX_WORKER_HANDLES_PER_CONNECTION = 256;
|
|
61
|
-
/**
|
|
62
|
-
* Answers client RPC frames against a database you constructed yourself. Use this in a custom
|
|
63
|
-
* worker entry when you need non-cloneable construction options (a custom store, `now`,
|
|
64
|
-
* `createId`) — the client's init frame is acknowledged without reconstructing anything.
|
|
65
|
-
*/
|
|
66
|
-
export declare function exposeDatabase(database: MinnowDatabase, scope: RpcScope, options?: ExposeDatabaseOptions): void;
|
|
67
12
|
/**
|
|
68
13
|
* Full worker-side wiring: waits for the client's init frame, builds the store it describes,
|
|
69
14
|
* constructs the database, and exposes it. The store is closed when the client disposes.
|