@minnowdb/core 0.6.9 → 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.d.ts +5 -0
- package/dist/date-value.js +71 -41
- 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 +15952 -18465
- 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 +2642 -2515
- package/dist/engine/point-read.d.ts +4 -2
- package/dist/engine/point-read.js +121 -171
- package/dist/engine/query-api.js +12 -3
- package/dist/engine/query-cache.js +61 -69
- package/dist/engine/query.d.ts +45 -0
- package/dist/engine/query.js +8506 -9375
- 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.d.ts +7 -1
- package/dist/engine/sql-domains.js +648 -734
- package/dist/engine/sql-driver.js +0 -1
- package/dist/engine/sql-functions.d.ts +11 -0
- package/dist/engine/sql-functions.js +1092 -0
- package/dist/engine/sql-json.js +199 -218
- package/dist/engine/sql-semantics.d.ts +25 -4
- package/dist/engine/sql-semantics.js +579 -513
- package/dist/engine/typed-live.js +271 -293
- package/dist/engine/vector.d.ts +7 -1
- package/dist/engine/vector.js +4513 -4580
- 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 +9 -1
- 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 +2952 -3228
- 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
- package/postgres-feature-profile.json +15 -5
- package/sql-feature-matrix.json +252 -2
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IndexedDbBlockStore } from "../storage/indexeddb.js";
|
|
2
|
+
import { singleStoreFactory } from "./worker-server.js";
|
|
3
|
+
const indexedDbWorkerStore = singleStoreFactory("indexeddb", (descriptor, options) => IndexedDbBlockStore.open({
|
|
4
|
+
name: descriptor.name,
|
|
5
|
+
...descriptor.durability === void 0 ? {} : { durability: descriptor.durability },
|
|
6
|
+
...descriptor.uniqueKeyCacheBytes === void 0 ? {} : { uniqueKeyCacheBytes: descriptor.uniqueKeyCacheBytes },
|
|
7
|
+
...options.indexedDB === void 0 ? {} : { indexedDB: options.indexedDB }
|
|
8
|
+
}));
|
|
9
|
+
export {
|
|
10
|
+
indexedDbWorkerStore
|
|
11
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OpfsBlockStore } from "../storage/opfs/index.js";
|
|
2
|
+
import { singleStoreFactory } from "./worker-server.js";
|
|
3
|
+
const opfsWorkerStore = singleStoreFactory("opfs", (descriptor) => OpfsBlockStore.open({
|
|
4
|
+
name: descriptor.name,
|
|
5
|
+
...descriptor.durability === void 0 ? {} : { durability: descriptor.durability }
|
|
6
|
+
}));
|
|
7
|
+
export {
|
|
8
|
+
opfsWorkerStore
|
|
9
|
+
};
|
package/dist/engine/worker.js
CHANGED
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
/// <reference lib="webworker" />
|
|
2
|
-
/**
|
|
3
|
-
* Ready-made dedicated-worker entry, published as `@minnowdb/core/worker`. Point a
|
|
4
|
-
* module worker at it and connect a MinnowDatabaseClient — the client's init frame carries the
|
|
5
|
-
* store descriptor and options, so this entry needs no configuration of its own:
|
|
6
|
-
*
|
|
7
|
-
* // db-worker.ts: import "@minnowdb/core/worker";
|
|
8
|
-
* new Worker(new URL("./db-worker.ts", import.meta.url), { type: "module" })
|
|
9
|
-
*
|
|
10
|
-
* For non-cloneable construction options (custom store, `now`, `createId`), write your own entry
|
|
11
|
-
* and import `exposeDatabase()` from `@minnowdb/core/worker-host` instead.
|
|
12
|
-
*/
|
|
13
1
|
import { attachDatabaseWorker } from "./worker-host.js";
|
|
14
2
|
attachDatabaseWorker(self);
|
|
@@ -1,112 +1,105 @@
|
|
|
1
|
-
import { MAX_BLOCK_ROW_COUNT, physicalColumnByteLength, wellFormedUtf8ByteLength
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
throw new RangeError("Maximum rows per write block exceeds the format limit");
|
|
1
|
+
import { MAX_BLOCK_ROW_COUNT, physicalColumnByteLength, wellFormedUtf8ByteLength } from "../block-format/index.js";
|
|
2
|
+
function planAlignedWriteBlockRanges(columns, rowCount, maximumRows, targetBytes, measureString = wellFormedUtf8ByteLength) {
|
|
3
|
+
if (rowCount === 0)
|
|
4
|
+
return [];
|
|
5
|
+
if (!Number.isSafeInteger(maximumRows) || maximumRows <= 0 || maximumRows > MAX_BLOCK_ROW_COUNT) {
|
|
6
|
+
throw new RangeError("Maximum rows per write block exceeds the format limit");
|
|
7
|
+
}
|
|
8
|
+
for (const column of columns) {
|
|
9
|
+
if (column.values.length !== rowCount) {
|
|
10
|
+
throw new RangeError("Column lengths must match while planning write blocks");
|
|
12
11
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
}
|
|
13
|
+
let maximumRowsPerRange = maximumRows;
|
|
14
|
+
const stringColumns = [];
|
|
15
|
+
for (const column of columns) {
|
|
16
|
+
if (column.type === "string")
|
|
17
|
+
stringColumns.push(column);
|
|
18
|
+
else {
|
|
19
|
+
maximumRowsPerRange = Math.min(maximumRowsPerRange, maximumFixedWidthRows(column.type, maximumRows, targetBytes));
|
|
17
20
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
else {
|
|
24
|
-
maximumRowsPerRange = Math.min(maximumRowsPerRange, maximumFixedWidthRows(column.type, maximumRows, targetBytes));
|
|
25
|
-
}
|
|
21
|
+
}
|
|
22
|
+
const ranges = [];
|
|
23
|
+
if (stringColumns.length === 0) {
|
|
24
|
+
for (let start = 0; start < rowCount; start += maximumRowsPerRange) {
|
|
25
|
+
ranges.push({ start, end: Math.min(rowCount, start + maximumRowsPerRange) });
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
return ranges;
|
|
28
|
+
}
|
|
29
|
+
for (let start = 0; start < rowCount; ) {
|
|
30
|
+
const rowLimit = Math.min(rowCount, start + maximumRowsPerRange);
|
|
31
|
+
const stringContentBytes = new Array(stringColumns.length).fill(0);
|
|
32
|
+
let end = start;
|
|
33
|
+
for (let row = start; row < rowLimit; row += 1) {
|
|
34
|
+
const count = row - start + 1;
|
|
35
|
+
let fitsTarget = true;
|
|
36
|
+
for (let columnIndex = 0; columnIndex < stringColumns.length; columnIndex += 1) {
|
|
37
|
+
const column = stringColumns[columnIndex];
|
|
38
|
+
if (column === void 0)
|
|
39
|
+
continue;
|
|
40
|
+
let contentBytes = stringContentBytes[columnIndex] ?? 0;
|
|
41
|
+
const value = column.values[row];
|
|
42
|
+
if (value !== null) {
|
|
43
|
+
if (typeof value !== "string") {
|
|
44
|
+
throw new TypeError("String column contains a non-string");
|
|
45
|
+
}
|
|
46
|
+
contentBytes += column.stringByteLengths?.[row] ?? measureString(value);
|
|
47
|
+
stringContentBytes[columnIndex] = contentBytes;
|
|
33
48
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
for (let start = 0; start < rowCount;) {
|
|
37
|
-
const rowLimit = Math.min(rowCount, start + maximumRowsPerRange);
|
|
38
|
-
const stringContentBytes = new Array(stringColumns.length).fill(0);
|
|
39
|
-
let end = start;
|
|
40
|
-
for (let row = start; row < rowLimit; row += 1) {
|
|
41
|
-
const count = row - start + 1;
|
|
42
|
-
let fitsTarget = true;
|
|
43
|
-
for (let columnIndex = 0; columnIndex < stringColumns.length; columnIndex += 1) {
|
|
44
|
-
const column = stringColumns[columnIndex];
|
|
45
|
-
if (column === undefined)
|
|
46
|
-
continue;
|
|
47
|
-
let contentBytes = stringContentBytes[columnIndex] ?? 0;
|
|
48
|
-
const value = column.values[row];
|
|
49
|
-
if (value !== null) {
|
|
50
|
-
if (typeof value !== "string") {
|
|
51
|
-
throw new TypeError("String column contains a non-string");
|
|
52
|
-
}
|
|
53
|
-
contentBytes += column.stringByteLengths?.[row] ?? measureString(value);
|
|
54
|
-
stringContentBytes[columnIndex] = contentBytes;
|
|
55
|
-
}
|
|
56
|
-
if (physicalColumnBytesUnchecked("string", count, contentBytes) > targetBytes) {
|
|
57
|
-
fitsTarget = false;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
if (!fitsTarget && count > 1)
|
|
61
|
-
break;
|
|
62
|
-
if (!fitsTarget) {
|
|
63
|
-
// The target is soft for one wide row, but the format ceiling is always hard. Validate
|
|
64
|
-
// every string column's exact one-row size before allowing that row to make progress.
|
|
65
|
-
for (let columnIndex = 0; columnIndex < stringColumns.length; columnIndex += 1) {
|
|
66
|
-
physicalColumnByteLength("string", 1, stringContentBytes[columnIndex] ?? 0);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
end = row + 1;
|
|
70
|
-
if (!fitsTarget)
|
|
71
|
-
break;
|
|
49
|
+
if (physicalColumnBytesUnchecked("string", count, contentBytes) > targetBytes) {
|
|
50
|
+
fitsTarget = false;
|
|
72
51
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
52
|
+
}
|
|
53
|
+
if (!fitsTarget && count > 1)
|
|
54
|
+
break;
|
|
55
|
+
if (!fitsTarget) {
|
|
56
|
+
for (let columnIndex = 0; columnIndex < stringColumns.length; columnIndex += 1) {
|
|
57
|
+
physicalColumnByteLength("string", 1, stringContentBytes[columnIndex] ?? 0);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
end = row + 1;
|
|
61
|
+
if (!fitsTarget)
|
|
62
|
+
break;
|
|
77
63
|
}
|
|
78
|
-
|
|
64
|
+
if (end <= start)
|
|
65
|
+
throw new Error("Write block planner made no progress");
|
|
66
|
+
ranges.push({ start, end });
|
|
67
|
+
start = end;
|
|
68
|
+
}
|
|
69
|
+
return ranges;
|
|
79
70
|
}
|
|
80
71
|
function maximumFixedWidthRows(type, maximumRows, targetBytes) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
72
|
+
if (physicalColumnBytesUnchecked(type, maximumRows, 0) <= targetBytes)
|
|
73
|
+
return maximumRows;
|
|
74
|
+
if (physicalColumnBytesUnchecked(type, 1, 0) > targetBytes)
|
|
75
|
+
return 1;
|
|
76
|
+
let low = 1;
|
|
77
|
+
let high = maximumRows;
|
|
78
|
+
while (low < high) {
|
|
79
|
+
const middle = Math.ceil((low + high) / 2);
|
|
80
|
+
if (physicalColumnBytesUnchecked(type, middle, 0) <= targetBytes)
|
|
81
|
+
low = middle;
|
|
82
|
+
else
|
|
83
|
+
high = middle - 1;
|
|
84
|
+
}
|
|
85
|
+
return low;
|
|
95
86
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
return Math.max(1, Math.min(MAX_BLOCK_ROW_COUNT, Math.floor(targetBlockBytes / maximumEncodedBytesPerRow)));
|
|
87
|
+
function estimateCompactionRowsPerOutput(targetBlockBytes, maximumEncodedBytesPerRow) {
|
|
88
|
+
return Math.max(1, Math.min(MAX_BLOCK_ROW_COUNT, Math.floor(targetBlockBytes / maximumEncodedBytesPerRow)));
|
|
99
89
|
}
|
|
100
|
-
/** Exact physical size without applying the 64 MiB hard limit during range search. */
|
|
101
90
|
function physicalColumnBytesUnchecked(type, rowCount, stringContentBytes) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
91
|
+
const validityBytes = Math.ceil(rowCount / 8);
|
|
92
|
+
switch (type) {
|
|
93
|
+
case "boolean":
|
|
94
|
+
return validityBytes * 2;
|
|
95
|
+
case "number":
|
|
96
|
+
case "datetime":
|
|
97
|
+
return validityBytes + rowCount * 8;
|
|
98
|
+
case "string":
|
|
99
|
+
return validityBytes + (rowCount + 1) * 4 + stringContentBytes;
|
|
100
|
+
}
|
|
112
101
|
}
|
|
102
|
+
export {
|
|
103
|
+
estimateCompactionRowsPerOutput,
|
|
104
|
+
planAlignedWriteBlockRanges
|
|
105
|
+
};
|
package/dist/plan/index.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export { validateFtsQuery } from "../engine/fts.js";
|
|
1
|
+
import { assembleSelectBlock, compoundSelectBlock, derivedTableSource, hasAggregate, splitCondition, validateLimit, validateOffset } from "../engine/query.js";
|
|
2
|
+
import { optimizePlan, renderPlan } from "../engine/optimizer.js";
|
|
3
|
+
import { validateFtsQuery } from "../engine/fts.js";
|
|
4
|
+
export {
|
|
5
|
+
assembleSelectBlock,
|
|
6
|
+
compoundSelectBlock,
|
|
7
|
+
derivedTableSource,
|
|
8
|
+
hasAggregate,
|
|
9
|
+
optimizePlan,
|
|
10
|
+
renderPlan,
|
|
11
|
+
splitCondition,
|
|
12
|
+
validateFtsQuery,
|
|
13
|
+
validateLimit,
|
|
14
|
+
validateOffset
|
|
15
|
+
};
|
package/dist/plan/model.d.ts
CHANGED
|
@@ -25,7 +25,9 @@ export type ScalarFunctionName = "ROUND" | "COALESCE" | "DATE_TRUNC" | "DATE_ADD
|
|
|
25
25
|
/** Optimizer-only, prefix-free equality key for hashable multi-column decorrelation. */
|
|
26
26
|
| "MINNOW_TUPLE_KEY"
|
|
27
27
|
/** Parser-produced wrapper carrying one explicit collation through ordering/comparison. */
|
|
28
|
-
| "MINNOW_COLLATE" | "NEXTVAL" | "CURRVAL" | "RANDOM" | "GEN_RANDOM_UUID"
|
|
28
|
+
| "MINNOW_COLLATE" | "NEXTVAL" | "CURRVAL" | "RANDOM" | "GEN_RANDOM_UUID"
|
|
29
|
+
/** Table-driven PostgreSQL string, math, datetime, regex, and formatting functions. */
|
|
30
|
+
| "CONCAT" | "CONCAT_WS" | "LEFT" | "RIGHT" | "REVERSE" | "REPEAT" | "INITCAP" | "SPLIT_PART" | "STRPOS" | "STARTS_WITH" | "TRANSLATE" | "ASCII" | "CHR" | "BTRIM" | "MD5" | "FORMAT" | "REGEXP_REPLACE" | "MINNOW_REGEX_MATCH" | "EXP" | "LN" | "LOG" | "LOG10" | "SIGN" | "TRUNC" | "PI" | "CBRT" | "DIV" | "WIDTH_BUCKET" | "SIN" | "COS" | "TAN" | "ASIN" | "ACOS" | "ATAN" | "ATAN2" | "DEGREES" | "RADIANS" | "TO_CHAR" | "TO_DATE" | "TO_TIMESTAMP" | "MAKE_DATE" | "MAKE_TIMESTAMP" | "AGE";
|
|
29
31
|
/** Exact BM25 corpus statistics attached to a cloned scoring node before execution. */
|
|
30
32
|
export interface FtsStats {
|
|
31
33
|
/** Every row of the corpus, including all-null documents. */
|
|
@@ -244,6 +246,12 @@ export interface CompiledQuery {
|
|
|
244
246
|
pendingSetOrder?: true;
|
|
245
247
|
/** Preserve `{ optimize: false }` after a deferred wildcard shape becomes concrete. */
|
|
246
248
|
preserveUnoptimizedShape?: true;
|
|
249
|
+
/**
|
|
250
|
+
* Set by the optimizer on the plan it returns. Parameter binding applies the value-dependent
|
|
251
|
+
* rewrites (calendar equalities) only to optimized plans, so `{ optimize: false }` stays the
|
|
252
|
+
* untouched oracle for them.
|
|
253
|
+
*/
|
|
254
|
+
optimized?: true;
|
|
247
255
|
distinctWildcard?: boolean;
|
|
248
256
|
limitParameter?: number;
|
|
249
257
|
offsetParameter?: number;
|
package/dist/plan/model.js
CHANGED
|
@@ -1,29 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
operator: "=",
|
|
15
|
-
left: { kind: "literal", value: 1 },
|
|
16
|
-
right: { kind: "literal", value: 1 },
|
|
17
|
-
},
|
|
18
|
-
};
|
|
1
|
+
function crossJoinPlan(source) {
|
|
2
|
+
return {
|
|
3
|
+
...source,
|
|
4
|
+
kind: "inner",
|
|
5
|
+
left: { kind: "literal", value: null },
|
|
6
|
+
right: { kind: "literal", value: null },
|
|
7
|
+
on: {
|
|
8
|
+
kind: "condition",
|
|
9
|
+
operator: "=",
|
|
10
|
+
left: { kind: "literal", value: 1 },
|
|
11
|
+
right: { kind: "literal", value: 1 }
|
|
12
|
+
}
|
|
13
|
+
};
|
|
19
14
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
condition?.kind === "condition" &&
|
|
24
|
-
condition.operator === "=" &&
|
|
25
|
-
condition.left.kind === "literal" &&
|
|
26
|
-
condition.left.value === 1 &&
|
|
27
|
-
condition.right.kind === "literal" &&
|
|
28
|
-
condition.right.value === 1);
|
|
15
|
+
function isCrossJoinPlan(join) {
|
|
16
|
+
const condition = join.on;
|
|
17
|
+
return join.kind === "inner" && condition?.kind === "condition" && condition.operator === "=" && condition.left.kind === "literal" && condition.left.value === 1 && condition.right.kind === "literal" && condition.right.value === 1;
|
|
29
18
|
}
|
|
19
|
+
export {
|
|
20
|
+
crossJoinPlan,
|
|
21
|
+
isCrossJoinPlan
|
|
22
|
+
};
|
package/dist/storage/index.js
CHANGED
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The storage surface, in three layers with enforced dependency directions
|
|
3
|
-
* (contract-boundaries.test.ts):
|
|
4
|
-
*
|
|
5
|
-
* - **The contract** — `types.ts` and `snapshot.ts`: the `BlockStore` capability interfaces,
|
|
6
|
-
* record types, and error classes. The engine depends on nothing else here.
|
|
7
|
-
* - **The adapters** — `indexeddb.ts`, `memory.ts`, `opfs/`: implementations, each owning its
|
|
8
|
-
* own low-level strategy.
|
|
9
|
-
* - **The toolkit** — `toolkit/`, published as `@minnowdb/core/storage/toolkit` rather than
|
|
10
|
-
* from this barrel: optional building blocks for writing new adapters. The contract never
|
|
11
|
-
* references it.
|
|
12
|
-
*/
|
|
13
1
|
export * from "./indexeddb.js";
|
|
14
2
|
export * from "./memory.js";
|
|
15
3
|
export * from "./opfs/index.js";
|