@nicia-ai/typegraph 0.35.0 → 0.36.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.js +6 -6
- package/dist/backend/postgres/pglite.cjs +11 -11
- package/dist/backend/postgres/pglite.js +6 -6
- package/dist/backend/sqlite/index.cjs +9 -9
- package/dist/backend/sqlite/index.js +6 -6
- package/dist/backend/sqlite/libsql.cjs +8 -8
- package/dist/backend/sqlite/libsql.js +6 -6
- package/dist/backend/sqlite/local.cjs +16 -16
- package/dist/backend/sqlite/local.js +6 -6
- package/dist/{chunk-VPYHY3LJ.cjs → chunk-2THZ3TQI.cjs} +11 -11
- package/dist/{chunk-VPYHY3LJ.cjs.map → chunk-2THZ3TQI.cjs.map} +1 -1
- package/dist/{chunk-EM3CWPND.cjs → chunk-456Z2U7Y.cjs} +51 -51
- package/dist/{chunk-EM3CWPND.cjs.map → chunk-456Z2U7Y.cjs.map} +1 -1
- package/dist/{chunk-GSQ6NPH6.cjs → chunk-4BCU6VFZ.cjs} +7 -7
- package/dist/{chunk-GSQ6NPH6.cjs.map → chunk-4BCU6VFZ.cjs.map} +1 -1
- package/dist/chunk-4BMPGT35.cjs +12 -0
- package/dist/{chunk-GUR2FNB5.cjs.map → chunk-4BMPGT35.cjs.map} +1 -1
- package/dist/{chunk-WJT7OU7E.cjs → chunk-4CAXEB2F.cjs} +124 -92
- package/dist/chunk-4CAXEB2F.cjs.map +1 -0
- package/dist/{chunk-WDBCBWC4.js → chunk-4GX2JJXS.js} +6 -6
- package/dist/{chunk-WDBCBWC4.js.map → chunk-4GX2JJXS.js.map} +1 -1
- package/dist/{chunk-UES55P7G.js → chunk-5DIPR3L3.js} +284 -154
- package/dist/chunk-5DIPR3L3.js.map +1 -0
- package/dist/{chunk-CZQ3FO2Q.js → chunk-5VTR2F2K.js} +49 -16
- package/dist/chunk-5VTR2F2K.js.map +1 -0
- package/dist/{chunk-CTTSDJLY.cjs → chunk-5W4L6DLF.cjs} +11 -11
- package/dist/{chunk-CTTSDJLY.cjs.map → chunk-5W4L6DLF.cjs.map} +1 -1
- package/dist/{chunk-J7WFGBJR.cjs → chunk-7BQLPXK6.cjs} +865 -735
- package/dist/chunk-7BQLPXK6.cjs.map +1 -0
- package/dist/{chunk-3TWF3SH4.js → chunk-BJVEU3ZL.js} +7 -7
- package/dist/{chunk-3TWF3SH4.js.map → chunk-BJVEU3ZL.js.map} +1 -1
- package/dist/{chunk-LGEALRC6.cjs → chunk-DIK74MXX.cjs} +18 -2
- package/dist/chunk-DIK74MXX.cjs.map +1 -0
- package/dist/{chunk-QNKSQTKQ.js → chunk-DN5VP4JC.js} +48 -17
- package/dist/chunk-DN5VP4JC.js.map +1 -0
- package/dist/{chunk-4JEZZJ6S.cjs → chunk-HW3LW7DH.cjs} +39 -39
- package/dist/{chunk-4JEZZJ6S.cjs.map → chunk-HW3LW7DH.cjs.map} +1 -1
- package/dist/{chunk-JBTOYDMN.js → chunk-IU46OHVW.js} +4 -4
- package/dist/{chunk-JBTOYDMN.js.map → chunk-IU46OHVW.js.map} +1 -1
- package/dist/{chunk-FL472AMI.cjs → chunk-J3LEGNQB.cjs} +8 -8
- package/dist/{chunk-FL472AMI.cjs.map → chunk-J3LEGNQB.cjs.map} +1 -1
- package/dist/{chunk-O7UN7OXA.cjs → chunk-JFMEONLG.cjs} +80 -80
- package/dist/{chunk-O7UN7OXA.cjs.map → chunk-JFMEONLG.cjs.map} +1 -1
- package/dist/{chunk-I7ZUZKFD.js → chunk-JFUPDJXD.js} +3 -3
- package/dist/{chunk-I7ZUZKFD.js.map → chunk-JFUPDJXD.js.map} +1 -1
- package/dist/{chunk-K3PPLHY7.js → chunk-M75SUBFG.js} +7 -7
- package/dist/{chunk-K3PPLHY7.js.map → chunk-M75SUBFG.js.map} +1 -1
- package/dist/{chunk-CK5BVQOW.cjs → chunk-PWGX5DF5.cjs} +79 -79
- package/dist/{chunk-CK5BVQOW.cjs.map → chunk-PWGX5DF5.cjs.map} +1 -1
- package/dist/{chunk-KMI7LYAF.js → chunk-PZKNKG5M.js} +8 -8
- package/dist/{chunk-KMI7LYAF.js.map → chunk-PZKNKG5M.js.map} +1 -1
- package/dist/{chunk-55MZDDZV.js → chunk-RAXU3RMB.js} +4 -4
- package/dist/{chunk-55MZDDZV.js.map → chunk-RAXU3RMB.js.map} +1 -1
- package/dist/{chunk-BLZDPRXT.cjs → chunk-RSSQKPSZ.cjs} +5 -5
- package/dist/{chunk-BLZDPRXT.cjs.map → chunk-RSSQKPSZ.cjs.map} +1 -1
- package/dist/{chunk-RGPG7EOJ.js → chunk-S5F7ZLP2.js} +3 -3
- package/dist/{chunk-RGPG7EOJ.js.map → chunk-S5F7ZLP2.js.map} +1 -1
- package/dist/{chunk-QWEUYILR.js → chunk-SKCOUWAX.js} +3 -3
- package/dist/{chunk-QWEUYILR.js.map → chunk-SKCOUWAX.js.map} +1 -1
- package/dist/{chunk-QOTI55H7.js → chunk-SXGE7ITL.js} +4 -4
- package/dist/{chunk-QOTI55H7.js.map → chunk-SXGE7ITL.js.map} +1 -1
- package/dist/{chunk-RGP33ZJ5.js → chunk-VQEXF5D4.js} +7 -7
- package/dist/{chunk-RGP33ZJ5.js.map → chunk-VQEXF5D4.js.map} +1 -1
- package/dist/{chunk-MP2JQKSG.js → chunk-WI7ISNQF.js} +17 -3
- package/dist/chunk-WI7ISNQF.js.map +1 -0
- package/dist/{chunk-4TOD4LBZ.cjs → chunk-X4JBT642.cjs} +29 -29
- package/dist/{chunk-4TOD4LBZ.cjs.map → chunk-X4JBT642.cjs.map} +1 -1
- package/dist/{chunk-EMF62TZG.cjs → chunk-ZAMFOJ5P.cjs} +86 -86
- package/dist/{chunk-EMF62TZG.cjs.map → chunk-ZAMFOJ5P.cjs.map} +1 -1
- package/dist/{chunk-VSPCZAXF.js → chunk-ZIGXMKQQ.js} +3 -3
- package/dist/{chunk-VSPCZAXF.js.map → chunk-ZIGXMKQQ.js.map} +1 -1
- package/dist/{chunk-XOX22WHL.cjs → chunk-ZUNQ5BEP.cjs} +104 -71
- package/dist/chunk-ZUNQ5BEP.cjs.map +1 -0
- 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/graph-merge/index.cjs +82 -82
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +2 -2
- package/dist/graph-merge/index.d.ts +2 -2
- package/dist/graph-merge/index.js +13 -13
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/{index-6CSUAq-x.d.ts → index-BFvdmBPV.d.ts} +68 -1
- package/dist/{index-Bks_3HHK.d.cts → index-BLtQWKRj.d.cts} +68 -1
- package/dist/index.cjs +144 -136
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +14 -14
- package/dist/interchange/index.cjs +27 -26
- package/dist/interchange/index.d.cts +1 -1
- package/dist/interchange/index.d.ts +1 -1
- package/dist/interchange/index.js +9 -8
- package/dist/profiler/index.d.cts +1 -1
- package/dist/profiler/index.d.ts +1 -1
- package/dist/provenance/index.cjs +31 -31
- package/dist/provenance/index.d.cts +1 -1
- package/dist/provenance/index.d.ts +1 -1
- package/dist/provenance/index.js +4 -4
- package/dist/schema/index.cjs +31 -31
- package/dist/schema/index.d.cts +1 -1
- package/dist/schema/index.d.ts +1 -1
- package/dist/schema/index.js +7 -7
- package/dist/{store-view-BSpqvAxK.d.cts → store-view-9KDOpZzF.d.cts} +250 -36
- package/dist/{store-view-CKbHFRnn.d.ts → store-view-DplHC3Nt.d.ts} +250 -36
- package/package.json +1 -1
- package/dist/chunk-CZQ3FO2Q.js.map +0 -1
- package/dist/chunk-GUR2FNB5.cjs +0 -12
- package/dist/chunk-J7WFGBJR.cjs.map +0 -1
- package/dist/chunk-LGEALRC6.cjs.map +0 -1
- package/dist/chunk-MP2JQKSG.js.map +0 -1
- package/dist/chunk-QNKSQTKQ.js.map +0 -1
- package/dist/chunk-UES55P7G.js.map +0 -1
- package/dist/chunk-WJT7OU7E.cjs.map +0 -1
- package/dist/chunk-XOX22WHL.cjs.map +0 -1
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
var chunkFN35DLCN_cjs = require('./chunk-FN35DLCN.cjs');
|
|
4
4
|
var chunkS55OV6PW_cjs = require('./chunk-S55OV6PW.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunk5W4L6DLF_cjs = require('./chunk-5W4L6DLF.cjs');
|
|
6
6
|
var chunkACSVZPK7_cjs = require('./chunk-ACSVZPK7.cjs');
|
|
7
7
|
var chunkTEDRJXOG_cjs = require('./chunk-TEDRJXOG.cjs');
|
|
8
8
|
var chunkD7ZEOS56_cjs = require('./chunk-D7ZEOS56.cjs');
|
|
9
|
-
var
|
|
10
|
-
var
|
|
9
|
+
var chunkX4JBT642_cjs = require('./chunk-X4JBT642.cjs');
|
|
10
|
+
var chunkRSSQKPSZ_cjs = require('./chunk-RSSQKPSZ.cjs');
|
|
11
11
|
var chunk7YSP4V4R_cjs = require('./chunk-7YSP4V4R.cjs');
|
|
12
|
-
var
|
|
12
|
+
var chunkDIK74MXX_cjs = require('./chunk-DIK74MXX.cjs');
|
|
13
13
|
var drizzleOrm = require('drizzle-orm');
|
|
14
14
|
var pgCore = require('drizzle-orm/pg-core');
|
|
15
15
|
var sqliteCore = require('drizzle-orm/sqlite-core');
|
|
@@ -748,10 +748,10 @@ function vectorSlotFromDropIndexParams(params) {
|
|
|
748
748
|
};
|
|
749
749
|
}
|
|
750
750
|
function mapVectorWriteError(error, params) {
|
|
751
|
-
const mismatch =
|
|
751
|
+
const mismatch = chunkRSSQKPSZ_cjs.parseDimensionMismatch(error);
|
|
752
752
|
if (mismatch === void 0) return error;
|
|
753
753
|
const attempted = mismatch.actual ?? "a different number of";
|
|
754
|
-
return new
|
|
754
|
+
return new chunkDIK74MXX_cjs.EmbeddingDimensionChangedError(
|
|
755
755
|
`Embedding "${params.nodeKind}.${params.fieldPath}" was written with ${attempted} dimensions, but its per-field storage expects ${mismatch.expected}. The field's embedding dimension changed; existing vectors must be recreated and re-embedded.`,
|
|
756
756
|
{
|
|
757
757
|
kind: params.nodeKind,
|
|
@@ -767,7 +767,7 @@ var SQLITE_CONTRIBUTION_MAT_TIMESTAMPS = {
|
|
|
767
767
|
encode: (value) => value
|
|
768
768
|
};
|
|
769
769
|
var POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS = {
|
|
770
|
-
decode:
|
|
770
|
+
decode: chunk5W4L6DLF_cjs.formatPostgresTimestamp,
|
|
771
771
|
encode: (value) => new Date(value)
|
|
772
772
|
};
|
|
773
773
|
function mapContributionMaterializationRow(row, decode) {
|
|
@@ -881,7 +881,7 @@ function gateFulltextMethods(source, assert) {
|
|
|
881
881
|
return gated;
|
|
882
882
|
}
|
|
883
883
|
function gateFulltext(tx, assert) {
|
|
884
|
-
return
|
|
884
|
+
return chunkX4JBT642_cjs.createBackendOverlay(
|
|
885
885
|
tx,
|
|
886
886
|
gateFulltextMethods(tx, assert)
|
|
887
887
|
);
|
|
@@ -911,13 +911,13 @@ function createContributionMaterializer(deps) {
|
|
|
911
911
|
await deps.recordMarker({
|
|
912
912
|
...identity,
|
|
913
913
|
signature,
|
|
914
|
-
attemptedAt:
|
|
914
|
+
attemptedAt: chunk5W4L6DLF_cjs.nowIso(),
|
|
915
915
|
materializedAt: void 0,
|
|
916
916
|
error: error.message
|
|
917
917
|
});
|
|
918
918
|
throw error;
|
|
919
919
|
}
|
|
920
|
-
const attemptedAt =
|
|
920
|
+
const attemptedAt = chunk5W4L6DLF_cjs.nowIso();
|
|
921
921
|
try {
|
|
922
922
|
for (const statement of contribution.createDdl) {
|
|
923
923
|
await deps.execDdl(statement);
|
|
@@ -954,7 +954,7 @@ function createContributionMaterializer(deps) {
|
|
|
954
954
|
state: evaluateContributionState(existing, signature)
|
|
955
955
|
};
|
|
956
956
|
} catch (error) {
|
|
957
|
-
if (!
|
|
957
|
+
if (!chunkRSSQKPSZ_cjs.isMissingTableError(error)) throw error;
|
|
958
958
|
return { kind: "missing-table", error };
|
|
959
959
|
}
|
|
960
960
|
}
|
|
@@ -983,13 +983,13 @@ function createContributionMaterializer(deps) {
|
|
|
983
983
|
for (const contribution of runtimeContributions()) {
|
|
984
984
|
const read = await readContributionState(graphId, contribution);
|
|
985
985
|
if (read.kind === "missing-table") {
|
|
986
|
-
throw new
|
|
986
|
+
throw new chunkDIK74MXX_cjs.StoreNotInitializedError(graphId, "missing", {
|
|
987
987
|
cause: read.error,
|
|
988
988
|
details: { logicalName: contribution.logicalName }
|
|
989
989
|
});
|
|
990
990
|
}
|
|
991
991
|
if (read.state !== "initialized") {
|
|
992
|
-
throw new
|
|
992
|
+
throw new chunkDIK74MXX_cjs.StoreNotInitializedError(graphId, read.state, {
|
|
993
993
|
details: { logicalName: contribution.logicalName }
|
|
994
994
|
});
|
|
995
995
|
}
|
|
@@ -1003,7 +1003,7 @@ var SQLITE_INDEX_MAT_TIMESTAMPS = {
|
|
|
1003
1003
|
encode: (value) => value
|
|
1004
1004
|
};
|
|
1005
1005
|
var POSTGRES_INDEX_MAT_TIMESTAMPS = {
|
|
1006
|
-
decode:
|
|
1006
|
+
decode: chunk5W4L6DLF_cjs.formatPostgresTimestamp,
|
|
1007
1007
|
encode: (value) => new Date(value)
|
|
1008
1008
|
};
|
|
1009
1009
|
function mapMaterializationRow(row, decode) {
|
|
@@ -1056,7 +1056,7 @@ var SQLITE_KIND_REMOVAL_TIMESTAMPS = {
|
|
|
1056
1056
|
encode: (value) => value
|
|
1057
1057
|
};
|
|
1058
1058
|
var POSTGRES_KIND_REMOVAL_TIMESTAMPS = {
|
|
1059
|
-
decode:
|
|
1059
|
+
decode: chunk5W4L6DLF_cjs.formatPostgresTimestamp,
|
|
1060
1060
|
encode: (value) => new Date(value)
|
|
1061
1061
|
};
|
|
1062
1062
|
function mapKindRemovalRow(row, decode) {
|
|
@@ -1188,12 +1188,12 @@ function present(value) {
|
|
|
1188
1188
|
function mapHybridSearchRow(row, toNodeRow) {
|
|
1189
1189
|
return {
|
|
1190
1190
|
node: toNodeRow(row),
|
|
1191
|
-
fusedScore:
|
|
1191
|
+
fusedScore: chunk5W4L6DLF_cjs.coerceNumericScore(row.fused_score),
|
|
1192
1192
|
...present(row.vector_rank) ? { vectorRank: Number(row.vector_rank) } : {},
|
|
1193
|
-
...present(row.vector_score) ? { vectorScore:
|
|
1193
|
+
...present(row.vector_score) ? { vectorScore: chunk5W4L6DLF_cjs.coerceNumericScore(row.vector_score) } : {},
|
|
1194
1194
|
...present(row.fulltext_rank) ? { fulltextRank: Number(row.fulltext_rank) } : {},
|
|
1195
1195
|
...present(row.fulltext_score) ? {
|
|
1196
|
-
fulltextScore:
|
|
1196
|
+
fulltextScore: chunk5W4L6DLF_cjs.coerceNumericScore(
|
|
1197
1197
|
row.fulltext_score
|
|
1198
1198
|
)
|
|
1199
1199
|
} : {},
|
|
@@ -1447,7 +1447,7 @@ function buildGetEdges(tables3, graphId, ids) {
|
|
|
1447
1447
|
return drizzleOrm.sql`
|
|
1448
1448
|
SELECT * FROM ${edges2}
|
|
1449
1449
|
WHERE ${edges2.graphId} = ${graphId}
|
|
1450
|
-
AND ${edges2.id} IN (${
|
|
1450
|
+
AND ${edges2.id} IN (${chunkX4JBT642_cjs.sqlValueList(ids)})
|
|
1451
1451
|
`;
|
|
1452
1452
|
}
|
|
1453
1453
|
function buildUpdateEdge(tables3, params, timestamp2) {
|
|
@@ -1498,7 +1498,7 @@ function buildDeleteEdgesBatch(tables3, params, timestamp2) {
|
|
|
1498
1498
|
UPDATE ${edges2}
|
|
1499
1499
|
SET ${chunk7YSP4V4R_cjs.quotedColumn(edges2.deletedAt)} = ${timestamp2}
|
|
1500
1500
|
WHERE ${edges2.graphId} = ${params.graphId}
|
|
1501
|
-
AND ${edges2.id} IN (${
|
|
1501
|
+
AND ${edges2.id} IN (${chunkX4JBT642_cjs.sqlValueList(params.ids)})
|
|
1502
1502
|
AND ${edges2.deletedAt} IS NULL
|
|
1503
1503
|
`;
|
|
1504
1504
|
}
|
|
@@ -1507,7 +1507,7 @@ function buildHardDeleteEdgesBatch(tables3, params) {
|
|
|
1507
1507
|
return drizzleOrm.sql`
|
|
1508
1508
|
DELETE FROM ${edges2}
|
|
1509
1509
|
WHERE ${edges2.graphId} = ${params.graphId}
|
|
1510
|
-
AND ${edges2.id} IN (${
|
|
1510
|
+
AND ${edges2.id} IN (${chunkX4JBT642_cjs.sqlValueList(params.ids)})
|
|
1511
1511
|
`;
|
|
1512
1512
|
}
|
|
1513
1513
|
function buildHardDeleteEdge(tables3, params) {
|
|
@@ -1710,7 +1710,7 @@ function buildGetNodes(tables3, graphId, kind, ids) {
|
|
|
1710
1710
|
SELECT * FROM ${nodes2}
|
|
1711
1711
|
WHERE ${nodes2.graphId} = ${graphId}
|
|
1712
1712
|
AND ${nodes2.kind} = ${kind}
|
|
1713
|
-
AND ${nodes2.id} IN (${
|
|
1713
|
+
AND ${nodes2.id} IN (${chunkX4JBT642_cjs.sqlValueList(ids)})
|
|
1714
1714
|
`;
|
|
1715
1715
|
}
|
|
1716
1716
|
function buildUpdateNode(tables3, params, timestamp2) {
|
|
@@ -2081,15 +2081,15 @@ function createCommonOperationStrategy(tables3, dialect, fulltextStrategy) {
|
|
|
2081
2081
|
dialect,
|
|
2082
2082
|
// Store-compiled candidates (predicates + subclass + currency)
|
|
2083
2083
|
// take precedence; the live-node default covers direct backend use.
|
|
2084
|
-
params.candidates ?? chunk7YSP4V4R_cjs.liveNodeIdsSubquery(tables3.nodes, params.graphId, params.nodeKind,
|
|
2084
|
+
params.candidates ?? chunk7YSP4V4R_cjs.liveNodeIdsSubquery(tables3.nodes, params.graphId, params.nodeKind, chunk5W4L6DLF_cjs.nowIso())
|
|
2085
2085
|
),
|
|
2086
|
-
buildLiveNodeIds: (graphId, nodeKind) => chunk7YSP4V4R_cjs.liveNodeIdsSubquery(tables3.nodes, graphId, nodeKind,
|
|
2086
|
+
buildLiveNodeIds: (graphId, nodeKind) => chunk7YSP4V4R_cjs.liveNodeIdsSubquery(tables3.nodes, graphId, nodeKind, chunk5W4L6DLF_cjs.nowIso()),
|
|
2087
2087
|
buildHybridSearch: (params, vectorSql, vectorScoreDescending) => {
|
|
2088
2088
|
const candidates = params.candidates ?? chunk7YSP4V4R_cjs.liveNodeIdsSubquery(
|
|
2089
2089
|
tables3.nodes,
|
|
2090
2090
|
params.graphId,
|
|
2091
2091
|
params.nodeKind,
|
|
2092
|
-
|
|
2092
|
+
chunk5W4L6DLF_cjs.nowIso()
|
|
2093
2093
|
);
|
|
2094
2094
|
const fulltextSql = buildFulltextSearch(
|
|
2095
2095
|
fulltextTable,
|
|
@@ -2164,7 +2164,7 @@ function createCommonOperationStrategy(tables3, dialect, fulltextStrategy) {
|
|
|
2164
2164
|
}
|
|
2165
2165
|
function tableExistsFromRow(row) {
|
|
2166
2166
|
if (row === void 0) return false;
|
|
2167
|
-
return Object.values(row).some((value) =>
|
|
2167
|
+
return Object.values(row).some((value) => chunkX4JBT642_cjs.isPresent(value));
|
|
2168
2168
|
}
|
|
2169
2169
|
function createCachedTableExistence(probe, options) {
|
|
2170
2170
|
const cacheExisting = options?.cacheExisting !== false;
|
|
@@ -2193,7 +2193,7 @@ function createPostgresOperationStrategy(tables3, fulltextStrategy) {
|
|
|
2193
2193
|
function assertAdoptedDialect(externalTx, brand, backend) {
|
|
2194
2194
|
if (drizzleOrm.is(externalTx, brand)) return;
|
|
2195
2195
|
const label = backend === "postgres" ? "Postgres" : "SQLite";
|
|
2196
|
-
throw new
|
|
2196
|
+
throw new chunkDIK74MXX_cjs.ConfigurationError(
|
|
2197
2197
|
`adoptTransaction received a handle that is not a ${label} Drizzle transaction. Pass the \`tx\` from a ${label} \`db.transaction(...)\` opened on this backend's connection.`,
|
|
2198
2198
|
{ backend, capability: "adoptTransaction" }
|
|
2199
2199
|
);
|
|
@@ -2201,7 +2201,7 @@ function assertAdoptedDialect(externalTx, brand, backend) {
|
|
|
2201
2201
|
function verifyExpectedActiveVersion(graphId, expected, actualActiveVersion) {
|
|
2202
2202
|
const expectedVersion = expected.kind === "active" ? expected.version : 0;
|
|
2203
2203
|
if (actualActiveVersion !== expectedVersion) {
|
|
2204
|
-
throw new
|
|
2204
|
+
throw new chunkDIK74MXX_cjs.StaleVersionError({
|
|
2205
2205
|
graphId,
|
|
2206
2206
|
expected: expectedVersion,
|
|
2207
2207
|
actual: actualActiveVersion
|
|
@@ -2210,7 +2210,7 @@ function verifyExpectedActiveVersion(graphId, expected, actualActiveVersion) {
|
|
|
2210
2210
|
}
|
|
2211
2211
|
function createCommonOperationBackend(options) {
|
|
2212
2212
|
const { batchConfig, execution, operationStrategy, rowMappers } = options;
|
|
2213
|
-
const nowIso2 = options.nowIso ??
|
|
2213
|
+
const nowIso2 = options.nowIso ?? chunk5W4L6DLF_cjs.nowIso;
|
|
2214
2214
|
const requiredClearTableExists = createCachedTableExistence(
|
|
2215
2215
|
(tableName) => execution.execGet(
|
|
2216
2216
|
operationStrategy.buildTableExists(tableName)
|
|
@@ -2237,7 +2237,7 @@ function createCommonOperationBackend(options) {
|
|
|
2237
2237
|
const timestamp2 = nowIso2();
|
|
2238
2238
|
const query = operationStrategy.buildInsertNode(params, timestamp2);
|
|
2239
2239
|
const row = await execution.execGet(query);
|
|
2240
|
-
if (!row) throw new
|
|
2240
|
+
if (!row) throw new chunkDIK74MXX_cjs.DatabaseOperationError("Insert node failed: no row returned", { operation: "insert", entity: "node" });
|
|
2241
2241
|
return rowMappers.toNodeRow(row);
|
|
2242
2242
|
},
|
|
2243
2243
|
async insertNodeNoReturn(params) {
|
|
@@ -2250,7 +2250,7 @@ function createCommonOperationBackend(options) {
|
|
|
2250
2250
|
return;
|
|
2251
2251
|
}
|
|
2252
2252
|
const timestamp2 = nowIso2();
|
|
2253
|
-
for (const chunk2 of
|
|
2253
|
+
for (const chunk2 of chunkX4JBT642_cjs.chunk(params, batchConfig.nodeInsertBatchSize)) {
|
|
2254
2254
|
const query = operationStrategy.buildInsertNodesBatch(chunk2, timestamp2);
|
|
2255
2255
|
await execution.execRun(query);
|
|
2256
2256
|
}
|
|
@@ -2261,7 +2261,7 @@ function createCommonOperationBackend(options) {
|
|
|
2261
2261
|
}
|
|
2262
2262
|
const timestamp2 = nowIso2();
|
|
2263
2263
|
const allRows = [];
|
|
2264
|
-
for (const chunk2 of
|
|
2264
|
+
for (const chunk2 of chunkX4JBT642_cjs.chunk(params, batchConfig.nodeInsertBatchSize)) {
|
|
2265
2265
|
const query = operationStrategy.buildInsertNodesBatchReturning(chunk2, timestamp2);
|
|
2266
2266
|
const rows = await execution.execAll(query);
|
|
2267
2267
|
allRows.push(...rows.map((row) => rowMappers.toNodeRow(row)));
|
|
@@ -2276,7 +2276,7 @@ function createCommonOperationBackend(options) {
|
|
|
2276
2276
|
async getNodes(graphId, kind, ids) {
|
|
2277
2277
|
if (ids.length === 0) return [];
|
|
2278
2278
|
const allRows = [];
|
|
2279
|
-
for (const chunk2 of
|
|
2279
|
+
for (const chunk2 of chunkX4JBT642_cjs.chunk(ids, batchConfig.getNodesChunkSize)) {
|
|
2280
2280
|
const query = operationStrategy.buildGetNodes(graphId, kind, chunk2);
|
|
2281
2281
|
const rows = await execution.execAll(query);
|
|
2282
2282
|
allRows.push(...rows.map((row) => rowMappers.toNodeRow(row)));
|
|
@@ -2287,7 +2287,7 @@ function createCommonOperationBackend(options) {
|
|
|
2287
2287
|
const timestamp2 = nowIso2();
|
|
2288
2288
|
const query = operationStrategy.buildUpdateNode(params, timestamp2);
|
|
2289
2289
|
const row = await execution.execGet(query);
|
|
2290
|
-
if (!row) throw new
|
|
2290
|
+
if (!row) throw new chunkDIK74MXX_cjs.DatabaseOperationError("Update node failed: no row returned", { operation: "update", entity: "node" });
|
|
2291
2291
|
return rowMappers.toNodeRow(row);
|
|
2292
2292
|
},
|
|
2293
2293
|
async deleteNode(params) {
|
|
@@ -2331,7 +2331,7 @@ function createCommonOperationBackend(options) {
|
|
|
2331
2331
|
const timestamp2 = nowIso2();
|
|
2332
2332
|
const query = operationStrategy.buildInsertEdge(params, timestamp2);
|
|
2333
2333
|
const row = await execution.execGet(query);
|
|
2334
|
-
if (!row) throw new
|
|
2334
|
+
if (!row) throw new chunkDIK74MXX_cjs.DatabaseOperationError("Insert edge failed: no row returned", { operation: "insert", entity: "edge" });
|
|
2335
2335
|
return rowMappers.toEdgeRow(row);
|
|
2336
2336
|
},
|
|
2337
2337
|
async insertEdgeNoReturn(params) {
|
|
@@ -2344,7 +2344,7 @@ function createCommonOperationBackend(options) {
|
|
|
2344
2344
|
return;
|
|
2345
2345
|
}
|
|
2346
2346
|
const timestamp2 = nowIso2();
|
|
2347
|
-
for (const chunk2 of
|
|
2347
|
+
for (const chunk2 of chunkX4JBT642_cjs.chunk(params, batchConfig.edgeInsertBatchSize)) {
|
|
2348
2348
|
const query = operationStrategy.buildInsertEdgesBatch(chunk2, timestamp2);
|
|
2349
2349
|
await execution.execRun(query);
|
|
2350
2350
|
}
|
|
@@ -2355,7 +2355,7 @@ function createCommonOperationBackend(options) {
|
|
|
2355
2355
|
}
|
|
2356
2356
|
const timestamp2 = nowIso2();
|
|
2357
2357
|
const allRows = [];
|
|
2358
|
-
for (const chunk2 of
|
|
2358
|
+
for (const chunk2 of chunkX4JBT642_cjs.chunk(params, batchConfig.edgeInsertBatchSize)) {
|
|
2359
2359
|
const query = operationStrategy.buildInsertEdgesBatchReturning(chunk2, timestamp2);
|
|
2360
2360
|
const rows = await execution.execAll(query);
|
|
2361
2361
|
allRows.push(...rows.map((row) => rowMappers.toEdgeRow(row)));
|
|
@@ -2370,7 +2370,7 @@ function createCommonOperationBackend(options) {
|
|
|
2370
2370
|
async getEdges(graphId, ids) {
|
|
2371
2371
|
if (ids.length === 0) return [];
|
|
2372
2372
|
const allRows = [];
|
|
2373
|
-
for (const chunk2 of
|
|
2373
|
+
for (const chunk2 of chunkX4JBT642_cjs.chunk(ids, batchConfig.getEdgesChunkSize)) {
|
|
2374
2374
|
const query = operationStrategy.buildGetEdges(graphId, chunk2);
|
|
2375
2375
|
const rows = await execution.execAll(query);
|
|
2376
2376
|
allRows.push(...rows.map((row) => rowMappers.toEdgeRow(row)));
|
|
@@ -2381,7 +2381,7 @@ function createCommonOperationBackend(options) {
|
|
|
2381
2381
|
const timestamp2 = nowIso2();
|
|
2382
2382
|
const query = operationStrategy.buildUpdateEdge(params, timestamp2);
|
|
2383
2383
|
const row = await execution.execGet(query);
|
|
2384
|
-
if (!row) throw new
|
|
2384
|
+
if (!row) throw new chunkDIK74MXX_cjs.DatabaseOperationError("Update edge failed: no row returned", { operation: "update", entity: "edge" });
|
|
2385
2385
|
return rowMappers.toEdgeRow(row);
|
|
2386
2386
|
},
|
|
2387
2387
|
async deleteEdge(params) {
|
|
@@ -2397,7 +2397,7 @@ function createCommonOperationBackend(options) {
|
|
|
2397
2397
|
if (params.ids.length === 0) return;
|
|
2398
2398
|
const timestamp2 = nowIso2();
|
|
2399
2399
|
const softDeleteChunkSize = Math.max(1, batchConfig.getEdgesChunkSize - 1);
|
|
2400
|
-
for (const chunk2 of
|
|
2400
|
+
for (const chunk2 of chunkX4JBT642_cjs.chunk(params.ids, softDeleteChunkSize)) {
|
|
2401
2401
|
const query = operationStrategy.buildDeleteEdgesBatch(
|
|
2402
2402
|
{ graphId: params.graphId, ids: chunk2 },
|
|
2403
2403
|
timestamp2
|
|
@@ -2407,7 +2407,7 @@ function createCommonOperationBackend(options) {
|
|
|
2407
2407
|
},
|
|
2408
2408
|
async hardDeleteEdgesBatch(params) {
|
|
2409
2409
|
if (params.ids.length === 0) return;
|
|
2410
|
-
for (const chunk2 of
|
|
2410
|
+
for (const chunk2 of chunkX4JBT642_cjs.chunk(params.ids, batchConfig.getEdgesChunkSize)) {
|
|
2411
2411
|
const query = operationStrategy.buildHardDeleteEdgesBatch({
|
|
2412
2412
|
graphId: params.graphId,
|
|
2413
2413
|
ids: chunk2
|
|
@@ -2454,7 +2454,7 @@ function createCommonOperationBackend(options) {
|
|
|
2454
2454
|
const query = operationStrategy.buildInsertUnique(params);
|
|
2455
2455
|
const result = await execution.execGet(query);
|
|
2456
2456
|
if (result && result.node_id !== params.nodeId) {
|
|
2457
|
-
throw new
|
|
2457
|
+
throw new chunkDIK74MXX_cjs.UniquenessError({
|
|
2458
2458
|
constraintName: params.constraintName,
|
|
2459
2459
|
kind: params.nodeKind,
|
|
2460
2460
|
existingId: result.node_id,
|
|
@@ -2474,7 +2474,7 @@ function createCommonOperationBackend(options) {
|
|
|
2474
2474
|
continue;
|
|
2475
2475
|
}
|
|
2476
2476
|
if (existing.nodeId !== entry.nodeId) {
|
|
2477
|
-
throw new
|
|
2477
|
+
throw new chunkDIK74MXX_cjs.UniquenessError({
|
|
2478
2478
|
constraintName: entry.constraintName,
|
|
2479
2479
|
kind: entry.nodeKind,
|
|
2480
2480
|
existingId: existing.nodeId,
|
|
@@ -2484,7 +2484,7 @@ function createCommonOperationBackend(options) {
|
|
|
2484
2484
|
}
|
|
2485
2485
|
}
|
|
2486
2486
|
const deduped = [...byTarget.values()];
|
|
2487
|
-
for (const chunk2 of
|
|
2487
|
+
for (const chunk2 of chunkX4JBT642_cjs.chunk(
|
|
2488
2488
|
deduped,
|
|
2489
2489
|
batchConfig.uniqueInsertBatchSize
|
|
2490
2490
|
)) {
|
|
@@ -2499,7 +2499,7 @@ function createCommonOperationBackend(options) {
|
|
|
2499
2499
|
for (const entry of chunk2) {
|
|
2500
2500
|
const owner = ownerByTarget.get(targetKey(entry));
|
|
2501
2501
|
if (owner !== void 0 && owner !== entry.nodeId) {
|
|
2502
|
-
throw new
|
|
2502
|
+
throw new chunkDIK74MXX_cjs.UniquenessError({
|
|
2503
2503
|
constraintName: entry.constraintName,
|
|
2504
2504
|
kind: entry.nodeKind,
|
|
2505
2505
|
existingId: owner,
|
|
@@ -2523,7 +2523,7 @@ function createCommonOperationBackend(options) {
|
|
|
2523
2523
|
async checkUniqueBatch(params) {
|
|
2524
2524
|
if (params.keys.length === 0) return [];
|
|
2525
2525
|
const allRows = [];
|
|
2526
|
-
for (const chunk2 of
|
|
2526
|
+
for (const chunk2 of chunkX4JBT642_cjs.chunk(params.keys, batchConfig.checkUniqueBatchChunkSize)) {
|
|
2527
2527
|
const query = operationStrategy.buildCheckUniqueBatch({ ...params, keys: chunk2 });
|
|
2528
2528
|
const rows = await execution.execAll(query);
|
|
2529
2529
|
allRows.push(...rows.map((row) => rowMappers.toUniqueRow(row)));
|
|
@@ -2551,7 +2551,7 @@ function createCommonOperationBackend(options) {
|
|
|
2551
2551
|
if (existingRaw !== void 0) {
|
|
2552
2552
|
const existing = rowMappers.toSchemaVersionRow(existingRaw);
|
|
2553
2553
|
if (existing.schema_hash !== params.schemaHash) {
|
|
2554
|
-
throw new
|
|
2554
|
+
throw new chunkDIK74MXX_cjs.SchemaContentConflictError({
|
|
2555
2555
|
graphId: params.graphId,
|
|
2556
2556
|
version: params.version,
|
|
2557
2557
|
existingHash: existing.schema_hash,
|
|
@@ -2599,7 +2599,7 @@ function createCommonOperationBackend(options) {
|
|
|
2599
2599
|
);
|
|
2600
2600
|
const insertedRaw = await execution.execGet(insertQuery);
|
|
2601
2601
|
if (!insertedRaw) {
|
|
2602
|
-
throw new
|
|
2602
|
+
throw new chunkDIK74MXX_cjs.DatabaseOperationError(
|
|
2603
2603
|
"Insert schema failed: no row returned",
|
|
2604
2604
|
{ operation: "insert", entity: "schema" }
|
|
2605
2605
|
);
|
|
@@ -2620,7 +2620,7 @@ function createCommonOperationBackend(options) {
|
|
|
2620
2620
|
)
|
|
2621
2621
|
);
|
|
2622
2622
|
if (!targetRaw) {
|
|
2623
|
-
throw new
|
|
2623
|
+
throw new chunkDIK74MXX_cjs.MigrationError(
|
|
2624
2624
|
`Cannot activate version ${params.version}: version does not exist for graph "${params.graphId}".`,
|
|
2625
2625
|
{
|
|
2626
2626
|
graphId: params.graphId,
|
|
@@ -2721,5 +2721,5 @@ exports.uniques = uniques;
|
|
|
2721
2721
|
exports.vectorSlotFromCreateIndexParams = vectorSlotFromCreateIndexParams;
|
|
2722
2722
|
exports.vectorSlotFromDropIndexParams = vectorSlotFromDropIndexParams;
|
|
2723
2723
|
exports.vectorSlotFromParams = vectorSlotFromParams;
|
|
2724
|
-
//# sourceMappingURL=chunk-
|
|
2725
|
-
//# sourceMappingURL=chunk-
|
|
2724
|
+
//# sourceMappingURL=chunk-456Z2U7Y.cjs.map
|
|
2725
|
+
//# sourceMappingURL=chunk-456Z2U7Y.cjs.map
|