@nicia-ai/typegraph 0.29.0 → 0.30.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.
- package/dist/backend/postgres/index.cjs +19 -19
- package/dist/backend/postgres/index.d.cts +5 -5
- package/dist/backend/postgres/index.d.ts +5 -5
- package/dist/backend/postgres/index.js +9 -9
- package/dist/backend/postgres/pglite.cjs +14 -14
- package/dist/backend/postgres/pglite.d.cts +2 -2
- package/dist/backend/postgres/pglite.d.ts +2 -2
- package/dist/backend/postgres/pglite.js +9 -9
- package/dist/backend/sqlite/index.cjs +17 -17
- package/dist/backend/sqlite/index.d.cts +11 -6
- package/dist/backend/sqlite/index.d.ts +11 -6
- package/dist/backend/sqlite/index.js +8 -8
- package/dist/backend/sqlite/libsql.cjs +13 -13
- package/dist/backend/sqlite/libsql.d.cts +2 -2
- package/dist/backend/sqlite/libsql.d.ts +2 -2
- package/dist/backend/sqlite/libsql.js +9 -9
- package/dist/backend/sqlite/local.cjs +16 -15
- package/dist/backend/sqlite/local.cjs.map +1 -1
- package/dist/backend/sqlite/local.d.cts +8 -2
- package/dist/backend/sqlite/local.d.ts +8 -2
- package/dist/backend/sqlite/local.js +11 -10
- package/dist/backend/sqlite/local.js.map +1 -1
- package/dist/{chunk-UP4QAJND.cjs → chunk-26HWIIVS.cjs} +65 -65
- package/dist/{chunk-UP4QAJND.cjs.map → chunk-26HWIIVS.cjs.map} +1 -1
- package/dist/{chunk-GPUNAJFH.js → chunk-2QA5EHEN.js} +3 -3
- package/dist/{chunk-GPUNAJFH.js.map → chunk-2QA5EHEN.js.map} +1 -1
- package/dist/{chunk-CUZGBWFT.js → chunk-3IRMLJEK.js} +3 -3
- package/dist/{chunk-CUZGBWFT.js.map → chunk-3IRMLJEK.js.map} +1 -1
- package/dist/{chunk-MRMD7S7E.js → chunk-3JLRHQ67.js} +7 -7
- package/dist/{chunk-MRMD7S7E.js.map → chunk-3JLRHQ67.js.map} +1 -1
- package/dist/{chunk-UPBXUOW7.cjs → chunk-4BXHVEFB.cjs} +15 -15
- package/dist/{chunk-UPBXUOW7.cjs.map → chunk-4BXHVEFB.cjs.map} +1 -1
- package/dist/{chunk-RU5BBUU2.cjs → chunk-4LBO6KIF.cjs} +70 -67
- package/dist/chunk-4LBO6KIF.cjs.map +1 -0
- package/dist/{chunk-HKN622O4.js → chunk-633N7DSE.js} +9 -5
- package/dist/chunk-633N7DSE.js.map +1 -0
- package/dist/{chunk-R2LA6MKR.cjs → chunk-7JGLPAFV.cjs} +8 -8
- package/dist/{chunk-R2LA6MKR.cjs.map → chunk-7JGLPAFV.cjs.map} +1 -1
- package/dist/{chunk-7KLVFWXR.js → chunk-AI3RNREM.js} +30 -4
- package/dist/chunk-AI3RNREM.js.map +1 -0
- package/dist/{chunk-SFNUHFON.js → chunk-ENDUY2CD.js} +4 -4
- package/dist/{chunk-SFNUHFON.js.map → chunk-ENDUY2CD.js.map} +1 -1
- package/dist/{chunk-7V335GHG.cjs → chunk-FLRCVI2G.cjs} +12 -2
- package/dist/chunk-FLRCVI2G.cjs.map +1 -0
- package/dist/{chunk-IE2TPFBT.js → chunk-FVIGJTS7.js} +3 -3
- package/dist/{chunk-IE2TPFBT.js.map → chunk-FVIGJTS7.js.map} +1 -1
- package/dist/{chunk-Q5ASTPM4.cjs → chunk-FWBVPATK.cjs} +19 -19
- package/dist/{chunk-Q5ASTPM4.cjs.map → chunk-FWBVPATK.cjs.map} +1 -1
- package/dist/{chunk-KGAJ5HFO.cjs → chunk-IE6GN7L3.cjs} +17 -17
- package/dist/{chunk-KGAJ5HFO.cjs.map → chunk-IE6GN7L3.cjs.map} +1 -1
- package/dist/{chunk-A4H6QMV4.js → chunk-IUIJJYPI.js} +14 -11
- package/dist/chunk-IUIJJYPI.js.map +1 -0
- package/dist/{chunk-BMDF2S7S.js → chunk-IX7RE7CG.js} +3 -3
- package/dist/{chunk-BMDF2S7S.js.map → chunk-IX7RE7CG.js.map} +1 -1
- package/dist/{chunk-G6P3OVDY.cjs → chunk-JIEJCTDS.cjs} +18 -2
- package/dist/chunk-JIEJCTDS.cjs.map +1 -0
- package/dist/{chunk-XTQHSOIC.cjs → chunk-K4N35E7B.cjs} +86 -86
- package/dist/{chunk-XTQHSOIC.cjs.map → chunk-K4N35E7B.cjs.map} +1 -1
- package/dist/{chunk-NZ5PMBTG.js → chunk-K5P5OZXS.js} +12 -3
- package/dist/chunk-K5P5OZXS.js.map +1 -0
- package/dist/{chunk-Y52UNT66.js → chunk-K5VREXMZ.js} +7 -7
- package/dist/{chunk-Y52UNT66.js.map → chunk-K5VREXMZ.js.map} +1 -1
- package/dist/chunk-LUHU4T2F.cjs +12 -0
- package/dist/{chunk-Q3ZZLU3O.cjs.map → chunk-LUHU4T2F.cjs.map} +1 -1
- package/dist/{chunk-Z36W5WUM.js → chunk-MAQJYNJR.js} +3 -3
- package/dist/{chunk-Z36W5WUM.js.map → chunk-MAQJYNJR.js.map} +1 -1
- package/dist/{chunk-N3VVQDMA.js → chunk-MXE2U3EX.js} +3 -3
- package/dist/{chunk-N3VVQDMA.js.map → chunk-MXE2U3EX.js.map} +1 -1
- package/dist/{chunk-3DTLDGIM.js → chunk-N2OEOGBB.js} +6 -6
- package/dist/{chunk-3DTLDGIM.js.map → chunk-N2OEOGBB.js.map} +1 -1
- package/dist/{chunk-OGUH56BB.js → chunk-R4JOBEJU.js} +4 -4
- package/dist/{chunk-OGUH56BB.js.map → chunk-R4JOBEJU.js.map} +1 -1
- package/dist/{chunk-HM6XMR3E.cjs → chunk-SGPXKJ4A.cjs} +18 -18
- package/dist/{chunk-HM6XMR3E.cjs.map → chunk-SGPXKJ4A.cjs.map} +1 -1
- package/dist/{chunk-MB363HT5.js → chunk-TQOYM4LN.js} +18 -3
- package/dist/chunk-TQOYM4LN.js.map +1 -0
- package/dist/{chunk-C2RWFIYP.cjs → chunk-UESTHN47.cjs} +34 -6
- package/dist/chunk-UESTHN47.cjs.map +1 -0
- package/dist/{chunk-4K6IHUW6.cjs → chunk-VFX3LC76.cjs} +14 -14
- package/dist/{chunk-4K6IHUW6.cjs.map → chunk-VFX3LC76.cjs.map} +1 -1
- package/dist/{chunk-F2Q76CQ4.cjs → chunk-WEMZM7J7.cjs} +11 -7
- package/dist/chunk-WEMZM7J7.cjs.map +1 -0
- package/dist/{chunk-ZYQEXGYC.cjs → chunk-WFCECD6Q.cjs} +84 -84
- package/dist/{chunk-ZYQEXGYC.cjs.map → chunk-WFCECD6Q.cjs.map} +1 -1
- package/dist/{chunk-VGU26WIU.cjs → chunk-YQGLVWB2.cjs} +4 -4
- package/dist/{chunk-VGU26WIU.cjs.map → chunk-YQGLVWB2.cjs.map} +1 -1
- package/dist/{ddl-D3o-RmsV.d.cts → ddl-BSFlbGQF.d.cts} +3 -3
- package/dist/{ddl-BwH00BB6.d.ts → ddl-EdkIiFVU.d.ts} +3 -3
- package/dist/graph-extension/index.cjs +19 -19
- package/dist/graph-extension/index.d.cts +1 -1
- package/dist/graph-extension/index.d.ts +1 -1
- package/dist/graph-extension/index.js +4 -4
- package/dist/{index-CapHwi1a.d.ts → index-DzeIiMO3.d.ts} +9 -1
- package/dist/{index-jPPexxM5.d.cts → index-Ln_KHTGA.d.cts} +9 -1
- package/dist/index.cjs +780 -515
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +314 -53
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.cjs +18 -18
- package/dist/indexes/index.d.cts +4 -4
- package/dist/indexes/index.d.ts +4 -4
- package/dist/indexes/index.js +4 -4
- package/dist/interchange/index.cjs +7 -7
- package/dist/interchange/index.d.cts +3 -3
- package/dist/interchange/index.d.ts +3 -3
- package/dist/interchange/index.js +2 -2
- package/dist/{manager-BUugwCYz.d.ts → manager-BbdyNhkv.d.ts} +1 -1
- package/dist/{manager-DpIpn1HQ.d.cts → manager-wTDgjoXG.d.cts} +1 -1
- package/dist/{postgres-CQL9UIn2.d.cts → postgres-CK2ByP1q.d.cts} +1 -1
- package/dist/{postgres-CcRLaxz0.d.ts → postgres-ymXYC6Rr.d.ts} +1 -1
- package/dist/profiler/index.cjs +9 -9
- package/dist/profiler/index.d.cts +5 -5
- package/dist/profiler/index.d.ts +5 -5
- package/dist/profiler/index.js +2 -2
- package/dist/schema/index.cjs +31 -31
- package/dist/schema/index.d.cts +5 -5
- package/dist/schema/index.d.ts +5 -5
- package/dist/schema/index.js +8 -8
- package/dist/{sqlite-Rj3xu4It.d.cts → sqlite-DxH1lrwD.d.cts} +1 -1
- package/dist/{sqlite-CZDFUfHS.d.ts → sqlite-R8YGOqVQ.d.ts} +1 -1
- package/dist/{store-B43FpOVX.d.cts → store--z1Tmk7U.d.cts} +43 -3
- package/dist/{store-De0Y33wP.d.ts → store-CNKM334w.d.ts} +43 -3
- package/dist/{types-CmAT-Z47.d.ts → types-BBiDqJCU.d.ts} +2 -0
- package/dist/{types-B5GSeE3t.d.ts → types-CMvxx2kd.d.ts} +1 -1
- package/dist/{types-Bwlp_yvu.d.cts → types-D5B6Be5c.d.cts} +1 -1
- package/dist/{types-DXCSyxac.d.cts → types-dL-clxO3.d.cts} +2 -0
- package/dist/{where-CP4qGIHd.d.ts → where-CAo6wsBZ.d.ts} +1 -1
- package/dist/{where-2dsyYt3d.d.cts → where-bJjuOCeV.d.cts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-7KLVFWXR.js.map +0 -1
- package/dist/chunk-7V335GHG.cjs.map +0 -1
- package/dist/chunk-A4H6QMV4.js.map +0 -1
- package/dist/chunk-C2RWFIYP.cjs.map +0 -1
- package/dist/chunk-F2Q76CQ4.cjs.map +0 -1
- package/dist/chunk-G6P3OVDY.cjs.map +0 -1
- package/dist/chunk-HKN622O4.js.map +0 -1
- package/dist/chunk-MB363HT5.js.map +0 -1
- package/dist/chunk-NZ5PMBTG.js.map +0 -1
- package/dist/chunk-Q3ZZLU3O.cjs +0 -12
- package/dist/chunk-RU5BBUU2.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
3
|
+
var chunkFWBVPATK_cjs = require('./chunk-FWBVPATK.cjs');
|
|
4
|
+
var chunkIE6GN7L3_cjs = require('./chunk-IE6GN7L3.cjs');
|
|
5
|
+
var chunkK4N35E7B_cjs = require('./chunk-K4N35E7B.cjs');
|
|
6
|
+
var chunk7JGLPAFV_cjs = require('./chunk-7JGLPAFV.cjs');
|
|
7
|
+
var chunkLUHU4T2F_cjs = require('./chunk-LUHU4T2F.cjs');
|
|
8
|
+
var chunkSGPXKJ4A_cjs = require('./chunk-SGPXKJ4A.cjs');
|
|
9
|
+
var chunkVFX3LC76_cjs = require('./chunk-VFX3LC76.cjs');
|
|
10
|
+
var chunkWEMZM7J7_cjs = require('./chunk-WEMZM7J7.cjs');
|
|
11
11
|
var chunkRP7YITHX_cjs = require('./chunk-RP7YITHX.cjs');
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
12
|
+
var chunkUESTHN47_cjs = require('./chunk-UESTHN47.cjs');
|
|
13
|
+
var chunk4BXHVEFB_cjs = require('./chunk-4BXHVEFB.cjs');
|
|
14
|
+
var chunkYQGLVWB2_cjs = require('./chunk-YQGLVWB2.cjs');
|
|
15
15
|
var chunkZFWNO3GE_cjs = require('./chunk-ZFWNO3GE.cjs');
|
|
16
|
-
var
|
|
17
|
-
var
|
|
16
|
+
var chunkJIEJCTDS_cjs = require('./chunk-JIEJCTDS.cjs');
|
|
17
|
+
var chunkFLRCVI2G_cjs = require('./chunk-FLRCVI2G.cjs');
|
|
18
18
|
var zod = require('zod');
|
|
19
19
|
var drizzleOrm = require('drizzle-orm');
|
|
20
20
|
var nanoid = require('nanoid');
|
|
@@ -30,7 +30,7 @@ function metaEdge(name, options = {}) {
|
|
|
30
30
|
description: options.description
|
|
31
31
|
};
|
|
32
32
|
return Object.freeze({
|
|
33
|
-
[
|
|
33
|
+
[chunkK4N35E7B_cjs.META_EDGE_BRAND]: true,
|
|
34
34
|
name,
|
|
35
35
|
properties
|
|
36
36
|
});
|
|
@@ -71,7 +71,7 @@ async function migrateLegacyEmbeddings(options) {
|
|
|
71
71
|
graphId,
|
|
72
72
|
resolveSlotConfig,
|
|
73
73
|
batchSize = DEFAULT_BATCH_SIZE,
|
|
74
|
-
legacyTableName =
|
|
74
|
+
legacyTableName = chunkWEMZM7J7_cjs.LEGACY_EMBEDDINGS_TABLE_NAME
|
|
75
75
|
} = options;
|
|
76
76
|
if (backend.vectorStrategy === void 0 || backend.upsertEmbedding === void 0) {
|
|
77
77
|
throw new Error(
|
|
@@ -135,7 +135,7 @@ async function migrateLegacyEmbeddings(options) {
|
|
|
135
135
|
indexType: config?.indexType ?? DEFAULT_SLOT_INDEX_TYPE
|
|
136
136
|
});
|
|
137
137
|
} catch (error) {
|
|
138
|
-
if (error instanceof
|
|
138
|
+
if (error instanceof chunkJIEJCTDS_cjs.EmbeddingDimensionChangedError) {
|
|
139
139
|
skippedDimensionMismatch[slotKey] = (skippedDimensionMismatch[slotKey] ?? 0) + 1;
|
|
140
140
|
continue;
|
|
141
141
|
}
|
|
@@ -162,7 +162,7 @@ async function migrateLegacyEmbeddings(options) {
|
|
|
162
162
|
};
|
|
163
163
|
}
|
|
164
164
|
async function readLegacyBatch(backend, params) {
|
|
165
|
-
const table =
|
|
165
|
+
const table = chunkUESTHN47_cjs.quotedTableName(params.legacyTableName);
|
|
166
166
|
const embeddingJson = legacyEmbeddingDecodeExpression(backend);
|
|
167
167
|
const conditions = [];
|
|
168
168
|
if (params.graphId !== void 0) {
|
|
@@ -459,7 +459,7 @@ function createFulltextAccessor(alias, hasSearchableField) {
|
|
|
459
459
|
return {
|
|
460
460
|
matches: (query, k, options) => {
|
|
461
461
|
if (!hasSearchableField()) {
|
|
462
|
-
throw new
|
|
462
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
463
463
|
`Cannot call .$fulltext.matches() on alias "${alias}" \u2014 its node kind has no fields declared with searchable(). Add at least one: \`title: searchable({ language: "english" })\`.`
|
|
464
464
|
);
|
|
465
465
|
}
|
|
@@ -474,7 +474,7 @@ function createFulltextAccessor(alias, hasSearchableField) {
|
|
|
474
474
|
}
|
|
475
475
|
function fulltextMatch(field2, query, limit, options) {
|
|
476
476
|
if (!Number.isFinite(limit) || limit <= 0) {
|
|
477
|
-
throw new
|
|
477
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
478
478
|
`matches() limit must be a positive finite number, got ${String(limit)}`
|
|
479
479
|
);
|
|
480
480
|
}
|
|
@@ -591,7 +591,7 @@ function buildFieldBuilderForTypeInfo(field2, typeInfo) {
|
|
|
591
591
|
}
|
|
592
592
|
}
|
|
593
593
|
function resolvePointerTypeInfo(typeInfo, pointer) {
|
|
594
|
-
return
|
|
594
|
+
return chunkYQGLVWB2_cjs.resolveFieldTypeInfoAtJsonPointer(typeInfo, pointer);
|
|
595
595
|
}
|
|
596
596
|
function objectOp(op, field2, pointer, value, options) {
|
|
597
597
|
const expr = {
|
|
@@ -614,8 +614,8 @@ function objectField(field2, options) {
|
|
|
614
614
|
return {
|
|
615
615
|
...baseFieldBuilder(field2),
|
|
616
616
|
get: (key) => {
|
|
617
|
-
const pointer =
|
|
618
|
-
const nestedPointer =
|
|
617
|
+
const pointer = chunkFLRCVI2G_cjs.jsonPointer([key]);
|
|
618
|
+
const nestedPointer = chunkFLRCVI2G_cjs.joinJsonPointers(basePointer, pointer);
|
|
619
619
|
const resolved = resolvePointerTypeInfo(options?.typeInfo, pointer);
|
|
620
620
|
const nestedRef = fieldRef(field2.alias, field2.path, {
|
|
621
621
|
jsonPointer: nestedPointer,
|
|
@@ -629,17 +629,17 @@ function objectField(field2, options) {
|
|
|
629
629
|
return buildFieldBuilderForTypeInfo(nestedRef, resolved);
|
|
630
630
|
},
|
|
631
631
|
hasKey: (key) => {
|
|
632
|
-
const pointer =
|
|
632
|
+
const pointer = chunkFLRCVI2G_cjs.jsonPointer([key]);
|
|
633
633
|
resolvePointerTypeInfo(options?.typeInfo, pointer);
|
|
634
634
|
return objectOp("hasKey", field2, pointer);
|
|
635
635
|
},
|
|
636
636
|
hasPath: (pointer) => {
|
|
637
|
-
const normalized =
|
|
637
|
+
const normalized = chunkFLRCVI2G_cjs.normalizeJsonPointer(pointer);
|
|
638
638
|
resolvePointerTypeInfo(options?.typeInfo, normalized);
|
|
639
639
|
return objectOp("hasPath", field2, normalized);
|
|
640
640
|
},
|
|
641
641
|
pathEquals: (pointer, value) => {
|
|
642
|
-
const normalized =
|
|
642
|
+
const normalized = chunkFLRCVI2G_cjs.normalizeJsonPointer(pointer);
|
|
643
643
|
const resolved = resolvePointerTypeInfo(options?.typeInfo, normalized);
|
|
644
644
|
if (resolved && (resolved.valueType === "array" || resolved.valueType === "object")) {
|
|
645
645
|
throw new Error("pathEquals is only supported for scalar JSON values");
|
|
@@ -648,7 +648,7 @@ function objectField(field2, options) {
|
|
|
648
648
|
return objectOp("pathEquals", field2, normalized, value, predicateOptions);
|
|
649
649
|
},
|
|
650
650
|
pathContains: (pointer, value) => {
|
|
651
|
-
const normalized =
|
|
651
|
+
const normalized = chunkFLRCVI2G_cjs.normalizeJsonPointer(pointer);
|
|
652
652
|
const resolved = resolvePointerTypeInfo(options?.typeInfo, normalized);
|
|
653
653
|
if (resolved && resolved.valueType !== "array") {
|
|
654
654
|
throw new Error("pathContains is only supported for JSON array values");
|
|
@@ -663,7 +663,7 @@ function objectField(field2, options) {
|
|
|
663
663
|
);
|
|
664
664
|
},
|
|
665
665
|
pathIsNull: (pointer) => {
|
|
666
|
-
const normalized =
|
|
666
|
+
const normalized = chunkFLRCVI2G_cjs.normalizeJsonPointer(pointer);
|
|
667
667
|
const resolved = resolvePointerTypeInfo(options?.typeInfo, normalized);
|
|
668
668
|
const predicateOptions = resolved?.valueType === void 0 ? void 0 : { valueType: resolved.valueType };
|
|
669
669
|
return objectOp(
|
|
@@ -675,7 +675,7 @@ function objectField(field2, options) {
|
|
|
675
675
|
);
|
|
676
676
|
},
|
|
677
677
|
pathIsNotNull: (pointer) => {
|
|
678
|
-
const normalized =
|
|
678
|
+
const normalized = chunkFLRCVI2G_cjs.normalizeJsonPointer(pointer);
|
|
679
679
|
const resolved = resolvePointerTypeInfo(options?.typeInfo, normalized);
|
|
680
680
|
const predicateOptions = resolved?.valueType === void 0 ? void 0 : { valueType: resolved.valueType };
|
|
681
681
|
return objectOp(
|
|
@@ -687,8 +687,8 @@ function objectField(field2, options) {
|
|
|
687
687
|
);
|
|
688
688
|
},
|
|
689
689
|
field: (pointer) => {
|
|
690
|
-
const normalized =
|
|
691
|
-
const nestedPointer =
|
|
690
|
+
const normalized = chunkFLRCVI2G_cjs.normalizeJsonPointer(pointer);
|
|
691
|
+
const nestedPointer = chunkFLRCVI2G_cjs.joinJsonPointers(basePointer, normalized);
|
|
692
692
|
const resolved = resolvePointerTypeInfo(options?.typeInfo, normalized);
|
|
693
693
|
const nestedRef = fieldRef(field2.alias, field2.path, {
|
|
694
694
|
jsonPointer: nestedPointer,
|
|
@@ -744,7 +744,7 @@ function notInSubquery(field2, subquery) {
|
|
|
744
744
|
function assertSingleColumnSubquery(subquery) {
|
|
745
745
|
const columnCount = getSubqueryColumnCount(subquery);
|
|
746
746
|
if (columnCount === 1) return;
|
|
747
|
-
throw new
|
|
747
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
748
748
|
`IN/NOT IN subquery must project exactly 1 column, but got ${columnCount}`,
|
|
749
749
|
{ subqueryColumnCount: columnCount },
|
|
750
750
|
{
|
|
@@ -757,7 +757,7 @@ function assertCompatibleSubqueryValueTypes(field2, subquery) {
|
|
|
757
757
|
const subqueryValueType = getSingleSubqueryColumnValueType(subquery);
|
|
758
758
|
const resolvedValueType = fieldValueType ?? subqueryValueType;
|
|
759
759
|
if (isUnsupportedInSubqueryValueType(resolvedValueType)) {
|
|
760
|
-
throw new
|
|
760
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
761
761
|
`IN/NOT IN subquery does not support ${String(resolvedValueType)} values`,
|
|
762
762
|
{ valueType: resolvedValueType },
|
|
763
763
|
{
|
|
@@ -768,7 +768,7 @@ function assertCompatibleSubqueryValueTypes(field2, subquery) {
|
|
|
768
768
|
if (isInSubqueryTypeCompatible(fieldValueType, subqueryValueType)) {
|
|
769
769
|
return;
|
|
770
770
|
}
|
|
771
|
-
throw new
|
|
771
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
772
772
|
`IN/NOT IN type mismatch: field type "${String(fieldValueType)}" does not match subquery column type "${String(subqueryValueType)}"`,
|
|
773
773
|
{
|
|
774
774
|
fieldValueType,
|
|
@@ -818,7 +818,7 @@ function getFieldPointer(field2) {
|
|
|
818
818
|
return field2.jsonPointer;
|
|
819
819
|
}
|
|
820
820
|
if (field2.path.length > 1 && field2.path[0] === "props") {
|
|
821
|
-
return
|
|
821
|
+
return chunkFLRCVI2G_cjs.jsonPointer(field2.path.slice(1));
|
|
822
822
|
}
|
|
823
823
|
return void 0;
|
|
824
824
|
}
|
|
@@ -894,7 +894,7 @@ function resolveLiteralValueTypes(literals) {
|
|
|
894
894
|
}
|
|
895
895
|
}
|
|
896
896
|
if (resolved.size > 1) {
|
|
897
|
-
throw new
|
|
897
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
898
898
|
"Mixed literal value types are not supported in predicates",
|
|
899
899
|
{ valueTypes: [...resolved] }
|
|
900
900
|
);
|
|
@@ -1020,7 +1020,7 @@ function compilePredicateExpression(expr, ctx) {
|
|
|
1020
1020
|
if (!upperIsParam) boundsForType.push(expr.upper);
|
|
1021
1021
|
const valueType = boundsForType.length > 0 ? resolveComparisonValueType(expr.field, boundsForType) : normalizeValueType2(expr.field.valueType);
|
|
1022
1022
|
if (valueType === "array" || valueType === "object") {
|
|
1023
|
-
throw new
|
|
1023
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
1024
1024
|
"Between comparisons are not supported for JSON arrays or objects"
|
|
1025
1025
|
);
|
|
1026
1026
|
}
|
|
@@ -1087,7 +1087,7 @@ function compileComparisonPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1087
1087
|
);
|
|
1088
1088
|
const opSql2 = COMPARISON_OP_SQL[expr.op];
|
|
1089
1089
|
if (!opSql2) {
|
|
1090
|
-
throw new
|
|
1090
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
1091
1091
|
`Comparison operation "${expr.op}" is not supported for parameterized predicates`
|
|
1092
1092
|
);
|
|
1093
1093
|
}
|
|
@@ -1095,7 +1095,7 @@ function compileComparisonPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1095
1095
|
}
|
|
1096
1096
|
const valueType = resolveComparisonValueType(expr.left, expr.right);
|
|
1097
1097
|
if (valueType === "array" || valueType === "object") {
|
|
1098
|
-
throw new
|
|
1098
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
1099
1099
|
`Comparison operation "${expr.op}" is not supported for ${valueType} values`
|
|
1100
1100
|
);
|
|
1101
1101
|
}
|
|
@@ -1123,7 +1123,7 @@ function compileComparisonPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1123
1123
|
const convertedRight = convertValueForSql(rightValue.value, dialect);
|
|
1124
1124
|
const opSql = COMPARISON_OP_SQL[expr.op];
|
|
1125
1125
|
if (!opSql) {
|
|
1126
|
-
throw new
|
|
1126
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
1127
1127
|
`Comparison operation "${expr.op}" is not supported`
|
|
1128
1128
|
);
|
|
1129
1129
|
}
|
|
@@ -1177,7 +1177,7 @@ function compileArrayPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1177
1177
|
}
|
|
1178
1178
|
function compileObjectPredicate(expr, dialect, cteColumnPrefix) {
|
|
1179
1179
|
const basePointer = getFieldPointer(expr.field);
|
|
1180
|
-
const pointer =
|
|
1180
|
+
const pointer = chunkFLRCVI2G_cjs.joinJsonPointers(basePointer, expr.pointer);
|
|
1181
1181
|
const column = compileFieldColumn(expr.field, void 0, cteColumnPrefix);
|
|
1182
1182
|
switch (expr.op) {
|
|
1183
1183
|
case "hasKey":
|
|
@@ -1186,13 +1186,13 @@ function compileObjectPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1186
1186
|
}
|
|
1187
1187
|
case "pathEquals": {
|
|
1188
1188
|
if (!expr.value) {
|
|
1189
|
-
throw new
|
|
1189
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
1190
1190
|
"pathEquals requires a comparison value"
|
|
1191
1191
|
);
|
|
1192
1192
|
}
|
|
1193
1193
|
const valueType = resolvePredicateValueType(expr.valueType, expr.value);
|
|
1194
1194
|
if (valueType === "array" || valueType === "object") {
|
|
1195
|
-
throw new
|
|
1195
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
1196
1196
|
"pathEquals is not supported for JSON arrays or objects"
|
|
1197
1197
|
);
|
|
1198
1198
|
}
|
|
@@ -1208,7 +1208,7 @@ function compileObjectPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1208
1208
|
}
|
|
1209
1209
|
case "pathContains": {
|
|
1210
1210
|
if (!expr.value) {
|
|
1211
|
-
throw new
|
|
1211
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
1212
1212
|
"pathContains requires a comparison value"
|
|
1213
1213
|
);
|
|
1214
1214
|
}
|
|
@@ -1236,7 +1236,7 @@ function compileAggregatePredicate(expr, dialect) {
|
|
|
1236
1236
|
const aggregate = compileAggregateExpr(expr.aggregate, dialect);
|
|
1237
1237
|
const op = COMPARISON_OP_SQL[expr.op];
|
|
1238
1238
|
if (!op) {
|
|
1239
|
-
throw new
|
|
1239
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
1240
1240
|
`Comparison operation "${expr.op}" is not supported for aggregate predicates`
|
|
1241
1241
|
);
|
|
1242
1242
|
}
|
|
@@ -1271,7 +1271,7 @@ function compileAggregateExpr(expr, dialect) {
|
|
|
1271
1271
|
return drizzleOrm.sql`MAX(${field2})`;
|
|
1272
1272
|
}
|
|
1273
1273
|
default: {
|
|
1274
|
-
throw new
|
|
1274
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
1275
1275
|
`Unknown aggregate function: ${expr.function}`
|
|
1276
1276
|
);
|
|
1277
1277
|
}
|
|
@@ -1279,7 +1279,7 @@ function compileAggregateExpr(expr, dialect) {
|
|
|
1279
1279
|
}
|
|
1280
1280
|
function compileExistsSubquery(expr, ctx) {
|
|
1281
1281
|
if (expr.subquery.graphId === void 0) {
|
|
1282
|
-
throw new
|
|
1282
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError("EXISTS subquery must have a graphId");
|
|
1283
1283
|
}
|
|
1284
1284
|
const subSql = ctx.compileQuery(expr.subquery, expr.subquery.graphId);
|
|
1285
1285
|
return expr.negated ? drizzleOrm.sql`NOT EXISTS (${subSql})` : drizzleOrm.sql`EXISTS (${subSql})`;
|
|
@@ -1287,7 +1287,7 @@ function compileExistsSubquery(expr, ctx) {
|
|
|
1287
1287
|
function compileInSubquery(expr, ctx) {
|
|
1288
1288
|
const subqueryColumnCount = getSubqueryColumnCount(expr.subquery);
|
|
1289
1289
|
if (subqueryColumnCount !== 1) {
|
|
1290
|
-
throw new
|
|
1290
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
1291
1291
|
`IN/NOT IN subquery must project exactly 1 column, but got ${subqueryColumnCount}`,
|
|
1292
1292
|
{ subqueryColumnCount }
|
|
1293
1293
|
);
|
|
@@ -1296,13 +1296,13 @@ function compileInSubquery(expr, ctx) {
|
|
|
1296
1296
|
const subqueryValueType = getSingleSubqueryColumnValueType(expr.subquery);
|
|
1297
1297
|
const resolvedValueType = fieldValueType ?? subqueryValueType;
|
|
1298
1298
|
if (isUnsupportedInSubqueryValueType(resolvedValueType)) {
|
|
1299
|
-
throw new
|
|
1299
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
1300
1300
|
`IN/NOT IN subquery does not support ${String(resolvedValueType)} values`,
|
|
1301
1301
|
{ valueType: resolvedValueType }
|
|
1302
1302
|
);
|
|
1303
1303
|
}
|
|
1304
1304
|
if (!isInSubqueryTypeCompatible(fieldValueType, subqueryValueType)) {
|
|
1305
|
-
throw new
|
|
1305
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
1306
1306
|
`IN/NOT IN type mismatch: field type "${String(fieldValueType)}" does not match subquery column type "${String(subqueryValueType)}"`,
|
|
1307
1307
|
{
|
|
1308
1308
|
fieldValueType,
|
|
@@ -1312,7 +1312,7 @@ function compileInSubquery(expr, ctx) {
|
|
|
1312
1312
|
}
|
|
1313
1313
|
const valueType = fieldValueType ?? subqueryValueType;
|
|
1314
1314
|
if (expr.subquery.graphId === void 0) {
|
|
1315
|
-
throw new
|
|
1315
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
1316
1316
|
"IN/NOT IN subquery must have a graphId"
|
|
1317
1317
|
);
|
|
1318
1318
|
}
|
|
@@ -1332,7 +1332,7 @@ function extractStructuralPredicates(predicates, isMatch, rejectionMessage) {
|
|
|
1332
1332
|
function visit(expr, inDisallowedBranch) {
|
|
1333
1333
|
if (isMatch(expr)) {
|
|
1334
1334
|
if (inDisallowedBranch) {
|
|
1335
|
-
throw new
|
|
1335
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(rejectionMessage);
|
|
1336
1336
|
}
|
|
1337
1337
|
results.push(expr);
|
|
1338
1338
|
return;
|
|
@@ -1438,7 +1438,7 @@ function getNodeKindsForAlias(ast, alias) {
|
|
|
1438
1438
|
return traversal.nodeKinds;
|
|
1439
1439
|
}
|
|
1440
1440
|
}
|
|
1441
|
-
throw new
|
|
1441
|
+
throw new chunkJIEJCTDS_cjs.CompilerInvariantError(`Unknown traversal source alias: ${alias}`);
|
|
1442
1442
|
}
|
|
1443
1443
|
function getHybridTargetAlias(vectorPredicate, fulltextPredicate) {
|
|
1444
1444
|
if (!vectorPredicate || !fulltextPredicate) return void 0;
|
|
@@ -1499,7 +1499,7 @@ function findUnaryNodeInProjectChain(rootNode, op) {
|
|
|
1499
1499
|
}
|
|
1500
1500
|
function inspectProjectPlan(logicalPlan) {
|
|
1501
1501
|
if (logicalPlan.root.op !== "project") {
|
|
1502
|
-
throw new
|
|
1502
|
+
throw new chunkJIEJCTDS_cjs.CompilerInvariantError(
|
|
1503
1503
|
`SQL emitter expected logical plan root to be "project", got "${logicalPlan.root.op}"`,
|
|
1504
1504
|
{ component: "plan-inspector" }
|
|
1505
1505
|
);
|
|
@@ -1530,13 +1530,13 @@ function inspectProjectPlan(logicalPlan) {
|
|
|
1530
1530
|
function inspectStandardProjectPlan(logicalPlan) {
|
|
1531
1531
|
const shape = inspectProjectPlan(logicalPlan);
|
|
1532
1532
|
if (shape.hasSetOperation) {
|
|
1533
|
-
throw new
|
|
1533
|
+
throw new chunkJIEJCTDS_cjs.CompilerInvariantError(
|
|
1534
1534
|
'Standard SQL emitter does not support plans containing "set_op" nodes',
|
|
1535
1535
|
{ component: "plan-inspector" }
|
|
1536
1536
|
);
|
|
1537
1537
|
}
|
|
1538
1538
|
if (shape.hasRecursiveExpand) {
|
|
1539
|
-
throw new
|
|
1539
|
+
throw new chunkJIEJCTDS_cjs.CompilerInvariantError(
|
|
1540
1540
|
'Standard SQL emitter does not support plans containing "recursive_expand" nodes',
|
|
1541
1541
|
{ component: "plan-inspector" }
|
|
1542
1542
|
);
|
|
@@ -1546,13 +1546,13 @@ function inspectStandardProjectPlan(logicalPlan) {
|
|
|
1546
1546
|
function inspectRecursiveProjectPlan(logicalPlan) {
|
|
1547
1547
|
const shape = inspectProjectPlan(logicalPlan);
|
|
1548
1548
|
if (!shape.hasRecursiveExpand) {
|
|
1549
|
-
throw new
|
|
1549
|
+
throw new chunkJIEJCTDS_cjs.CompilerInvariantError(
|
|
1550
1550
|
'Recursive SQL emitter expected logical plan to contain a "recursive_expand" node',
|
|
1551
1551
|
{ component: "plan-inspector" }
|
|
1552
1552
|
);
|
|
1553
1553
|
}
|
|
1554
1554
|
if (shape.hasSetOperation) {
|
|
1555
|
-
throw new
|
|
1555
|
+
throw new chunkJIEJCTDS_cjs.CompilerInvariantError(
|
|
1556
1556
|
'Recursive SQL emitter does not support plans containing "set_op" nodes',
|
|
1557
1557
|
{ component: "plan-inspector" }
|
|
1558
1558
|
);
|
|
@@ -1613,7 +1613,7 @@ function inspectSetOperationPlan(logicalPlan) {
|
|
|
1613
1613
|
const operations = /* @__PURE__ */ new Set();
|
|
1614
1614
|
collectPlanOperations(logicalPlan.root, operations);
|
|
1615
1615
|
if (!operations.has("set_op")) {
|
|
1616
|
-
throw new
|
|
1616
|
+
throw new chunkJIEJCTDS_cjs.CompilerInvariantError(
|
|
1617
1617
|
'Set-operation SQL emitter expected logical plan to contain a "set_op" node',
|
|
1618
1618
|
{ component: "plan-inspector" }
|
|
1619
1619
|
);
|
|
@@ -1631,25 +1631,25 @@ function inspectSetOperationPlan(logicalPlan) {
|
|
|
1631
1631
|
function assertRecursiveEmitterClauseAlignment(logicalPlan, input) {
|
|
1632
1632
|
const planShape = inspectRecursiveProjectPlan(logicalPlan);
|
|
1633
1633
|
if (planShape.hasSort && input.orderBy === void 0) {
|
|
1634
|
-
throw new
|
|
1634
|
+
throw new chunkJIEJCTDS_cjs.CompilerInvariantError(
|
|
1635
1635
|
"Recursive SQL emitter expected ORDER BY clause for plan containing a sort node",
|
|
1636
1636
|
{ component: "recursive-emitter" }
|
|
1637
1637
|
);
|
|
1638
1638
|
}
|
|
1639
1639
|
if (!planShape.hasSort && input.orderBy !== void 0) {
|
|
1640
|
-
throw new
|
|
1640
|
+
throw new chunkJIEJCTDS_cjs.CompilerInvariantError(
|
|
1641
1641
|
"Recursive SQL emitter received ORDER BY clause for a plan without sort nodes",
|
|
1642
1642
|
{ component: "recursive-emitter" }
|
|
1643
1643
|
);
|
|
1644
1644
|
}
|
|
1645
1645
|
if (planShape.hasLimitOffset && input.limitOffset === void 0) {
|
|
1646
|
-
throw new
|
|
1646
|
+
throw new chunkJIEJCTDS_cjs.CompilerInvariantError(
|
|
1647
1647
|
"Recursive SQL emitter expected LIMIT/OFFSET clause for plan containing a limit_offset node",
|
|
1648
1648
|
{ component: "recursive-emitter" }
|
|
1649
1649
|
);
|
|
1650
1650
|
}
|
|
1651
1651
|
if (!planShape.hasLimitOffset && input.limitOffset !== void 0) {
|
|
1652
|
-
throw new
|
|
1652
|
+
throw new chunkJIEJCTDS_cjs.CompilerInvariantError(
|
|
1653
1653
|
"Recursive SQL emitter received LIMIT/OFFSET clause for a plan without limit_offset nodes",
|
|
1654
1654
|
{ component: "recursive-emitter" }
|
|
1655
1655
|
);
|
|
@@ -1676,14 +1676,14 @@ function assertSetOperationEmitterClauseAlignment(logicalPlan, suffixClauses) {
|
|
|
1676
1676
|
const shape = inspectSetOperationPlan(logicalPlan);
|
|
1677
1677
|
const hasSuffixClauses = suffixClauses !== void 0 && suffixClauses.length > 0;
|
|
1678
1678
|
if (!shape.hasSort && !shape.hasLimitOffset && hasSuffixClauses) {
|
|
1679
|
-
throw new
|
|
1679
|
+
throw new chunkJIEJCTDS_cjs.CompilerInvariantError(
|
|
1680
1680
|
"Set-operation SQL emitter received suffix clauses for a plan without top-level sort or limit_offset nodes",
|
|
1681
1681
|
{ component: "set-operation-emitter" }
|
|
1682
1682
|
);
|
|
1683
1683
|
}
|
|
1684
1684
|
if (!hasSuffixClauses) {
|
|
1685
1685
|
if (shape.hasSort || shape.hasLimitOffset) {
|
|
1686
|
-
throw new
|
|
1686
|
+
throw new chunkJIEJCTDS_cjs.CompilerInvariantError(
|
|
1687
1687
|
"Set-operation SQL emitter expected suffix clauses for plan containing top-level sort or limit_offset nodes",
|
|
1688
1688
|
{ component: "set-operation-emitter" }
|
|
1689
1689
|
);
|
|
@@ -1693,7 +1693,7 @@ function assertSetOperationEmitterClauseAlignment(logicalPlan, suffixClauses) {
|
|
|
1693
1693
|
const limitOffsetClauseCount = shape.limitOffsetNode === void 0 ? 0 : (shape.limitOffsetNode.limit === void 0 ? 0 : 1) + (shape.limitOffsetNode.offset === void 0 ? 0 : 1);
|
|
1694
1694
|
const expectedClauseCount = (shape.sortNode === void 0 ? 0 : 1) + limitOffsetClauseCount;
|
|
1695
1695
|
if (suffixClauses.length !== expectedClauseCount) {
|
|
1696
|
-
throw new
|
|
1696
|
+
throw new chunkJIEJCTDS_cjs.CompilerInvariantError(
|
|
1697
1697
|
`Set-operation SQL emitter expected ${String(expectedClauseCount)} top-level suffix clause(s) from logical plan, got ${String(suffixClauses.length)}`,
|
|
1698
1698
|
{ component: "set-operation-emitter" }
|
|
1699
1699
|
);
|
|
@@ -1717,38 +1717,38 @@ function emitSetOperationQuerySql(input) {
|
|
|
1717
1717
|
function assertStandardEmitterClauseAlignment(logicalPlan, input) {
|
|
1718
1718
|
const planShape = inspectStandardProjectPlan(logicalPlan);
|
|
1719
1719
|
if (input.groupBy !== void 0 && !planShape.hasAggregate) {
|
|
1720
|
-
throw new
|
|
1720
|
+
throw new chunkJIEJCTDS_cjs.CompilerInvariantError(
|
|
1721
1721
|
"Standard SQL emitter received GROUP BY clause for a plan without aggregate nodes",
|
|
1722
1722
|
{ component: "standard-emitter" }
|
|
1723
1723
|
);
|
|
1724
1724
|
}
|
|
1725
1725
|
if (input.having !== void 0 && !planShape.hasAggregate) {
|
|
1726
|
-
throw new
|
|
1726
|
+
throw new chunkJIEJCTDS_cjs.CompilerInvariantError(
|
|
1727
1727
|
"Standard SQL emitter received HAVING clause for a plan without aggregate nodes",
|
|
1728
1728
|
{ component: "standard-emitter" }
|
|
1729
1729
|
);
|
|
1730
1730
|
}
|
|
1731
1731
|
const expectsOrderBy = planShape.hasSort || planShape.hasVectorKnn || planShape.hasFulltextMatch;
|
|
1732
1732
|
if (expectsOrderBy && input.orderBy === void 0) {
|
|
1733
|
-
throw new
|
|
1733
|
+
throw new chunkJIEJCTDS_cjs.CompilerInvariantError(
|
|
1734
1734
|
"Standard SQL emitter expected ORDER BY clause for plan containing a sort, vector_knn, or fulltext_match node",
|
|
1735
1735
|
{ component: "standard-emitter" }
|
|
1736
1736
|
);
|
|
1737
1737
|
}
|
|
1738
1738
|
if (!expectsOrderBy && input.orderBy !== void 0) {
|
|
1739
|
-
throw new
|
|
1739
|
+
throw new chunkJIEJCTDS_cjs.CompilerInvariantError(
|
|
1740
1740
|
"Standard SQL emitter received ORDER BY clause for a plan without sort, vector_knn, or fulltext_match nodes",
|
|
1741
1741
|
{ component: "standard-emitter" }
|
|
1742
1742
|
);
|
|
1743
1743
|
}
|
|
1744
1744
|
if (planShape.hasLimitOffset && input.limitOffset === void 0) {
|
|
1745
|
-
throw new
|
|
1745
|
+
throw new chunkJIEJCTDS_cjs.CompilerInvariantError(
|
|
1746
1746
|
"Standard SQL emitter expected LIMIT/OFFSET clause for plan containing a limit_offset node",
|
|
1747
1747
|
{ component: "standard-emitter" }
|
|
1748
1748
|
);
|
|
1749
1749
|
}
|
|
1750
1750
|
if (!planShape.hasLimitOffset && input.limitOffset !== void 0) {
|
|
1751
|
-
throw new
|
|
1751
|
+
throw new chunkJIEJCTDS_cjs.CompilerInvariantError(
|
|
1752
1752
|
"Standard SQL emitter received LIMIT/OFFSET clause for a plan without limit_offset nodes",
|
|
1753
1753
|
{ component: "standard-emitter" }
|
|
1754
1754
|
);
|
|
@@ -1796,15 +1796,15 @@ var DEFAULT_TABLE_NAMES = {
|
|
|
1796
1796
|
var VALID_IDENTIFIER_PATTERN = /^[a-z_][a-z0-9_$]*$/i;
|
|
1797
1797
|
function validateTableName(name, label) {
|
|
1798
1798
|
if (!name || name.length === 0) {
|
|
1799
|
-
throw new
|
|
1799
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(`${label} table name cannot be empty`);
|
|
1800
1800
|
}
|
|
1801
|
-
if (name.length >
|
|
1802
|
-
throw new
|
|
1803
|
-
`${label} table name exceeds maximum length of ${
|
|
1801
|
+
if (name.length > chunk4BXHVEFB_cjs.MAX_PG_IDENTIFIER_LENGTH) {
|
|
1802
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
1803
|
+
`${label} table name exceeds maximum length of ${chunk4BXHVEFB_cjs.MAX_PG_IDENTIFIER_LENGTH} characters`
|
|
1804
1804
|
);
|
|
1805
1805
|
}
|
|
1806
1806
|
if (!VALID_IDENTIFIER_PATTERN.test(name)) {
|
|
1807
|
-
throw new
|
|
1807
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
1808
1808
|
`${label} table name "${name}" is not a valid SQL identifier. Table names must start with a letter or underscore and contain only letters, digits, underscores, or dollar signs.`
|
|
1809
1809
|
);
|
|
1810
1810
|
}
|
|
@@ -1872,7 +1872,7 @@ function compileColumnReference(tableAlias, column) {
|
|
|
1872
1872
|
return drizzleOrm.sql`${drizzleOrm.sql.raw(tableAlias)}.${drizzleOrm.sql.raw(column)}`;
|
|
1873
1873
|
}
|
|
1874
1874
|
function qualifyColumn(owner, name) {
|
|
1875
|
-
return drizzleOrm.sql`${
|
|
1875
|
+
return drizzleOrm.sql`${chunkIE6GN7L3_cjs.quoteIdentifier(owner)}.${chunkIE6GN7L3_cjs.quoteIdentifier(name)}`;
|
|
1876
1876
|
}
|
|
1877
1877
|
var SCOPED_RELEVANCE_NODES_ALIAS = "scoped_relevance_nodes";
|
|
1878
1878
|
function buildScopedNodeIdsSubquery(nodeAlias) {
|
|
@@ -1882,20 +1882,20 @@ function buildScopedNodeIdsSubquery(nodeAlias) {
|
|
|
1882
1882
|
SELECT DISTINCT
|
|
1883
1883
|
${qualifyColumn(cteAlias, `${nodeAlias}_id`)} AS node_id,
|
|
1884
1884
|
${qualifyColumn(cteAlias, `${nodeAlias}_kind`)} AS node_kind
|
|
1885
|
-
FROM ${
|
|
1885
|
+
FROM ${chunkIE6GN7L3_cjs.quoteIdentifier(cteAlias)}
|
|
1886
1886
|
) AS ${drizzleOrm.sql.raw(SCOPED_RELEVANCE_NODES_ALIAS)}
|
|
1887
1887
|
`;
|
|
1888
1888
|
}
|
|
1889
1889
|
function compileNodeSelectColumns(tableAlias, alias, requiredColumns) {
|
|
1890
|
-
return
|
|
1891
|
-
(column) => column === "id" || column === "kind" ||
|
|
1890
|
+
return chunkIE6GN7L3_cjs.NODE_COLUMNS.filter(
|
|
1891
|
+
(column) => column === "id" || column === "kind" || chunkIE6GN7L3_cjs.shouldProjectColumn(requiredColumns, column)
|
|
1892
1892
|
).map(
|
|
1893
1893
|
(column) => drizzleOrm.sql`${compileColumnReference(tableAlias, column)} AS ${drizzleOrm.sql.raw(`${alias}_${column}`)}`
|
|
1894
1894
|
);
|
|
1895
1895
|
}
|
|
1896
1896
|
function compileEdgeSelectColumns(tableAlias, alias, requiredColumns) {
|
|
1897
|
-
return
|
|
1898
|
-
(column) =>
|
|
1897
|
+
return chunkIE6GN7L3_cjs.EDGE_COLUMNS.filter(
|
|
1898
|
+
(column) => chunkIE6GN7L3_cjs.shouldProjectColumn(requiredColumns, column)
|
|
1899
1899
|
).map(
|
|
1900
1900
|
(column) => drizzleOrm.sql`${compileColumnReference(tableAlias, column)} AS ${drizzleOrm.sql.raw(`${alias}_${column}`)}`
|
|
1901
1901
|
);
|
|
@@ -1918,7 +1918,7 @@ function buildStandardStartCte(input) {
|
|
|
1918
1918
|
temporalFilter,
|
|
1919
1919
|
...predicateClauses
|
|
1920
1920
|
];
|
|
1921
|
-
const effectiveRequiredColumns = requiredColumnsByAlias ? requiredColumnsByAlias.get(alias) ??
|
|
1921
|
+
const effectiveRequiredColumns = requiredColumnsByAlias ? requiredColumnsByAlias.get(alias) ?? chunkIE6GN7L3_cjs.EMPTY_REQUIRED_COLUMNS : void 0;
|
|
1922
1922
|
const limitClause = input.limitOffset === void 0 ? drizzleOrm.sql`` : input.limitOffset.offset === void 0 ? drizzleOrm.sql`
|
|
1923
1923
|
LIMIT ${input.limitOffset.limit}
|
|
1924
1924
|
` : drizzleOrm.sql`
|
|
@@ -1984,8 +1984,8 @@ function buildStandardTraversalCte(input) {
|
|
|
1984
1984
|
const previousAlias = traversal.joinFromAlias;
|
|
1985
1985
|
const edgeAlias = traversal.edgeAlias;
|
|
1986
1986
|
const nodeAlias = traversal.nodeAlias;
|
|
1987
|
-
const requiredNodeColumns = requiredColumnsByAlias ? requiredColumnsByAlias.get(nodeAlias) ??
|
|
1988
|
-
const requiredEdgeColumns = requiredColumnsByAlias ? requiredColumnsByAlias.get(edgeAlias) ??
|
|
1987
|
+
const requiredNodeColumns = requiredColumnsByAlias ? requiredColumnsByAlias.get(nodeAlias) ?? chunkIE6GN7L3_cjs.EMPTY_REQUIRED_COLUMNS : void 0;
|
|
1988
|
+
const requiredEdgeColumns = requiredColumnsByAlias ? requiredColumnsByAlias.get(edgeAlias) ?? chunkIE6GN7L3_cjs.EMPTY_REQUIRED_COLUMNS : void 0;
|
|
1989
1989
|
const previousRowColumns = carryForwardPreviousColumns ? [drizzleOrm.sql`cte_${drizzleOrm.sql.raw(previousAlias)}.*`] : [
|
|
1990
1990
|
drizzleOrm.sql`cte_${drizzleOrm.sql.raw(previousAlias)}.${drizzleOrm.sql.raw(previousAlias)}_id AS ${drizzleOrm.sql.raw(previousAlias)}_id`,
|
|
1991
1991
|
drizzleOrm.sql`cte_${drizzleOrm.sql.raw(previousAlias)}.${drizzleOrm.sql.raw(previousAlias)}_kind AS ${drizzleOrm.sql.raw(previousAlias)}_kind`
|
|
@@ -2110,14 +2110,14 @@ function compileAggregateExprFromSource(expr, dialect) {
|
|
|
2110
2110
|
return drizzleOrm.sql`${drizzleOrm.sql.raw(fn.toUpperCase())}(${column})`;
|
|
2111
2111
|
}
|
|
2112
2112
|
default: {
|
|
2113
|
-
throw new
|
|
2113
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
2114
2114
|
`Unknown aggregate function: ${String(fn)}`
|
|
2115
2115
|
);
|
|
2116
2116
|
}
|
|
2117
2117
|
}
|
|
2118
2118
|
}
|
|
2119
2119
|
function compileProjectedSource(field2, dialect) {
|
|
2120
|
-
if (
|
|
2120
|
+
if (chunkIE6GN7L3_cjs.isAggregateExpr(field2.source)) {
|
|
2121
2121
|
return compileAggregateExprFromSource(field2.source, dialect);
|
|
2122
2122
|
}
|
|
2123
2123
|
const cteAlias = field2.cteAlias ?? `cte_${field2.source.alias}`;
|
|
@@ -2144,7 +2144,7 @@ function buildStandardProjection(input) {
|
|
|
2144
2144
|
}
|
|
2145
2145
|
const projectedFields = fields.map((field2) => {
|
|
2146
2146
|
const source = compileProjectedSource(field2, dialect);
|
|
2147
|
-
return drizzleOrm.sql`${source} AS ${
|
|
2147
|
+
return drizzleOrm.sql`${source} AS ${chunkIE6GN7L3_cjs.quoteIdentifier(field2.outputName)}`;
|
|
2148
2148
|
});
|
|
2149
2149
|
return drizzleOrm.sql.join(projectedFields, drizzleOrm.sql`, `);
|
|
2150
2150
|
}
|
|
@@ -2163,19 +2163,19 @@ function compileSelectiveProjection(fields, dialect, ast, collapsedTraversalCteA
|
|
|
2163
2163
|
const columns = fields.map((field2) => {
|
|
2164
2164
|
const cteAlias = collapsedTraversalCteAlias ?? aliasToCte.get(field2.alias) ?? `cte_${field2.alias}`;
|
|
2165
2165
|
if (field2.isSystemField) {
|
|
2166
|
-
const dbColumn =
|
|
2167
|
-
return drizzleOrm.sql`${drizzleOrm.sql.raw(cteAlias)}.${drizzleOrm.sql.raw(`${field2.alias}_${dbColumn}`)} AS ${
|
|
2166
|
+
const dbColumn = chunkIE6GN7L3_cjs.mapSelectiveSystemFieldToColumn(field2.field);
|
|
2167
|
+
return drizzleOrm.sql`${drizzleOrm.sql.raw(cteAlias)}.${drizzleOrm.sql.raw(`${field2.alias}_${dbColumn}`)} AS ${chunkIE6GN7L3_cjs.quoteIdentifier(field2.outputName)}`;
|
|
2168
2168
|
}
|
|
2169
2169
|
const propsColumn = `${field2.alias}_props`;
|
|
2170
2170
|
const column = drizzleOrm.sql`${drizzleOrm.sql.raw(cteAlias)}.${drizzleOrm.sql.raw(propsColumn)}`;
|
|
2171
|
-
const pointer =
|
|
2171
|
+
const pointer = chunkFLRCVI2G_cjs.jsonPointer([field2.field]);
|
|
2172
2172
|
const extracted = compileTypedJsonExtract({
|
|
2173
2173
|
column,
|
|
2174
2174
|
dialect,
|
|
2175
2175
|
pointer,
|
|
2176
2176
|
valueType: field2.valueType
|
|
2177
2177
|
});
|
|
2178
|
-
return drizzleOrm.sql`${extracted} AS ${
|
|
2178
|
+
return drizzleOrm.sql`${extracted} AS ${chunkIE6GN7L3_cjs.quoteIdentifier(field2.outputName)}`;
|
|
2179
2179
|
});
|
|
2180
2180
|
return drizzleOrm.sql.join(columns, drizzleOrm.sql`, `);
|
|
2181
2181
|
}
|
|
@@ -2254,7 +2254,7 @@ function buildStandardOrderBy(input) {
|
|
|
2254
2254
|
for (const orderSpec of ast.orderBy) {
|
|
2255
2255
|
const valueType = orderSpec.field.valueType;
|
|
2256
2256
|
if (valueType === "array" || valueType === "object") {
|
|
2257
|
-
throw new
|
|
2257
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
2258
2258
|
"Ordering by JSON arrays or objects is not supported"
|
|
2259
2259
|
);
|
|
2260
2260
|
}
|
|
@@ -2337,13 +2337,13 @@ function buildStandardEmbeddingsCte(input) {
|
|
|
2337
2337
|
const { ctx, graphId, nodeKinds, vectorPredicate } = input;
|
|
2338
2338
|
const { field: field2, metric, minScore, queryEmbedding } = vectorPredicate;
|
|
2339
2339
|
if (nodeKinds.length === 0) {
|
|
2340
|
-
throw new
|
|
2340
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
2341
2341
|
"Vector predicate must resolve to at least one node kind"
|
|
2342
2342
|
);
|
|
2343
2343
|
}
|
|
2344
2344
|
const { vectorStrategy } = ctx;
|
|
2345
2345
|
if (vectorStrategy === void 0) {
|
|
2346
|
-
throw new
|
|
2346
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
2347
2347
|
"Vector similarity predicate requires a backend with a vector strategy"
|
|
2348
2348
|
);
|
|
2349
2349
|
}
|
|
@@ -2361,13 +2361,13 @@ function buildStandardEmbeddingsCte(input) {
|
|
|
2361
2361
|
queryEmbedding,
|
|
2362
2362
|
branchMetric
|
|
2363
2363
|
);
|
|
2364
|
-
const scoreExpr =
|
|
2364
|
+
const scoreExpr = chunkUESTHN47_cjs.vectorScoreExpression(distanceExpr, branchMetric);
|
|
2365
2365
|
const conditions = [
|
|
2366
2366
|
drizzleOrm.sql`${qualifyColumn(tableName, "graph_id")} = ${graphId}`
|
|
2367
2367
|
];
|
|
2368
2368
|
if (minScore !== void 0) {
|
|
2369
2369
|
conditions.push(
|
|
2370
|
-
|
|
2370
|
+
chunkUESTHN47_cjs.vectorMinScoreCondition(distanceExpr, branchMetric, minScore)
|
|
2371
2371
|
);
|
|
2372
2372
|
}
|
|
2373
2373
|
return drizzleOrm.sql`
|
|
@@ -2376,7 +2376,7 @@ function buildStandardEmbeddingsCte(input) {
|
|
|
2376
2376
|
${kind} AS node_kind,
|
|
2377
2377
|
${distanceExpr} AS distance,
|
|
2378
2378
|
${scoreExpr} AS score
|
|
2379
|
-
FROM ${
|
|
2379
|
+
FROM ${chunkIE6GN7L3_cjs.quoteIdentifier(tableName)}
|
|
2380
2380
|
INNER JOIN ${scopedNodes}
|
|
2381
2381
|
ON ${drizzleOrm.sql.raw(`${SCOPED_RELEVANCE_NODES_ALIAS}.node_id`)} =
|
|
2382
2382
|
${qualifyColumn(tableName, "node_id")}
|
|
@@ -2421,7 +2421,7 @@ function buildStandardFulltextCte(input) {
|
|
|
2421
2421
|
const { dialect, schema } = ctx;
|
|
2422
2422
|
const { query, mode, language, limit, minScore } = fulltextPredicate;
|
|
2423
2423
|
if (nodeKinds.length === 0) {
|
|
2424
|
-
throw new
|
|
2424
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
2425
2425
|
"Fulltext predicate must resolve to at least one node kind"
|
|
2426
2426
|
);
|
|
2427
2427
|
}
|
|
@@ -2429,7 +2429,7 @@ function buildStandardFulltextCte(input) {
|
|
|
2429
2429
|
const scopedNodes = buildScopedNodeIdsSubquery(fulltextPredicate.field.alias);
|
|
2430
2430
|
const fulltextStrategy = dialect.fulltext;
|
|
2431
2431
|
if (fulltextStrategy === void 0) {
|
|
2432
|
-
throw new
|
|
2432
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
2433
2433
|
`Fulltext match predicates are not supported for dialect "${dialect.name}"`
|
|
2434
2434
|
);
|
|
2435
2435
|
}
|
|
@@ -2494,7 +2494,7 @@ function compileUserOrderBy(ast, dialect) {
|
|
|
2494
2494
|
for (const orderSpec of ast.orderBy) {
|
|
2495
2495
|
const valueType = orderSpec.field.valueType;
|
|
2496
2496
|
if (valueType === "array" || valueType === "object") {
|
|
2497
|
-
throw new
|
|
2497
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
2498
2498
|
"Ordering by JSON arrays or objects is not supported"
|
|
2499
2499
|
);
|
|
2500
2500
|
}
|
|
@@ -2557,7 +2557,7 @@ function buildLimitOffsetClause(input) {
|
|
|
2557
2557
|
function runFulltextPredicatePass(ast, dialect) {
|
|
2558
2558
|
const fulltextPredicates = extractFulltextMatchPredicates(ast.predicates);
|
|
2559
2559
|
if (fulltextPredicates.length > 1) {
|
|
2560
|
-
throw new
|
|
2560
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
2561
2561
|
"Multiple fulltext match predicates in a single query are not supported"
|
|
2562
2562
|
);
|
|
2563
2563
|
}
|
|
@@ -2566,34 +2566,34 @@ function runFulltextPredicatePass(ast, dialect) {
|
|
|
2566
2566
|
return { fulltextPredicate: void 0 };
|
|
2567
2567
|
}
|
|
2568
2568
|
if (!dialect.capabilities.supportsFulltext) {
|
|
2569
|
-
throw new
|
|
2569
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
2570
2570
|
`Fulltext match predicates are not supported for dialect "${dialect.name}"`
|
|
2571
2571
|
);
|
|
2572
2572
|
}
|
|
2573
2573
|
const strategy = dialect.fulltext;
|
|
2574
2574
|
if (strategy === void 0) {
|
|
2575
|
-
throw new
|
|
2575
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
2576
2576
|
`Dialect "${dialect.name}" advertises fulltext support but has no strategy configured`
|
|
2577
2577
|
);
|
|
2578
2578
|
}
|
|
2579
2579
|
if (!strategy.supportedModes.includes(fulltextPredicate.mode)) {
|
|
2580
|
-
throw new
|
|
2580
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
2581
2581
|
`Fulltext query mode "${fulltextPredicate.mode}" is not supported by the "${strategy.name}" strategy. Supported modes: ${strategy.supportedModes.join(", ")}.`
|
|
2582
2582
|
);
|
|
2583
2583
|
}
|
|
2584
2584
|
if (fulltextPredicate.language !== void 0 && !strategy.supportsLanguageOverride) {
|
|
2585
|
-
throw new
|
|
2585
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
2586
2586
|
`Fulltext strategy "${strategy.name}" does not honor a per-query \`language\` override (its tokenizer is fixed at table-create time). Drop the option, or use a strategy that advertises \`supportsLanguageOverride: true\`.`
|
|
2587
2587
|
);
|
|
2588
2588
|
}
|
|
2589
2589
|
if (!Number.isFinite(fulltextPredicate.limit) || fulltextPredicate.limit <= 0) {
|
|
2590
|
-
throw new
|
|
2590
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
2591
2591
|
`Fulltext match limit must be a positive finite number, got ${String(fulltextPredicate.limit)}`
|
|
2592
2592
|
);
|
|
2593
2593
|
}
|
|
2594
2594
|
const { minScore } = fulltextPredicate;
|
|
2595
2595
|
if (minScore !== void 0 && !Number.isFinite(minScore)) {
|
|
2596
|
-
throw new
|
|
2596
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
2597
2597
|
`Fulltext minScore must be a finite number, got ${String(minScore)}`
|
|
2598
2598
|
);
|
|
2599
2599
|
}
|
|
@@ -2614,12 +2614,12 @@ function runFusionConfigPass(ast, vectorPredicate, fulltextPredicate) {
|
|
|
2614
2614
|
const fusion = ast.fusion;
|
|
2615
2615
|
if (fusion === void 0) return { fusion: void 0 };
|
|
2616
2616
|
if (vectorPredicate === void 0 || fulltextPredicate === void 0) {
|
|
2617
|
-
throw new
|
|
2617
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
2618
2618
|
`.fuseWith() requires both a .similarTo() and a .$fulltext.matches() predicate in the same query. Remove .fuseWith(), or add the missing predicate.`
|
|
2619
2619
|
);
|
|
2620
2620
|
}
|
|
2621
2621
|
if (vectorPredicate.field.alias !== fulltextPredicate.field.alias) {
|
|
2622
|
-
throw new
|
|
2622
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
2623
2623
|
`.fuseWith() requires .similarTo() and .$fulltext.matches() to target the same node alias. Got vector=${vectorPredicate.field.alias}, fulltext=${fulltextPredicate.field.alias}.`
|
|
2624
2624
|
);
|
|
2625
2625
|
}
|
|
@@ -2632,10 +2632,10 @@ function runRecursiveTraversalSelectionPass(ast) {
|
|
|
2632
2632
|
(traversal) => traversal.variableLength !== void 0
|
|
2633
2633
|
);
|
|
2634
2634
|
if (variableLengthTraversal === void 0) {
|
|
2635
|
-
throw new
|
|
2635
|
+
throw new chunkJIEJCTDS_cjs.CompilerInvariantError("No variable-length traversal found");
|
|
2636
2636
|
}
|
|
2637
2637
|
if (ast.traversals.length > 1) {
|
|
2638
|
-
throw new
|
|
2638
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
2639
2639
|
"Variable-length traversals with multiple traversals are not yet supported. Please use a single variable-length traversal."
|
|
2640
2640
|
);
|
|
2641
2641
|
}
|
|
@@ -2699,7 +2699,7 @@ function createTemporalFilterPass(ast, currentTimestamp) {
|
|
|
2699
2699
|
function runVectorPredicatePass(ast, dialect, vectorStrategy) {
|
|
2700
2700
|
const vectorPredicates = extractVectorSimilarityPredicates(ast.predicates);
|
|
2701
2701
|
if (vectorPredicates.length > 1) {
|
|
2702
|
-
throw new
|
|
2702
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
2703
2703
|
"Multiple vector similarity predicates in a single query are not supported"
|
|
2704
2704
|
);
|
|
2705
2705
|
}
|
|
@@ -2709,32 +2709,32 @@ function runVectorPredicatePass(ast, dialect, vectorStrategy) {
|
|
|
2709
2709
|
}
|
|
2710
2710
|
const predicateStrategy = dialect.capabilities.vectorPredicateStrategy;
|
|
2711
2711
|
if (predicateStrategy === "unsupported" || !dialect.supportsVectors) {
|
|
2712
|
-
throw new
|
|
2712
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
2713
2713
|
`Vector similarity predicates are not supported for dialect "${dialect.name}"`
|
|
2714
2714
|
);
|
|
2715
2715
|
}
|
|
2716
2716
|
if (vectorPredicate.metric !== void 0) {
|
|
2717
2717
|
const supportedMetrics = vectorStrategy?.capabilities.metrics ?? dialect.capabilities.vectorMetrics;
|
|
2718
2718
|
if (!supportedMetrics.includes(vectorPredicate.metric)) {
|
|
2719
|
-
throw new
|
|
2719
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
2720
2720
|
vectorStrategy === void 0 ? `Vector metric "${vectorPredicate.metric}" is not supported for dialect "${dialect.name}"` : `Vector metric "${vectorPredicate.metric}" is not supported by vector strategy "${vectorStrategy.name}" (supported: ${supportedMetrics.join(", ")})`
|
|
2721
2721
|
);
|
|
2722
2722
|
}
|
|
2723
2723
|
}
|
|
2724
2724
|
if (!Number.isFinite(vectorPredicate.limit) || vectorPredicate.limit <= 0) {
|
|
2725
|
-
throw new
|
|
2725
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
2726
2726
|
`Vector predicate limit must be a positive finite number, got ${String(vectorPredicate.limit)}`
|
|
2727
2727
|
);
|
|
2728
2728
|
}
|
|
2729
2729
|
const { minScore } = vectorPredicate;
|
|
2730
2730
|
if (minScore !== void 0) {
|
|
2731
2731
|
if (!Number.isFinite(minScore)) {
|
|
2732
|
-
throw new
|
|
2732
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
2733
2733
|
`Vector minScore must be a finite number, got ${String(minScore)}`
|
|
2734
2734
|
);
|
|
2735
2735
|
}
|
|
2736
2736
|
if (vectorPredicate.metric === "cosine" && (minScore < -1 || minScore > 1)) {
|
|
2737
|
-
throw new
|
|
2737
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
2738
2738
|
`Cosine minScore must be between -1 and 1, got ${String(minScore)}`
|
|
2739
2739
|
);
|
|
2740
2740
|
}
|
|
@@ -2828,7 +2828,7 @@ function appendAggregateSortLimitAndProjectNodes(currentNode, ast, nextPlanNodeI
|
|
|
2828
2828
|
} else if (hasOffset) {
|
|
2829
2829
|
node = { ...limitOffsetNodeBase, offset: ast.offset };
|
|
2830
2830
|
} else {
|
|
2831
|
-
throw new
|
|
2831
|
+
throw new chunkJIEJCTDS_cjs.CompilerInvariantError(
|
|
2832
2832
|
"limit_offset node requires limit or offset to be present"
|
|
2833
2833
|
);
|
|
2834
2834
|
}
|
|
@@ -2984,7 +2984,7 @@ function lowerComposableQueryToLogicalPlanNode(query, dialect, graphId, nextPlan
|
|
|
2984
2984
|
nextPlanNodeId
|
|
2985
2985
|
});
|
|
2986
2986
|
}
|
|
2987
|
-
const dialectAdapter =
|
|
2987
|
+
const dialectAdapter = chunkUESTHN47_cjs.getDialect(dialect);
|
|
2988
2988
|
const vectorPredicate = runVectorPredicatePass(
|
|
2989
2989
|
query,
|
|
2990
2990
|
dialectAdapter,
|
|
@@ -3147,7 +3147,7 @@ function runRecursiveQueryPassPipeline(ast, graphId, ctx) {
|
|
|
3147
3147
|
execute(currentState) {
|
|
3148
3148
|
const traversal = currentState.traversal;
|
|
3149
3149
|
if (traversal === void 0) {
|
|
3150
|
-
throw new
|
|
3150
|
+
throw new chunkJIEJCTDS_cjs.CompilerInvariantError(
|
|
3151
3151
|
"Recursive traversal pass did not select traversal"
|
|
3152
3152
|
);
|
|
3153
3153
|
}
|
|
@@ -3200,17 +3200,17 @@ function compileVariableLengthQueryWithRecursiveCteStrategy(ast, graphId, ctx) {
|
|
|
3200
3200
|
traversal: vlTraversal
|
|
3201
3201
|
} = passState;
|
|
3202
3202
|
if (temporalFilterPass === void 0) {
|
|
3203
|
-
throw new
|
|
3203
|
+
throw new chunkJIEJCTDS_cjs.CompilerInvariantError(
|
|
3204
3204
|
"Temporal filter pass did not initialize temporal state"
|
|
3205
3205
|
);
|
|
3206
3206
|
}
|
|
3207
3207
|
if (logicalPlan === void 0) {
|
|
3208
|
-
throw new
|
|
3208
|
+
throw new chunkJIEJCTDS_cjs.CompilerInvariantError(
|
|
3209
3209
|
"Logical plan pass did not initialize plan state"
|
|
3210
3210
|
);
|
|
3211
3211
|
}
|
|
3212
3212
|
if (vlTraversal === void 0) {
|
|
3213
|
-
throw new
|
|
3213
|
+
throw new chunkJIEJCTDS_cjs.CompilerInvariantError(
|
|
3214
3214
|
"Recursive traversal pass did not select traversal"
|
|
3215
3215
|
);
|
|
3216
3216
|
}
|
|
@@ -3257,8 +3257,8 @@ function compileRecursiveCte(ast, traversal, graphId, ctx, requiredColumnsByAlia
|
|
|
3257
3257
|
if (previousNodeKinds.length > 1) {
|
|
3258
3258
|
recursiveJoinRequiredColumns.add("kind");
|
|
3259
3259
|
}
|
|
3260
|
-
const requiredStartColumns = requiredColumnsByAlias ? requiredColumnsByAlias.get(startAlias) ??
|
|
3261
|
-
const requiredNodeColumns = requiredColumnsByAlias ? requiredColumnsByAlias.get(nodeAlias) ??
|
|
3260
|
+
const requiredStartColumns = requiredColumnsByAlias ? requiredColumnsByAlias.get(startAlias) ?? chunkIE6GN7L3_cjs.EMPTY_REQUIRED_COLUMNS : void 0;
|
|
3261
|
+
const requiredNodeColumns = requiredColumnsByAlias ? requiredColumnsByAlias.get(nodeAlias) ?? chunkIE6GN7L3_cjs.EMPTY_REQUIRED_COLUMNS : void 0;
|
|
3262
3262
|
const startColumnsFromBase = compileNodeSelectColumnsFromTable(
|
|
3263
3263
|
"n0",
|
|
3264
3264
|
startAlias,
|
|
@@ -3302,7 +3302,7 @@ function compileRecursiveCte(ast, traversal, graphId, ctx, requiredColumnsByAlia
|
|
|
3302
3302
|
targetContext
|
|
3303
3303
|
);
|
|
3304
3304
|
if (vl.maxDepth > MAX_EXPLICIT_RECURSIVE_DEPTH) {
|
|
3305
|
-
throw new
|
|
3305
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
3306
3306
|
`Recursive traversal maxHops(${vl.maxDepth}) exceeds maximum explicit depth of ${MAX_EXPLICIT_RECURSIVE_DEPTH}`
|
|
3307
3307
|
);
|
|
3308
3308
|
}
|
|
@@ -3454,30 +3454,30 @@ function collectRequiredColumnsByAlias(ast, traversal) {
|
|
|
3454
3454
|
const previousNodeKinds = [
|
|
3455
3455
|
.../* @__PURE__ */ new Set([...ast.start.kinds, ...traversal.nodeKinds])
|
|
3456
3456
|
];
|
|
3457
|
-
|
|
3457
|
+
chunkIE6GN7L3_cjs.addRequiredColumn(requiredColumnsByAlias, traversal.nodeAlias, "id");
|
|
3458
3458
|
if (previousNodeKinds.length > 1) {
|
|
3459
|
-
|
|
3459
|
+
chunkIE6GN7L3_cjs.addRequiredColumn(requiredColumnsByAlias, traversal.nodeAlias, "kind");
|
|
3460
3460
|
}
|
|
3461
3461
|
for (const field2 of selectiveFields) {
|
|
3462
|
-
|
|
3462
|
+
chunkIE6GN7L3_cjs.markSelectiveFieldAsRequired(requiredColumnsByAlias, field2);
|
|
3463
3463
|
}
|
|
3464
3464
|
if (ast.orderBy) {
|
|
3465
3465
|
for (const orderSpec of ast.orderBy) {
|
|
3466
|
-
|
|
3466
|
+
chunkIE6GN7L3_cjs.markFieldRefAsRequired(requiredColumnsByAlias, orderSpec.field);
|
|
3467
3467
|
}
|
|
3468
3468
|
}
|
|
3469
3469
|
return requiredColumnsByAlias;
|
|
3470
3470
|
}
|
|
3471
3471
|
function compileNodeSelectColumnsFromTable(tableAlias, alias, requiredColumns, alwaysRequiredColumns) {
|
|
3472
|
-
return
|
|
3473
|
-
(column) =>
|
|
3472
|
+
return chunkIE6GN7L3_cjs.NODE_COLUMNS.filter(
|
|
3473
|
+
(column) => chunkIE6GN7L3_cjs.shouldProjectColumn(requiredColumns, column, alwaysRequiredColumns)
|
|
3474
3474
|
).map(
|
|
3475
3475
|
(column) => drizzleOrm.sql`${drizzleOrm.sql.raw(tableAlias)}.${drizzleOrm.sql.raw(column)} AS ${drizzleOrm.sql.raw(`${alias}_${column}`)}`
|
|
3476
3476
|
);
|
|
3477
3477
|
}
|
|
3478
3478
|
function compileNodeSelectColumnsFromRecursiveRow(alias, requiredColumns, alwaysRequiredColumns) {
|
|
3479
|
-
return
|
|
3480
|
-
(column) =>
|
|
3479
|
+
return chunkIE6GN7L3_cjs.NODE_COLUMNS.filter(
|
|
3480
|
+
(column) => chunkIE6GN7L3_cjs.shouldProjectColumn(requiredColumns, column, alwaysRequiredColumns)
|
|
3481
3481
|
).map((column) => {
|
|
3482
3482
|
const projected = `${alias}_${column}`;
|
|
3483
3483
|
return drizzleOrm.sql`r.${drizzleOrm.sql.raw(projected)} AS ${drizzleOrm.sql.raw(projected)}`;
|
|
@@ -3518,10 +3518,10 @@ function compileRecursiveProjection(ast, traversal, dialect) {
|
|
|
3518
3518
|
drizzleOrm.sql`${drizzleOrm.sql.raw(nodeAlias)}_deleted_at`
|
|
3519
3519
|
];
|
|
3520
3520
|
if (vl.depthAlias !== void 0) {
|
|
3521
|
-
fields.push(drizzleOrm.sql`depth AS ${
|
|
3521
|
+
fields.push(drizzleOrm.sql`depth AS ${chunkIE6GN7L3_cjs.quoteIdentifier(vl.depthAlias)}`);
|
|
3522
3522
|
}
|
|
3523
3523
|
if (vl.pathAlias !== void 0) {
|
|
3524
|
-
fields.push(drizzleOrm.sql`path AS ${
|
|
3524
|
+
fields.push(drizzleOrm.sql`path AS ${chunkIE6GN7L3_cjs.quoteIdentifier(vl.pathAlias)}`);
|
|
3525
3525
|
}
|
|
3526
3526
|
return drizzleOrm.sql.join(fields, drizzleOrm.sql`, `);
|
|
3527
3527
|
}
|
|
@@ -3529,29 +3529,29 @@ function compileRecursiveSelectiveProjection(fields, ast, traversal, dialect) {
|
|
|
3529
3529
|
const allowedAliases = /* @__PURE__ */ new Set([ast.start.alias, traversal.nodeAlias]);
|
|
3530
3530
|
const columns = fields.map((field2) => {
|
|
3531
3531
|
if (!allowedAliases.has(field2.alias)) {
|
|
3532
|
-
throw new
|
|
3532
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
3533
3533
|
`Selective projection for recursive traversals does not support alias "${field2.alias}"`
|
|
3534
3534
|
);
|
|
3535
3535
|
}
|
|
3536
3536
|
if (field2.isSystemField) {
|
|
3537
|
-
const dbColumn =
|
|
3538
|
-
return drizzleOrm.sql`${drizzleOrm.sql.raw(`${field2.alias}_${dbColumn}`)} AS ${
|
|
3537
|
+
const dbColumn = chunkIE6GN7L3_cjs.mapSelectiveSystemFieldToColumn(field2.field);
|
|
3538
|
+
return drizzleOrm.sql`${drizzleOrm.sql.raw(`${field2.alias}_${dbColumn}`)} AS ${chunkIE6GN7L3_cjs.quoteIdentifier(field2.outputName)}`;
|
|
3539
3539
|
}
|
|
3540
3540
|
const column = drizzleOrm.sql.raw(`${field2.alias}_props`);
|
|
3541
3541
|
const extracted = compileTypedJsonExtract({
|
|
3542
3542
|
column,
|
|
3543
3543
|
dialect,
|
|
3544
|
-
pointer:
|
|
3544
|
+
pointer: chunkFLRCVI2G_cjs.jsonPointer([field2.field]),
|
|
3545
3545
|
valueType: field2.valueType
|
|
3546
3546
|
});
|
|
3547
|
-
return drizzleOrm.sql`${extracted} AS ${
|
|
3547
|
+
return drizzleOrm.sql`${extracted} AS ${chunkIE6GN7L3_cjs.quoteIdentifier(field2.outputName)}`;
|
|
3548
3548
|
});
|
|
3549
3549
|
const vl = traversal.variableLength;
|
|
3550
3550
|
if (vl.depthAlias !== void 0) {
|
|
3551
|
-
columns.push(drizzleOrm.sql`depth AS ${
|
|
3551
|
+
columns.push(drizzleOrm.sql`depth AS ${chunkIE6GN7L3_cjs.quoteIdentifier(vl.depthAlias)}`);
|
|
3552
3552
|
}
|
|
3553
3553
|
if (vl.pathAlias !== void 0) {
|
|
3554
|
-
columns.push(drizzleOrm.sql`path AS ${
|
|
3554
|
+
columns.push(drizzleOrm.sql`path AS ${chunkIE6GN7L3_cjs.quoteIdentifier(vl.pathAlias)}`);
|
|
3555
3555
|
}
|
|
3556
3556
|
return drizzleOrm.sql.join(columns, drizzleOrm.sql`, `);
|
|
3557
3557
|
}
|
|
@@ -3563,7 +3563,7 @@ function compileRecursiveOrderBy(ast, dialect) {
|
|
|
3563
3563
|
for (const orderSpec of ast.orderBy) {
|
|
3564
3564
|
const valueType = orderSpec.field.valueType;
|
|
3565
3565
|
if (valueType === "array" || valueType === "object") {
|
|
3566
|
-
throw new
|
|
3566
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
3567
3567
|
"Ordering by JSON arrays or objects is not supported"
|
|
3568
3568
|
);
|
|
3569
3569
|
}
|
|
@@ -3762,7 +3762,7 @@ function nullToUndefined2(value) {
|
|
|
3762
3762
|
}
|
|
3763
3763
|
function rowToNode(row) {
|
|
3764
3764
|
const rawProps = JSON.parse(row.props);
|
|
3765
|
-
const props =
|
|
3765
|
+
const props = chunkSGPXKJ4A_cjs.filterReservedKeys(rawProps, chunkSGPXKJ4A_cjs.RESERVED_NODE_KEYS);
|
|
3766
3766
|
return {
|
|
3767
3767
|
kind: row.kind,
|
|
3768
3768
|
id: row.id,
|
|
@@ -3782,7 +3782,7 @@ function rowToNodeMeta(row) {
|
|
|
3782
3782
|
}
|
|
3783
3783
|
function rowToEdge(row) {
|
|
3784
3784
|
const rawProps = JSON.parse(row.props);
|
|
3785
|
-
const props =
|
|
3785
|
+
const props = chunkSGPXKJ4A_cjs.filterReservedKeys(rawProps, chunkSGPXKJ4A_cjs.RESERVED_EDGE_KEYS);
|
|
3786
3786
|
return {
|
|
3787
3787
|
id: row.id,
|
|
3788
3788
|
kind: row.kind,
|
|
@@ -3818,9 +3818,9 @@ function truncateToBytes(value, maxBytes) {
|
|
|
3818
3818
|
}
|
|
3819
3819
|
function projectionAlias(entityPrefix, kind, field2) {
|
|
3820
3820
|
const prefix = entityPrefix === "node" ? "sg_n" : "sg_e";
|
|
3821
|
-
const hash =
|
|
3821
|
+
const hash = chunk4BXHVEFB_cjs.fnv1aBase36(`${kind}\0${field2}`);
|
|
3822
3822
|
const fixedBytes = prefix.length + 1 + 1 + hash.length;
|
|
3823
|
-
const maxKindBytes =
|
|
3823
|
+
const maxKindBytes = chunk4BXHVEFB_cjs.MAX_PG_IDENTIFIER_LENGTH - fixedBytes;
|
|
3824
3824
|
const truncatedKind = truncateToBytes(kind, maxKindBytes);
|
|
3825
3825
|
return `${prefix}_${truncatedKind}_${hash}`;
|
|
3826
3826
|
}
|
|
@@ -3918,7 +3918,7 @@ function getSubgraphSchemaIntrospector(graph) {
|
|
|
3918
3918
|
{ schema: definition.type.schema }
|
|
3919
3919
|
])
|
|
3920
3920
|
);
|
|
3921
|
-
const introspector =
|
|
3921
|
+
const introspector = chunkYQGLVWB2_cjs.createSchemaIntrospector(nodeKinds, edgeKinds);
|
|
3922
3922
|
introspectorCache.set(graph, introspector);
|
|
3923
3923
|
return introspector;
|
|
3924
3924
|
}
|
|
@@ -3946,7 +3946,7 @@ function buildKindProjectionPlan(kind, selection, resolveFieldType, entityPrefix
|
|
|
3946
3946
|
includeMeta = true;
|
|
3947
3947
|
continue;
|
|
3948
3948
|
}
|
|
3949
|
-
|
|
3949
|
+
chunkSGPXKJ4A_cjs.validateProjectionField(field2, entityPrefix, kind);
|
|
3950
3950
|
if (!propertyFields.has(field2)) {
|
|
3951
3951
|
propertyFields.set(field2, {
|
|
3952
3952
|
field: field2,
|
|
@@ -4062,11 +4062,11 @@ function buildProjectedPropertyColumns(alias, plan, dialect) {
|
|
|
4062
4062
|
const extracted = compileTypedJsonExtract({
|
|
4063
4063
|
column: drizzleOrm.sql.raw(`${alias}.props`),
|
|
4064
4064
|
dialect,
|
|
4065
|
-
pointer:
|
|
4065
|
+
pointer: chunkFLRCVI2G_cjs.jsonPointer([fieldPlan.field]),
|
|
4066
4066
|
valueType: fieldPlan.typeInfo?.valueType
|
|
4067
4067
|
});
|
|
4068
4068
|
columns.push(
|
|
4069
|
-
drizzleOrm.sql`CASE WHEN ${drizzleOrm.sql.raw(alias)}.kind = ${kind} THEN ${extracted} ELSE NULL END AS ${
|
|
4069
|
+
drizzleOrm.sql`CASE WHEN ${drizzleOrm.sql.raw(alias)}.kind = ${kind} THEN ${extracted} ELSE NULL END AS ${chunkIE6GN7L3_cjs.quoteIdentifier(fieldPlan.outputName)}`
|
|
4070
4070
|
);
|
|
4071
4071
|
}
|
|
4072
4072
|
}
|
|
@@ -4193,7 +4193,7 @@ function buildIncompatibleChangeError(classification, nonEmpty, graphId) {
|
|
|
4193
4193
|
}
|
|
4194
4194
|
const all = [...classification.incompatible, ...promoted];
|
|
4195
4195
|
if (all.length === 0) return void 0;
|
|
4196
|
-
return new
|
|
4196
|
+
return new chunkSGPXKJ4A_cjs.IncompatibleChangeError(all, graphId);
|
|
4197
4197
|
}
|
|
4198
4198
|
function classifyNode(kind, existing, next, recorders) {
|
|
4199
4199
|
classifyProperties(kind, existing.properties, next.properties, recorders);
|
|
@@ -4493,7 +4493,7 @@ function planRemovals(graph, names) {
|
|
|
4493
4493
|
if (namesSet.size === 0) {
|
|
4494
4494
|
return { document, removedNodeKinds: [], removedEdgeKinds: [] };
|
|
4495
4495
|
}
|
|
4496
|
-
const { nodes: runtimeNodeNames, edges: runtimeEdgeNames } =
|
|
4496
|
+
const { nodes: runtimeNodeNames, edges: runtimeEdgeNames } = chunkK4N35E7B_cjs.extensionKindNames(document);
|
|
4497
4497
|
const compileTimeNodeNames = new Set(
|
|
4498
4498
|
Object.keys(graph.nodes).filter((name) => !runtimeNodeNames.has(name))
|
|
4499
4499
|
);
|
|
@@ -4502,10 +4502,10 @@ function planRemovals(graph, names) {
|
|
|
4502
4502
|
);
|
|
4503
4503
|
for (const name of namesSet) {
|
|
4504
4504
|
if (compileTimeNodeNames.has(name)) {
|
|
4505
|
-
throw new
|
|
4505
|
+
throw new chunkSGPXKJ4A_cjs.RemoveCompileTimeKindError(name, "node", graph.id);
|
|
4506
4506
|
}
|
|
4507
4507
|
if (compileTimeEdgeNames.has(name)) {
|
|
4508
|
-
throw new
|
|
4508
|
+
throw new chunkSGPXKJ4A_cjs.RemoveCompileTimeKindError(name, "edge", graph.id);
|
|
4509
4509
|
}
|
|
4510
4510
|
}
|
|
4511
4511
|
const removedNodeKinds = [...namesSet].filter(
|
|
@@ -4521,7 +4521,7 @@ function planRemovals(graph, names) {
|
|
|
4521
4521
|
for (const kindName of removedNodeKinds) {
|
|
4522
4522
|
const referents = referentsByKind.get(kindName);
|
|
4523
4523
|
if (referents !== void 0 && referents.length > 0) {
|
|
4524
|
-
throw new
|
|
4524
|
+
throw new chunkSGPXKJ4A_cjs.KindHasReferentsError(kindName, referents, graph.id);
|
|
4525
4525
|
}
|
|
4526
4526
|
}
|
|
4527
4527
|
if (document === void 0) {
|
|
@@ -4593,8 +4593,8 @@ function planRemovals(graph, names) {
|
|
|
4593
4593
|
function stripGraphExtension(graph) {
|
|
4594
4594
|
const document = graph.extension;
|
|
4595
4595
|
if (document === void 0) return graph;
|
|
4596
|
-
const { nodes: runtimeNodeNames, edges: runtimeEdgeNames } =
|
|
4597
|
-
const runtimeOntologyKeys =
|
|
4596
|
+
const { nodes: runtimeNodeNames, edges: runtimeEdgeNames } = chunkK4N35E7B_cjs.extensionKindNames(document);
|
|
4597
|
+
const runtimeOntologyKeys = chunkK4N35E7B_cjs.buildGraphExtensionOntologyKeySet(document);
|
|
4598
4598
|
const compileNodes = {};
|
|
4599
4599
|
for (const [name, registration] of Object.entries(graph.nodes)) {
|
|
4600
4600
|
if (runtimeNodeNames.has(name)) continue;
|
|
@@ -4606,7 +4606,7 @@ function stripGraphExtension(graph) {
|
|
|
4606
4606
|
compileEdges[name] = registration;
|
|
4607
4607
|
}
|
|
4608
4608
|
const compileOntology = graph.ontology.filter(
|
|
4609
|
-
(relation) => !runtimeOntologyKeys.has(
|
|
4609
|
+
(relation) => !runtimeOntologyKeys.has(chunkK4N35E7B_cjs.compileTimeOntologyKey(relation))
|
|
4610
4610
|
);
|
|
4611
4611
|
const compileIndexes = (graph.indexes ?? []).filter(
|
|
4612
4612
|
(index) => index.origin !== "runtime"
|
|
@@ -4646,13 +4646,13 @@ function buildCompileTimeReferentIndex(graph, runtimeEdgeNames) {
|
|
|
4646
4646
|
append(endpoint.kind, referent);
|
|
4647
4647
|
}
|
|
4648
4648
|
}
|
|
4649
|
-
const runtimeOntologyKeys =
|
|
4649
|
+
const runtimeOntologyKeys = chunkK4N35E7B_cjs.buildGraphExtensionOntologyKeySet(
|
|
4650
4650
|
graph.extension
|
|
4651
4651
|
);
|
|
4652
4652
|
for (const relation of graph.ontology) {
|
|
4653
|
-
if (runtimeOntologyKeys.has(
|
|
4654
|
-
const fromName =
|
|
4655
|
-
const toName =
|
|
4653
|
+
if (runtimeOntologyKeys.has(chunkK4N35E7B_cjs.compileTimeOntologyKey(relation))) continue;
|
|
4654
|
+
const fromName = chunkK4N35E7B_cjs.getTypeName(relation.from);
|
|
4655
|
+
const toName = chunkK4N35E7B_cjs.getTypeName(relation.to);
|
|
4656
4656
|
const referent = {
|
|
4657
4657
|
type: "compile-time-ontology",
|
|
4658
4658
|
name: `${relation.metaEdge.name}(${fromName}, ${toName})`
|
|
@@ -4704,7 +4704,7 @@ function compileSetOperation(op, graphId, dialect, compileQuery2, vectorStrategy
|
|
|
4704
4704
|
);
|
|
4705
4705
|
const { logicalPlan } = passState;
|
|
4706
4706
|
if (logicalPlan === void 0) {
|
|
4707
|
-
throw new
|
|
4707
|
+
throw new chunkJIEJCTDS_cjs.CompilerInvariantError(
|
|
4708
4708
|
"Logical plan pass did not initialize plan state"
|
|
4709
4709
|
);
|
|
4710
4710
|
}
|
|
@@ -4749,7 +4749,7 @@ function getLeftmostProjection(op) {
|
|
|
4749
4749
|
function normalizeFieldRefKey(field2) {
|
|
4750
4750
|
let pointer = field2.jsonPointer;
|
|
4751
4751
|
if (pointer === void 0 && field2.path.length > 1 && field2.path[0] === "props") {
|
|
4752
|
-
pointer =
|
|
4752
|
+
pointer = chunkFLRCVI2G_cjs.jsonPointer(field2.path.slice(1));
|
|
4753
4753
|
}
|
|
4754
4754
|
const basePath = field2.path.length > 0 && field2.path[0] === "props" ? "props" : field2.path.join(".");
|
|
4755
4755
|
return `${field2.alias}:${basePath}:${pointer ?? ""}`;
|
|
@@ -4770,7 +4770,7 @@ function buildSetOperationSuffixClauses(op, dialect) {
|
|
|
4770
4770
|
if (op.orderBy && op.orderBy.length > 0) {
|
|
4771
4771
|
const projection = getLeftmostProjection(op);
|
|
4772
4772
|
if (projection.fields.length === 0) {
|
|
4773
|
-
throw new
|
|
4773
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
4774
4774
|
"Set operation ORDER BY requires explicit field projection. SELECT * does not provide stable output column names for ordering. Use .select() to specify which fields to project."
|
|
4775
4775
|
);
|
|
4776
4776
|
}
|
|
@@ -4780,7 +4780,7 @@ function buildSetOperationSuffixClauses(op, dialect) {
|
|
|
4780
4780
|
if (!projected) {
|
|
4781
4781
|
const fieldDesc = orderSpec.field.jsonPointer ? `${orderSpec.field.alias}.props${orderSpec.field.jsonPointer}` : `${orderSpec.field.alias}.${orderSpec.field.path.join(".")}`;
|
|
4782
4782
|
const availableFields = projection.fields.map((f) => f.outputName).join(", ");
|
|
4783
|
-
throw new
|
|
4783
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
4784
4784
|
`Set operation ORDER BY field "${fieldDesc}" is not in the projection. ORDER BY for UNION/INTERSECT/EXCEPT must reference projected columns. Available columns: ${availableFields}`
|
|
4785
4785
|
);
|
|
4786
4786
|
}
|
|
@@ -4821,7 +4821,7 @@ function isColumnPruningEnabled(ast) {
|
|
|
4821
4821
|
function markPredicateFieldsAsRequired(requiredColumnsByAlias, expression) {
|
|
4822
4822
|
switch (expression.__type) {
|
|
4823
4823
|
case "comparison": {
|
|
4824
|
-
|
|
4824
|
+
chunkIE6GN7L3_cjs.markFieldRefAsRequired(requiredColumnsByAlias, expression.left);
|
|
4825
4825
|
return;
|
|
4826
4826
|
}
|
|
4827
4827
|
case "string_op":
|
|
@@ -4829,7 +4829,7 @@ function markPredicateFieldsAsRequired(requiredColumnsByAlias, expression) {
|
|
|
4829
4829
|
case "between":
|
|
4830
4830
|
case "array_op":
|
|
4831
4831
|
case "object_op": {
|
|
4832
|
-
|
|
4832
|
+
chunkIE6GN7L3_cjs.markFieldRefAsRequired(requiredColumnsByAlias, expression.field);
|
|
4833
4833
|
return;
|
|
4834
4834
|
}
|
|
4835
4835
|
case "and":
|
|
@@ -4847,22 +4847,22 @@ function markPredicateFieldsAsRequired(requiredColumnsByAlias, expression) {
|
|
|
4847
4847
|
return;
|
|
4848
4848
|
}
|
|
4849
4849
|
case "aggregate_comparison": {
|
|
4850
|
-
|
|
4850
|
+
chunkIE6GN7L3_cjs.markFieldRefAsRequired(
|
|
4851
4851
|
requiredColumnsByAlias,
|
|
4852
4852
|
expression.aggregate.field
|
|
4853
4853
|
);
|
|
4854
4854
|
return;
|
|
4855
4855
|
}
|
|
4856
4856
|
case "in_subquery": {
|
|
4857
|
-
|
|
4857
|
+
chunkIE6GN7L3_cjs.markFieldRefAsRequired(requiredColumnsByAlias, expression.field);
|
|
4858
4858
|
return;
|
|
4859
4859
|
}
|
|
4860
4860
|
case "vector_similarity": {
|
|
4861
|
-
|
|
4861
|
+
chunkIE6GN7L3_cjs.markFieldRefAsRequired(requiredColumnsByAlias, expression.field);
|
|
4862
4862
|
return;
|
|
4863
4863
|
}
|
|
4864
4864
|
case "fulltext_match": {
|
|
4865
|
-
|
|
4865
|
+
chunkIE6GN7L3_cjs.markFieldRefAsRequired(requiredColumnsByAlias, expression.field);
|
|
4866
4866
|
return;
|
|
4867
4867
|
}
|
|
4868
4868
|
case "exists": {
|
|
@@ -4872,33 +4872,33 @@ function markPredicateFieldsAsRequired(requiredColumnsByAlias, expression) {
|
|
|
4872
4872
|
}
|
|
4873
4873
|
function collectRequiredColumnsByAlias2(ast) {
|
|
4874
4874
|
const requiredColumnsByAlias = /* @__PURE__ */ new Map();
|
|
4875
|
-
|
|
4875
|
+
chunkIE6GN7L3_cjs.addRequiredColumn(requiredColumnsByAlias, ast.start.alias, "id");
|
|
4876
4876
|
for (const traversal of ast.traversals) {
|
|
4877
|
-
|
|
4877
|
+
chunkIE6GN7L3_cjs.addRequiredColumn(requiredColumnsByAlias, traversal.nodeAlias, "id");
|
|
4878
4878
|
}
|
|
4879
4879
|
if (ast.selectiveFields && ast.selectiveFields.length > 0) {
|
|
4880
4880
|
for (const field2 of ast.selectiveFields) {
|
|
4881
|
-
|
|
4881
|
+
chunkIE6GN7L3_cjs.markSelectiveFieldAsRequired(requiredColumnsByAlias, field2);
|
|
4882
4882
|
}
|
|
4883
4883
|
} else {
|
|
4884
4884
|
for (const projectedField of ast.projection.fields) {
|
|
4885
4885
|
const source = projectedField.source;
|
|
4886
4886
|
if (source.__type === "field_ref") {
|
|
4887
|
-
|
|
4887
|
+
chunkIE6GN7L3_cjs.markFieldRefAsRequired(requiredColumnsByAlias, source);
|
|
4888
4888
|
} else {
|
|
4889
|
-
|
|
4890
|
-
|
|
4889
|
+
chunkIE6GN7L3_cjs.addRequiredColumn(requiredColumnsByAlias, source.field.alias, "id");
|
|
4890
|
+
chunkIE6GN7L3_cjs.markFieldRefAsRequired(requiredColumnsByAlias, source.field);
|
|
4891
4891
|
}
|
|
4892
4892
|
}
|
|
4893
4893
|
}
|
|
4894
4894
|
if (ast.groupBy) {
|
|
4895
4895
|
for (const field2 of ast.groupBy.fields) {
|
|
4896
|
-
|
|
4896
|
+
chunkIE6GN7L3_cjs.markFieldRefAsRequired(requiredColumnsByAlias, field2);
|
|
4897
4897
|
}
|
|
4898
4898
|
}
|
|
4899
4899
|
if (ast.orderBy) {
|
|
4900
4900
|
for (const orderSpec of ast.orderBy) {
|
|
4901
|
-
|
|
4901
|
+
chunkIE6GN7L3_cjs.markFieldRefAsRequired(requiredColumnsByAlias, orderSpec.field);
|
|
4902
4902
|
}
|
|
4903
4903
|
}
|
|
4904
4904
|
if (ast.having) {
|
|
@@ -4912,7 +4912,7 @@ function collectRequiredColumnsByAlias2(ast) {
|
|
|
4912
4912
|
function hasIdEqualityPredicate(expression, alias) {
|
|
4913
4913
|
switch (expression.__type) {
|
|
4914
4914
|
case "comparison": {
|
|
4915
|
-
return expression.op === "eq" && expression.left.alias === alias &&
|
|
4915
|
+
return expression.op === "eq" && expression.left.alias === alias && chunkIE6GN7L3_cjs.isIdFieldRef(expression.left);
|
|
4916
4916
|
}
|
|
4917
4917
|
case "and": {
|
|
4918
4918
|
return expression.predicates.some(
|
|
@@ -5193,6 +5193,7 @@ function compileQuery(ast, graphId, options = "sqlite") {
|
|
|
5193
5193
|
schema,
|
|
5194
5194
|
compileQuery: (subAst, subGraphId) => compileQuery(subAst, subGraphId, propagateOptions(options_)),
|
|
5195
5195
|
...options_.vectorStrategy === void 0 ? {} : { vectorStrategy: options_.vectorStrategy },
|
|
5196
|
+
windowFunctions: options_.windowFunctions ?? true,
|
|
5196
5197
|
...options_.vectorSlots === void 0 ? {} : { vectorSlots: options_.vectorSlots }
|
|
5197
5198
|
};
|
|
5198
5199
|
if (hasVariableLengthTraversal(ast)) {
|
|
@@ -5238,7 +5239,7 @@ function compileSetOperation2(op, graphId, options = "sqlite") {
|
|
|
5238
5239
|
);
|
|
5239
5240
|
}
|
|
5240
5241
|
function resolveDialectAdapter(dialect, fulltextStrategy) {
|
|
5241
|
-
const baseAdapter =
|
|
5242
|
+
const baseAdapter = chunkUESTHN47_cjs.getDialect(dialect);
|
|
5242
5243
|
if (fulltextStrategy === void 0 || fulltextStrategy === baseAdapter.fulltext) {
|
|
5243
5244
|
return baseAdapter;
|
|
5244
5245
|
}
|
|
@@ -5250,6 +5251,7 @@ function propagateOptions(options_) {
|
|
|
5250
5251
|
...options_.schema === void 0 ? {} : { schema: options_.schema },
|
|
5251
5252
|
...options_.fulltextStrategy === void 0 ? {} : { fulltextStrategy: options_.fulltextStrategy },
|
|
5252
5253
|
...options_.vectorStrategy === void 0 ? {} : { vectorStrategy: options_.vectorStrategy },
|
|
5254
|
+
windowFunctions: options_.windowFunctions ?? true,
|
|
5253
5255
|
...options_.vectorSlots === void 0 ? {} : { vectorSlots: options_.vectorSlots }
|
|
5254
5256
|
};
|
|
5255
5257
|
}
|
|
@@ -5271,7 +5273,7 @@ function resolveCountAggregateFastPath(ast) {
|
|
|
5271
5273
|
return void 0;
|
|
5272
5274
|
}
|
|
5273
5275
|
const groupField = ast.groupBy.fields[0];
|
|
5274
|
-
if (groupField.alias !== ast.start.alias || !
|
|
5276
|
+
if (groupField.alias !== ast.start.alias || !chunkIE6GN7L3_cjs.isIdFieldRef(groupField)) {
|
|
5275
5277
|
return void 0;
|
|
5276
5278
|
}
|
|
5277
5279
|
let requiresNodeCount = false;
|
|
@@ -5280,13 +5282,13 @@ function resolveCountAggregateFastPath(ast) {
|
|
|
5280
5282
|
let requiresEdgeCountDistinct = false;
|
|
5281
5283
|
for (const projectedField of ast.projection.fields) {
|
|
5282
5284
|
const source = projectedField.source;
|
|
5283
|
-
if (!
|
|
5285
|
+
if (!chunkIE6GN7L3_cjs.isAggregateExpr(source)) {
|
|
5284
5286
|
if (source.alias !== ast.start.alias) {
|
|
5285
5287
|
return void 0;
|
|
5286
5288
|
}
|
|
5287
5289
|
continue;
|
|
5288
5290
|
}
|
|
5289
|
-
if (!
|
|
5291
|
+
if (!chunkIE6GN7L3_cjs.isIdFieldRef(source.field)) {
|
|
5290
5292
|
return void 0;
|
|
5291
5293
|
}
|
|
5292
5294
|
const isNodeTarget = source.field.alias === traversal.nodeAlias;
|
|
@@ -5451,19 +5453,19 @@ function compileCountAggregateFastPath(ast, graphId, ctx, logicalPlan, requiredC
|
|
|
5451
5453
|
const projection = drizzleOrm.sql.join(
|
|
5452
5454
|
ast.projection.fields.map((projectedField) => {
|
|
5453
5455
|
const source = projectedField.source;
|
|
5454
|
-
if (!
|
|
5456
|
+
if (!chunkIE6GN7L3_cjs.isAggregateExpr(source)) {
|
|
5455
5457
|
const value = compileFieldValue(
|
|
5456
5458
|
source,
|
|
5457
5459
|
dialect,
|
|
5458
5460
|
source.valueType,
|
|
5459
5461
|
`cte_${source.alias}`
|
|
5460
5462
|
);
|
|
5461
|
-
return drizzleOrm.sql`${value} AS ${
|
|
5463
|
+
return drizzleOrm.sql`${value} AS ${chunkIE6GN7L3_cjs.quoteIdentifier(projectedField.outputName)}`;
|
|
5462
5464
|
}
|
|
5463
5465
|
const projectedCountColumn = resolveCountColumn(source);
|
|
5464
5466
|
const countValue = drizzleOrm.sql`${drizzleOrm.sql.raw(countCteAlias)}.${drizzleOrm.sql.raw(projectedCountColumn)}`;
|
|
5465
5467
|
const aggregateValue = traversal.optional ? drizzleOrm.sql`COALESCE(${countValue}, 0)` : countValue;
|
|
5466
|
-
return drizzleOrm.sql`${aggregateValue} AS ${
|
|
5468
|
+
return drizzleOrm.sql`${aggregateValue} AS ${chunkIE6GN7L3_cjs.quoteIdentifier(projectedField.outputName)}`;
|
|
5467
5469
|
}),
|
|
5468
5470
|
drizzleOrm.sql`, `
|
|
5469
5471
|
);
|
|
@@ -5530,6 +5532,27 @@ function selectStandardOrderBy(input) {
|
|
|
5530
5532
|
dialect
|
|
5531
5533
|
});
|
|
5532
5534
|
}
|
|
5535
|
+
function selectWindowFunctionOperation(vectorPredicate, fulltextPredicate) {
|
|
5536
|
+
if (vectorPredicate !== void 0 && fulltextPredicate !== void 0) {
|
|
5537
|
+
return "hybrid relevance ranking";
|
|
5538
|
+
}
|
|
5539
|
+
if (vectorPredicate !== void 0) return "vector relevance ranking";
|
|
5540
|
+
return "fulltext relevance ranking";
|
|
5541
|
+
}
|
|
5542
|
+
function assertWindowFunctionsSupported(ctx, operation) {
|
|
5543
|
+
if (ctx.windowFunctions) return;
|
|
5544
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
5545
|
+
`${operation} requires SQL window functions, but this backend profile declares windowFunctions: false.`,
|
|
5546
|
+
{
|
|
5547
|
+
capability: "windowFunctions",
|
|
5548
|
+
operation,
|
|
5549
|
+
windowFunctions: false
|
|
5550
|
+
},
|
|
5551
|
+
{
|
|
5552
|
+
suggestion: "Use a backend profile that supports SQL window functions, or avoid this query shape."
|
|
5553
|
+
}
|
|
5554
|
+
);
|
|
5555
|
+
}
|
|
5533
5556
|
function compileStandardQueryWithCteStrategy(ast, graphId, ctx) {
|
|
5534
5557
|
const { dialect } = ctx;
|
|
5535
5558
|
const {
|
|
@@ -5546,17 +5569,23 @@ function compileStandardQueryWithCteStrategy(ast, graphId, ctx) {
|
|
|
5546
5569
|
vectorPredicate
|
|
5547
5570
|
} = runStandardQueryPassPipeline(ast, graphId, ctx);
|
|
5548
5571
|
if (temporalFilterPass === void 0) {
|
|
5549
|
-
throw new
|
|
5572
|
+
throw new chunkJIEJCTDS_cjs.CompilerInvariantError(
|
|
5550
5573
|
"Temporal filter pass did not initialize temporal state",
|
|
5551
5574
|
{ phase: "standard-pass-pipeline" }
|
|
5552
5575
|
);
|
|
5553
5576
|
}
|
|
5554
5577
|
if (logicalPlan === void 0) {
|
|
5555
|
-
throw new
|
|
5578
|
+
throw new chunkJIEJCTDS_cjs.CompilerInvariantError(
|
|
5556
5579
|
"Logical plan pass did not initialize plan state",
|
|
5557
5580
|
{ phase: "standard-pass-pipeline" }
|
|
5558
5581
|
);
|
|
5559
5582
|
}
|
|
5583
|
+
if (vectorPredicate !== void 0 || fulltextPredicate !== void 0) {
|
|
5584
|
+
assertWindowFunctionsSupported(
|
|
5585
|
+
ctx,
|
|
5586
|
+
selectWindowFunctionOperation(vectorPredicate, fulltextPredicate)
|
|
5587
|
+
);
|
|
5588
|
+
}
|
|
5560
5589
|
if (!vectorPredicate && !fulltextPredicate) {
|
|
5561
5590
|
const fastPathSql = compileCountAggregateFastPath(
|
|
5562
5591
|
ast,
|
|
@@ -5679,7 +5708,7 @@ function decodeCursor(cursor) {
|
|
|
5679
5708
|
const json = atob(base64);
|
|
5680
5709
|
const raw = JSON.parse(json);
|
|
5681
5710
|
if (typeof raw.v !== "number" || raw.v > CURSOR_VERSION) {
|
|
5682
|
-
throw new
|
|
5711
|
+
throw new chunkJIEJCTDS_cjs.ValidationError(
|
|
5683
5712
|
`Unsupported cursor version: ${String(raw.v)}. Maximum supported: ${CURSOR_VERSION}`,
|
|
5684
5713
|
{
|
|
5685
5714
|
issues: [
|
|
@@ -5695,7 +5724,7 @@ function decodeCursor(cursor) {
|
|
|
5695
5724
|
);
|
|
5696
5725
|
}
|
|
5697
5726
|
if (raw.d !== "f" && raw.d !== "b") {
|
|
5698
|
-
throw new
|
|
5727
|
+
throw new chunkJIEJCTDS_cjs.ValidationError(`Invalid cursor direction: ${String(raw.d)}`, {
|
|
5699
5728
|
issues: [
|
|
5700
5729
|
{
|
|
5701
5730
|
path: "cursor",
|
|
@@ -5705,7 +5734,7 @@ function decodeCursor(cursor) {
|
|
|
5705
5734
|
});
|
|
5706
5735
|
}
|
|
5707
5736
|
if (!Array.isArray(raw.vals) || !Array.isArray(raw.cols)) {
|
|
5708
|
-
throw new
|
|
5737
|
+
throw new chunkJIEJCTDS_cjs.ValidationError("Invalid cursor structure", {
|
|
5709
5738
|
issues: [
|
|
5710
5739
|
{
|
|
5711
5740
|
path: "cursor",
|
|
@@ -5715,7 +5744,7 @@ function decodeCursor(cursor) {
|
|
|
5715
5744
|
});
|
|
5716
5745
|
}
|
|
5717
5746
|
if (raw.vals.length !== raw.cols.length) {
|
|
5718
|
-
throw new
|
|
5747
|
+
throw new chunkJIEJCTDS_cjs.ValidationError("Cursor column count mismatch", {
|
|
5719
5748
|
issues: [
|
|
5720
5749
|
{
|
|
5721
5750
|
path: "cursor",
|
|
@@ -5731,10 +5760,10 @@ function decodeCursor(cursor) {
|
|
|
5731
5760
|
cols: raw.cols
|
|
5732
5761
|
};
|
|
5733
5762
|
} catch (error) {
|
|
5734
|
-
if (error instanceof
|
|
5763
|
+
if (error instanceof chunkJIEJCTDS_cjs.ValidationError) {
|
|
5735
5764
|
throw error;
|
|
5736
5765
|
}
|
|
5737
|
-
throw new
|
|
5766
|
+
throw new chunkJIEJCTDS_cjs.ValidationError(
|
|
5738
5767
|
"Invalid cursor format",
|
|
5739
5768
|
{
|
|
5740
5769
|
issues: [{ path: "cursor", message: "Failed to decode cursor" }]
|
|
@@ -5768,12 +5797,7 @@ function extractCursorValue(row, spec) {
|
|
|
5768
5797
|
current = record[segment];
|
|
5769
5798
|
}
|
|
5770
5799
|
if (jsonPointer2) {
|
|
5771
|
-
|
|
5772
|
-
for (const segment of segments) {
|
|
5773
|
-
if (current === null || current === void 0) return void 0;
|
|
5774
|
-
if (typeof current !== "object") return void 0;
|
|
5775
|
-
current = current[segment];
|
|
5776
|
-
}
|
|
5800
|
+
return chunkFLRCVI2G_cjs.resolveJsonPointer(current, jsonPointer2);
|
|
5777
5801
|
}
|
|
5778
5802
|
return current;
|
|
5779
5803
|
}
|
|
@@ -5798,7 +5822,7 @@ function buildCursorFromRow(row, orderSpecs, direction) {
|
|
|
5798
5822
|
function validateCursorColumns(cursorData, orderSpecs) {
|
|
5799
5823
|
const expectedCols = orderSpecs.map((spec) => buildColumnId(spec));
|
|
5800
5824
|
if (cursorData.cols.length !== expectedCols.length) {
|
|
5801
|
-
throw new
|
|
5825
|
+
throw new chunkJIEJCTDS_cjs.ValidationError(
|
|
5802
5826
|
`Cursor has ${cursorData.cols.length} columns but query has ${expectedCols.length} ORDER BY columns`,
|
|
5803
5827
|
{
|
|
5804
5828
|
issues: [
|
|
@@ -5815,7 +5839,7 @@ function validateCursorColumns(cursorData, orderSpecs) {
|
|
|
5815
5839
|
}
|
|
5816
5840
|
for (const [index, expectedCol] of expectedCols.entries()) {
|
|
5817
5841
|
if (cursorData.cols[index] !== expectedCol) {
|
|
5818
|
-
throw new
|
|
5842
|
+
throw new chunkJIEJCTDS_cjs.ValidationError(
|
|
5819
5843
|
`Cursor column mismatch at position ${index}: expected "${expectedCol}", got "${cursorData.cols[index]}"`,
|
|
5820
5844
|
{
|
|
5821
5845
|
issues: [
|
|
@@ -5838,14 +5862,14 @@ function generateId() {
|
|
|
5838
5862
|
|
|
5839
5863
|
// src/utils/path.ts
|
|
5840
5864
|
function parseSqlitePath(path) {
|
|
5841
|
-
const emptyPath = `${
|
|
5865
|
+
const emptyPath = `${chunk4BXHVEFB_cjs.SQLITE_PATH_DELIMITER}${chunk4BXHVEFB_cjs.SQLITE_PATH_DELIMITER}`;
|
|
5842
5866
|
if (!path || path === emptyPath) return [];
|
|
5843
5867
|
const trimmed = path.slice(1, -1);
|
|
5844
5868
|
if (trimmed === "") return [];
|
|
5845
|
-
return trimmed.split(
|
|
5869
|
+
return trimmed.split(chunk4BXHVEFB_cjs.SQLITE_PATH_DELIMITER);
|
|
5846
5870
|
}
|
|
5847
5871
|
function isSqlitePath(value) {
|
|
5848
|
-
return typeof value === "string" && value.startsWith(
|
|
5872
|
+
return typeof value === "string" && value.startsWith(chunk4BXHVEFB_cjs.SQLITE_PATH_DELIMITER) && value.endsWith(chunk4BXHVEFB_cjs.SQLITE_PATH_DELIMITER);
|
|
5849
5873
|
}
|
|
5850
5874
|
function normalizePath(value) {
|
|
5851
5875
|
if (Array.isArray(value)) {
|
|
@@ -5860,12 +5884,12 @@ function normalizePath(value) {
|
|
|
5860
5884
|
return [];
|
|
5861
5885
|
}
|
|
5862
5886
|
function isPostgresTextArray(value) {
|
|
5863
|
-
return typeof value === "string" && value.startsWith(
|
|
5887
|
+
return typeof value === "string" && value.startsWith(chunk4BXHVEFB_cjs.PG_ARRAY_START) && value.endsWith(chunk4BXHVEFB_cjs.PG_ARRAY_END);
|
|
5864
5888
|
}
|
|
5865
5889
|
function parsePostgresTextArray(value) {
|
|
5866
5890
|
const inner = value.slice(1, -1);
|
|
5867
5891
|
if (inner === "") return [];
|
|
5868
|
-
return inner.split(
|
|
5892
|
+
return inner.split(chunk4BXHVEFB_cjs.PG_PATH_ELEMENT_SEPARATOR);
|
|
5869
5893
|
}
|
|
5870
5894
|
|
|
5871
5895
|
// src/query/execution/result-mapper.ts
|
|
@@ -6102,7 +6126,7 @@ async function* createStreamIterable(batchSize, paginate) {
|
|
|
6102
6126
|
}
|
|
6103
6127
|
}
|
|
6104
6128
|
function getStreamBatchSize(options) {
|
|
6105
|
-
return options?.batchSize ??
|
|
6129
|
+
return options?.batchSize ?? chunk4BXHVEFB_cjs.DEFAULT_STREAM_BATCH_SIZE;
|
|
6106
6130
|
}
|
|
6107
6131
|
|
|
6108
6132
|
// src/query/execution/field-tracker.ts
|
|
@@ -6184,7 +6208,7 @@ function createNodeTrackingProxy(alias, kindNames, tracker, options) {
|
|
|
6184
6208
|
return getPlaceholderForSystemField(property, options.mode);
|
|
6185
6209
|
}
|
|
6186
6210
|
if (property === "meta") {
|
|
6187
|
-
for (const key of
|
|
6211
|
+
for (const key of chunk4BXHVEFB_cjs.NODE_META_KEYS) {
|
|
6188
6212
|
tracker.record(alias, `meta.${key}`, true);
|
|
6189
6213
|
}
|
|
6190
6214
|
return buildNodeMetaPlaceholder(options.mode);
|
|
@@ -6217,7 +6241,7 @@ function createEdgeTrackingProxy(alias, edgeKindNames, tracker, options) {
|
|
|
6217
6241
|
return getPlaceholderForSystemField(property, options.mode);
|
|
6218
6242
|
}
|
|
6219
6243
|
if (property === "meta") {
|
|
6220
|
-
for (const key of
|
|
6244
|
+
for (const key of chunk4BXHVEFB_cjs.EDGE_META_KEYS) {
|
|
6221
6245
|
tracker.record(alias, `meta.${key}`, true);
|
|
6222
6246
|
}
|
|
6223
6247
|
return buildEdgeMetaPlaceholder(options.mode);
|
|
@@ -6615,7 +6639,7 @@ var SQL_RESERVED_KEYWORDS = /* @__PURE__ */ new Set([
|
|
|
6615
6639
|
]);
|
|
6616
6640
|
function validateSqlIdentifier(alias) {
|
|
6617
6641
|
if (!SQL_IDENTIFIER_PATTERN.test(alias)) {
|
|
6618
|
-
throw new
|
|
6642
|
+
throw new chunkJIEJCTDS_cjs.ValidationError(
|
|
6619
6643
|
`Invalid alias "${alias}": must start with a letter or underscore, contain only letters, digits, and underscores, and be at most 63 characters`,
|
|
6620
6644
|
{
|
|
6621
6645
|
issues: [
|
|
@@ -6631,7 +6655,7 @@ function validateSqlIdentifier(alias) {
|
|
|
6631
6655
|
);
|
|
6632
6656
|
}
|
|
6633
6657
|
if (alias.toLowerCase().startsWith("cte_")) {
|
|
6634
|
-
throw new
|
|
6658
|
+
throw new chunkJIEJCTDS_cjs.ValidationError(
|
|
6635
6659
|
`Invalid alias "${alias}": aliases starting with "cte_" are reserved for internal use`,
|
|
6636
6660
|
{
|
|
6637
6661
|
issues: [
|
|
@@ -6647,7 +6671,7 @@ function validateSqlIdentifier(alias) {
|
|
|
6647
6671
|
);
|
|
6648
6672
|
}
|
|
6649
6673
|
if (SQL_RESERVED_KEYWORDS.has(alias.toLowerCase())) {
|
|
6650
|
-
throw new
|
|
6674
|
+
throw new chunkJIEJCTDS_cjs.ValidationError(
|
|
6651
6675
|
`Invalid alias "${alias}": "${alias}" is a reserved SQL keyword`,
|
|
6652
6676
|
{
|
|
6653
6677
|
issues: [
|
|
@@ -6716,7 +6740,7 @@ function validateStructuralPredicatePlacement(expression, matchType, buildError,
|
|
|
6716
6740
|
}
|
|
6717
6741
|
}
|
|
6718
6742
|
function throwInvalidVectorPredicatePlacement(path) {
|
|
6719
|
-
throw new
|
|
6743
|
+
throw new chunkJIEJCTDS_cjs.ValidationError(
|
|
6720
6744
|
"Vector similarity predicates cannot be nested under OR or NOT. Use top-level AND combinations instead.",
|
|
6721
6745
|
{
|
|
6722
6746
|
issues: [
|
|
@@ -6732,7 +6756,7 @@ function throwInvalidVectorPredicatePlacement(path) {
|
|
|
6732
6756
|
);
|
|
6733
6757
|
}
|
|
6734
6758
|
function throwInvalidFulltextPredicatePlacement(path) {
|
|
6735
|
-
throw new
|
|
6759
|
+
throw new chunkJIEJCTDS_cjs.ValidationError(
|
|
6736
6760
|
"Fulltext match predicates (.matches()) cannot be nested under OR or NOT. Use top-level AND combinations instead.",
|
|
6737
6761
|
{
|
|
6738
6762
|
issues: [
|
|
@@ -6772,13 +6796,13 @@ function validateFulltextPredicatePlacement(predicates) {
|
|
|
6772
6796
|
function validateHybridFusionOptions(options) {
|
|
6773
6797
|
const method = options.method;
|
|
6774
6798
|
if (method !== void 0 && method !== "rrf") {
|
|
6775
|
-
throw new
|
|
6799
|
+
throw new chunkJIEJCTDS_cjs.ValidationError(`Unsupported fusion method: ${method}`, {
|
|
6776
6800
|
issues: [{ path: "fusion.method", message: `Only "rrf" is supported.` }]
|
|
6777
6801
|
});
|
|
6778
6802
|
}
|
|
6779
6803
|
const { k } = options;
|
|
6780
6804
|
if (k !== void 0 && (!Number.isFinite(k) || k <= 0)) {
|
|
6781
|
-
throw new
|
|
6805
|
+
throw new chunkJIEJCTDS_cjs.ValidationError(
|
|
6782
6806
|
`Fusion k must be a positive finite number, got: ${String(k)}`,
|
|
6783
6807
|
{
|
|
6784
6808
|
issues: [{ path: "fusion.k", message: "Must be a positive number." }]
|
|
@@ -6790,7 +6814,7 @@ function validateHybridFusionOptions(options) {
|
|
|
6790
6814
|
for (const key of ["vector", "fulltext"]) {
|
|
6791
6815
|
const weight = weights[key];
|
|
6792
6816
|
if (weight !== void 0 && (!Number.isFinite(weight) || weight < 0)) {
|
|
6793
|
-
throw new
|
|
6817
|
+
throw new chunkJIEJCTDS_cjs.ValidationError(
|
|
6794
6818
|
`Fusion weight for "${key}" must be a non-negative finite number, got: ${String(weight)}`,
|
|
6795
6819
|
{
|
|
6796
6820
|
issues: [
|
|
@@ -6845,6 +6869,7 @@ function buildCompileOptions(config) {
|
|
|
6845
6869
|
return {
|
|
6846
6870
|
dialect: config.dialect ?? "sqlite",
|
|
6847
6871
|
schema: config.schema,
|
|
6872
|
+
windowFunctions: config.backend?.capabilities.windowFunctions ?? true,
|
|
6848
6873
|
...fulltextStrategy === void 0 ? {} : { fulltextStrategy },
|
|
6849
6874
|
...vectorStrategy === void 0 ? {} : { vectorStrategy, vectorSlots: buildVectorSlots(config.registry) }
|
|
6850
6875
|
};
|
|
@@ -6868,7 +6893,7 @@ function buildVectorSlots(registry) {
|
|
|
6868
6893
|
}
|
|
6869
6894
|
function toLiteral(value) {
|
|
6870
6895
|
if (value === null) {
|
|
6871
|
-
throw new
|
|
6896
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
6872
6897
|
"Parameter value must not be null (use undefined-based patterns instead)",
|
|
6873
6898
|
{ parameterName: "value", valueType: "null" }
|
|
6874
6899
|
);
|
|
@@ -6885,7 +6910,7 @@ function toLiteral(value) {
|
|
|
6885
6910
|
if (typeof value === "boolean") {
|
|
6886
6911
|
return { __type: "literal", value, valueType: "boolean" };
|
|
6887
6912
|
}
|
|
6888
|
-
throw new
|
|
6913
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
6889
6914
|
`Unsupported parameter value type: ${typeof value}`,
|
|
6890
6915
|
{ parameterName: "value", actualType: typeof value }
|
|
6891
6916
|
);
|
|
@@ -6896,7 +6921,7 @@ function substitutePredicateExpression(expr, bindings) {
|
|
|
6896
6921
|
if (isParameterRef(expr.right)) {
|
|
6897
6922
|
const value = bindings[expr.right.name];
|
|
6898
6923
|
if (value === void 0) {
|
|
6899
|
-
throw new
|
|
6924
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
6900
6925
|
`Missing binding for parameter "${expr.right.name}"`,
|
|
6901
6926
|
{ parameterName: expr.right.name }
|
|
6902
6927
|
);
|
|
@@ -6912,13 +6937,13 @@ function substitutePredicateExpression(expr, bindings) {
|
|
|
6912
6937
|
if (isParameterRef(expr.pattern)) {
|
|
6913
6938
|
const value = bindings[expr.pattern.name];
|
|
6914
6939
|
if (value === void 0) {
|
|
6915
|
-
throw new
|
|
6940
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
6916
6941
|
`Missing binding for parameter "${expr.pattern.name}"`,
|
|
6917
6942
|
{ parameterName: expr.pattern.name }
|
|
6918
6943
|
);
|
|
6919
6944
|
}
|
|
6920
6945
|
if (typeof value !== "string") {
|
|
6921
|
-
throw new
|
|
6946
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
6922
6947
|
`Parameter "${expr.pattern.name}" must be a string for string operations`,
|
|
6923
6948
|
{ parameterName: expr.pattern.name, actualType: typeof value }
|
|
6924
6949
|
);
|
|
@@ -6986,7 +7011,7 @@ function substitutePredicateExpression(expr, bindings) {
|
|
|
6986
7011
|
function resolveBinding(bindings, name) {
|
|
6987
7012
|
const value = bindings[name];
|
|
6988
7013
|
if (value === void 0) {
|
|
6989
|
-
throw new
|
|
7014
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(`Missing binding for parameter "${name}"`, {
|
|
6990
7015
|
parameterName: name
|
|
6991
7016
|
});
|
|
6992
7017
|
}
|
|
@@ -7005,13 +7030,13 @@ function substituteParameters(ast, bindings) {
|
|
|
7005
7030
|
};
|
|
7006
7031
|
}
|
|
7007
7032
|
function fillPlaceholders(params, bindings, dialect) {
|
|
7008
|
-
const adapter =
|
|
7033
|
+
const adapter = chunkUESTHN47_cjs.getDialect(dialect);
|
|
7009
7034
|
return params.map((parameter) => {
|
|
7010
7035
|
if (parameter instanceof drizzleOrm.Placeholder) {
|
|
7011
7036
|
const name = parameter.name;
|
|
7012
7037
|
const value = bindings[name];
|
|
7013
7038
|
if (value === void 0) {
|
|
7014
|
-
throw new
|
|
7039
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
7015
7040
|
`Missing binding for parameter "${name}"`,
|
|
7016
7041
|
{ parameterName: name }
|
|
7017
7042
|
);
|
|
@@ -7078,7 +7103,7 @@ var PreparedQuery = class {
|
|
|
7078
7103
|
this.#selectFn
|
|
7079
7104
|
);
|
|
7080
7105
|
} catch (error) {
|
|
7081
|
-
if (error instanceof MissingSelectiveFieldError || error instanceof
|
|
7106
|
+
if (error instanceof MissingSelectiveFieldError || error instanceof chunkJIEJCTDS_cjs.UnsupportedPredicateError) {
|
|
7082
7107
|
return this.#executeUnoptimized(bindings);
|
|
7083
7108
|
}
|
|
7084
7109
|
throw error;
|
|
@@ -7249,7 +7274,7 @@ function validateBindings(bindings, metadata) {
|
|
|
7249
7274
|
}
|
|
7250
7275
|
}
|
|
7251
7276
|
if (missing.length > 0) {
|
|
7252
|
-
throw new
|
|
7277
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
7253
7278
|
`Missing bindings for parameter${missing.length === 1 ? "" : "s"}: ${missing.map((name) => `"${name}"`).join(", ")}`,
|
|
7254
7279
|
{ missingParameters: missing }
|
|
7255
7280
|
);
|
|
@@ -7258,7 +7283,7 @@ function validateBindings(bindings, metadata) {
|
|
|
7258
7283
|
(name) => !expectedNames.has(name)
|
|
7259
7284
|
);
|
|
7260
7285
|
if (unexpected.length > 0) {
|
|
7261
|
-
throw new
|
|
7286
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
7262
7287
|
`Unexpected bindings provided: ${unexpected.map((name) => `"${name}"`).join(", ")}`,
|
|
7263
7288
|
{ unexpectedParameters: unexpected }
|
|
7264
7289
|
);
|
|
@@ -7270,14 +7295,14 @@ function validateBindings(bindings, metadata) {
|
|
|
7270
7295
|
}
|
|
7271
7296
|
function validateBindingValue(name, value, isStringOp) {
|
|
7272
7297
|
if (value === null) {
|
|
7273
|
-
throw new
|
|
7298
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
7274
7299
|
"Parameter value must not be null (use undefined-based patterns instead)",
|
|
7275
7300
|
{ parameterName: name, valueType: "null" }
|
|
7276
7301
|
);
|
|
7277
7302
|
}
|
|
7278
7303
|
if (isStringOp) {
|
|
7279
7304
|
if (typeof value !== "string") {
|
|
7280
|
-
throw new
|
|
7305
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
7281
7306
|
`Parameter "${name}" must be a string for string operations`,
|
|
7282
7307
|
{ parameterName: name, actualType: typeof value }
|
|
7283
7308
|
);
|
|
@@ -7287,7 +7312,7 @@ function validateBindingValue(name, value, isStringOp) {
|
|
|
7287
7312
|
if (value instanceof Date || typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
7288
7313
|
return;
|
|
7289
7314
|
}
|
|
7290
|
-
throw new
|
|
7315
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
7291
7316
|
`Unsupported parameter value type: ${typeof value}`,
|
|
7292
7317
|
{ parameterName: name, actualType: typeof value }
|
|
7293
7318
|
);
|
|
@@ -7350,7 +7375,7 @@ var ExecutableQuery = class _ExecutableQuery {
|
|
|
7350
7375
|
direction
|
|
7351
7376
|
} : {
|
|
7352
7377
|
field: fieldRef(alias, ["props"], {
|
|
7353
|
-
jsonPointer:
|
|
7378
|
+
jsonPointer: chunkFLRCVI2G_cjs.jsonPointer([field2]),
|
|
7354
7379
|
valueType: typeInfo?.valueType,
|
|
7355
7380
|
elementType: typeInfo?.elementType
|
|
7356
7381
|
}),
|
|
@@ -7693,7 +7718,7 @@ var ExecutableQuery = class _ExecutableQuery {
|
|
|
7693
7718
|
this.#cachedOptimizedCompiled = NOT_COMPUTED;
|
|
7694
7719
|
return void 0;
|
|
7695
7720
|
}
|
|
7696
|
-
if (error instanceof
|
|
7721
|
+
if (error instanceof chunkJIEJCTDS_cjs.UnsupportedPredicateError) {
|
|
7697
7722
|
this.#cachedSelectiveFieldsForExecute = void 0;
|
|
7698
7723
|
this.#cachedOptimizedCompiled = NOT_COMPUTED;
|
|
7699
7724
|
return void 0;
|
|
@@ -7743,7 +7768,7 @@ var ExecutableQuery = class _ExecutableQuery {
|
|
|
7743
7768
|
this.#cachedOptimizedCompiled = NOT_COMPUTED;
|
|
7744
7769
|
return void 0;
|
|
7745
7770
|
}
|
|
7746
|
-
if (error instanceof
|
|
7771
|
+
if (error instanceof chunkJIEJCTDS_cjs.UnsupportedPredicateError) {
|
|
7747
7772
|
this.#cachedSelectiveFieldsForExecute = void 0;
|
|
7748
7773
|
this.#cachedOptimizedCompiled = NOT_COMPUTED;
|
|
7749
7774
|
return void 0;
|
|
@@ -7877,7 +7902,7 @@ var ExecutableQuery = class _ExecutableQuery {
|
|
|
7877
7902
|
selectiveFields
|
|
7878
7903
|
});
|
|
7879
7904
|
} catch (error) {
|
|
7880
|
-
if (error instanceof
|
|
7905
|
+
if (error instanceof chunkJIEJCTDS_cjs.UnsupportedPredicateError) {
|
|
7881
7906
|
this.#cachedSelectiveFieldsForPagination = void 0;
|
|
7882
7907
|
return void 0;
|
|
7883
7908
|
}
|
|
@@ -7903,7 +7928,7 @@ var ExecutableQuery = class _ExecutableQuery {
|
|
|
7903
7928
|
this.#cachedSelectiveFieldsForPagination = void 0;
|
|
7904
7929
|
return void 0;
|
|
7905
7930
|
}
|
|
7906
|
-
if (error instanceof
|
|
7931
|
+
if (error instanceof chunkJIEJCTDS_cjs.UnsupportedPredicateError) {
|
|
7907
7932
|
this.#cachedSelectiveFieldsForPagination = void 0;
|
|
7908
7933
|
return void 0;
|
|
7909
7934
|
}
|
|
@@ -7928,7 +7953,7 @@ var ExecutableQuery = class _ExecutableQuery {
|
|
|
7928
7953
|
this.#cachedSelectiveFieldsForPagination = void 0;
|
|
7929
7954
|
return void 0;
|
|
7930
7955
|
}
|
|
7931
|
-
if (error instanceof
|
|
7956
|
+
if (error instanceof chunkJIEJCTDS_cjs.UnsupportedPredicateError) {
|
|
7932
7957
|
this.#cachedSelectiveFieldsForPagination = void 0;
|
|
7933
7958
|
return void 0;
|
|
7934
7959
|
}
|
|
@@ -7956,7 +7981,7 @@ var ExecutableQuery = class _ExecutableQuery {
|
|
|
7956
7981
|
if (field2.jsonPointer === void 0) {
|
|
7957
7982
|
return false;
|
|
7958
7983
|
}
|
|
7959
|
-
const segments =
|
|
7984
|
+
const segments = chunkFLRCVI2G_cjs.parseJsonPointer(field2.jsonPointer);
|
|
7960
7985
|
if (segments.length !== 1) {
|
|
7961
7986
|
return false;
|
|
7962
7987
|
}
|
|
@@ -8004,7 +8029,7 @@ var ExecutableQuery = class _ExecutableQuery {
|
|
|
8004
8029
|
aliasObject2[fieldName] = nullToUndefined(row[outputName2]);
|
|
8005
8030
|
continue;
|
|
8006
8031
|
}
|
|
8007
|
-
const segments =
|
|
8032
|
+
const segments = chunkFLRCVI2G_cjs.parseJsonPointer(jsonPointer2);
|
|
8008
8033
|
if (segments.length === 0) {
|
|
8009
8034
|
throw new MissingSelectiveFieldError(alias, "orderBy");
|
|
8010
8035
|
}
|
|
@@ -8084,7 +8109,7 @@ var ExecutableQuery = class _ExecutableQuery {
|
|
|
8084
8109
|
);
|
|
8085
8110
|
}
|
|
8086
8111
|
if (this.#state.orderBy.length === 0) {
|
|
8087
|
-
throw new
|
|
8112
|
+
throw new chunkJIEJCTDS_cjs.ValidationError(
|
|
8088
8113
|
"Cursor pagination requires ORDER BY. Add .orderBy() before .paginate()",
|
|
8089
8114
|
{
|
|
8090
8115
|
issues: [
|
|
@@ -8100,7 +8125,7 @@ var ExecutableQuery = class _ExecutableQuery {
|
|
|
8100
8125
|
);
|
|
8101
8126
|
}
|
|
8102
8127
|
const isBackward = options.last !== void 0 || options.before !== void 0;
|
|
8103
|
-
const limit = options.first ?? options.last ??
|
|
8128
|
+
const limit = options.first ?? options.last ?? chunk4BXHVEFB_cjs.DEFAULT_PAGINATION_LIMIT;
|
|
8104
8129
|
const cursor = options.after ?? options.before;
|
|
8105
8130
|
let cursorData;
|
|
8106
8131
|
if (cursor) {
|
|
@@ -8160,7 +8185,7 @@ var ExecutableQuery = class _ExecutableQuery {
|
|
|
8160
8185
|
*/
|
|
8161
8186
|
stream(options) {
|
|
8162
8187
|
if (this.#state.orderBy.length === 0) {
|
|
8163
|
-
throw new
|
|
8188
|
+
throw new chunkJIEJCTDS_cjs.ValidationError(
|
|
8164
8189
|
"Streaming requires ORDER BY. Add .orderBy() before .stream()",
|
|
8165
8190
|
{
|
|
8166
8191
|
issues: [
|
|
@@ -8236,7 +8261,7 @@ function createDynamicFieldBuilder(introspector, alias, name, kindNames, entity)
|
|
|
8236
8261
|
throw new Error(`Property "${name}" is not declared on ${where}.`);
|
|
8237
8262
|
}
|
|
8238
8263
|
const ref = fieldRef(alias, ["props"], {
|
|
8239
|
-
jsonPointer:
|
|
8264
|
+
jsonPointer: chunkFLRCVI2G_cjs.jsonPointer([name]),
|
|
8240
8265
|
valueType: typeInfo.valueType,
|
|
8241
8266
|
elementType: typeInfo.elementType
|
|
8242
8267
|
});
|
|
@@ -8560,7 +8585,7 @@ var TraversalBuilder = class _TraversalBuilder {
|
|
|
8560
8585
|
const valueType = typeInfo?.valueType;
|
|
8561
8586
|
const elementType = typeInfo?.elementType;
|
|
8562
8587
|
const ref = fieldRef(alias, ["props"], {
|
|
8563
|
-
jsonPointer:
|
|
8588
|
+
jsonPointer: chunkFLRCVI2G_cjs.jsonPointer([propertyName]),
|
|
8564
8589
|
valueType,
|
|
8565
8590
|
elementType
|
|
8566
8591
|
});
|
|
@@ -8632,7 +8657,7 @@ var TraversalBuilder = class _TraversalBuilder {
|
|
|
8632
8657
|
toDynamic(kind, alias, options) {
|
|
8633
8658
|
validateSqlIdentifier(alias);
|
|
8634
8659
|
if (!this.#config.registry.hasNodeType(kind)) {
|
|
8635
|
-
throw new
|
|
8660
|
+
throw new chunkJIEJCTDS_cjs.KindNotFoundError(kind, "node", {
|
|
8636
8661
|
graphId: this.#config.graphId
|
|
8637
8662
|
});
|
|
8638
8663
|
}
|
|
@@ -8717,7 +8742,7 @@ var TraversalBuilder = class _TraversalBuilder {
|
|
|
8717
8742
|
for (const expected of expectedKinds) {
|
|
8718
8743
|
if (this.#config.registry.isAssignableTo(targetKind, expected)) return;
|
|
8719
8744
|
}
|
|
8720
|
-
throw new
|
|
8745
|
+
throw new chunkJIEJCTDS_cjs.EndpointError({
|
|
8721
8746
|
edgeKind: this.#edgeKinds[0] ?? "(unknown)",
|
|
8722
8747
|
endpoint: forwardSide,
|
|
8723
8748
|
actualKind: targetKind,
|
|
@@ -8850,7 +8875,7 @@ var QueryBuilder = class _QueryBuilder {
|
|
|
8850
8875
|
fromDynamic(kind, alias, options) {
|
|
8851
8876
|
validateSqlIdentifier(alias);
|
|
8852
8877
|
if (!this.#config.registry.hasNodeType(kind)) {
|
|
8853
|
-
throw new
|
|
8878
|
+
throw new chunkJIEJCTDS_cjs.KindNotFoundError(kind, "node", {
|
|
8854
8879
|
graphId: this.#config.graphId
|
|
8855
8880
|
});
|
|
8856
8881
|
}
|
|
@@ -8980,7 +9005,7 @@ var QueryBuilder = class _QueryBuilder {
|
|
|
8980
9005
|
#beginDynamicTraversal(edgeKind, edgeAlias, optional, options) {
|
|
8981
9006
|
validateSqlIdentifier(edgeAlias);
|
|
8982
9007
|
if (!this.#config.registry.hasEdgeType(edgeKind)) {
|
|
8983
|
-
throw new
|
|
9008
|
+
throw new chunkJIEJCTDS_cjs.KindNotFoundError(edgeKind, "edge", {
|
|
8984
9009
|
graphId: this.#config.graphId
|
|
8985
9010
|
});
|
|
8986
9011
|
}
|
|
@@ -9043,7 +9068,7 @@ var QueryBuilder = class _QueryBuilder {
|
|
|
9043
9068
|
if (source.valueType !== void 0 || source.path.length !== 1 || source.path[0] !== "props" || source.jsonPointer === void 0) {
|
|
9044
9069
|
return [outputName, source];
|
|
9045
9070
|
}
|
|
9046
|
-
const segments =
|
|
9071
|
+
const segments = chunkFLRCVI2G_cjs.parseJsonPointer(source.jsonPointer);
|
|
9047
9072
|
if (segments.length !== 1) {
|
|
9048
9073
|
return [outputName, source];
|
|
9049
9074
|
}
|
|
@@ -9097,7 +9122,7 @@ var QueryBuilder = class _QueryBuilder {
|
|
|
9097
9122
|
direction
|
|
9098
9123
|
} : {
|
|
9099
9124
|
field: fieldRef(alias, ["props"], {
|
|
9100
|
-
jsonPointer:
|
|
9125
|
+
jsonPointer: chunkFLRCVI2G_cjs.jsonPointer([field2]),
|
|
9101
9126
|
valueType: typeInfo?.valueType,
|
|
9102
9127
|
elementType: typeInfo?.elementType
|
|
9103
9128
|
}),
|
|
@@ -9140,7 +9165,7 @@ var QueryBuilder = class _QueryBuilder {
|
|
|
9140
9165
|
*/
|
|
9141
9166
|
temporal(mode, asOf) {
|
|
9142
9167
|
if (mode === "asOf" && asOf === void 0) {
|
|
9143
|
-
throw new
|
|
9168
|
+
throw new chunkJIEJCTDS_cjs.ValidationError(
|
|
9144
9169
|
'Temporal mode "asOf" requires a timestamp',
|
|
9145
9170
|
{
|
|
9146
9171
|
issues: [
|
|
@@ -9172,7 +9197,7 @@ var QueryBuilder = class _QueryBuilder {
|
|
|
9172
9197
|
__type: "field_ref",
|
|
9173
9198
|
alias,
|
|
9174
9199
|
path: ["props"],
|
|
9175
|
-
jsonPointer:
|
|
9200
|
+
jsonPointer: chunkFLRCVI2G_cjs.jsonPointer([field2]),
|
|
9176
9201
|
valueType: typeInfo?.valueType,
|
|
9177
9202
|
elementType: typeInfo?.elementType
|
|
9178
9203
|
};
|
|
@@ -9300,7 +9325,7 @@ var QueryBuilder = class _QueryBuilder {
|
|
|
9300
9325
|
property
|
|
9301
9326
|
) : void 0;
|
|
9302
9327
|
const ref = fieldRef(alias, ["props"], {
|
|
9303
|
-
jsonPointer:
|
|
9328
|
+
jsonPointer: chunkFLRCVI2G_cjs.jsonPointer([property]),
|
|
9304
9329
|
valueType: typeInfo?.valueType,
|
|
9305
9330
|
elementType: typeInfo?.elementType
|
|
9306
9331
|
});
|
|
@@ -9393,7 +9418,7 @@ var QueryBuilder = class _QueryBuilder {
|
|
|
9393
9418
|
property
|
|
9394
9419
|
) : void 0;
|
|
9395
9420
|
const ref = fieldRef(alias, ["props"], {
|
|
9396
|
-
jsonPointer:
|
|
9421
|
+
jsonPointer: chunkFLRCVI2G_cjs.jsonPointer([property]),
|
|
9397
9422
|
valueType: typeInfo?.valueType,
|
|
9398
9423
|
elementType: typeInfo?.elementType
|
|
9399
9424
|
});
|
|
@@ -9654,7 +9679,7 @@ function count(alias, field2) {
|
|
|
9654
9679
|
__type: "field_ref",
|
|
9655
9680
|
alias,
|
|
9656
9681
|
path: field2 ? ["props"] : ["id"],
|
|
9657
|
-
jsonPointer: field2 ?
|
|
9682
|
+
jsonPointer: field2 ? chunkFLRCVI2G_cjs.jsonPointer([field2]) : void 0,
|
|
9658
9683
|
valueType: field2 ? void 0 : "string"
|
|
9659
9684
|
}
|
|
9660
9685
|
};
|
|
@@ -9667,7 +9692,7 @@ function countDistinct(alias, field2) {
|
|
|
9667
9692
|
__type: "field_ref",
|
|
9668
9693
|
alias,
|
|
9669
9694
|
path: field2 ? ["props"] : ["id"],
|
|
9670
|
-
jsonPointer: field2 ?
|
|
9695
|
+
jsonPointer: field2 ? chunkFLRCVI2G_cjs.jsonPointer([field2]) : void 0,
|
|
9671
9696
|
valueType: field2 ? void 0 : "string"
|
|
9672
9697
|
}
|
|
9673
9698
|
};
|
|
@@ -9686,7 +9711,7 @@ function sum(alias, field2) {
|
|
|
9686
9711
|
__type: "field_ref",
|
|
9687
9712
|
alias,
|
|
9688
9713
|
path: ["props"],
|
|
9689
|
-
jsonPointer:
|
|
9714
|
+
jsonPointer: chunkFLRCVI2G_cjs.jsonPointer([field2]),
|
|
9690
9715
|
valueType: "number"
|
|
9691
9716
|
}
|
|
9692
9717
|
};
|
|
@@ -9699,7 +9724,7 @@ function avg(alias, field2) {
|
|
|
9699
9724
|
__type: "field_ref",
|
|
9700
9725
|
alias,
|
|
9701
9726
|
path: ["props"],
|
|
9702
|
-
jsonPointer:
|
|
9727
|
+
jsonPointer: chunkFLRCVI2G_cjs.jsonPointer([field2]),
|
|
9703
9728
|
valueType: "number"
|
|
9704
9729
|
}
|
|
9705
9730
|
};
|
|
@@ -9712,7 +9737,7 @@ function min(alias, field2) {
|
|
|
9712
9737
|
__type: "field_ref",
|
|
9713
9738
|
alias,
|
|
9714
9739
|
path: ["props"],
|
|
9715
|
-
jsonPointer:
|
|
9740
|
+
jsonPointer: chunkFLRCVI2G_cjs.jsonPointer([field2]),
|
|
9716
9741
|
valueType: "number"
|
|
9717
9742
|
}
|
|
9718
9743
|
};
|
|
@@ -9725,7 +9750,7 @@ function max(alias, field2) {
|
|
|
9725
9750
|
__type: "field_ref",
|
|
9726
9751
|
alias,
|
|
9727
9752
|
path: ["props"],
|
|
9728
|
-
jsonPointer:
|
|
9753
|
+
jsonPointer: chunkFLRCVI2G_cjs.jsonPointer([field2]),
|
|
9729
9754
|
valueType: "number"
|
|
9730
9755
|
}
|
|
9731
9756
|
};
|
|
@@ -9756,7 +9781,7 @@ function field(alias, ...path) {
|
|
|
9756
9781
|
__type: "field_ref",
|
|
9757
9782
|
alias,
|
|
9758
9783
|
path: ["props"],
|
|
9759
|
-
jsonPointer:
|
|
9784
|
+
jsonPointer: chunkFLRCVI2G_cjs.jsonPointer(path)
|
|
9760
9785
|
};
|
|
9761
9786
|
}
|
|
9762
9787
|
function having(aggregate, op, value) {
|
|
@@ -9819,7 +9844,7 @@ setUnionableQueryClass(UnionableQuery);
|
|
|
9819
9844
|
|
|
9820
9845
|
// src/query/builder.ts
|
|
9821
9846
|
function createQueryBuilder(graphId, registry, options) {
|
|
9822
|
-
const schemaIntrospector =
|
|
9847
|
+
const schemaIntrospector = chunkYQGLVWB2_cjs.createSchemaIntrospector(
|
|
9823
9848
|
registry.nodeKinds,
|
|
9824
9849
|
registry.edgeKinds
|
|
9825
9850
|
);
|
|
@@ -9858,12 +9883,12 @@ function createQueryBuilder(graphId, registry, options) {
|
|
|
9858
9883
|
function buildKindRegistry(graph) {
|
|
9859
9884
|
const nodeTypes = extractNodeTypes(graph);
|
|
9860
9885
|
const edgeTypes = extractEdgeTypes(graph);
|
|
9861
|
-
const closures = graph.ontology.length > 0 ?
|
|
9862
|
-
return new
|
|
9886
|
+
const closures = graph.ontology.length > 0 ? chunkK4N35E7B_cjs.computeClosuresFromOntology(graph.ontology) : chunkK4N35E7B_cjs.createEmptyClosures();
|
|
9887
|
+
return new chunkK4N35E7B_cjs.KindRegistry(nodeTypes, edgeTypes, closures);
|
|
9863
9888
|
}
|
|
9864
9889
|
function extractNodeTypes(graph) {
|
|
9865
9890
|
const result = /* @__PURE__ */ new Map();
|
|
9866
|
-
for (const typeName of
|
|
9891
|
+
for (const typeName of chunk7JGLPAFV_cjs.getNodeKinds(graph)) {
|
|
9867
9892
|
const registration = graph.nodes[typeName];
|
|
9868
9893
|
result.set(typeName, registration.type);
|
|
9869
9894
|
}
|
|
@@ -9871,7 +9896,7 @@ function extractNodeTypes(graph) {
|
|
|
9871
9896
|
}
|
|
9872
9897
|
function extractEdgeTypes(graph) {
|
|
9873
9898
|
const result = /* @__PURE__ */ new Map();
|
|
9874
|
-
for (const typeName of
|
|
9899
|
+
for (const typeName of chunk7JGLPAFV_cjs.getEdgeKinds(graph)) {
|
|
9875
9900
|
const registration = graph.edges[typeName];
|
|
9876
9901
|
result.set(typeName, registration.type);
|
|
9877
9902
|
}
|
|
@@ -9900,19 +9925,19 @@ function resolveTemporalFilter(ctx, options, tableAlias) {
|
|
|
9900
9925
|
function resolveMaxHops(rawMaxHops, fallback, optionName) {
|
|
9901
9926
|
const value = rawMaxHops ?? fallback;
|
|
9902
9927
|
if (!Number.isFinite(value) || !Number.isInteger(value)) {
|
|
9903
|
-
throw new
|
|
9928
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
9904
9929
|
`Graph algorithm ${optionName} must be a finite integer, got ${String(value)}.`,
|
|
9905
9930
|
{ option: optionName, value }
|
|
9906
9931
|
);
|
|
9907
9932
|
}
|
|
9908
9933
|
if (value < 1) {
|
|
9909
|
-
throw new
|
|
9934
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
9910
9935
|
`Graph algorithm ${optionName} must be at least 1, got ${value}.`,
|
|
9911
9936
|
{ option: optionName, value }
|
|
9912
9937
|
);
|
|
9913
9938
|
}
|
|
9914
9939
|
if (value > MAX_EXPLICIT_RECURSIVE_DEPTH) {
|
|
9915
|
-
throw new
|
|
9940
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
9916
9941
|
`Graph algorithm ${optionName} (${value}) exceeds the maximum of ${MAX_EXPLICIT_RECURSIVE_DEPTH}.`,
|
|
9917
9942
|
{ option: optionName, value, limit: MAX_EXPLICIT_RECURSIVE_DEPTH }
|
|
9918
9943
|
);
|
|
@@ -9921,7 +9946,7 @@ function resolveMaxHops(rawMaxHops, fallback, optionName) {
|
|
|
9921
9946
|
}
|
|
9922
9947
|
function assertEdgeKinds(edges) {
|
|
9923
9948
|
if (edges.length === 0) {
|
|
9924
|
-
throw new
|
|
9949
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
9925
9950
|
`Graph algorithms require at least one edge kind in 'edges'.`,
|
|
9926
9951
|
{ edges }
|
|
9927
9952
|
);
|
|
@@ -10085,7 +10110,7 @@ function createGraphAlgorithms(params) {
|
|
|
10085
10110
|
const ctx = {
|
|
10086
10111
|
graphId: params.graphId,
|
|
10087
10112
|
backend: params.backend,
|
|
10088
|
-
dialect:
|
|
10113
|
+
dialect: chunkUESTHN47_cjs.getDialect(params.backend.dialect),
|
|
10089
10114
|
schema: params.schema ?? (params.backend.tableNames ? createSqlSchema(params.backend.tableNames) : createSqlSchema()),
|
|
10090
10115
|
defaultTemporalMode: params.defaultTemporalMode
|
|
10091
10116
|
};
|
|
@@ -10278,7 +10303,7 @@ function createEdgeCollection(config) {
|
|
|
10278
10303
|
async find(options) {
|
|
10279
10304
|
const untypedOptions = options;
|
|
10280
10305
|
if (untypedOptions?.where !== void 0) {
|
|
10281
|
-
throw new
|
|
10306
|
+
throw new chunkJIEJCTDS_cjs.UnsupportedPredicateError(
|
|
10282
10307
|
`store.edges.${kind}.find({ where }) is not supported. Use store.query().traverse(...).whereEdge(...) for edge property filters.`,
|
|
10283
10308
|
{ kind, operation: "find" }
|
|
10284
10309
|
);
|
|
@@ -10291,7 +10316,7 @@ function createEdgeCollection(config) {
|
|
|
10291
10316
|
temporalMode: mode
|
|
10292
10317
|
};
|
|
10293
10318
|
if (mode === "current" || mode === "asOf") {
|
|
10294
|
-
params.asOf = options?.asOf ??
|
|
10319
|
+
params.asOf = options?.asOf ?? chunk7JGLPAFV_cjs.nowIso();
|
|
10295
10320
|
}
|
|
10296
10321
|
if (options?.from?.kind !== void 0)
|
|
10297
10322
|
params.fromKind = options.from.kind;
|
|
@@ -10312,7 +10337,7 @@ function createEdgeCollection(config) {
|
|
|
10312
10337
|
temporalMode: mode
|
|
10313
10338
|
};
|
|
10314
10339
|
if (mode === "current" || mode === "asOf") {
|
|
10315
|
-
params.asOf = options?.asOf ??
|
|
10340
|
+
params.asOf = options?.asOf ?? chunk7JGLPAFV_cjs.nowIso();
|
|
10316
10341
|
}
|
|
10317
10342
|
if (options?.from?.kind !== void 0)
|
|
10318
10343
|
params.fromKind = options.from.kind;
|
|
@@ -10485,6 +10510,27 @@ function createEdgeCollection(config) {
|
|
|
10485
10510
|
};
|
|
10486
10511
|
}
|
|
10487
10512
|
|
|
10513
|
+
// src/store/node-fetch.ts
|
|
10514
|
+
async function getNodeRowsByIds(backend, graphId, kind, ids) {
|
|
10515
|
+
const rowsById = /* @__PURE__ */ new Map();
|
|
10516
|
+
if (ids.length === 0) return rowsById;
|
|
10517
|
+
if (backend.getNodes !== void 0) {
|
|
10518
|
+
const rows2 = await backend.getNodes(graphId, kind, ids);
|
|
10519
|
+
for (const row of rows2) {
|
|
10520
|
+
rowsById.set(row.id, row);
|
|
10521
|
+
}
|
|
10522
|
+
return rowsById;
|
|
10523
|
+
}
|
|
10524
|
+
const uniqueIds = [...new Set(ids)];
|
|
10525
|
+
const rows = await Promise.all(
|
|
10526
|
+
uniqueIds.map((id) => backend.getNode(graphId, kind, id))
|
|
10527
|
+
);
|
|
10528
|
+
for (const row of rows) {
|
|
10529
|
+
if (row !== void 0) rowsById.set(row.id, row);
|
|
10530
|
+
}
|
|
10531
|
+
return rowsById;
|
|
10532
|
+
}
|
|
10533
|
+
|
|
10488
10534
|
// src/store/collections/node-collection.ts
|
|
10489
10535
|
function narrowNode(node) {
|
|
10490
10536
|
return node;
|
|
@@ -10526,7 +10572,8 @@ function createNodeCollection(config) {
|
|
|
10526
10572
|
executeGetOrCreateByConstraint,
|
|
10527
10573
|
executeBulkGetOrCreateByConstraint,
|
|
10528
10574
|
executeFindByConstraint,
|
|
10529
|
-
executeBulkFindByConstraint
|
|
10575
|
+
executeBulkFindByConstraint,
|
|
10576
|
+
executeBulkFindByIndex
|
|
10530
10577
|
} = config;
|
|
10531
10578
|
return {
|
|
10532
10579
|
async create(props, options) {
|
|
@@ -10547,27 +10594,13 @@ function createNodeCollection(config) {
|
|
|
10547
10594
|
},
|
|
10548
10595
|
async getByIds(ids, options) {
|
|
10549
10596
|
if (ids.length === 0) return [];
|
|
10550
|
-
|
|
10551
|
-
|
|
10552
|
-
const
|
|
10553
|
-
|
|
10554
|
-
|
|
10555
|
-
|
|
10556
|
-
|
|
10557
|
-
const row = rowMap.get(id);
|
|
10558
|
-
if (!row) return;
|
|
10559
|
-
if (!matchesTemporalMode(row, options)) return;
|
|
10560
|
-
return narrowNode(rowToNode2(row));
|
|
10561
|
-
});
|
|
10562
|
-
}
|
|
10563
|
-
return Promise.all(
|
|
10564
|
-
ids.map(async (id) => {
|
|
10565
|
-
const row = await backend.getNode(graphId, kind, id);
|
|
10566
|
-
if (!row) return;
|
|
10567
|
-
if (!matchesTemporalMode(row, options)) return;
|
|
10568
|
-
return narrowNode(rowToNode2(row));
|
|
10569
|
-
})
|
|
10570
|
-
);
|
|
10597
|
+
const rowsById = await getNodeRowsByIds(backend, graphId, kind, ids);
|
|
10598
|
+
return ids.map((id) => {
|
|
10599
|
+
const row = rowsById.get(id);
|
|
10600
|
+
if (!row) return;
|
|
10601
|
+
if (!matchesTemporalMode(row, options)) return;
|
|
10602
|
+
return narrowNode(rowToNode2(row));
|
|
10603
|
+
});
|
|
10571
10604
|
},
|
|
10572
10605
|
async update(id, props, options) {
|
|
10573
10606
|
const result = await executeNodeUpdate2(
|
|
@@ -10584,7 +10617,7 @@ function createNodeCollection(config) {
|
|
|
10584
10617
|
},
|
|
10585
10618
|
async find(options) {
|
|
10586
10619
|
if (options?.where !== void 0 && createQuery === void 0) {
|
|
10587
|
-
throw new
|
|
10620
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
10588
10621
|
`store.nodes.${kind}.find({ where }) requires a query-capable store`,
|
|
10589
10622
|
{ kind, operation: "find" }
|
|
10590
10623
|
);
|
|
@@ -10593,7 +10626,7 @@ function createNodeCollection(config) {
|
|
|
10593
10626
|
const mode2 = options.temporalMode ?? defaultTemporalMode;
|
|
10594
10627
|
let query = createQuery().from(kind, "_n").temporal(
|
|
10595
10628
|
mode2,
|
|
10596
|
-
mode2 === "asOf" ? options.asOf ??
|
|
10629
|
+
mode2 === "asOf" ? options.asOf ?? chunk7JGLPAFV_cjs.nowIso() : void 0
|
|
10597
10630
|
).whereNode("_n", options.where).select((ctx) => ctx._n);
|
|
10598
10631
|
if (options.limit !== void 0) query = query.limit(options.limit);
|
|
10599
10632
|
if (options.offset !== void 0) query = query.offset(options.offset);
|
|
@@ -10608,7 +10641,7 @@ function createNodeCollection(config) {
|
|
|
10608
10641
|
temporalMode: mode
|
|
10609
10642
|
};
|
|
10610
10643
|
if (mode === "current" || mode === "asOf") {
|
|
10611
|
-
params.asOf = options?.asOf ??
|
|
10644
|
+
params.asOf = options?.asOf ?? chunk7JGLPAFV_cjs.nowIso();
|
|
10612
10645
|
}
|
|
10613
10646
|
if (options?.limit !== void 0) params.limit = options.limit;
|
|
10614
10647
|
if (options?.offset !== void 0) params.offset = options.offset;
|
|
@@ -10624,7 +10657,7 @@ function createNodeCollection(config) {
|
|
|
10624
10657
|
temporalMode: mode
|
|
10625
10658
|
};
|
|
10626
10659
|
if (mode === "current" || mode === "asOf") {
|
|
10627
|
-
params.asOf = options?.asOf ??
|
|
10660
|
+
params.asOf = options?.asOf ?? chunk7JGLPAFV_cjs.nowIso();
|
|
10628
10661
|
}
|
|
10629
10662
|
return backend.countNodesByKind(params);
|
|
10630
10663
|
},
|
|
@@ -10764,6 +10797,20 @@ function createNodeCollection(config) {
|
|
|
10764
10797
|
(result) => result === void 0 ? void 0 : narrowNode(result)
|
|
10765
10798
|
);
|
|
10766
10799
|
},
|
|
10800
|
+
async bulkFindByIndex(indexName, items, options) {
|
|
10801
|
+
if (items.length === 0) return [];
|
|
10802
|
+
const mappedItems = items.map((item) => ({
|
|
10803
|
+
props: item.props
|
|
10804
|
+
}));
|
|
10805
|
+
const results = await executeBulkFindByIndex(
|
|
10806
|
+
kind,
|
|
10807
|
+
indexName,
|
|
10808
|
+
mappedItems,
|
|
10809
|
+
backend,
|
|
10810
|
+
options
|
|
10811
|
+
);
|
|
10812
|
+
return results.map((bucket) => narrowNodes(bucket));
|
|
10813
|
+
},
|
|
10767
10814
|
async getOrCreateByConstraint(constraintName, props, options) {
|
|
10768
10815
|
const execute = async (target) => {
|
|
10769
10816
|
const result = await executeGetOrCreateByConstraint(
|
|
@@ -10811,7 +10858,7 @@ function createNodeCollectionsProxy(graph, graphId, registry, backend, operation
|
|
|
10811
10858
|
return new Proxy({}, {
|
|
10812
10859
|
get: (_, kind) => {
|
|
10813
10860
|
if (!Object.hasOwn(graph.nodes, kind)) {
|
|
10814
|
-
throw new
|
|
10861
|
+
throw new chunkJIEJCTDS_cjs.KindNotFoundError(kind, "node");
|
|
10815
10862
|
}
|
|
10816
10863
|
const cached = collectionCache.get(kind);
|
|
10817
10864
|
if (cached !== void 0) {
|
|
@@ -10833,7 +10880,7 @@ function createEdgeCollectionsProxy(graph, graphId, registry, backend, operation
|
|
|
10833
10880
|
return new Proxy({}, {
|
|
10834
10881
|
get: (_, kind) => {
|
|
10835
10882
|
if (!Object.hasOwn(graph.edges, kind)) {
|
|
10836
|
-
throw new
|
|
10883
|
+
throw new chunkJIEJCTDS_cjs.KindNotFoundError(kind, "edge");
|
|
10837
10884
|
}
|
|
10838
10885
|
const cached = collectionCache.get(kind);
|
|
10839
10886
|
if (cached !== void 0) {
|
|
@@ -10854,7 +10901,7 @@ function createEdgeCollectionsProxy(graph, graphId, registry, backend, operation
|
|
|
10854
10901
|
// src/store/introspect.ts
|
|
10855
10902
|
function introspectSchema(graph, context) {
|
|
10856
10903
|
const extension = graph.extension;
|
|
10857
|
-
const { nodes: runtimeNodeNames, edges: runtimeEdgeNames } =
|
|
10904
|
+
const { nodes: runtimeNodeNames, edges: runtimeEdgeNames } = chunkK4N35E7B_cjs.extensionKindNames(extension);
|
|
10858
10905
|
const deprecated = graph.deprecatedKinds;
|
|
10859
10906
|
const kinds = [];
|
|
10860
10907
|
for (const [name, registration] of Object.entries(graph.nodes)) {
|
|
@@ -10865,7 +10912,7 @@ function introspectSchema(graph, context) {
|
|
|
10865
10912
|
description: reg.type.description,
|
|
10866
10913
|
annotations: reg.type.annotations,
|
|
10867
10914
|
deprecated: deprecated.has(name),
|
|
10868
|
-
properties:
|
|
10915
|
+
properties: chunkK4N35E7B_cjs.serializeSchemaProperties(reg.type.schema),
|
|
10869
10916
|
unique: (reg.unique ?? []).map((constraint) => ({
|
|
10870
10917
|
name: constraint.name,
|
|
10871
10918
|
fields: [...constraint.fields],
|
|
@@ -10886,17 +10933,17 @@ function introspectSchema(graph, context) {
|
|
|
10886
10933
|
to: reg.to.map((entry2) => entry2.kind),
|
|
10887
10934
|
cardinality: reg.cardinality ?? "many",
|
|
10888
10935
|
endpointExistence: reg.endpointExistence ?? "notDeleted",
|
|
10889
|
-
properties:
|
|
10936
|
+
properties: chunkK4N35E7B_cjs.serializeSchemaProperties(edgeType.schema),
|
|
10890
10937
|
annotations: edgeType.annotations,
|
|
10891
10938
|
deprecated: deprecated.has(name)
|
|
10892
10939
|
});
|
|
10893
10940
|
}
|
|
10894
|
-
const runtimeOntologyKeys =
|
|
10941
|
+
const runtimeOntologyKeys = chunkK4N35E7B_cjs.buildGraphExtensionOntologyKeySet(extension);
|
|
10895
10942
|
const ontology = graph.ontology.map((relation) => ({
|
|
10896
10943
|
metaEdge: relation.metaEdge.name,
|
|
10897
|
-
from:
|
|
10898
|
-
to:
|
|
10899
|
-
origin: runtimeOntologyKeys.has(
|
|
10944
|
+
from: chunkK4N35E7B_cjs.getTypeName(relation.from),
|
|
10945
|
+
to: chunkK4N35E7B_cjs.getTypeName(relation.to),
|
|
10946
|
+
origin: runtimeOntologyKeys.has(chunkK4N35E7B_cjs.compileTimeOntologyKey(relation)) ? "runtime" : "compile-time"
|
|
10900
10947
|
}));
|
|
10901
10948
|
return {
|
|
10902
10949
|
graphId: context.graphId,
|
|
@@ -10935,13 +10982,13 @@ async function runMaterialization(items, options, runOne) {
|
|
|
10935
10982
|
async function materializeIndexes(context, options = {}) {
|
|
10936
10983
|
const { graph, graphId, backend, schemaVersion } = context;
|
|
10937
10984
|
if (backend.executeDdl === void 0) {
|
|
10938
|
-
throw new
|
|
10985
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
10939
10986
|
"store.materializeIndexes() requires a backend with `executeDdl` support. The bundled SQLite and Postgres backends provide it; a custom backend without `executeDdl` cannot run index DDL.",
|
|
10940
10987
|
{ code: "MATERIALIZE_BACKEND_UNSUPPORTED" }
|
|
10941
10988
|
);
|
|
10942
10989
|
}
|
|
10943
10990
|
if (backend.getIndexMaterialization === void 0 || backend.recordIndexMaterialization === void 0) {
|
|
10944
|
-
throw new
|
|
10991
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
10945
10992
|
"store.materializeIndexes() requires a backend with index materialization status primitives. The bundled SQLite and Postgres backends provide them; a custom backend must implement `getIndexMaterialization` and `recordIndexMaterialization`.",
|
|
10946
10993
|
{ code: "MATERIALIZE_BACKEND_UNSUPPORTED" }
|
|
10947
10994
|
);
|
|
@@ -10950,8 +10997,8 @@ async function materializeIndexes(context, options = {}) {
|
|
|
10950
10997
|
const kindFilter = options.kinds === void 0 ? void 0 : new Set(options.kinds);
|
|
10951
10998
|
if (kindFilter !== void 0) {
|
|
10952
10999
|
for (const name of kindFilter) {
|
|
10953
|
-
if (!
|
|
10954
|
-
throw new
|
|
11000
|
+
if (!chunk7JGLPAFV_cjs.isKnownKind(graph, name)) {
|
|
11001
|
+
throw new chunkJIEJCTDS_cjs.KindNotFoundError(
|
|
10955
11002
|
name,
|
|
10956
11003
|
Object.hasOwn(graph.edges, name) ? "edge" : "node",
|
|
10957
11004
|
{
|
|
@@ -11044,7 +11091,7 @@ function parallelBucketKey(declaration) {
|
|
|
11044
11091
|
return declaration.entity;
|
|
11045
11092
|
}
|
|
11046
11093
|
async function materializeRelationalIndex(declaration, backend, dialect, ddlOptions, graphId, schemaVersion, existingByStatusKey) {
|
|
11047
|
-
const ddl =
|
|
11094
|
+
const ddl = chunkUESTHN47_cjs.generateIndexDDL(declaration, dialect, ddlOptions);
|
|
11048
11095
|
const targetTable = declaration.entity === "node" ? ddlOptions.nodesTableName ?? "typegraph_nodes" : ddlOptions.edgesTableName ?? "typegraph_edges";
|
|
11049
11096
|
const signature = await computeIndexSignature(
|
|
11050
11097
|
dialect,
|
|
@@ -11143,7 +11190,7 @@ async function materializeOne(declaration, backend, graphId, schemaVersion, acti
|
|
|
11143
11190
|
}
|
|
11144
11191
|
try {
|
|
11145
11192
|
await run();
|
|
11146
|
-
const attemptedAt =
|
|
11193
|
+
const attemptedAt = chunk7JGLPAFV_cjs.nowIso();
|
|
11147
11194
|
await recordIndexMaterialization(
|
|
11148
11195
|
buildAttempt({
|
|
11149
11196
|
declaration,
|
|
@@ -11220,7 +11267,7 @@ function buildAttempt(args) {
|
|
|
11220
11267
|
kind: args.declaration.kind,
|
|
11221
11268
|
signature: args.signature,
|
|
11222
11269
|
schemaVersion: args.schemaVersion,
|
|
11223
|
-
attemptedAt: args.attemptedAt ??
|
|
11270
|
+
attemptedAt: args.attemptedAt ?? chunk7JGLPAFV_cjs.nowIso(),
|
|
11224
11271
|
materializedAt: args.materializedAt,
|
|
11225
11272
|
error: args.error?.message
|
|
11226
11273
|
};
|
|
@@ -11228,7 +11275,7 @@ function buildAttempt(args) {
|
|
|
11228
11275
|
async function computeIndexSignature(dialect, targetTableName, declaration) {
|
|
11229
11276
|
const hashable = { dialect, targetTableName, declaration };
|
|
11230
11277
|
const json = JSON.stringify(hashable, chunkRP7YITHX_cjs.sortedReplacer);
|
|
11231
|
-
return
|
|
11278
|
+
return chunk4BXHVEFB_cjs.sha256Hex(json, 16);
|
|
11232
11279
|
}
|
|
11233
11280
|
|
|
11234
11281
|
// src/store/materialize-removals.ts
|
|
@@ -11239,7 +11286,7 @@ function buildPendingKindRemoval(args) {
|
|
|
11239
11286
|
async function materializeRemovals(context, options = {}) {
|
|
11240
11287
|
const { backend, graphId } = context;
|
|
11241
11288
|
if (backend.executeDdl === void 0 || backend.recordKindRemoval === void 0 || backend.getPendingKindRemovals === void 0) {
|
|
11242
|
-
throw new
|
|
11289
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
11243
11290
|
"store.materializeRemovals() requires a backend with kind-removal primitives (executeDdl, recordKindRemoval, getPendingKindRemovals). The bundled SQLite and Postgres backends provide them.",
|
|
11244
11291
|
{ code: "MATERIALIZE_REMOVALS_BACKEND_UNSUPPORTED" }
|
|
11245
11292
|
);
|
|
@@ -11295,14 +11342,14 @@ async function reconcilePendingRemovals(context) {
|
|
|
11295
11342
|
const reconciliations = [];
|
|
11296
11343
|
const stopAtVersion = marker ?? 1;
|
|
11297
11344
|
let currentRow = activeRow;
|
|
11298
|
-
let currentSchema =
|
|
11345
|
+
let currentSchema = chunkK4N35E7B_cjs.parseSerializedSchema(activeRow.schema_doc);
|
|
11299
11346
|
while (currentRow.version > stopAtVersion) {
|
|
11300
11347
|
const priorRow = await backend.getSchemaVersion(
|
|
11301
11348
|
graphId,
|
|
11302
11349
|
currentRow.version - 1
|
|
11303
11350
|
);
|
|
11304
11351
|
if (priorRow === void 0) break;
|
|
11305
|
-
const priorSchema =
|
|
11352
|
+
const priorSchema = chunkK4N35E7B_cjs.parseSerializedSchema(priorRow.schema_doc);
|
|
11306
11353
|
for (const entity of ENTITY_KINDS) {
|
|
11307
11354
|
const priorEntries = priorSchema[entity === "node" ? "nodes" : "edges"];
|
|
11308
11355
|
const currentEntries = currentSchema[entity === "node" ? "nodes" : "edges"];
|
|
@@ -11322,7 +11369,7 @@ async function reconcilePendingRemovals(context) {
|
|
|
11322
11369
|
currentSchema = priorSchema;
|
|
11323
11370
|
}
|
|
11324
11371
|
if (reconciliations.length > 0) {
|
|
11325
|
-
const attemptedAt =
|
|
11372
|
+
const attemptedAt = chunk7JGLPAFV_cjs.nowIso();
|
|
11326
11373
|
await Promise.all(
|
|
11327
11374
|
reconciliations.map(
|
|
11328
11375
|
(entry2) => recordKindRemoval(
|
|
@@ -11375,7 +11422,7 @@ async function materializeOne2(row, ctx) {
|
|
|
11375
11422
|
);
|
|
11376
11423
|
}
|
|
11377
11424
|
await Promise.all(deletes);
|
|
11378
|
-
const removedAt =
|
|
11425
|
+
const removedAt = chunk7JGLPAFV_cjs.nowIso();
|
|
11379
11426
|
await recordKindRemoval({
|
|
11380
11427
|
graphId: ctx.graphId,
|
|
11381
11428
|
kindName: row.kindName,
|
|
@@ -11397,7 +11444,7 @@ async function materializeOne2(row, ctx) {
|
|
|
11397
11444
|
kindName: row.kindName,
|
|
11398
11445
|
entity: row.entity,
|
|
11399
11446
|
schemaVersion: row.schemaVersion,
|
|
11400
|
-
attemptedAt:
|
|
11447
|
+
attemptedAt: chunk7JGLPAFV_cjs.nowIso(),
|
|
11401
11448
|
removedAt: void 0,
|
|
11402
11449
|
error: error.message
|
|
11403
11450
|
});
|
|
@@ -11437,7 +11484,7 @@ async function resolveRemovedKindEmbeddingSlots(backend, row) {
|
|
|
11437
11484
|
if (priorVersion < 1) return [];
|
|
11438
11485
|
const priorRow = await backend.getSchemaVersion(row.graphId, priorVersion);
|
|
11439
11486
|
if (priorRow === void 0) return [];
|
|
11440
|
-
const priorSchema =
|
|
11487
|
+
const priorSchema = chunkK4N35E7B_cjs.parseSerializedSchema(priorRow.schema_doc);
|
|
11441
11488
|
const slots = /* @__PURE__ */ new Map();
|
|
11442
11489
|
for (const declaration of priorSchema.indexes ?? []) {
|
|
11443
11490
|
if (declaration.entity === "vector" && declaration.kind === row.kindName) {
|
|
@@ -11467,7 +11514,7 @@ async function reclaimRemovedVectorFieldTables(context) {
|
|
|
11467
11514
|
let perBackend = reclaimCache.get(backend);
|
|
11468
11515
|
const cached = perBackend?.get(cacheKey);
|
|
11469
11516
|
if (cached !== void 0) return cached;
|
|
11470
|
-
const activeSchema =
|
|
11517
|
+
const activeSchema = chunkK4N35E7B_cjs.parseSerializedSchema(activeRow.schema_doc);
|
|
11471
11518
|
const activeVectorFields = /* @__PURE__ */ new Set();
|
|
11472
11519
|
for (const declaration of activeSchema.indexes ?? []) {
|
|
11473
11520
|
if (declaration.entity === "vector") {
|
|
@@ -11481,7 +11528,7 @@ async function reclaimRemovedVectorFieldTables(context) {
|
|
|
11481
11528
|
for (let version = activeRow.version - 1; version >= 1; version -= 1) {
|
|
11482
11529
|
const priorRow = await backend.getSchemaVersion(graphId, version);
|
|
11483
11530
|
if (priorRow === void 0) continue;
|
|
11484
|
-
const priorSchema =
|
|
11531
|
+
const priorSchema = chunkK4N35E7B_cjs.parseSerializedSchema(priorRow.schema_doc);
|
|
11485
11532
|
for (const declaration of priorSchema.indexes ?? []) {
|
|
11486
11533
|
if (declaration.entity !== "vector") continue;
|
|
11487
11534
|
const key = vectorFieldKey(declaration.kind, declaration.fieldPath);
|
|
@@ -11619,7 +11666,7 @@ function checkCardinality(edgeKind, fromKind, fromId, cardinality, existingEdgeC
|
|
|
11619
11666
|
}
|
|
11620
11667
|
case "one": {
|
|
11621
11668
|
if (existingEdgeCount > 0) {
|
|
11622
|
-
return new
|
|
11669
|
+
return new chunkJIEJCTDS_cjs.CardinalityError({
|
|
11623
11670
|
edgeKind,
|
|
11624
11671
|
fromKind,
|
|
11625
11672
|
fromId,
|
|
@@ -11634,7 +11681,7 @@ function checkCardinality(edgeKind, fromKind, fromId, cardinality, existingEdgeC
|
|
|
11634
11681
|
}
|
|
11635
11682
|
case "oneActive": {
|
|
11636
11683
|
if (hasActiveEdge) {
|
|
11637
|
-
return new
|
|
11684
|
+
return new chunkJIEJCTDS_cjs.CardinalityError({
|
|
11638
11685
|
edgeKind,
|
|
11639
11686
|
fromKind,
|
|
11640
11687
|
fromId,
|
|
@@ -11648,7 +11695,7 @@ function checkCardinality(edgeKind, fromKind, fromId, cardinality, existingEdgeC
|
|
|
11648
11695
|
}
|
|
11649
11696
|
function checkUniqueEdge(edgeKind, fromKind, fromId, _toKind, _toId, existingCount) {
|
|
11650
11697
|
if (existingCount > 0) {
|
|
11651
|
-
return new
|
|
11698
|
+
return new chunkJIEJCTDS_cjs.CardinalityError({
|
|
11652
11699
|
edgeKind,
|
|
11653
11700
|
fromKind,
|
|
11654
11701
|
fromId,
|
|
@@ -11664,7 +11711,7 @@ function validateEdgeEndpoints(edgeKind, fromKind, toKind, registration, registr
|
|
|
11664
11711
|
(validKind) => registry.isAssignableTo(fromKind, validKind)
|
|
11665
11712
|
);
|
|
11666
11713
|
if (!fromValid) {
|
|
11667
|
-
return new
|
|
11714
|
+
return new chunkJIEJCTDS_cjs.EndpointError({
|
|
11668
11715
|
edgeKind,
|
|
11669
11716
|
endpoint: "from",
|
|
11670
11717
|
actualKind: fromKind,
|
|
@@ -11676,7 +11723,7 @@ function validateEdgeEndpoints(edgeKind, fromKind, toKind, registration, registr
|
|
|
11676
11723
|
(validKind) => registry.isAssignableTo(toKind, validKind)
|
|
11677
11724
|
);
|
|
11678
11725
|
if (!toValid) {
|
|
11679
|
-
return new
|
|
11726
|
+
return new chunkJIEJCTDS_cjs.EndpointError({
|
|
11680
11727
|
edgeKind,
|
|
11681
11728
|
endpoint: "to",
|
|
11682
11729
|
actualKind: toKind,
|
|
@@ -11688,7 +11735,7 @@ function validateEdgeEndpoints(edgeKind, fromKind, toKind, registration, registr
|
|
|
11688
11735
|
function checkDisjointness(nodeId, nodeKind, existingKinds, registry) {
|
|
11689
11736
|
for (const existingKind of existingKinds) {
|
|
11690
11737
|
if (registry.areDisjoint(nodeKind, existingKind)) {
|
|
11691
|
-
return new
|
|
11738
|
+
return new chunkJIEJCTDS_cjs.DisjointError({
|
|
11692
11739
|
nodeId,
|
|
11693
11740
|
attemptedKind: nodeKind,
|
|
11694
11741
|
conflictingKind: existingKind
|
|
@@ -11780,7 +11827,7 @@ async function checkCardinalityConstraint(ctx, edgeKind, cardinality, fromKind,
|
|
|
11780
11827
|
// src/store/operations/edge-operations.ts
|
|
11781
11828
|
function getEdgeRegistration(graph, kind) {
|
|
11782
11829
|
const registration = graph.edges[kind];
|
|
11783
|
-
if (registration === void 0) throw new
|
|
11830
|
+
if (registration === void 0) throw new chunkJIEJCTDS_cjs.KindNotFoundError(kind, "edge");
|
|
11784
11831
|
return registration;
|
|
11785
11832
|
}
|
|
11786
11833
|
function buildEdgeEndpointCacheKey(graphId, kind, id) {
|
|
@@ -11922,7 +11969,7 @@ async function validateAndPrepareEdgeCreate(ctx, input, id, backend) {
|
|
|
11922
11969
|
if (endpointError) throw endpointError;
|
|
11923
11970
|
const fromNode = await backend.getNode(ctx.graphId, fromKind, input.fromId);
|
|
11924
11971
|
if (!fromNode || fromNode.deleted_at) {
|
|
11925
|
-
throw new
|
|
11972
|
+
throw new chunkJIEJCTDS_cjs.EndpointNotFoundError({
|
|
11926
11973
|
edgeKind: kind,
|
|
11927
11974
|
endpoint: "from",
|
|
11928
11975
|
nodeKind: fromKind,
|
|
@@ -11931,19 +11978,19 @@ async function validateAndPrepareEdgeCreate(ctx, input, id, backend) {
|
|
|
11931
11978
|
}
|
|
11932
11979
|
const toNode = await backend.getNode(ctx.graphId, toKind, input.toId);
|
|
11933
11980
|
if (!toNode || toNode.deleted_at) {
|
|
11934
|
-
throw new
|
|
11981
|
+
throw new chunkJIEJCTDS_cjs.EndpointNotFoundError({
|
|
11935
11982
|
edgeKind: kind,
|
|
11936
11983
|
endpoint: "to",
|
|
11937
11984
|
nodeKind: toKind,
|
|
11938
11985
|
nodeId: input.toId
|
|
11939
11986
|
});
|
|
11940
11987
|
}
|
|
11941
|
-
const validatedProps =
|
|
11988
|
+
const validatedProps = chunkK4N35E7B_cjs.validateEdgeProps(edgeKind.schema, input.props, {
|
|
11942
11989
|
kind,
|
|
11943
11990
|
operation: "create"
|
|
11944
11991
|
});
|
|
11945
|
-
const validFrom =
|
|
11946
|
-
const validTo =
|
|
11992
|
+
const validFrom = chunk7JGLPAFV_cjs.validateOptionalIsoDate(input.validFrom, "validFrom");
|
|
11993
|
+
const validTo = chunk7JGLPAFV_cjs.validateOptionalIsoDate(input.validTo, "validTo");
|
|
11947
11994
|
const cardinality = registration.cardinality ?? "many";
|
|
11948
11995
|
const constraintContext = {
|
|
11949
11996
|
graphId: ctx.graphId,
|
|
@@ -11998,7 +12045,7 @@ async function executeEdgeCreateInternal(ctx, input, backend, options) {
|
|
|
11998
12045
|
async function executeEdgeCreate(ctx, input, backend) {
|
|
11999
12046
|
const result = await executeEdgeCreateInternal(ctx, input, backend);
|
|
12000
12047
|
if (!result) {
|
|
12001
|
-
throw new
|
|
12048
|
+
throw new chunkJIEJCTDS_cjs.DatabaseOperationError(
|
|
12002
12049
|
"Edge create failed: expected created edge row",
|
|
12003
12050
|
{ operation: "insert", entity: "edge" }
|
|
12004
12051
|
);
|
|
@@ -12075,7 +12122,7 @@ async function executeEdgeUpdate(ctx, input, backend) {
|
|
|
12075
12122
|
const id = input.id;
|
|
12076
12123
|
const existing = await backend.getEdge(ctx.graphId, id);
|
|
12077
12124
|
if (!existing || existing.deleted_at) {
|
|
12078
|
-
throw new
|
|
12125
|
+
throw new chunkJIEJCTDS_cjs.EdgeNotFoundError("unknown", id);
|
|
12079
12126
|
}
|
|
12080
12127
|
const opContext = ctx.createOperationContext(
|
|
12081
12128
|
"update",
|
|
@@ -12088,12 +12135,12 @@ async function executeEdgeUpdate(ctx, input, backend) {
|
|
|
12088
12135
|
const edgeKind = registration.type;
|
|
12089
12136
|
const existingProps = JSON.parse(existing.props);
|
|
12090
12137
|
const mergedProps = { ...existingProps, ...input.props };
|
|
12091
|
-
const validatedProps =
|
|
12138
|
+
const validatedProps = chunkK4N35E7B_cjs.validateEdgeProps(edgeKind.schema, mergedProps, {
|
|
12092
12139
|
kind: existing.kind,
|
|
12093
12140
|
operation: "update",
|
|
12094
12141
|
id
|
|
12095
12142
|
});
|
|
12096
|
-
const validTo =
|
|
12143
|
+
const validTo = chunk7JGLPAFV_cjs.validateOptionalIsoDate(input.validTo, "validTo");
|
|
12097
12144
|
const updateParams = {
|
|
12098
12145
|
graphId: ctx.graphId,
|
|
12099
12146
|
id,
|
|
@@ -12108,18 +12155,18 @@ async function executeEdgeUpsertUpdate(ctx, input, backend, options) {
|
|
|
12108
12155
|
const id = input.id;
|
|
12109
12156
|
const existing = await backend.getEdge(ctx.graphId, id);
|
|
12110
12157
|
if (!existing) {
|
|
12111
|
-
throw new
|
|
12158
|
+
throw new chunkJIEJCTDS_cjs.EdgeNotFoundError("unknown", id);
|
|
12112
12159
|
}
|
|
12113
12160
|
const registration = getEdgeRegistration(ctx.graph, existing.kind);
|
|
12114
12161
|
const edgeKind = registration.type;
|
|
12115
12162
|
const existingProps = JSON.parse(existing.props);
|
|
12116
12163
|
const mergedProps = { ...existingProps, ...input.props };
|
|
12117
|
-
const validatedProps =
|
|
12164
|
+
const validatedProps = chunkK4N35E7B_cjs.validateEdgeProps(edgeKind.schema, mergedProps, {
|
|
12118
12165
|
kind: existing.kind,
|
|
12119
12166
|
operation: "update",
|
|
12120
12167
|
id
|
|
12121
12168
|
});
|
|
12122
|
-
const validTo =
|
|
12169
|
+
const validTo = chunk7JGLPAFV_cjs.validateOptionalIsoDate(input.validTo, "validTo");
|
|
12123
12170
|
const updateParams = {
|
|
12124
12171
|
graphId: ctx.graphId,
|
|
12125
12172
|
id,
|
|
@@ -12173,7 +12220,7 @@ function validateMatchOnFields(schema, matchOn, edgeKind) {
|
|
|
12173
12220
|
if (matchOn.length === 0) return;
|
|
12174
12221
|
const shape = schema.shape;
|
|
12175
12222
|
if (shape === void 0) {
|
|
12176
|
-
throw new
|
|
12223
|
+
throw new chunkJIEJCTDS_cjs.ValidationError(
|
|
12177
12224
|
`Edge kind "${edgeKind}" has no schema shape to validate matchOn fields against`,
|
|
12178
12225
|
{
|
|
12179
12226
|
kind: edgeKind,
|
|
@@ -12187,7 +12234,7 @@ function validateMatchOnFields(schema, matchOn, edgeKind) {
|
|
|
12187
12234
|
}
|
|
12188
12235
|
const invalidFields = matchOn.filter((field2) => !(field2 in shape));
|
|
12189
12236
|
if (invalidFields.length > 0) {
|
|
12190
|
-
throw new
|
|
12237
|
+
throw new chunkJIEJCTDS_cjs.ValidationError(
|
|
12191
12238
|
`Invalid matchOn fields for edge kind "${edgeKind}": ${invalidFields.join(", ")}`,
|
|
12192
12239
|
{
|
|
12193
12240
|
kind: edgeKind,
|
|
@@ -12271,7 +12318,7 @@ async function executeEdgeGetOrCreateByEndpoints(ctx, kind, fromKind, fromId, to
|
|
|
12271
12318
|
const matchOn = options?.matchOn ?? [];
|
|
12272
12319
|
const registration = getEdgeRegistration(ctx.graph, kind);
|
|
12273
12320
|
const edgeKind = registration.type;
|
|
12274
|
-
const validatedProps =
|
|
12321
|
+
const validatedProps = chunkK4N35E7B_cjs.validateEdgeProps(edgeKind.schema, props, {
|
|
12275
12322
|
kind,
|
|
12276
12323
|
operation: "create"
|
|
12277
12324
|
});
|
|
@@ -12353,7 +12400,7 @@ async function executeEdgeBulkGetOrCreateByEndpoints(ctx, kind, items, backend,
|
|
|
12353
12400
|
validateMatchOnFields(edgeKind.schema, matchOn, kind);
|
|
12354
12401
|
const validated = [];
|
|
12355
12402
|
for (const item of items) {
|
|
12356
|
-
const validatedProps =
|
|
12403
|
+
const validatedProps = chunkK4N35E7B_cjs.validateEdgeProps(edgeKind.schema, item.props, {
|
|
12357
12404
|
kind,
|
|
12358
12405
|
operation: "create"
|
|
12359
12406
|
});
|
|
@@ -12598,7 +12645,7 @@ function computeSearchableFields(schema) {
|
|
|
12598
12645
|
if (!shape) return [];
|
|
12599
12646
|
const fields = [];
|
|
12600
12647
|
for (const [fieldPath, fieldSchema] of Object.entries(shape)) {
|
|
12601
|
-
const metadata =
|
|
12648
|
+
const metadata = chunkYQGLVWB2_cjs.getSearchableMetadata(fieldSchema);
|
|
12602
12649
|
if (metadata !== void 0) {
|
|
12603
12650
|
fields.push({ fieldPath, metadata });
|
|
12604
12651
|
}
|
|
@@ -12614,14 +12661,14 @@ function warnIfConflictingLanguages(fields) {
|
|
|
12614
12661
|
return;
|
|
12615
12662
|
}
|
|
12616
12663
|
const fieldSummary = fields.map((field2) => `${field2.fieldPath}=${field2.metadata.language}`).join(", ");
|
|
12617
|
-
const winning = fields[0]?.metadata.language ??
|
|
12664
|
+
const winning = fields[0]?.metadata.language ?? chunkYQGLVWB2_cjs.DEFAULT_SEARCHABLE_LANGUAGE;
|
|
12618
12665
|
console.warn(
|
|
12619
12666
|
`[typegraph] searchable() fields declare conflicting languages (${fieldSummary}). The first field's language ("${winning}") is recorded on the fulltext row; true multilingual indexing requires a dedicated node kind per language.`
|
|
12620
12667
|
);
|
|
12621
12668
|
}
|
|
12622
12669
|
var FIELD_SEPARATOR = "\n";
|
|
12623
12670
|
function resolveCombinedLanguage(fields) {
|
|
12624
|
-
return fields[0]?.metadata.language ??
|
|
12671
|
+
return fields[0]?.metadata.language ?? chunkYQGLVWB2_cjs.DEFAULT_SEARCHABLE_LANGUAGE;
|
|
12625
12672
|
}
|
|
12626
12673
|
function computeFulltextContent(schema, props) {
|
|
12627
12674
|
const searchableFields = getSearchableFields(schema);
|
|
@@ -12701,7 +12748,7 @@ async function checkUniquenessConstraints(ctx, kind, id, props, constraints) {
|
|
|
12701
12748
|
key
|
|
12702
12749
|
});
|
|
12703
12750
|
if (existing && existing.node_id !== id) {
|
|
12704
|
-
throw new
|
|
12751
|
+
throw new chunkJIEJCTDS_cjs.UniquenessError({
|
|
12705
12752
|
constraintName: constraint.name,
|
|
12706
12753
|
kind: kindToCheck,
|
|
12707
12754
|
existingId: existing.node_id,
|
|
@@ -12784,7 +12831,7 @@ async function updateUniquenessEntries(ctx, kind, id, oldProps, newProps, constr
|
|
|
12784
12831
|
key: newKey
|
|
12785
12832
|
});
|
|
12786
12833
|
if (existing && existing.node_id !== id) {
|
|
12787
|
-
throw new
|
|
12834
|
+
throw new chunkJIEJCTDS_cjs.UniquenessError({
|
|
12788
12835
|
constraintName: constraint.name,
|
|
12789
12836
|
kind: kindToCheck,
|
|
12790
12837
|
existingId: existing.node_id,
|
|
@@ -12808,7 +12855,7 @@ async function updateUniquenessEntries(ctx, kind, id, oldProps, newProps, constr
|
|
|
12808
12855
|
// src/store/operations/node-operations.ts
|
|
12809
12856
|
function getNodeRegistration(graph, kind) {
|
|
12810
12857
|
const registration = graph.nodes[kind];
|
|
12811
|
-
if (registration === void 0) throw new
|
|
12858
|
+
if (registration === void 0) throw new chunkJIEJCTDS_cjs.KindNotFoundError(kind, "node");
|
|
12812
12859
|
return registration;
|
|
12813
12860
|
}
|
|
12814
12861
|
var CACHE_KEY_SEPARATOR = "\0";
|
|
@@ -12819,7 +12866,7 @@ function buildUniqueCacheKey(graphId, nodeKind, constraintName, key) {
|
|
|
12819
12866
|
return `${graphId}${CACHE_KEY_SEPARATOR}${nodeKind}${CACHE_KEY_SEPARATOR}${constraintName}${CACHE_KEY_SEPARATOR}${key}`;
|
|
12820
12867
|
}
|
|
12821
12868
|
function createNodeAlreadyExistsError(kind, id) {
|
|
12822
|
-
return new
|
|
12869
|
+
return new chunkJIEJCTDS_cjs.ValidationError(
|
|
12823
12870
|
`Node already exists: ${kind}/${id}`,
|
|
12824
12871
|
{
|
|
12825
12872
|
entityType: "node",
|
|
@@ -12860,7 +12907,7 @@ function resolveConstraint(graph, kind, constraintName) {
|
|
|
12860
12907
|
(candidate) => candidate.name === constraintName
|
|
12861
12908
|
);
|
|
12862
12909
|
if (constraint === void 0) {
|
|
12863
|
-
throw new
|
|
12910
|
+
throw new chunkJIEJCTDS_cjs.NodeConstraintNotFoundError(constraintName, kind);
|
|
12864
12911
|
}
|
|
12865
12912
|
return constraint;
|
|
12866
12913
|
}
|
|
@@ -12972,12 +13019,12 @@ async function validateAndPrepareNodeCreate(ctx, input, id, backend) {
|
|
|
12972
13019
|
const kind = input.kind;
|
|
12973
13020
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
12974
13021
|
const nodeKind = registration.type;
|
|
12975
|
-
const validatedProps =
|
|
13022
|
+
const validatedProps = chunkK4N35E7B_cjs.validateNodeProps(nodeKind.schema, input.props, {
|
|
12976
13023
|
kind,
|
|
12977
13024
|
operation: "create"
|
|
12978
13025
|
});
|
|
12979
|
-
const validFrom =
|
|
12980
|
-
const validTo =
|
|
13026
|
+
const validFrom = chunk7JGLPAFV_cjs.validateOptionalIsoDate(input.validFrom, "validFrom");
|
|
13027
|
+
const validTo = chunk7JGLPAFV_cjs.validateOptionalIsoDate(input.validTo, "validTo");
|
|
12981
13028
|
const existingNode = await backend.getNode(ctx.graphId, kind, id);
|
|
12982
13029
|
if (existingNode && !existingNode.deleted_at) {
|
|
12983
13030
|
throw createNodeAlreadyExistsError(kind, id);
|
|
@@ -13041,17 +13088,17 @@ async function performNodeUpdate(ctx, input, backend, options) {
|
|
|
13041
13088
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
13042
13089
|
const existing = await backend.getNode(ctx.graphId, kind, id);
|
|
13043
13090
|
if (!existing || existing.deleted_at && !options?.clearDeleted) {
|
|
13044
|
-
throw new
|
|
13091
|
+
throw new chunkJIEJCTDS_cjs.NodeNotFoundError(kind, id);
|
|
13045
13092
|
}
|
|
13046
13093
|
const existingProps = JSON.parse(existing.props);
|
|
13047
13094
|
const mergedProps = { ...existingProps, ...input.props };
|
|
13048
13095
|
const nodeKind = registration.type;
|
|
13049
|
-
const validatedProps =
|
|
13096
|
+
const validatedProps = chunkK4N35E7B_cjs.validateNodeProps(nodeKind.schema, mergedProps, {
|
|
13050
13097
|
kind,
|
|
13051
13098
|
operation: "update",
|
|
13052
13099
|
id
|
|
13053
13100
|
});
|
|
13054
|
-
const validTo =
|
|
13101
|
+
const validTo = chunk7JGLPAFV_cjs.validateOptionalIsoDate(input.validTo, "validTo");
|
|
13055
13102
|
await updateUniquenessEntries(
|
|
13056
13103
|
createUniquenessContext(ctx.graphId, ctx.registry, backend),
|
|
13057
13104
|
kind,
|
|
@@ -13093,7 +13140,7 @@ async function enforceDeleteBehavior(ctx, kind, id, mode, backend, registration)
|
|
|
13093
13140
|
switch (deleteBehavior) {
|
|
13094
13141
|
case "restrict": {
|
|
13095
13142
|
const edgeKinds = [...new Set(connectedEdges.map((edge) => edge.kind))];
|
|
13096
|
-
throw new
|
|
13143
|
+
throw new chunkJIEJCTDS_cjs.RestrictedDeleteError({
|
|
13097
13144
|
nodeKind: kind,
|
|
13098
13145
|
nodeId: id,
|
|
13099
13146
|
edgeCount: connectedEdges.length,
|
|
@@ -13214,7 +13261,7 @@ async function executeNodeCreateInternal(ctx, input, backend, options) {
|
|
|
13214
13261
|
async function executeNodeCreate(ctx, input, backend) {
|
|
13215
13262
|
const result = await executeNodeCreateInternal(ctx, input, backend);
|
|
13216
13263
|
if (!result) {
|
|
13217
|
-
throw new
|
|
13264
|
+
throw new chunkJIEJCTDS_cjs.DatabaseOperationError(
|
|
13218
13265
|
"Node create failed: expected created node row",
|
|
13219
13266
|
{ operation: "insert", entity: "node" }
|
|
13220
13267
|
);
|
|
@@ -13323,7 +13370,7 @@ async function executeNodeGetOrCreateByConstraint(ctx, kind, constraintName, pro
|
|
|
13323
13370
|
const ifExists = options?.ifExists ?? "return";
|
|
13324
13371
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
13325
13372
|
const nodeKind = registration.type;
|
|
13326
|
-
const validatedProps =
|
|
13373
|
+
const validatedProps = chunkK4N35E7B_cjs.validateNodeProps(nodeKind.schema, props, {
|
|
13327
13374
|
kind,
|
|
13328
13375
|
operation: "create"
|
|
13329
13376
|
});
|
|
@@ -13395,7 +13442,7 @@ async function executeNodeGetOrCreateByConstraint(ctx, kind, constraintName, pro
|
|
|
13395
13442
|
async function executeNodeFindByConstraint(ctx, kind, constraintName, props, backend) {
|
|
13396
13443
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
13397
13444
|
const nodeKind = registration.type;
|
|
13398
|
-
const validatedProps =
|
|
13445
|
+
const validatedProps = chunkK4N35E7B_cjs.validateNodeProps(nodeKind.schema, props, {
|
|
13399
13446
|
kind,
|
|
13400
13447
|
operation: "create"
|
|
13401
13448
|
});
|
|
@@ -13432,7 +13479,7 @@ async function executeNodeFindByConstraint(ctx, kind, constraintName, props, bac
|
|
|
13432
13479
|
function validateAndComputeKeys(nodeKind, kind, constraint, items) {
|
|
13433
13480
|
const validated = [];
|
|
13434
13481
|
for (const item of items) {
|
|
13435
|
-
const validatedProps =
|
|
13482
|
+
const validatedProps = chunkK4N35E7B_cjs.validateNodeProps(nodeKind.schema, item.props, {
|
|
13436
13483
|
kind,
|
|
13437
13484
|
operation: "create"
|
|
13438
13485
|
});
|
|
@@ -13504,6 +13551,212 @@ async function executeNodeBulkFindByConstraint(ctx, kind, constraintName, items,
|
|
|
13504
13551
|
}
|
|
13505
13552
|
return results;
|
|
13506
13553
|
}
|
|
13554
|
+
function resolveNodeIndex(graph, kind, indexName) {
|
|
13555
|
+
getNodeRegistration(graph, kind);
|
|
13556
|
+
const declaration = graph.indexes?.find(
|
|
13557
|
+
(candidate) => candidate.entity === "node" && candidate.kind === kind && candidate.name === indexName
|
|
13558
|
+
);
|
|
13559
|
+
if (declaration?.entity !== "node") {
|
|
13560
|
+
throw new chunkJIEJCTDS_cjs.NodeIndexNotFoundError(indexName, kind);
|
|
13561
|
+
}
|
|
13562
|
+
return declaration;
|
|
13563
|
+
}
|
|
13564
|
+
var INDEX_PROBE_EXPECTED_TYPEOF = {
|
|
13565
|
+
string: "string",
|
|
13566
|
+
number: "number",
|
|
13567
|
+
boolean: "boolean"
|
|
13568
|
+
};
|
|
13569
|
+
function validateIndexProbeValue(value, valueType, pointer, kind) {
|
|
13570
|
+
if (value === void 0 || value === null) return;
|
|
13571
|
+
if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean" && !(value instanceof Date)) {
|
|
13572
|
+
throw indexProbeTypeError(
|
|
13573
|
+
pointer,
|
|
13574
|
+
kind,
|
|
13575
|
+
"a scalar (string, number, boolean, or Date)",
|
|
13576
|
+
value
|
|
13577
|
+
);
|
|
13578
|
+
}
|
|
13579
|
+
if (valueType === "date") {
|
|
13580
|
+
if (value instanceof Date || typeof value === "string") return;
|
|
13581
|
+
throw indexProbeTypeError(
|
|
13582
|
+
pointer,
|
|
13583
|
+
kind,
|
|
13584
|
+
"date (Date or ISO string)",
|
|
13585
|
+
value
|
|
13586
|
+
);
|
|
13587
|
+
}
|
|
13588
|
+
const expected = INDEX_PROBE_EXPECTED_TYPEOF[valueType ?? "unknown"];
|
|
13589
|
+
if (expected === void 0) return;
|
|
13590
|
+
if (typeof value !== expected) {
|
|
13591
|
+
throw indexProbeTypeError(pointer, kind, expected, value);
|
|
13592
|
+
}
|
|
13593
|
+
}
|
|
13594
|
+
function indexProbeTypeError(pointer, kind, expected, value) {
|
|
13595
|
+
return new chunkJIEJCTDS_cjs.ValidationError(
|
|
13596
|
+
`Index probe value for "${pointer}" on node kind "${kind}" has an incompatible type`,
|
|
13597
|
+
{
|
|
13598
|
+
entityType: "node",
|
|
13599
|
+
kind,
|
|
13600
|
+
issues: [
|
|
13601
|
+
{
|
|
13602
|
+
path: pointer,
|
|
13603
|
+
message: `Expected ${expected}, received ${typeof value}`,
|
|
13604
|
+
code: "invalid_type"
|
|
13605
|
+
}
|
|
13606
|
+
]
|
|
13607
|
+
}
|
|
13608
|
+
);
|
|
13609
|
+
}
|
|
13610
|
+
function coerceIndexProbeBind(value, adapter) {
|
|
13611
|
+
return adapter.bindValue(normalizeProbeScalar(value));
|
|
13612
|
+
}
|
|
13613
|
+
function normalizeProbeScalar(value) {
|
|
13614
|
+
return value instanceof Date ? value.toISOString() : value;
|
|
13615
|
+
}
|
|
13616
|
+
var PROBE_NULL_TAG = 0;
|
|
13617
|
+
var PROBE_VALUE_TAG = 1;
|
|
13618
|
+
function canonicalIndexProbeKey(probe) {
|
|
13619
|
+
return JSON.stringify(
|
|
13620
|
+
probe.map(
|
|
13621
|
+
(value) => value === void 0 || value === null ? [PROBE_NULL_TAG] : [PROBE_VALUE_TAG, normalizeProbeScalar(value)]
|
|
13622
|
+
)
|
|
13623
|
+
);
|
|
13624
|
+
}
|
|
13625
|
+
async function executeNodeBulkFindByIndex(ctx, kind, indexName, items, backend, options) {
|
|
13626
|
+
if (items.length === 0) return [];
|
|
13627
|
+
const index = resolveNodeIndex(ctx.graph, kind, indexName);
|
|
13628
|
+
if (index.fieldValueTypes.includes("date")) {
|
|
13629
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
13630
|
+
`bulkFindByIndex does not support date-typed key fields on index "${indexName}" (node kind "${kind}")`,
|
|
13631
|
+
{ indexName, kind },
|
|
13632
|
+
{
|
|
13633
|
+
suggestion: "Date index keys compare differently across SQLite and PostgreSQL. Use a string-encoded key field, or query date predicates via store.query(...).where(...)."
|
|
13634
|
+
}
|
|
13635
|
+
);
|
|
13636
|
+
}
|
|
13637
|
+
const limitPerInput = options?.limitPerInput;
|
|
13638
|
+
if (limitPerInput !== void 0 && (!Number.isInteger(limitPerInput) || limitPerInput <= 0)) {
|
|
13639
|
+
throw new chunkJIEJCTDS_cjs.ValidationError(
|
|
13640
|
+
"bulkFindByIndex limitPerInput must be a positive integer",
|
|
13641
|
+
{
|
|
13642
|
+
entityType: "node",
|
|
13643
|
+
kind,
|
|
13644
|
+
issues: [
|
|
13645
|
+
{
|
|
13646
|
+
path: "limitPerInput",
|
|
13647
|
+
message: `Expected a positive integer, received ${String(limitPerInput)}`,
|
|
13648
|
+
code: "invalid_value"
|
|
13649
|
+
}
|
|
13650
|
+
]
|
|
13651
|
+
}
|
|
13652
|
+
);
|
|
13653
|
+
}
|
|
13654
|
+
const adapter = chunkUESTHN47_cjs.getDialect(backend.dialect);
|
|
13655
|
+
const probes = items.map(
|
|
13656
|
+
(item) => index.fields.map((pointer, position) => {
|
|
13657
|
+
const value = chunkFLRCVI2G_cjs.resolveJsonPointer(item.props, pointer);
|
|
13658
|
+
validateIndexProbeValue(
|
|
13659
|
+
value,
|
|
13660
|
+
index.fieldValueTypes[position],
|
|
13661
|
+
pointer,
|
|
13662
|
+
kind
|
|
13663
|
+
);
|
|
13664
|
+
return value;
|
|
13665
|
+
})
|
|
13666
|
+
);
|
|
13667
|
+
const groupByKey = /* @__PURE__ */ new Map();
|
|
13668
|
+
const groupProbes = [];
|
|
13669
|
+
const groupToInputs = [];
|
|
13670
|
+
for (const [inputIndex, probe] of probes.entries()) {
|
|
13671
|
+
const key = canonicalIndexProbeKey(probe);
|
|
13672
|
+
const existing = groupByKey.get(key);
|
|
13673
|
+
if (existing === void 0) {
|
|
13674
|
+
groupByKey.set(key, groupProbes.length);
|
|
13675
|
+
groupProbes.push(probe);
|
|
13676
|
+
groupToInputs.push([inputIndex]);
|
|
13677
|
+
continue;
|
|
13678
|
+
}
|
|
13679
|
+
groupToInputs[existing]?.push(inputIndex);
|
|
13680
|
+
}
|
|
13681
|
+
const schema = backend.tableNames ? createSqlSchema(backend.tableNames) : DEFAULT_SQL_SCHEMA;
|
|
13682
|
+
const compileContext = {
|
|
13683
|
+
dialect: backend.dialect,
|
|
13684
|
+
propsColumn: drizzleOrm.sql.raw(`"props"`),
|
|
13685
|
+
systemColumn: (column) => drizzleOrm.sql.raw(`"${column}"`)
|
|
13686
|
+
};
|
|
13687
|
+
const fieldKeys = chunkUESTHN47_cjs.compileNodeIndexFieldKeys(index, compileContext);
|
|
13688
|
+
const groupPredicates = groupProbes.map(
|
|
13689
|
+
(probe) => drizzleOrm.sql`(${drizzleOrm.sql.join(
|
|
13690
|
+
fieldKeys.map((fieldKey, position) => {
|
|
13691
|
+
const value = probe[position];
|
|
13692
|
+
if (value === void 0 || value === null) {
|
|
13693
|
+
return drizzleOrm.sql`${fieldKey} IS NULL`;
|
|
13694
|
+
}
|
|
13695
|
+
return adapter.nullSafeEquals(
|
|
13696
|
+
fieldKey,
|
|
13697
|
+
drizzleOrm.sql`${coerceIndexProbeBind(value, adapter)}`
|
|
13698
|
+
);
|
|
13699
|
+
}),
|
|
13700
|
+
drizzleOrm.sql` AND `
|
|
13701
|
+
)})`
|
|
13702
|
+
);
|
|
13703
|
+
const caseBranches = groupPredicates.map(
|
|
13704
|
+
(predicate2, group) => drizzleOrm.sql`WHEN ${predicate2} THEN ${drizzleOrm.sql.raw(String(group))}`
|
|
13705
|
+
);
|
|
13706
|
+
const probeIndexExpr = drizzleOrm.sql`CASE ${drizzleOrm.sql.join(caseBranches, drizzleOrm.sql` `)} ELSE NULL END`;
|
|
13707
|
+
const conditions = [
|
|
13708
|
+
drizzleOrm.sql`"graph_id" = ${ctx.graphId}`,
|
|
13709
|
+
drizzleOrm.sql`"kind" = ${kind}`,
|
|
13710
|
+
drizzleOrm.sql`"deleted_at" IS NULL`
|
|
13711
|
+
];
|
|
13712
|
+
if (index.where !== void 0) {
|
|
13713
|
+
conditions.push(chunkUESTHN47_cjs.compileIndexWhere(compileContext, index.where));
|
|
13714
|
+
}
|
|
13715
|
+
conditions.push(drizzleOrm.sql`(${drizzleOrm.sql.join(groupPredicates, drizzleOrm.sql` OR `)})`);
|
|
13716
|
+
const whereClause = drizzleOrm.sql.join(conditions, drizzleOrm.sql` AND `);
|
|
13717
|
+
const probedSelect = drizzleOrm.sql`SELECT "id", ${probeIndexExpr} AS probe_idx FROM ${schema.nodesTable} WHERE ${whereClause}`;
|
|
13718
|
+
const capInSql = limitPerInput !== void 0 && backend.capabilities.windowFunctions;
|
|
13719
|
+
const query = capInSql ? drizzleOrm.sql`SELECT "id", probe_idx FROM (SELECT "id", probe_idx, ROW_NUMBER() OVER (PARTITION BY probe_idx ORDER BY "id") AS probe_rank FROM (${probedSelect}) AS probed) AS ranked WHERE probe_rank <= ${limitPerInput} ORDER BY probe_idx, "id"` : drizzleOrm.sql`${probedSelect} ORDER BY probe_idx, "id"`;
|
|
13720
|
+
const rawMatches = await backend.execute(query);
|
|
13721
|
+
const matches = limitPerInput !== void 0 && !capInSql ? capMatchesPerGroup(rawMatches, limitPerInput) : rawMatches;
|
|
13722
|
+
const nodesById = await hydrateNodesById(
|
|
13723
|
+
backend,
|
|
13724
|
+
ctx.graphId,
|
|
13725
|
+
kind,
|
|
13726
|
+
matches.map((match) => match.id)
|
|
13727
|
+
);
|
|
13728
|
+
const results = Array.from({ length: items.length }, () => []);
|
|
13729
|
+
for (const match of matches) {
|
|
13730
|
+
const node = nodesById.get(match.id);
|
|
13731
|
+
if (node === void 0) continue;
|
|
13732
|
+
const inputs = groupToInputs[match.probe_idx];
|
|
13733
|
+
if (inputs === void 0) continue;
|
|
13734
|
+
for (const inputIndex of inputs) {
|
|
13735
|
+
results[inputIndex]?.push(node);
|
|
13736
|
+
}
|
|
13737
|
+
}
|
|
13738
|
+
return results;
|
|
13739
|
+
}
|
|
13740
|
+
function capMatchesPerGroup(matches, limitPerInput) {
|
|
13741
|
+
const perGroupCount = /* @__PURE__ */ new Map();
|
|
13742
|
+
const capped = [];
|
|
13743
|
+
for (const match of matches) {
|
|
13744
|
+
const count2 = perGroupCount.get(match.probe_idx) ?? 0;
|
|
13745
|
+
if (count2 >= limitPerInput) continue;
|
|
13746
|
+
perGroupCount.set(match.probe_idx, count2 + 1);
|
|
13747
|
+
capped.push(match);
|
|
13748
|
+
}
|
|
13749
|
+
return capped;
|
|
13750
|
+
}
|
|
13751
|
+
async function hydrateNodesById(backend, graphId, kind, ids) {
|
|
13752
|
+
const rowsById = await getNodeRowsByIds(backend, graphId, kind, ids);
|
|
13753
|
+
const nodesById = /* @__PURE__ */ new Map();
|
|
13754
|
+
for (const [id, row] of rowsById) {
|
|
13755
|
+
if (row.deleted_at !== void 0) continue;
|
|
13756
|
+
nodesById.set(id, rowToNode(row));
|
|
13757
|
+
}
|
|
13758
|
+
return nodesById;
|
|
13759
|
+
}
|
|
13507
13760
|
async function executeNodeBulkGetOrCreateByConstraint(ctx, kind, constraintName, items, backend, options) {
|
|
13508
13761
|
if (items.length === 0) return [];
|
|
13509
13762
|
const ifExists = options?.ifExists ?? "return";
|
|
@@ -13616,7 +13869,7 @@ var DEFAULT_MAX_SKIPPED_IDS = 1e4;
|
|
|
13616
13869
|
function validatePageSize(value) {
|
|
13617
13870
|
if (value === void 0) return DEFAULT_PAGE_SIZE;
|
|
13618
13871
|
if (!Number.isInteger(value) || value <= 0) {
|
|
13619
|
-
throw new
|
|
13872
|
+
throw new chunkJIEJCTDS_cjs.ValidationError(
|
|
13620
13873
|
`pageSize must be a positive integer, got: ${String(value)}`,
|
|
13621
13874
|
{
|
|
13622
13875
|
issues: [{ path: "pageSize", message: "Must be a positive integer." }]
|
|
@@ -13628,7 +13881,7 @@ function validatePageSize(value) {
|
|
|
13628
13881
|
function validateMaxSkippedIds(value) {
|
|
13629
13882
|
if (value === void 0) return DEFAULT_MAX_SKIPPED_IDS;
|
|
13630
13883
|
if (!Number.isInteger(value) || value < 0) {
|
|
13631
|
-
throw new
|
|
13884
|
+
throw new chunkJIEJCTDS_cjs.ValidationError(
|
|
13632
13885
|
`maxSkippedIds must be a non-negative integer, got: ${String(value)}`,
|
|
13633
13886
|
{
|
|
13634
13887
|
issues: [
|
|
@@ -13648,7 +13901,7 @@ function isPropsObject(value) {
|
|
|
13648
13901
|
async function rebuildFulltextIndex(ctx, nodeKind, options) {
|
|
13649
13902
|
const { backend, registry } = ctx;
|
|
13650
13903
|
if (!backend.upsertFulltext || !backend.deleteFulltext) {
|
|
13651
|
-
throw new
|
|
13904
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
13652
13905
|
"Backend does not support fulltext; cannot rebuild index",
|
|
13653
13906
|
{ backend: backend.dialect, capability: "fulltext" }
|
|
13654
13907
|
);
|
|
@@ -13665,7 +13918,7 @@ async function rebuildFulltextIndex(ctx, nodeKind, options) {
|
|
|
13665
13918
|
for (const kind of targetKinds) {
|
|
13666
13919
|
const nodeType = registry.getNodeType(kind);
|
|
13667
13920
|
if (!nodeType) {
|
|
13668
|
-
throw new
|
|
13921
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(`Unknown node kind: ${kind}`, { kind });
|
|
13669
13922
|
}
|
|
13670
13923
|
if (getSearchableFields(nodeType.schema).length === 0) {
|
|
13671
13924
|
continue;
|
|
@@ -13726,7 +13979,7 @@ async function rebuildFulltextIndex(ctx, nodeKind, options) {
|
|
|
13726
13979
|
}
|
|
13727
13980
|
}
|
|
13728
13981
|
};
|
|
13729
|
-
await
|
|
13982
|
+
await chunkWEMZM7J7_cjs.runOptionallyInTransaction(backend, writePage);
|
|
13730
13983
|
processed += rows.length;
|
|
13731
13984
|
upserted += pageResult.toUpsert.length;
|
|
13732
13985
|
cleared += pageResult.toDelete.length;
|
|
@@ -13797,7 +14050,7 @@ function resolveSearchSlot(ctx, nodeKind, fieldPath) {
|
|
|
13797
14050
|
};
|
|
13798
14051
|
}
|
|
13799
14052
|
}
|
|
13800
|
-
throw new
|
|
14053
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
13801
14054
|
`Node kind "${nodeKind}" has no embedding field "${fieldPath}". Declare it with embedding(dimensions) on the node schema.`,
|
|
13802
14055
|
{ capability: "vector", graphId: ctx.graphId }
|
|
13803
14056
|
);
|
|
@@ -13805,7 +14058,7 @@ function resolveSearchSlot(ctx, nodeKind, fieldPath) {
|
|
|
13805
14058
|
async function executeFulltextSearch(ctx, nodeKind, options) {
|
|
13806
14059
|
const { backend, graphId } = ctx;
|
|
13807
14060
|
if (!backend.fulltextSearch) {
|
|
13808
|
-
throw new
|
|
14061
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError("Backend does not support fulltext search", {
|
|
13809
14062
|
backend: backend.dialect,
|
|
13810
14063
|
capability: "fulltext"
|
|
13811
14064
|
});
|
|
@@ -13852,7 +14105,7 @@ async function executeFulltextSearch(ctx, nodeKind, options) {
|
|
|
13852
14105
|
async function executeVectorSearch(ctx, nodeKind, options) {
|
|
13853
14106
|
const { backend, graphId } = ctx;
|
|
13854
14107
|
if (!backend.vectorSearch) {
|
|
13855
|
-
throw new
|
|
14108
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError("Backend does not support vector search", {
|
|
13856
14109
|
backend: backend.dialect,
|
|
13857
14110
|
capability: "vector"
|
|
13858
14111
|
});
|
|
@@ -13906,13 +14159,13 @@ async function executeVectorSearch(ctx, nodeKind, options) {
|
|
|
13906
14159
|
async function executeHybridSearch(ctx, nodeKind, options) {
|
|
13907
14160
|
const { backend, graphId } = ctx;
|
|
13908
14161
|
if (!backend.vectorSearch) {
|
|
13909
|
-
throw new
|
|
14162
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError("Backend does not support vector search", {
|
|
13910
14163
|
backend: backend.dialect,
|
|
13911
14164
|
capability: "vector"
|
|
13912
14165
|
});
|
|
13913
14166
|
}
|
|
13914
14167
|
if (!backend.fulltextSearch) {
|
|
13915
|
-
throw new
|
|
14168
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError("Backend does not support fulltext search", {
|
|
13916
14169
|
backend: backend.dialect,
|
|
13917
14170
|
capability: "fulltext"
|
|
13918
14171
|
});
|
|
@@ -14053,18 +14306,18 @@ function assertEfSearch(efSearch, label) {
|
|
|
14053
14306
|
}
|
|
14054
14307
|
function assertMinScore(minScore, metric, label) {
|
|
14055
14308
|
if (minScore === void 0) return;
|
|
14056
|
-
|
|
14309
|
+
chunkUESTHN47_cjs.assertVectorMinScore(minScore, metric, label);
|
|
14057
14310
|
}
|
|
14058
14311
|
function assertVectorQueryCompatible(backend, slot, options, label) {
|
|
14059
14312
|
if (options.metric !== void 0 && options.metric !== slot.metric) {
|
|
14060
|
-
throw new
|
|
14313
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
14061
14314
|
`${label}: metric "${options.metric}" does not match the field's declared metric "${slot.metric}". Vector storage is built for the declared metric \u2014 omit metric or pass "${slot.metric}".`,
|
|
14062
14315
|
{ backend: backend.dialect, capability: "vector" }
|
|
14063
14316
|
);
|
|
14064
14317
|
}
|
|
14065
14318
|
const supported = backend.capabilities.vector?.metrics;
|
|
14066
14319
|
if (supported !== void 0 && !supported.includes(slot.metric)) {
|
|
14067
|
-
throw new
|
|
14320
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
14068
14321
|
`${label}: backend "${backend.dialect}" does not support the "${slot.metric}" metric (supported: ${supported.join(", ")}).`,
|
|
14069
14322
|
{ backend: backend.dialect, capability: "vector" }
|
|
14070
14323
|
);
|
|
@@ -14096,7 +14349,7 @@ function validateFulltextCallOptions(backend, options) {
|
|
|
14096
14349
|
function validateFulltextMode(backend, strategy, capabilities, mode) {
|
|
14097
14350
|
if (strategy !== void 0) {
|
|
14098
14351
|
if (strategy.supportedModes.includes(mode)) return;
|
|
14099
|
-
throw new
|
|
14352
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
14100
14353
|
`Backend "${backend.dialect}" fulltext strategy "${strategy.name}" does not support mode "${mode}". Supported modes: ${strategy.supportedModes.join(", ")}`,
|
|
14101
14354
|
{
|
|
14102
14355
|
backend: backend.dialect,
|
|
@@ -14106,7 +14359,7 @@ function validateFulltextMode(backend, strategy, capabilities, mode) {
|
|
|
14106
14359
|
);
|
|
14107
14360
|
}
|
|
14108
14361
|
if (mode === "phrase" && capabilities && !capabilities.phraseQueries) {
|
|
14109
|
-
throw new
|
|
14362
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
14110
14363
|
`Backend "${backend.dialect}" does not support phrase queries`,
|
|
14111
14364
|
{ backend: backend.dialect, capability: "fulltext.phraseQueries" }
|
|
14112
14365
|
);
|
|
@@ -14115,14 +14368,14 @@ function validateFulltextMode(backend, strategy, capabilities, mode) {
|
|
|
14115
14368
|
function validateFulltextSnippets(backend, strategy, capabilities) {
|
|
14116
14369
|
const supportsSnippets = strategy === void 0 ? capabilities?.highlighting !== false : strategy.supportsSnippets;
|
|
14117
14370
|
if (supportsSnippets) return;
|
|
14118
|
-
throw new
|
|
14371
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
14119
14372
|
`Backend "${backend.dialect}" does not support snippet highlighting; drop includeSnippets or switch to a backend where highlighting is supported`,
|
|
14120
14373
|
{ backend: backend.dialect, capability: "fulltext.highlighting" }
|
|
14121
14374
|
);
|
|
14122
14375
|
}
|
|
14123
14376
|
function validateFulltextLanguageOption(backend, strategy, capabilities, language) {
|
|
14124
14377
|
if (strategy !== void 0 && !strategy.supportsLanguageOverride) {
|
|
14125
|
-
throw new
|
|
14378
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
14126
14379
|
`Backend "${backend.dialect}" fulltext strategy "${strategy.name}" does not honor a per-query \`language\` override (its tokenizer is fixed at table-create time). Drop the option, or pick a strategy that advertises \`supportsLanguageOverride: true\`.`,
|
|
14127
14380
|
{
|
|
14128
14381
|
backend: backend.dialect,
|
|
@@ -14266,7 +14519,7 @@ var StoreSearch = class {
|
|
|
14266
14519
|
}
|
|
14267
14520
|
#assertKindRegistered(kind) {
|
|
14268
14521
|
if (this.#context.registry.hasNodeType(kind)) return;
|
|
14269
|
-
throw new
|
|
14522
|
+
throw new chunkJIEJCTDS_cjs.KindNotFoundError(kind, "node", {
|
|
14270
14523
|
graphId: this.#context.graphId,
|
|
14271
14524
|
suggestion: "Compile-time kinds come from defineGraph; extension kinds appear after store.evolve() returns. Check store.introspect() for the registered set."
|
|
14272
14525
|
});
|
|
@@ -14457,7 +14710,7 @@ var Store = class _Store {
|
|
|
14457
14710
|
getNodeCollectionOrThrow(kind) {
|
|
14458
14711
|
const collection = this.getNodeCollection(kind);
|
|
14459
14712
|
if (collection === void 0) {
|
|
14460
|
-
throw new
|
|
14713
|
+
throw new chunkJIEJCTDS_cjs.KindNotFoundError(kind, "node", {
|
|
14461
14714
|
graphId: this.graphId
|
|
14462
14715
|
});
|
|
14463
14716
|
}
|
|
@@ -14481,7 +14734,7 @@ var Store = class _Store {
|
|
|
14481
14734
|
getEdgeCollectionOrThrow(kind) {
|
|
14482
14735
|
const collection = this.getEdgeCollection(kind);
|
|
14483
14736
|
if (collection === void 0) {
|
|
14484
|
-
throw new
|
|
14737
|
+
throw new chunkJIEJCTDS_cjs.KindNotFoundError(kind, "edge", {
|
|
14485
14738
|
graphId: this.graphId
|
|
14486
14739
|
});
|
|
14487
14740
|
}
|
|
@@ -14507,7 +14760,7 @@ var Store = class _Store {
|
|
|
14507
14760
|
getNodePropsSchemaOrThrow(kind) {
|
|
14508
14761
|
const schema = this.getNodePropsSchema(kind);
|
|
14509
14762
|
if (schema === void 0) {
|
|
14510
|
-
throw new
|
|
14763
|
+
throw new chunkJIEJCTDS_cjs.KindNotFoundError(kind, "node", {
|
|
14511
14764
|
graphId: this.graphId
|
|
14512
14765
|
});
|
|
14513
14766
|
}
|
|
@@ -14528,7 +14781,7 @@ var Store = class _Store {
|
|
|
14528
14781
|
getEdgePropsSchemaOrThrow(kind) {
|
|
14529
14782
|
const schema = this.getEdgePropsSchema(kind);
|
|
14530
14783
|
if (schema === void 0) {
|
|
14531
|
-
throw new
|
|
14784
|
+
throw new chunkJIEJCTDS_cjs.KindNotFoundError(kind, "edge", {
|
|
14532
14785
|
graphId: this.graphId
|
|
14533
14786
|
});
|
|
14534
14787
|
}
|
|
@@ -14602,6 +14855,14 @@ var Store = class _Store {
|
|
|
14602
14855
|
constraintName,
|
|
14603
14856
|
items,
|
|
14604
14857
|
backend
|
|
14858
|
+
),
|
|
14859
|
+
executeBulkFindByIndex: (kind, indexName, items, backend, options) => executeNodeBulkFindByIndex(
|
|
14860
|
+
ctx,
|
|
14861
|
+
kind,
|
|
14862
|
+
indexName,
|
|
14863
|
+
items,
|
|
14864
|
+
backend,
|
|
14865
|
+
options
|
|
14605
14866
|
)
|
|
14606
14867
|
};
|
|
14607
14868
|
}
|
|
@@ -14744,7 +15005,7 @@ var Store = class _Store {
|
|
|
14744
15005
|
* @returns A tuple with per-query typed results, preserving input order
|
|
14745
15006
|
*/
|
|
14746
15007
|
async batch(...queries) {
|
|
14747
|
-
return
|
|
15008
|
+
return chunkWEMZM7J7_cjs.runOptionallyInTransaction(this.#backend, async (target) => {
|
|
14748
15009
|
const results = [];
|
|
14749
15010
|
for (const query of queries) {
|
|
14750
15011
|
const result = await query.executeOn(target);
|
|
@@ -14786,7 +15047,7 @@ var Store = class _Store {
|
|
|
14786
15047
|
graphId: this.graphId,
|
|
14787
15048
|
rootId,
|
|
14788
15049
|
backend: this.#backend,
|
|
14789
|
-
dialect:
|
|
15050
|
+
dialect: chunkUESTHN47_cjs.getDialect(this.#backend.dialect),
|
|
14790
15051
|
schema: this.#schema,
|
|
14791
15052
|
options
|
|
14792
15053
|
});
|
|
@@ -14848,7 +15109,7 @@ var Store = class _Store {
|
|
|
14848
15109
|
return fn({ nodes: this.nodes, edges: this.edges });
|
|
14849
15110
|
}
|
|
14850
15111
|
return this.#backend.transaction(
|
|
14851
|
-
async (txBackend,
|
|
15112
|
+
async (txBackend, sql19) => fn(this.#buildTransactionContext(txBackend, sql19))
|
|
14852
15113
|
);
|
|
14853
15114
|
}
|
|
14854
15115
|
/**
|
|
@@ -14909,7 +15170,7 @@ var Store = class _Store {
|
|
|
14909
15170
|
withTransaction(externalTx) {
|
|
14910
15171
|
const adopt = this.#backend.adoptTransaction;
|
|
14911
15172
|
if (!adopt) {
|
|
14912
|
-
throw new
|
|
15173
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
14913
15174
|
"This backend cannot adopt an external transaction for cross-store atomicity. adoptTransaction is provided only by the Drizzle Postgres/SQLite backends with transaction support. Check backend.capabilities.transactions, or run the relational and graph writes as separate transactions with manual compensation.",
|
|
14914
15175
|
{ capability: "adoptTransaction" }
|
|
14915
15176
|
);
|
|
@@ -14925,7 +15186,7 @@ var Store = class _Store {
|
|
|
14925
15186
|
* raw Drizzle handle bound to the same transaction (#140);
|
|
14926
15187
|
* `undefined` only on the non-transactional fallback.
|
|
14927
15188
|
*/
|
|
14928
|
-
#buildTransactionContext(txBackend,
|
|
15189
|
+
#buildTransactionContext(txBackend, sql19) {
|
|
14929
15190
|
const txNodeOperations = {
|
|
14930
15191
|
...this.#nodeOperations,
|
|
14931
15192
|
createQuery: () => this.#createQueryForBackend(txBackend)
|
|
@@ -14948,7 +15209,7 @@ var Store = class _Store {
|
|
|
14948
15209
|
txBackend,
|
|
14949
15210
|
txEdgeOperations
|
|
14950
15211
|
);
|
|
14951
|
-
return
|
|
15212
|
+
return sql19 === void 0 ? { nodes, edges } : { nodes, edges, sql: sql19 };
|
|
14952
15213
|
}
|
|
14953
15214
|
// === Graph Lifecycle ===
|
|
14954
15215
|
/**
|
|
@@ -15083,7 +15344,7 @@ var Store = class _Store {
|
|
|
15083
15344
|
*/
|
|
15084
15345
|
async evolve(extension, options) {
|
|
15085
15346
|
const { activeRow, baseline } = await this.#loadCaughtUp("evolve");
|
|
15086
|
-
const merged =
|
|
15347
|
+
const merged = chunkK4N35E7B_cjs.mergeGraphExtension(baseline, extension);
|
|
15087
15348
|
if (merged === baseline) {
|
|
15088
15349
|
if (baseline === this.#graph) {
|
|
15089
15350
|
if (options?.ref !== void 0) options.ref.current = this;
|
|
@@ -15105,7 +15366,7 @@ var Store = class _Store {
|
|
|
15105
15366
|
const baselineDocument = baseline.extension ?? Object.freeze({});
|
|
15106
15367
|
const classification = classifyModifications(baselineDocument, extension);
|
|
15107
15368
|
if (classification.incompatible.length > 0) {
|
|
15108
|
-
throw new
|
|
15369
|
+
throw new chunkSGPXKJ4A_cjs.IncompatibleChangeError(
|
|
15109
15370
|
classification.incompatible,
|
|
15110
15371
|
this.graphId
|
|
15111
15372
|
);
|
|
@@ -15119,7 +15380,7 @@ var Store = class _Store {
|
|
|
15119
15380
|
);
|
|
15120
15381
|
if (error !== void 0) throw error;
|
|
15121
15382
|
}
|
|
15122
|
-
const committed = await
|
|
15383
|
+
const committed = await chunkK4N35E7B_cjs.commitNewSchemaVersion(
|
|
15123
15384
|
this.#backend,
|
|
15124
15385
|
merged,
|
|
15125
15386
|
activeRow.version
|
|
@@ -15137,7 +15398,7 @@ var Store = class _Store {
|
|
|
15137
15398
|
async #runEagerOrThrow(store, eager) {
|
|
15138
15399
|
const result = await store.materializeIndexes(eager);
|
|
15139
15400
|
if (result.results.some((entry2) => entry2.status === "failed")) {
|
|
15140
|
-
throw new
|
|
15401
|
+
throw new chunkJIEJCTDS_cjs.EagerMaterializationError(result, this.graphId);
|
|
15141
15402
|
}
|
|
15142
15403
|
}
|
|
15143
15404
|
/**
|
|
@@ -15253,7 +15514,7 @@ var Store = class _Store {
|
|
|
15253
15514
|
const backend = this.#backend;
|
|
15254
15515
|
const strategy = backend.vectorStrategy;
|
|
15255
15516
|
if (strategy === void 0 || backend.executeDdl === void 0) {
|
|
15256
|
-
throw new
|
|
15517
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
15257
15518
|
"reembedVectorField requires a backend with a vector strategy and executeDdl.",
|
|
15258
15519
|
{
|
|
15259
15520
|
backend: backend.dialect,
|
|
@@ -15266,7 +15527,7 @@ var Store = class _Store {
|
|
|
15266
15527
|
(candidate) => candidate.entity === "vector" && candidate.kind === kind && candidate.fieldPath === fieldPath
|
|
15267
15528
|
);
|
|
15268
15529
|
if (declaration === void 0) {
|
|
15269
|
-
throw new
|
|
15530
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
15270
15531
|
`No embedding field "${kind}.${fieldPath}" is declared in the active schema.`,
|
|
15271
15532
|
{ kind, fieldPath, operation: "reembed" }
|
|
15272
15533
|
);
|
|
@@ -15312,7 +15573,7 @@ var Store = class _Store {
|
|
|
15312
15573
|
tableName,
|
|
15313
15574
|
declaration
|
|
15314
15575
|
);
|
|
15315
|
-
const now =
|
|
15576
|
+
const now = chunk7JGLPAFV_cjs.nowIso();
|
|
15316
15577
|
await backend.recordIndexMaterialization({
|
|
15317
15578
|
indexName: vectorStatusKey(this.graphId, declaration.name),
|
|
15318
15579
|
graphId: this.graphId,
|
|
@@ -15329,7 +15590,7 @@ var Store = class _Store {
|
|
|
15329
15590
|
return { recreated: true, reembedded: 0 };
|
|
15330
15591
|
}
|
|
15331
15592
|
if (backend.upsertEmbedding === void 0) {
|
|
15332
|
-
throw new
|
|
15593
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
15333
15594
|
"reembedVectorField with an `embed` callback requires a backend that supports upsertEmbedding.",
|
|
15334
15595
|
{
|
|
15335
15596
|
backend: backend.dialect,
|
|
@@ -15415,9 +15676,9 @@ var Store = class _Store {
|
|
|
15415
15676
|
);
|
|
15416
15677
|
}
|
|
15417
15678
|
const compileTimeGraph = stripGraphExtension(this.#graph);
|
|
15418
|
-
const merged = plan.document === void 0 ? compileTimeGraph :
|
|
15419
|
-
const finalGraph =
|
|
15420
|
-
const committedRow = await
|
|
15679
|
+
const merged = plan.document === void 0 ? compileTimeGraph : chunkK4N35E7B_cjs.mergeGraphExtension(compileTimeGraph, plan.document);
|
|
15680
|
+
const finalGraph = chunkK4N35E7B_cjs.applyDeprecatedKinds(merged, baseline.deprecatedKinds);
|
|
15681
|
+
const committedRow = await chunkK4N35E7B_cjs.commitNewSchemaVersion(
|
|
15421
15682
|
this.#backend,
|
|
15422
15683
|
finalGraph,
|
|
15423
15684
|
activeRow.version
|
|
@@ -15427,7 +15688,7 @@ var Store = class _Store {
|
|
|
15427
15688
|
if (this.#backend.ensureKindRemovalsTable !== void 0) {
|
|
15428
15689
|
await this.#backend.ensureKindRemovalsTable();
|
|
15429
15690
|
}
|
|
15430
|
-
const attemptedAt =
|
|
15691
|
+
const attemptedAt = chunk7JGLPAFV_cjs.nowIso();
|
|
15431
15692
|
const newSchemaVersion = committedRow.version;
|
|
15432
15693
|
const queue = (kindName, entity) => recordKindRemoval(
|
|
15433
15694
|
buildPendingKindRemoval({
|
|
@@ -15474,8 +15735,8 @@ var Store = class _Store {
|
|
|
15474
15735
|
const nextSet = new Set(baseline.deprecatedKinds);
|
|
15475
15736
|
if (direction === "add") {
|
|
15476
15737
|
for (const name of names) {
|
|
15477
|
-
if (!
|
|
15478
|
-
throw new
|
|
15738
|
+
if (!chunk7JGLPAFV_cjs.isKnownKind(baseline, name)) {
|
|
15739
|
+
throw new chunkJIEJCTDS_cjs.KindNotFoundError(
|
|
15479
15740
|
name,
|
|
15480
15741
|
isKnownEdgeKind(baseline, name) ? "edge" : "node",
|
|
15481
15742
|
{
|
|
@@ -15500,8 +15761,8 @@ var Store = class _Store {
|
|
|
15500
15761
|
schemaMetadataFromRow(activeRow)
|
|
15501
15762
|
);
|
|
15502
15763
|
}
|
|
15503
|
-
const merged =
|
|
15504
|
-
const result = await
|
|
15764
|
+
const merged = chunkK4N35E7B_cjs.applyDeprecatedKinds(baseline, nextSet);
|
|
15765
|
+
const result = await chunkK4N35E7B_cjs.ensureSchema(this.#backend, merged, {
|
|
15505
15766
|
preloaded: { activeRow, storedSchema },
|
|
15506
15767
|
autoMigrate: true
|
|
15507
15768
|
});
|
|
@@ -15510,8 +15771,8 @@ var Store = class _Store {
|
|
|
15510
15771
|
}
|
|
15511
15772
|
#catchUpToStored(storedSchema) {
|
|
15512
15773
|
const compileTimeGraph = stripGraphExtension(this.#graph);
|
|
15513
|
-
const withGraphExtension = storedSchema.extension === void 0 ? compileTimeGraph :
|
|
15514
|
-
return
|
|
15774
|
+
const withGraphExtension = storedSchema.extension === void 0 ? compileTimeGraph : chunkK4N35E7B_cjs.mergeGraphExtension(compileTimeGraph, storedSchema.extension);
|
|
15775
|
+
return chunkK4N35E7B_cjs.applyDeprecatedKinds(
|
|
15515
15776
|
withGraphExtension,
|
|
15516
15777
|
storedSchema.deprecatedKinds
|
|
15517
15778
|
);
|
|
@@ -15529,18 +15790,18 @@ var Store = class _Store {
|
|
|
15529
15790
|
* serializes the actual commit.
|
|
15530
15791
|
*/
|
|
15531
15792
|
async #loadCaughtUp(verb) {
|
|
15532
|
-
const activeRow = await
|
|
15793
|
+
const activeRow = await chunkK4N35E7B_cjs.loadActiveSchemaWithBootstrap(
|
|
15533
15794
|
this.#backend,
|
|
15534
15795
|
this.graphId
|
|
15535
15796
|
);
|
|
15536
15797
|
if (activeRow === void 0) {
|
|
15537
15798
|
const { phrase, code } = CAUGHT_UP_VERB_DETAILS[verb];
|
|
15538
|
-
throw new
|
|
15799
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
15539
15800
|
`Cannot ${phrase} graph "${this.graphId}": no schema has been initialized. Call createStoreWithSchema first.`,
|
|
15540
15801
|
{ code }
|
|
15541
15802
|
);
|
|
15542
15803
|
}
|
|
15543
|
-
const storedSchema =
|
|
15804
|
+
const storedSchema = chunkK4N35E7B_cjs.parseSerializedSchema(activeRow.schema_doc);
|
|
15544
15805
|
const baseline = this.#catchUpToStored(storedSchema);
|
|
15545
15806
|
return { activeRow, storedSchema, baseline };
|
|
15546
15807
|
}
|
|
@@ -15654,7 +15915,7 @@ var Store = class _Store {
|
|
|
15654
15915
|
// === Internal: Temporal Filtering ===
|
|
15655
15916
|
#matchesTemporalMode(row, options) {
|
|
15656
15917
|
const mode = options?.temporalMode ?? this.#graph.defaults.temporalMode;
|
|
15657
|
-
const asOf = options?.asOf ??
|
|
15918
|
+
const asOf = options?.asOf ?? chunk7JGLPAFV_cjs.nowIso();
|
|
15658
15919
|
switch (mode) {
|
|
15659
15920
|
case "current":
|
|
15660
15921
|
case "asOf": {
|
|
@@ -15718,8 +15979,8 @@ async function createStoreWithSchema(graph, backend, options) {
|
|
|
15718
15979
|
graph: merged,
|
|
15719
15980
|
activeRow,
|
|
15720
15981
|
storedSchema
|
|
15721
|
-
} = await
|
|
15722
|
-
const result = await
|
|
15982
|
+
} = await chunkK4N35E7B_cjs.loadAndMergeGraphExtensionDocument(backend, graph);
|
|
15983
|
+
const result = await chunkK4N35E7B_cjs.ensureSchema(backend, merged, {
|
|
15723
15984
|
...options,
|
|
15724
15985
|
preloaded: { activeRow, storedSchema }
|
|
15725
15986
|
});
|
|
@@ -15737,7 +15998,7 @@ async function createVerifiedStore(graph, backend, options) {
|
|
|
15737
15998
|
graph: merged,
|
|
15738
15999
|
activeRow,
|
|
15739
16000
|
result
|
|
15740
|
-
} = await
|
|
16001
|
+
} = await chunkK4N35E7B_cjs.loadAndVerifyGraph(backend, graph);
|
|
15741
16002
|
const store = new Store(
|
|
15742
16003
|
merged,
|
|
15743
16004
|
backend,
|
|
@@ -15749,215 +16010,215 @@ async function createVerifiedStore(graph, backend, options) {
|
|
|
15749
16010
|
|
|
15750
16011
|
Object.defineProperty(exports, "libsqlVectorStrategy", {
|
|
15751
16012
|
enumerable: true,
|
|
15752
|
-
get: function () { return
|
|
16013
|
+
get: function () { return chunkFWBVPATK_cjs.libsqlVectorStrategy; }
|
|
15753
16014
|
});
|
|
15754
16015
|
Object.defineProperty(exports, "pgvectorStrategy", {
|
|
15755
16016
|
enumerable: true,
|
|
15756
|
-
get: function () { return
|
|
16017
|
+
get: function () { return chunkIE6GN7L3_cjs.pgvectorStrategy; }
|
|
15757
16018
|
});
|
|
15758
16019
|
Object.defineProperty(exports, "broader", {
|
|
15759
16020
|
enumerable: true,
|
|
15760
|
-
get: function () { return
|
|
16021
|
+
get: function () { return chunkK4N35E7B_cjs.broader; }
|
|
15761
16022
|
});
|
|
15762
16023
|
Object.defineProperty(exports, "core", {
|
|
15763
16024
|
enumerable: true,
|
|
15764
|
-
get: function () { return
|
|
16025
|
+
get: function () { return chunkK4N35E7B_cjs.core; }
|
|
15765
16026
|
});
|
|
15766
16027
|
Object.defineProperty(exports, "defineEdge", {
|
|
15767
16028
|
enumerable: true,
|
|
15768
|
-
get: function () { return
|
|
16029
|
+
get: function () { return chunkK4N35E7B_cjs.defineEdge; }
|
|
15769
16030
|
});
|
|
15770
16031
|
Object.defineProperty(exports, "defineNode", {
|
|
15771
16032
|
enumerable: true,
|
|
15772
|
-
get: function () { return
|
|
16033
|
+
get: function () { return chunkK4N35E7B_cjs.defineNode; }
|
|
15773
16034
|
});
|
|
15774
16035
|
Object.defineProperty(exports, "differentFrom", {
|
|
15775
16036
|
enumerable: true,
|
|
15776
|
-
get: function () { return
|
|
16037
|
+
get: function () { return chunkK4N35E7B_cjs.differentFrom; }
|
|
15777
16038
|
});
|
|
15778
16039
|
Object.defineProperty(exports, "disjointWith", {
|
|
15779
16040
|
enumerable: true,
|
|
15780
|
-
get: function () { return
|
|
16041
|
+
get: function () { return chunkK4N35E7B_cjs.disjointWith; }
|
|
15781
16042
|
});
|
|
15782
16043
|
Object.defineProperty(exports, "equivalentTo", {
|
|
15783
16044
|
enumerable: true,
|
|
15784
|
-
get: function () { return
|
|
16045
|
+
get: function () { return chunkK4N35E7B_cjs.equivalentTo; }
|
|
15785
16046
|
});
|
|
15786
16047
|
Object.defineProperty(exports, "hasPart", {
|
|
15787
16048
|
enumerable: true,
|
|
15788
|
-
get: function () { return
|
|
16049
|
+
get: function () { return chunkK4N35E7B_cjs.hasPart; }
|
|
15789
16050
|
});
|
|
15790
16051
|
Object.defineProperty(exports, "implies", {
|
|
15791
16052
|
enumerable: true,
|
|
15792
|
-
get: function () { return
|
|
16053
|
+
get: function () { return chunkK4N35E7B_cjs.implies; }
|
|
15793
16054
|
});
|
|
15794
16055
|
Object.defineProperty(exports, "inverseOf", {
|
|
15795
16056
|
enumerable: true,
|
|
15796
|
-
get: function () { return
|
|
16057
|
+
get: function () { return chunkK4N35E7B_cjs.inverseOf; }
|
|
15797
16058
|
});
|
|
15798
16059
|
Object.defineProperty(exports, "isMetaEdge", {
|
|
15799
16060
|
enumerable: true,
|
|
15800
|
-
get: function () { return
|
|
16061
|
+
get: function () { return chunkK4N35E7B_cjs.isMetaEdge; }
|
|
15801
16062
|
});
|
|
15802
16063
|
Object.defineProperty(exports, "narrower", {
|
|
15803
16064
|
enumerable: true,
|
|
15804
|
-
get: function () { return
|
|
16065
|
+
get: function () { return chunkK4N35E7B_cjs.narrower; }
|
|
15805
16066
|
});
|
|
15806
16067
|
Object.defineProperty(exports, "partOf", {
|
|
15807
16068
|
enumerable: true,
|
|
15808
|
-
get: function () { return
|
|
16069
|
+
get: function () { return chunkK4N35E7B_cjs.partOf; }
|
|
15809
16070
|
});
|
|
15810
16071
|
Object.defineProperty(exports, "relatedTo", {
|
|
15811
16072
|
enumerable: true,
|
|
15812
|
-
get: function () { return
|
|
16073
|
+
get: function () { return chunkK4N35E7B_cjs.relatedTo; }
|
|
15813
16074
|
});
|
|
15814
16075
|
Object.defineProperty(exports, "sameAs", {
|
|
15815
16076
|
enumerable: true,
|
|
15816
|
-
get: function () { return
|
|
16077
|
+
get: function () { return chunkK4N35E7B_cjs.sameAs; }
|
|
15817
16078
|
});
|
|
15818
16079
|
Object.defineProperty(exports, "subClassOf", {
|
|
15819
16080
|
enumerable: true,
|
|
15820
|
-
get: function () { return
|
|
16081
|
+
get: function () { return chunkK4N35E7B_cjs.subClassOf; }
|
|
15821
16082
|
});
|
|
15822
16083
|
Object.defineProperty(exports, "defineGraph", {
|
|
15823
16084
|
enumerable: true,
|
|
15824
|
-
get: function () { return
|
|
16085
|
+
get: function () { return chunk7JGLPAFV_cjs.defineGraph; }
|
|
15825
16086
|
});
|
|
15826
16087
|
Object.defineProperty(exports, "getEdgeKinds", {
|
|
15827
16088
|
enumerable: true,
|
|
15828
|
-
get: function () { return
|
|
16089
|
+
get: function () { return chunk7JGLPAFV_cjs.getEdgeKinds; }
|
|
15829
16090
|
});
|
|
15830
16091
|
Object.defineProperty(exports, "getNodeKinds", {
|
|
15831
16092
|
enumerable: true,
|
|
15832
|
-
get: function () { return
|
|
16093
|
+
get: function () { return chunk7JGLPAFV_cjs.getNodeKinds; }
|
|
15833
16094
|
});
|
|
15834
16095
|
Object.defineProperty(exports, "isEdgeType", {
|
|
15835
16096
|
enumerable: true,
|
|
15836
|
-
get: function () { return
|
|
16097
|
+
get: function () { return chunk7JGLPAFV_cjs.isEdgeType; }
|
|
15837
16098
|
});
|
|
15838
16099
|
Object.defineProperty(exports, "isEdgeTypeWithEndpoints", {
|
|
15839
16100
|
enumerable: true,
|
|
15840
|
-
get: function () { return
|
|
16101
|
+
get: function () { return chunk7JGLPAFV_cjs.isEdgeTypeWithEndpoints; }
|
|
15841
16102
|
});
|
|
15842
16103
|
Object.defineProperty(exports, "isGraphDef", {
|
|
15843
16104
|
enumerable: true,
|
|
15844
|
-
get: function () { return
|
|
16105
|
+
get: function () { return chunk7JGLPAFV_cjs.isGraphDef; }
|
|
15845
16106
|
});
|
|
15846
16107
|
Object.defineProperty(exports, "isNodeType", {
|
|
15847
16108
|
enumerable: true,
|
|
15848
|
-
get: function () { return
|
|
16109
|
+
get: function () { return chunk7JGLPAFV_cjs.isNodeType; }
|
|
15849
16110
|
});
|
|
15850
16111
|
Object.defineProperty(exports, "defineGraphExtension", {
|
|
15851
16112
|
enumerable: true,
|
|
15852
|
-
get: function () { return
|
|
16113
|
+
get: function () { return chunkLUHU4T2F_cjs.defineGraphExtension; }
|
|
15853
16114
|
});
|
|
15854
16115
|
Object.defineProperty(exports, "CURRENT_GRAPH_EXTENSION_VERSION", {
|
|
15855
16116
|
enumerable: true,
|
|
15856
|
-
get: function () { return
|
|
16117
|
+
get: function () { return chunkSGPXKJ4A_cjs.CURRENT_GRAPH_EXTENSION_VERSION; }
|
|
15857
16118
|
});
|
|
15858
16119
|
Object.defineProperty(exports, "GraphExtensionError", {
|
|
15859
16120
|
enumerable: true,
|
|
15860
|
-
get: function () { return
|
|
16121
|
+
get: function () { return chunkSGPXKJ4A_cjs.GraphExtensionError; }
|
|
15861
16122
|
});
|
|
15862
16123
|
Object.defineProperty(exports, "GraphExtensionUnresolvedEndpointError", {
|
|
15863
16124
|
enumerable: true,
|
|
15864
|
-
get: function () { return
|
|
16125
|
+
get: function () { return chunkSGPXKJ4A_cjs.GraphExtensionUnresolvedEndpointError; }
|
|
15865
16126
|
});
|
|
15866
16127
|
Object.defineProperty(exports, "GraphExtensionValidationError", {
|
|
15867
16128
|
enumerable: true,
|
|
15868
|
-
get: function () { return
|
|
16129
|
+
get: function () { return chunkSGPXKJ4A_cjs.GraphExtensionValidationError; }
|
|
15869
16130
|
});
|
|
15870
16131
|
Object.defineProperty(exports, "GraphExtensionVersionUnsupportedError", {
|
|
15871
16132
|
enumerable: true,
|
|
15872
|
-
get: function () { return
|
|
16133
|
+
get: function () { return chunkSGPXKJ4A_cjs.GraphExtensionVersionUnsupportedError; }
|
|
15873
16134
|
});
|
|
15874
16135
|
Object.defineProperty(exports, "IncompatibleChangeError", {
|
|
15875
16136
|
enumerable: true,
|
|
15876
|
-
get: function () { return
|
|
16137
|
+
get: function () { return chunkSGPXKJ4A_cjs.IncompatibleChangeError; }
|
|
15877
16138
|
});
|
|
15878
16139
|
Object.defineProperty(exports, "KindCollisionError", {
|
|
15879
16140
|
enumerable: true,
|
|
15880
|
-
get: function () { return
|
|
16141
|
+
get: function () { return chunkSGPXKJ4A_cjs.KindCollisionError; }
|
|
15881
16142
|
});
|
|
15882
16143
|
Object.defineProperty(exports, "KindHasReferentsError", {
|
|
15883
16144
|
enumerable: true,
|
|
15884
|
-
get: function () { return
|
|
16145
|
+
get: function () { return chunkSGPXKJ4A_cjs.KindHasReferentsError; }
|
|
15885
16146
|
});
|
|
15886
16147
|
Object.defineProperty(exports, "LEGACY_GRAPH_EXTENSION_VERSION", {
|
|
15887
16148
|
enumerable: true,
|
|
15888
|
-
get: function () { return
|
|
16149
|
+
get: function () { return chunkSGPXKJ4A_cjs.LEGACY_GRAPH_EXTENSION_VERSION; }
|
|
15889
16150
|
});
|
|
15890
16151
|
Object.defineProperty(exports, "RemoveCompileTimeKindError", {
|
|
15891
16152
|
enumerable: true,
|
|
15892
|
-
get: function () { return
|
|
16153
|
+
get: function () { return chunkSGPXKJ4A_cjs.RemoveCompileTimeKindError; }
|
|
15893
16154
|
});
|
|
15894
16155
|
Object.defineProperty(exports, "computeTransitiveClosure", {
|
|
15895
16156
|
enumerable: true,
|
|
15896
|
-
get: function () { return
|
|
16157
|
+
get: function () { return chunkSGPXKJ4A_cjs.computeTransitiveClosure; }
|
|
15897
16158
|
});
|
|
15898
16159
|
Object.defineProperty(exports, "invertClosure", {
|
|
15899
16160
|
enumerable: true,
|
|
15900
|
-
get: function () { return
|
|
16161
|
+
get: function () { return chunkSGPXKJ4A_cjs.invertClosure; }
|
|
15901
16162
|
});
|
|
15902
16163
|
Object.defineProperty(exports, "isReachable", {
|
|
15903
16164
|
enumerable: true,
|
|
15904
|
-
get: function () { return
|
|
16165
|
+
get: function () { return chunkSGPXKJ4A_cjs.isReachable; }
|
|
15905
16166
|
});
|
|
15906
16167
|
Object.defineProperty(exports, "validateGraphExtension", {
|
|
15907
16168
|
enumerable: true,
|
|
15908
|
-
get: function () { return
|
|
16169
|
+
get: function () { return chunkSGPXKJ4A_cjs.validateGraphExtension; }
|
|
15909
16170
|
});
|
|
15910
16171
|
Object.defineProperty(exports, "sqliteVecStrategy", {
|
|
15911
16172
|
enumerable: true,
|
|
15912
|
-
get: function () { return
|
|
16173
|
+
get: function () { return chunkVFX3LC76_cjs.sqliteVecStrategy; }
|
|
15913
16174
|
});
|
|
15914
16175
|
Object.defineProperty(exports, "andWhere", {
|
|
15915
16176
|
enumerable: true,
|
|
15916
|
-
get: function () { return
|
|
16177
|
+
get: function () { return chunkUESTHN47_cjs.andWhere; }
|
|
15917
16178
|
});
|
|
15918
16179
|
Object.defineProperty(exports, "buildVectorCapabilities", {
|
|
15919
16180
|
enumerable: true,
|
|
15920
|
-
get: function () { return
|
|
16181
|
+
get: function () { return chunkUESTHN47_cjs.buildVectorCapabilities; }
|
|
15921
16182
|
});
|
|
15922
16183
|
Object.defineProperty(exports, "fts5Strategy", {
|
|
15923
16184
|
enumerable: true,
|
|
15924
|
-
get: function () { return
|
|
16185
|
+
get: function () { return chunkUESTHN47_cjs.fts5Strategy; }
|
|
15925
16186
|
});
|
|
15926
16187
|
Object.defineProperty(exports, "notWhere", {
|
|
15927
16188
|
enumerable: true,
|
|
15928
|
-
get: function () { return
|
|
16189
|
+
get: function () { return chunkUESTHN47_cjs.notWhere; }
|
|
15929
16190
|
});
|
|
15930
16191
|
Object.defineProperty(exports, "orWhere", {
|
|
15931
16192
|
enumerable: true,
|
|
15932
|
-
get: function () { return
|
|
16193
|
+
get: function () { return chunkUESTHN47_cjs.orWhere; }
|
|
15933
16194
|
});
|
|
15934
16195
|
Object.defineProperty(exports, "tsvectorStrategy", {
|
|
15935
16196
|
enumerable: true,
|
|
15936
|
-
get: function () { return
|
|
16197
|
+
get: function () { return chunkUESTHN47_cjs.tsvectorStrategy; }
|
|
15937
16198
|
});
|
|
15938
16199
|
Object.defineProperty(exports, "defineEdgeIndex", {
|
|
15939
16200
|
enumerable: true,
|
|
15940
|
-
get: function () { return
|
|
16201
|
+
get: function () { return chunk4BXHVEFB_cjs.defineEdgeIndex; }
|
|
15941
16202
|
});
|
|
15942
16203
|
Object.defineProperty(exports, "defineNodeIndex", {
|
|
15943
16204
|
enumerable: true,
|
|
15944
|
-
get: function () { return
|
|
16205
|
+
get: function () { return chunk4BXHVEFB_cjs.defineNodeIndex; }
|
|
15945
16206
|
});
|
|
15946
16207
|
Object.defineProperty(exports, "DEFAULT_SEARCHABLE_LANGUAGE", {
|
|
15947
16208
|
enumerable: true,
|
|
15948
|
-
get: function () { return
|
|
16209
|
+
get: function () { return chunkYQGLVWB2_cjs.DEFAULT_SEARCHABLE_LANGUAGE; }
|
|
15949
16210
|
});
|
|
15950
16211
|
Object.defineProperty(exports, "getSearchableMetadata", {
|
|
15951
16212
|
enumerable: true,
|
|
15952
|
-
get: function () { return
|
|
16213
|
+
get: function () { return chunkYQGLVWB2_cjs.getSearchableMetadata; }
|
|
15953
16214
|
});
|
|
15954
16215
|
Object.defineProperty(exports, "isSearchableSchema", {
|
|
15955
16216
|
enumerable: true,
|
|
15956
|
-
get: function () { return
|
|
16217
|
+
get: function () { return chunkYQGLVWB2_cjs.isSearchableSchema; }
|
|
15957
16218
|
});
|
|
15958
16219
|
Object.defineProperty(exports, "searchable", {
|
|
15959
16220
|
enumerable: true,
|
|
15960
|
-
get: function () { return
|
|
16221
|
+
get: function () { return chunkYQGLVWB2_cjs.searchable; }
|
|
15961
16222
|
});
|
|
15962
16223
|
Object.defineProperty(exports, "embedding", {
|
|
15963
16224
|
enumerable: true,
|
|
@@ -15973,143 +16234,147 @@ Object.defineProperty(exports, "isEmbeddingSchema", {
|
|
|
15973
16234
|
});
|
|
15974
16235
|
Object.defineProperty(exports, "BackendDisposedError", {
|
|
15975
16236
|
enumerable: true,
|
|
15976
|
-
get: function () { return
|
|
16237
|
+
get: function () { return chunkJIEJCTDS_cjs.BackendDisposedError; }
|
|
15977
16238
|
});
|
|
15978
16239
|
Object.defineProperty(exports, "CardinalityError", {
|
|
15979
16240
|
enumerable: true,
|
|
15980
|
-
get: function () { return
|
|
16241
|
+
get: function () { return chunkJIEJCTDS_cjs.CardinalityError; }
|
|
15981
16242
|
});
|
|
15982
16243
|
Object.defineProperty(exports, "CompilerInvariantError", {
|
|
15983
16244
|
enumerable: true,
|
|
15984
|
-
get: function () { return
|
|
16245
|
+
get: function () { return chunkJIEJCTDS_cjs.CompilerInvariantError; }
|
|
15985
16246
|
});
|
|
15986
16247
|
Object.defineProperty(exports, "ConfigurationError", {
|
|
15987
16248
|
enumerable: true,
|
|
15988
|
-
get: function () { return
|
|
16249
|
+
get: function () { return chunkJIEJCTDS_cjs.ConfigurationError; }
|
|
15989
16250
|
});
|
|
15990
16251
|
Object.defineProperty(exports, "DatabaseOperationError", {
|
|
15991
16252
|
enumerable: true,
|
|
15992
|
-
get: function () { return
|
|
16253
|
+
get: function () { return chunkJIEJCTDS_cjs.DatabaseOperationError; }
|
|
15993
16254
|
});
|
|
15994
16255
|
Object.defineProperty(exports, "DisjointError", {
|
|
15995
16256
|
enumerable: true,
|
|
15996
|
-
get: function () { return
|
|
16257
|
+
get: function () { return chunkJIEJCTDS_cjs.DisjointError; }
|
|
15997
16258
|
});
|
|
15998
16259
|
Object.defineProperty(exports, "EagerMaterializationError", {
|
|
15999
16260
|
enumerable: true,
|
|
16000
|
-
get: function () { return
|
|
16261
|
+
get: function () { return chunkJIEJCTDS_cjs.EagerMaterializationError; }
|
|
16001
16262
|
});
|
|
16002
16263
|
Object.defineProperty(exports, "EdgeNotFoundError", {
|
|
16003
16264
|
enumerable: true,
|
|
16004
|
-
get: function () { return
|
|
16265
|
+
get: function () { return chunkJIEJCTDS_cjs.EdgeNotFoundError; }
|
|
16005
16266
|
});
|
|
16006
16267
|
Object.defineProperty(exports, "EmbeddingDimensionChangedError", {
|
|
16007
16268
|
enumerable: true,
|
|
16008
|
-
get: function () { return
|
|
16269
|
+
get: function () { return chunkJIEJCTDS_cjs.EmbeddingDimensionChangedError; }
|
|
16009
16270
|
});
|
|
16010
16271
|
Object.defineProperty(exports, "EndpointError", {
|
|
16011
16272
|
enumerable: true,
|
|
16012
|
-
get: function () { return
|
|
16273
|
+
get: function () { return chunkJIEJCTDS_cjs.EndpointError; }
|
|
16013
16274
|
});
|
|
16014
16275
|
Object.defineProperty(exports, "EndpointNotFoundError", {
|
|
16015
16276
|
enumerable: true,
|
|
16016
|
-
get: function () { return
|
|
16277
|
+
get: function () { return chunkJIEJCTDS_cjs.EndpointNotFoundError; }
|
|
16017
16278
|
});
|
|
16018
16279
|
Object.defineProperty(exports, "KindNotFoundError", {
|
|
16019
16280
|
enumerable: true,
|
|
16020
|
-
get: function () { return
|
|
16281
|
+
get: function () { return chunkJIEJCTDS_cjs.KindNotFoundError; }
|
|
16021
16282
|
});
|
|
16022
16283
|
Object.defineProperty(exports, "MigrationError", {
|
|
16023
16284
|
enumerable: true,
|
|
16024
|
-
get: function () { return
|
|
16285
|
+
get: function () { return chunkJIEJCTDS_cjs.MigrationError; }
|
|
16025
16286
|
});
|
|
16026
16287
|
Object.defineProperty(exports, "NodeConstraintNotFoundError", {
|
|
16027
16288
|
enumerable: true,
|
|
16028
|
-
get: function () { return
|
|
16289
|
+
get: function () { return chunkJIEJCTDS_cjs.NodeConstraintNotFoundError; }
|
|
16290
|
+
});
|
|
16291
|
+
Object.defineProperty(exports, "NodeIndexNotFoundError", {
|
|
16292
|
+
enumerable: true,
|
|
16293
|
+
get: function () { return chunkJIEJCTDS_cjs.NodeIndexNotFoundError; }
|
|
16029
16294
|
});
|
|
16030
16295
|
Object.defineProperty(exports, "NodeNotFoundError", {
|
|
16031
16296
|
enumerable: true,
|
|
16032
|
-
get: function () { return
|
|
16297
|
+
get: function () { return chunkJIEJCTDS_cjs.NodeNotFoundError; }
|
|
16033
16298
|
});
|
|
16034
16299
|
Object.defineProperty(exports, "RestrictedDeleteError", {
|
|
16035
16300
|
enumerable: true,
|
|
16036
|
-
get: function () { return
|
|
16301
|
+
get: function () { return chunkJIEJCTDS_cjs.RestrictedDeleteError; }
|
|
16037
16302
|
});
|
|
16038
16303
|
Object.defineProperty(exports, "SchemaContentConflictError", {
|
|
16039
16304
|
enumerable: true,
|
|
16040
|
-
get: function () { return
|
|
16305
|
+
get: function () { return chunkJIEJCTDS_cjs.SchemaContentConflictError; }
|
|
16041
16306
|
});
|
|
16042
16307
|
Object.defineProperty(exports, "SchemaMismatchError", {
|
|
16043
16308
|
enumerable: true,
|
|
16044
|
-
get: function () { return
|
|
16309
|
+
get: function () { return chunkJIEJCTDS_cjs.SchemaMismatchError; }
|
|
16045
16310
|
});
|
|
16046
16311
|
Object.defineProperty(exports, "StaleVersionError", {
|
|
16047
16312
|
enumerable: true,
|
|
16048
|
-
get: function () { return
|
|
16313
|
+
get: function () { return chunkJIEJCTDS_cjs.StaleVersionError; }
|
|
16049
16314
|
});
|
|
16050
16315
|
Object.defineProperty(exports, "StoreNotInitializedError", {
|
|
16051
16316
|
enumerable: true,
|
|
16052
|
-
get: function () { return
|
|
16317
|
+
get: function () { return chunkJIEJCTDS_cjs.StoreNotInitializedError; }
|
|
16053
16318
|
});
|
|
16054
16319
|
Object.defineProperty(exports, "TypeGraphError", {
|
|
16055
16320
|
enumerable: true,
|
|
16056
|
-
get: function () { return
|
|
16321
|
+
get: function () { return chunkJIEJCTDS_cjs.TypeGraphError; }
|
|
16057
16322
|
});
|
|
16058
16323
|
Object.defineProperty(exports, "UniquenessError", {
|
|
16059
16324
|
enumerable: true,
|
|
16060
|
-
get: function () { return
|
|
16325
|
+
get: function () { return chunkJIEJCTDS_cjs.UniquenessError; }
|
|
16061
16326
|
});
|
|
16062
16327
|
Object.defineProperty(exports, "UnsupportedPredicateError", {
|
|
16063
16328
|
enumerable: true,
|
|
16064
|
-
get: function () { return
|
|
16329
|
+
get: function () { return chunkJIEJCTDS_cjs.UnsupportedPredicateError; }
|
|
16065
16330
|
});
|
|
16066
16331
|
Object.defineProperty(exports, "ValidationError", {
|
|
16067
16332
|
enumerable: true,
|
|
16068
|
-
get: function () { return
|
|
16333
|
+
get: function () { return chunkJIEJCTDS_cjs.ValidationError; }
|
|
16069
16334
|
});
|
|
16070
16335
|
Object.defineProperty(exports, "VersionConflictError", {
|
|
16071
16336
|
enumerable: true,
|
|
16072
|
-
get: function () { return
|
|
16337
|
+
get: function () { return chunkJIEJCTDS_cjs.VersionConflictError; }
|
|
16073
16338
|
});
|
|
16074
16339
|
Object.defineProperty(exports, "getErrorSuggestion", {
|
|
16075
16340
|
enumerable: true,
|
|
16076
|
-
get: function () { return
|
|
16341
|
+
get: function () { return chunkJIEJCTDS_cjs.getErrorSuggestion; }
|
|
16077
16342
|
});
|
|
16078
16343
|
Object.defineProperty(exports, "isConstraintError", {
|
|
16079
16344
|
enumerable: true,
|
|
16080
|
-
get: function () { return
|
|
16345
|
+
get: function () { return chunkJIEJCTDS_cjs.isConstraintError; }
|
|
16081
16346
|
});
|
|
16082
16347
|
Object.defineProperty(exports, "isSystemError", {
|
|
16083
16348
|
enumerable: true,
|
|
16084
|
-
get: function () { return
|
|
16349
|
+
get: function () { return chunkJIEJCTDS_cjs.isSystemError; }
|
|
16085
16350
|
});
|
|
16086
16351
|
Object.defineProperty(exports, "isTypeGraphError", {
|
|
16087
16352
|
enumerable: true,
|
|
16088
|
-
get: function () { return
|
|
16353
|
+
get: function () { return chunkJIEJCTDS_cjs.isTypeGraphError; }
|
|
16089
16354
|
});
|
|
16090
16355
|
Object.defineProperty(exports, "isUserRecoverable", {
|
|
16091
16356
|
enumerable: true,
|
|
16092
|
-
get: function () { return
|
|
16357
|
+
get: function () { return chunkJIEJCTDS_cjs.isUserRecoverable; }
|
|
16093
16358
|
});
|
|
16094
16359
|
Object.defineProperty(exports, "MAX_JSON_POINTER_DEPTH", {
|
|
16095
16360
|
enumerable: true,
|
|
16096
|
-
get: function () { return
|
|
16361
|
+
get: function () { return chunkFLRCVI2G_cjs.MAX_JSON_POINTER_DEPTH; }
|
|
16097
16362
|
});
|
|
16098
16363
|
Object.defineProperty(exports, "joinJsonPointers", {
|
|
16099
16364
|
enumerable: true,
|
|
16100
|
-
get: function () { return
|
|
16365
|
+
get: function () { return chunkFLRCVI2G_cjs.joinJsonPointers; }
|
|
16101
16366
|
});
|
|
16102
16367
|
Object.defineProperty(exports, "jsonPointer", {
|
|
16103
16368
|
enumerable: true,
|
|
16104
|
-
get: function () { return
|
|
16369
|
+
get: function () { return chunkFLRCVI2G_cjs.jsonPointer; }
|
|
16105
16370
|
});
|
|
16106
16371
|
Object.defineProperty(exports, "normalizeJsonPointer", {
|
|
16107
16372
|
enumerable: true,
|
|
16108
|
-
get: function () { return
|
|
16373
|
+
get: function () { return chunkFLRCVI2G_cjs.normalizeJsonPointer; }
|
|
16109
16374
|
});
|
|
16110
16375
|
Object.defineProperty(exports, "parseJsonPointer", {
|
|
16111
16376
|
enumerable: true,
|
|
16112
|
-
get: function () { return
|
|
16377
|
+
get: function () { return chunkFLRCVI2G_cjs.parseJsonPointer; }
|
|
16113
16378
|
});
|
|
16114
16379
|
exports.DEFAULT_SQL_SCHEMA = DEFAULT_SQL_SCHEMA;
|
|
16115
16380
|
exports.ExecutableAggregateQuery = ExecutableAggregateQuery;
|