@nicia-ai/typegraph 0.65.0 → 0.66.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/CHANGELOG.md +17 -0
- package/dist/{atomic-mutation-program-BznZQ06C.d.ts → atomic-mutation-program-BhP75Qn0.d.ts} +1 -1
- package/dist/{atomic-mutation-program-Bfu5z-je.d.cts → atomic-mutation-program-DMdmc4s0.d.cts} +1 -1
- package/dist/backend/drizzle/engine/index.cjs +13 -13
- package/dist/backend/drizzle/engine/index.d.cts +9 -9
- package/dist/backend/drizzle/engine/index.d.ts +9 -9
- package/dist/backend/drizzle/engine/index.js +8 -8
- package/dist/backend/drizzle/indexes.d.cts +1 -1
- package/dist/backend/drizzle/indexes.d.ts +1 -1
- package/dist/backend/index.cjs +91 -91
- package/dist/backend/index.d.cts +7 -7
- package/dist/backend/index.d.ts +7 -7
- package/dist/backend/index.js +8 -8
- package/dist/backend/postgres/index.cjs +23 -23
- package/dist/backend/postgres/index.d.cts +8 -8
- package/dist/backend/postgres/index.d.ts +8 -8
- package/dist/backend/postgres/index.js +8 -8
- package/dist/backend/postgres/pglite-store.cjs +1 -1
- package/dist/backend/postgres/pglite-store.d.cts +6 -6
- package/dist/backend/postgres/pglite-store.d.ts +6 -6
- package/dist/backend/postgres/pglite-store.js +1 -1
- package/dist/backend/postgres/pglite.cjs +10 -10
- package/dist/backend/postgres/pglite.d.cts +3 -3
- package/dist/backend/postgres/pglite.d.ts +3 -3
- package/dist/backend/postgres/pglite.js +9 -9
- package/dist/backend/sqlite/index.cjs +21 -21
- package/dist/backend/sqlite/index.d.cts +7 -7
- package/dist/backend/sqlite/index.d.ts +7 -7
- package/dist/backend/sqlite/index.js +8 -8
- package/dist/backend/sqlite/libsql.cjs +14 -14
- package/dist/backend/sqlite/libsql.d.cts +3 -3
- package/dist/backend/sqlite/libsql.d.ts +3 -3
- package/dist/backend/sqlite/libsql.js +8 -8
- package/dist/backend/sqlite/local-store.cjs +1 -1
- package/dist/backend/sqlite/local-store.d.cts +6 -6
- package/dist/backend/sqlite/local-store.d.ts +6 -6
- package/dist/backend/sqlite/local-store.js +1 -1
- package/dist/backend/sqlite/local.cjs +10 -10
- package/dist/backend/sqlite/local.d.cts +3 -3
- package/dist/backend/sqlite/local.d.ts +3 -3
- package/dist/backend/sqlite/local.js +9 -9
- package/dist/{chunk-337ONI2I.js → chunk-3SUZXB5X.js} +146 -80
- package/dist/chunk-3SUZXB5X.js.map +1 -0
- package/dist/{chunk-4VTCIEK3.js → chunk-4TQOIBWH.js} +3 -3
- package/dist/{chunk-4VTCIEK3.js.map → chunk-4TQOIBWH.js.map} +1 -1
- package/dist/{chunk-JRWKRBI5.cjs → chunk-5JOCIMQ3.cjs} +6 -6
- package/dist/{chunk-JRWKRBI5.cjs.map → chunk-5JOCIMQ3.cjs.map} +1 -1
- package/dist/{chunk-BWQA3POT.cjs → chunk-6B3LQUYG.cjs} +206 -138
- package/dist/chunk-6B3LQUYG.cjs.map +1 -0
- package/dist/{chunk-RQPCUHIH.js → chunk-6ECNYQDW.js} +3 -3
- package/dist/{chunk-RQPCUHIH.js.map → chunk-6ECNYQDW.js.map} +1 -1
- package/dist/{chunk-OLB75LRQ.js → chunk-6GKKAQMW.js} +5 -5
- package/dist/{chunk-OLB75LRQ.js.map → chunk-6GKKAQMW.js.map} +1 -1
- package/dist/{chunk-OC5ROP7V.cjs → chunk-6JRVV2SS.cjs} +8 -2
- package/dist/chunk-6JRVV2SS.cjs.map +1 -0
- package/dist/{chunk-JERQGJKG.cjs → chunk-732VS5PW.cjs} +18 -18
- package/dist/{chunk-JERQGJKG.cjs.map → chunk-732VS5PW.cjs.map} +1 -1
- package/dist/{chunk-DSX3P4S5.cjs → chunk-76OB5RSH.cjs} +6 -6
- package/dist/{chunk-DSX3P4S5.cjs.map → chunk-76OB5RSH.cjs.map} +1 -1
- package/dist/{chunk-DHRLOQLQ.cjs → chunk-7LQTDGV5.cjs} +11 -11
- package/dist/{chunk-DHRLOQLQ.cjs.map → chunk-7LQTDGV5.cjs.map} +1 -1
- package/dist/{chunk-Q25QYSOH.js → chunk-7YJHUY4T.js} +9 -9
- package/dist/{chunk-Q25QYSOH.js.map → chunk-7YJHUY4T.js.map} +1 -1
- package/dist/{chunk-BBOMNH44.js → chunk-BABP4D5B.js} +3 -3
- package/dist/{chunk-BBOMNH44.js.map → chunk-BABP4D5B.js.map} +1 -1
- package/dist/{chunk-EVGZ2TRQ.js → chunk-BE75G3M5.js} +3 -3
- package/dist/{chunk-EVGZ2TRQ.js.map → chunk-BE75G3M5.js.map} +1 -1
- package/dist/{chunk-FXGZT3WO.cjs → chunk-BX42F7IJ.cjs} +41 -41
- package/dist/{chunk-FXGZT3WO.cjs.map → chunk-BX42F7IJ.cjs.map} +1 -1
- package/dist/{chunk-VROJKWZ7.js → chunk-C3HNC3S6.js} +5 -5
- package/dist/{chunk-VROJKWZ7.js.map → chunk-C3HNC3S6.js.map} +1 -1
- package/dist/{chunk-G6T23JU7.js → chunk-CDKNGCE7.js} +3 -3
- package/dist/{chunk-G6T23JU7.js.map → chunk-CDKNGCE7.js.map} +1 -1
- package/dist/{chunk-BNTJ5YFO.cjs → chunk-EACDHXJL.cjs} +4 -4
- package/dist/{chunk-BNTJ5YFO.cjs.map → chunk-EACDHXJL.cjs.map} +1 -1
- package/dist/{chunk-SNDJUTMB.cjs → chunk-EBQX7MYL.cjs} +72 -72
- package/dist/{chunk-SNDJUTMB.cjs.map → chunk-EBQX7MYL.cjs.map} +1 -1
- package/dist/{chunk-GKSAEUX6.js → chunk-FXOFJ4FS.js} +7 -7
- package/dist/{chunk-GKSAEUX6.js.map → chunk-FXOFJ4FS.js.map} +1 -1
- package/dist/{chunk-ZOWRACZQ.cjs → chunk-G7OKJDMG.cjs} +5 -5
- package/dist/{chunk-ZOWRACZQ.cjs.map → chunk-G7OKJDMG.cjs.map} +1 -1
- package/dist/{chunk-VZRXXABW.js → chunk-HSLP6CVG.js} +5 -5
- package/dist/{chunk-VZRXXABW.js.map → chunk-HSLP6CVG.js.map} +1 -1
- package/dist/{chunk-MKJPBSID.cjs → chunk-I7SBZJI2.cjs} +4 -4
- package/dist/{chunk-MKJPBSID.cjs.map → chunk-I7SBZJI2.cjs.map} +1 -1
- package/dist/{chunk-H346QK3V.cjs → chunk-K7YACILO.cjs} +9 -9
- package/dist/{chunk-H346QK3V.cjs.map → chunk-K7YACILO.cjs.map} +1 -1
- package/dist/{chunk-L2GBVYRU.cjs → chunk-MGCPSR4C.cjs} +11 -11
- package/dist/{chunk-L2GBVYRU.cjs.map → chunk-MGCPSR4C.cjs.map} +1 -1
- package/dist/{chunk-KDNRACRG.cjs → chunk-MRUOOAIQ.cjs} +4 -4
- package/dist/{chunk-KDNRACRG.cjs.map → chunk-MRUOOAIQ.cjs.map} +1 -1
- package/dist/{chunk-PFXNQFFY.js → chunk-MUEPEWMQ.js} +67 -8
- package/dist/chunk-MUEPEWMQ.js.map +1 -0
- package/dist/{chunk-HTSJTWUT.js → chunk-OF63ZHSD.js} +4 -4
- package/dist/{chunk-HTSJTWUT.js.map → chunk-OF63ZHSD.js.map} +1 -1
- package/dist/{chunk-NGA3THGU.cjs → chunk-QR7W37HG.cjs} +14 -14
- package/dist/{chunk-NGA3THGU.cjs.map → chunk-QR7W37HG.cjs.map} +1 -1
- package/dist/{chunk-QFEO4M5W.js → chunk-RTPMG6LQ.js} +11 -11
- package/dist/{chunk-QFEO4M5W.js.map → chunk-RTPMG6LQ.js.map} +1 -1
- package/dist/{chunk-PFD4NUYV.js → chunk-SSDHR2C2.js} +3 -3
- package/dist/{chunk-PFD4NUYV.js.map → chunk-SSDHR2C2.js.map} +1 -1
- package/dist/{chunk-THK3SCQA.js → chunk-SYXTWPX6.js} +5 -5
- package/dist/{chunk-THK3SCQA.js.map → chunk-SYXTWPX6.js.map} +1 -1
- package/dist/{chunk-XSLQYGNR.cjs → chunk-T3VU3YRQ.cjs} +69 -69
- package/dist/{chunk-XSLQYGNR.cjs.map → chunk-T3VU3YRQ.cjs.map} +1 -1
- package/dist/{chunk-MIBWA6HX.js → chunk-TR7QTODF.js} +213 -33
- package/dist/chunk-TR7QTODF.js.map +1 -0
- package/dist/{chunk-AD3NLSV5.js → chunk-TU22BFMP.js} +8 -2
- package/dist/chunk-TU22BFMP.js.map +1 -0
- package/dist/{chunk-WTMSUIRO.js → chunk-UFKYMQJ5.js} +3 -3
- package/dist/{chunk-WTMSUIRO.js.map → chunk-UFKYMQJ5.js.map} +1 -1
- package/dist/{chunk-35LDKSMM.cjs → chunk-VNJMM2QQ.cjs} +30 -30
- package/dist/{chunk-35LDKSMM.cjs.map → chunk-VNJMM2QQ.cjs.map} +1 -1
- package/dist/{chunk-53ZEBIMD.js → chunk-WB55URNM.js} +6 -6
- package/dist/{chunk-53ZEBIMD.js.map → chunk-WB55URNM.js.map} +1 -1
- package/dist/{chunk-D2JPOFRZ.cjs → chunk-WY3IFEKV.cjs} +191 -191
- package/dist/{chunk-D2JPOFRZ.cjs.map → chunk-WY3IFEKV.cjs.map} +1 -1
- package/dist/{chunk-3KWF25MF.cjs → chunk-XQNKN3UF.cjs} +305 -246
- package/dist/chunk-XQNKN3UF.cjs.map +1 -0
- package/dist/{chunk-3RSFLZ7A.cjs → chunk-Y4X6ODVY.cjs} +943 -763
- package/dist/chunk-Y4X6ODVY.cjs.map +1 -0
- package/dist/core/index.d.cts +3 -3
- package/dist/core/index.d.ts +3 -3
- package/dist/{ddl-DvW9aobX.d.ts → ddl-2q7xLM1X.d.ts} +3 -3
- package/dist/{ddl-BjuXbPfw.d.cts → ddl-D_09BfbN.d.cts} +3 -3
- package/dist/graph-extension/index.d.cts +2 -2
- package/dist/graph-extension/index.d.ts +2 -2
- package/dist/graph-merge/index.cjs +156 -156
- package/dist/graph-merge/index.d.cts +7 -7
- package/dist/graph-merge/index.d.ts +7 -7
- package/dist/graph-merge/index.js +14 -14
- package/dist/{graph-templates-1vMqlPsu.d.cts → graph-templates-B5Q7oYAA.d.cts} +2 -2
- package/dist/{graph-templates-Y52w16dH.d.ts → graph-templates-D9N-Z9kw.d.ts} +2 -2
- package/dist/index.cjs +99 -99
- package/dist/index.d.cts +10 -10
- package/dist/index.d.ts +10 -10
- package/dist/index.js +18 -18
- package/dist/indexes/index.d.cts +4 -4
- package/dist/indexes/index.d.ts +4 -4
- package/dist/{ingestion-import-target-CCKeXZbW.d.ts → ingestion-import-target-B8EU6ug2.d.ts} +1 -1
- package/dist/{ingestion-import-target-774QRgkF.d.cts → ingestion-import-target-C5sHNFJF.d.cts} +1 -1
- package/dist/interchange/index.cjs +34 -34
- package/dist/interchange/index.d.cts +7 -7
- package/dist/interchange/index.d.ts +7 -7
- package/dist/interchange/index.js +11 -11
- package/dist/{local-store-impl-3E4VLFCI.cjs → local-store-impl-J6TJG45N.cjs} +22 -22
- package/dist/{local-store-impl-3E4VLFCI.cjs.map → local-store-impl-J6TJG45N.cjs.map} +1 -1
- package/dist/{local-store-impl-DFKS7QTV.js → local-store-impl-XKWR46WQ.js} +18 -18
- package/dist/{local-store-impl-DFKS7QTV.js.map → local-store-impl-XKWR46WQ.js.map} +1 -1
- package/dist/{pglite-store-impl-T75O3LVQ.cjs → pglite-store-impl-KXD5VWC5.cjs} +22 -22
- package/dist/{pglite-store-impl-T75O3LVQ.cjs.map → pglite-store-impl-KXD5VWC5.cjs.map} +1 -1
- package/dist/{pglite-store-impl-N63GGBU2.js → pglite-store-impl-LRZ4TO3H.js} +18 -18
- package/dist/{pglite-store-impl-N63GGBU2.js.map → pglite-store-impl-LRZ4TO3H.js.map} +1 -1
- package/dist/{postgres-2FYdVYCm.d.cts → postgres-BIm6TDfF.d.cts} +3 -3
- package/dist/{postgres-C9gitL71.d.ts → postgres-CRRB2qzy.d.ts} +3 -3
- package/dist/{postgres-BONrXHb4.d.cts → postgres-DOBXcZVg.d.cts} +1 -1
- package/dist/{postgres-DAFRdnTr.d.ts → postgres-DhZixg92.d.ts} +1 -1
- package/dist/{profile-Bmcg07Ki.d.cts → profile-CjAffcQt.d.cts} +2 -2
- package/dist/{profile-CAD65CqS.d.ts → profile-DVd70NA-.d.ts} +2 -2
- package/dist/profiler/index.d.cts +8 -8
- package/dist/profiler/index.d.ts +8 -8
- package/dist/provenance/index.cjs +22 -22
- package/dist/provenance/index.d.cts +6 -6
- package/dist/provenance/index.d.ts +6 -6
- package/dist/provenance/index.js +6 -6
- package/dist/{repair-validity-windows-CinP91t7.d.cts → repair-validity-windows-CpP_GpIx.d.cts} +1 -1
- package/dist/{repair-validity-windows-BJz4nffP.d.ts → repair-validity-windows-lfe275bY.d.ts} +1 -1
- package/dist/{resolve-DgOSlXx_.d.ts → resolve-CoYqHqno.d.cts} +7 -2
- package/dist/{resolve-DQXSEN_A.d.cts → resolve-DV0Iposp.d.ts} +7 -2
- package/dist/schema/index.cjs +37 -37
- package/dist/schema/index.d.cts +7 -7
- package/dist/schema/index.d.ts +7 -7
- package/dist/schema/index.js +7 -7
- package/dist/{searchable-DMdCwkXO.d.cts → searchable-C7Xt6g45.d.cts} +1 -1
- package/dist/{searchable-BPRF0Bah.d.ts → searchable-KKXrPet3.d.ts} +1 -1
- package/dist/{sqlite-DcDAAYow.d.ts → sqlite-BNwQ5pd7.d.ts} +3 -3
- package/dist/{sqlite-DgbYa-1Y.d.cts → sqlite-BkQM9ZeI.d.cts} +1 -1
- package/dist/{sqlite-UlG5prJQ.d.ts → sqlite-CcCSeXGg.d.ts} +1 -1
- package/dist/{sqlite-Co_uIpfs.d.cts → sqlite-DX9H3L7z.d.cts} +3 -3
- package/dist/{store-HxoFyQMu.d.cts → store-3nfPQK5j.d.cts} +30 -7
- package/dist/{store-C9T1c9Az.d.ts → store-C8ZPl7OW.d.ts} +30 -7
- package/dist/{types-CRCyg1fJ.d.cts → types-BynPp5kU.d.cts} +18 -2
- package/dist/{types-CRCyg1fJ.d.ts → types-BynPp5kU.d.ts} +18 -2
- package/dist/{types-Dg_prBqC.d.ts → types-C9YwrkSe.d.ts} +1 -1
- package/dist/{types-B5AUesS1.d.cts → types-JG-4CG6P.d.cts} +1 -1
- package/dist/{where-gRyc3jj_.d.cts → where-D1gBDqQ_.d.cts} +1 -1
- package/dist/{where-D-NDKMPw.d.ts → where-D2GqMFp-.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-337ONI2I.js.map +0 -1
- package/dist/chunk-3KWF25MF.cjs.map +0 -1
- package/dist/chunk-3RSFLZ7A.cjs.map +0 -1
- package/dist/chunk-AD3NLSV5.js.map +0 -1
- package/dist/chunk-BWQA3POT.cjs.map +0 -1
- package/dist/chunk-MIBWA6HX.js.map +0 -1
- package/dist/chunk-OC5ROP7V.cjs.map +0 -1
- package/dist/chunk-PFXNQFFY.js.map +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkVNJMM2QQ_cjs = require('./chunk-VNJMM2QQ.cjs');
|
|
4
|
+
var chunkI7SBZJI2_cjs = require('./chunk-I7SBZJI2.cjs');
|
|
5
|
+
var chunkG7OKJDMG_cjs = require('./chunk-G7OKJDMG.cjs');
|
|
6
6
|
var chunkR255UE5U_cjs = require('./chunk-R255UE5U.cjs');
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
7
|
+
var chunkMRUOOAIQ_cjs = require('./chunk-MRUOOAIQ.cjs');
|
|
8
|
+
var chunkEBQX7MYL_cjs = require('./chunk-EBQX7MYL.cjs');
|
|
9
|
+
var chunk6B3LQUYG_cjs = require('./chunk-6B3LQUYG.cjs');
|
|
10
|
+
var chunk5JOCIMQ3_cjs = require('./chunk-5JOCIMQ3.cjs');
|
|
11
|
+
var chunk7LQTDGV5_cjs = require('./chunk-7LQTDGV5.cjs');
|
|
12
|
+
var chunk6JRVV2SS_cjs = require('./chunk-6JRVV2SS.cjs');
|
|
13
13
|
var chunk7D2ZLF4O_cjs = require('./chunk-7D2ZLF4O.cjs');
|
|
14
14
|
var chunk5ICDVLI3_cjs = require('./chunk-5ICDVLI3.cjs');
|
|
15
15
|
var chunkL4L4AV6F_cjs = require('./chunk-L4L4AV6F.cjs');
|
|
@@ -27,7 +27,7 @@ function nullToUndefined(value) {
|
|
|
27
27
|
return value === null ? void 0 : value;
|
|
28
28
|
}
|
|
29
29
|
function rowToNode(row) {
|
|
30
|
-
const rawProps =
|
|
30
|
+
const rawProps = chunk6JRVV2SS_cjs.rowPropsToObject(row.props);
|
|
31
31
|
const props = chunkJLSXOBLQ_cjs.filterReservedKeys(rawProps, chunkJLSXOBLQ_cjs.RESERVED_NODE_KEYS);
|
|
32
32
|
return {
|
|
33
33
|
kind: row.kind,
|
|
@@ -47,7 +47,7 @@ function rowToNodeMeta(row) {
|
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
function rowToEdge(row) {
|
|
50
|
-
const rawProps =
|
|
50
|
+
const rawProps = chunk6JRVV2SS_cjs.rowPropsToObject(row.props);
|
|
51
51
|
const props = chunkJLSXOBLQ_cjs.filterReservedKeys(rawProps, chunkJLSXOBLQ_cjs.RESERVED_EDGE_KEYS);
|
|
52
52
|
return {
|
|
53
53
|
id: row.id,
|
|
@@ -75,14 +75,14 @@ function edgeWriteNeedsConstraintFence(cardinality) {
|
|
|
75
75
|
return cardinality === "many" ? void 0 : "edgeCardinality";
|
|
76
76
|
}
|
|
77
77
|
function nodeWriteNeedsConstraintFence(registry, kind, uniqueConstraints, operation) {
|
|
78
|
-
return
|
|
78
|
+
return chunkVNJMM2QQ_cjs.nodeClaimSites(registry, kind, uniqueConstraints, operation).find(
|
|
79
79
|
(site) => site.needsLockFence
|
|
80
80
|
)?.refusalReason;
|
|
81
81
|
}
|
|
82
82
|
function graphOwesClaims(graph, registry) {
|
|
83
83
|
for (const [kind, registration] of Object.entries(graph.nodes)) {
|
|
84
84
|
for (const operation of ["create", "update"]) {
|
|
85
|
-
const gating =
|
|
85
|
+
const gating = chunkVNJMM2QQ_cjs.nodeClaimSites(
|
|
86
86
|
registry,
|
|
87
87
|
kind,
|
|
88
88
|
registration.unique ?? [],
|
|
@@ -103,7 +103,7 @@ async function checkDisjointnessConstraint(ctx, kind, id) {
|
|
|
103
103
|
const disjointKinds = ctx.registry.getDisjointKinds(kind);
|
|
104
104
|
for (const disjointKind of disjointKinds) {
|
|
105
105
|
const existing = await ctx.backend.getNode(ctx.graphId, disjointKind, id);
|
|
106
|
-
if (existing !== void 0 &&
|
|
106
|
+
if (existing !== void 0 && chunk6JRVV2SS_cjs.isLiveNodeRow(existing)) {
|
|
107
107
|
const error = chunk5ICDVLI3_cjs.checkDisjointness(id, kind, [disjointKind], ctx.registry);
|
|
108
108
|
if (error) throw error;
|
|
109
109
|
}
|
|
@@ -111,7 +111,7 @@ async function checkDisjointnessConstraint(ctx, kind, id) {
|
|
|
111
111
|
}
|
|
112
112
|
async function checkCardinalityConstraint(ctx, edgeKind, cardinality, fromKind, fromId, toKind, toId, validTo) {
|
|
113
113
|
if (cardinality === "many") return;
|
|
114
|
-
const spec =
|
|
114
|
+
const spec = chunkG7OKJDMG_cjs.EDGE_CARDINALITY_SPECS[cardinality];
|
|
115
115
|
if (!spec.claimsWhenBornEnded && validTo !== void 0) return;
|
|
116
116
|
if (spec.keyShape === "fromAndTo") {
|
|
117
117
|
const exists = await ctx.backend.edgeExistsBetween({
|
|
@@ -507,7 +507,7 @@ function createEdgeBatchValidationBackend(backend) {
|
|
|
507
507
|
);
|
|
508
508
|
}
|
|
509
509
|
}
|
|
510
|
-
const validationBackend =
|
|
510
|
+
const validationBackend = chunk6JRVV2SS_cjs.deriveBackend(backend, {
|
|
511
511
|
getNode: getNodeCached,
|
|
512
512
|
countEdgesFrom: countEdgesFromCached,
|
|
513
513
|
edgeExistsBetween: edgeExistsBetweenCached
|
|
@@ -530,7 +530,7 @@ var AutocommitWriteRequiresTransaction = class extends Error {
|
|
|
530
530
|
function canUseSchemaFenceAtExecutionBoundary(backend, rootAutocommitAllowed) {
|
|
531
531
|
if (backend.commands.session === "transaction") return true;
|
|
532
532
|
if (backend.capabilities.execution.interactiveTransactions) return true;
|
|
533
|
-
return rootAutocommitAllowed &&
|
|
533
|
+
return rootAutocommitAllowed && chunkI7SBZJI2_cjs.isBundledRootAutocommitEligible(backend);
|
|
534
534
|
}
|
|
535
535
|
function canFuseSchemaFenceInFirstWrite(input) {
|
|
536
536
|
switch (input.kind) {
|
|
@@ -545,11 +545,11 @@ function canFuseSchemaFenceInFirstWrite(input) {
|
|
|
545
545
|
// regardless of which id it carries, so a batch-tier target
|
|
546
546
|
// clears this gate for a supplied id too.
|
|
547
547
|
candidate.idGenerated || candidate.backend.capabilities.execution.unitOfWork === "batch"
|
|
548
|
-
) &&
|
|
548
|
+
) && chunk6JRVV2SS_cjs.isSchemaFencedInsertEligible(candidate.backend) && !candidate.historyEnabled && !candidate.revisionTrackingEnabled && (!candidate.identityEnabled || candidate.idGenerated) && candidate.kindRegistered && candidate.uniqueConstraintCount === 0 && candidate.disjointKindCount === 0 && (candidate.idGenerated ? candidate.backend.insertNodeWithSchemaFence !== void 0 : candidate.backend.insertNodeIfAbsentWithSchemaFence !== void 0);
|
|
549
549
|
}
|
|
550
550
|
case "edge": {
|
|
551
551
|
const candidate = input.candidate;
|
|
552
|
-
return candidate.schemaVersion !== void 0 && canUseSchemaFenceAtExecutionBoundary(candidate.backend, true) &&
|
|
552
|
+
return candidate.schemaVersion !== void 0 && canUseSchemaFenceAtExecutionBoundary(candidate.backend, true) && chunk6JRVV2SS_cjs.isSchemaFencedInsertEligible(candidate.backend) && !candidate.historyEnabled && !candidate.revisionTrackingEnabled && candidate.kindRegistered && !candidate.convergesDynamically && candidate.cardinality === "many";
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
555
|
}
|
|
@@ -557,7 +557,7 @@ function isAutocommitSingleStatementWrite(input) {
|
|
|
557
557
|
switch (input.kind) {
|
|
558
558
|
case "node": {
|
|
559
559
|
const candidate = input.candidate;
|
|
560
|
-
return candidate.schemaVersion !== void 0 &&
|
|
560
|
+
return candidate.schemaVersion !== void 0 && chunkI7SBZJI2_cjs.isBundledRootAutocommitEligible(candidate.backend) && chunk6JRVV2SS_cjs.isSchemaFencedInsertEligible(candidate.backend) && !candidate.historyEnabled && !candidate.revisionTrackingEnabled && !candidate.identityEnabled && // Unlike `canFuseSchemaFenceInFirstWrite`'s root-autocommit test,
|
|
561
561
|
// this `idGenerated` stays strict for every target, batch-tier
|
|
562
562
|
// included: the eligibility check below proves only
|
|
563
563
|
// `insertNodeWithSchemaFence` (the fresh-id INSERT, no duplicate
|
|
@@ -566,14 +566,14 @@ function isAutocommitSingleStatementWrite(input) {
|
|
|
566
566
|
// unitOfWork, so it takes `runHookedWritePlan`'s route instead,
|
|
567
567
|
// where `canFuseSchemaFenceInFirstWrite` already selects the
|
|
568
568
|
// correct statement per id.
|
|
569
|
-
candidate.idGenerated && candidate.kindRegistered && candidate.uniqueConstraintCount === 0 && candidate.disjointKindCount === 0 && (
|
|
570
|
-
embedding:
|
|
569
|
+
candidate.idGenerated && candidate.kindRegistered && candidate.uniqueConstraintCount === 0 && candidate.disjointKindCount === 0 && (chunkVNJMM2QQ_cjs.getEmbeddingFields(candidate.schema).length > 0 || chunkHAHNRASW_cjs.getSearchableFields(candidate.schema).length > 0 ? chunkI7SBZJI2_cjs.supportsNodeInsertProjectionRequirements(candidate.backend, {
|
|
570
|
+
embedding: chunkVNJMM2QQ_cjs.getEmbeddingFields(candidate.schema).length > 0,
|
|
571
571
|
fulltext: chunkHAHNRASW_cjs.getSearchableFields(candidate.schema).length > 0
|
|
572
572
|
}) : candidate.backend.insertNodeWithSchemaFence !== void 0);
|
|
573
573
|
}
|
|
574
574
|
case "edge": {
|
|
575
575
|
const candidate = input.candidate;
|
|
576
|
-
return candidate.schemaVersion !== void 0 &&
|
|
576
|
+
return candidate.schemaVersion !== void 0 && chunkI7SBZJI2_cjs.isBundledRootAutocommitEligible(candidate.backend) && chunk6JRVV2SS_cjs.isSchemaFencedInsertEligible(candidate.backend) && !candidate.historyEnabled && !candidate.revisionTrackingEnabled && candidate.kindRegistered && !candidate.convergesDynamically && candidate.cardinality === "many";
|
|
577
577
|
}
|
|
578
578
|
}
|
|
579
579
|
}
|
|
@@ -585,7 +585,7 @@ function createEdgeWriteContext(graphId, lock, claimsVerdict) {
|
|
|
585
585
|
async function applyEdgeUpdate(ctx, args, backend) {
|
|
586
586
|
const { claim, ...rowWork } = args;
|
|
587
587
|
if (claim !== void 0) {
|
|
588
|
-
await
|
|
588
|
+
await chunkG7OKJDMG_cjs.claimEdgeCardinality(backend, ctx.claimsVerdict(), claim);
|
|
589
589
|
}
|
|
590
590
|
const updateParams = { graphId: ctx.graphId, ...rowWork };
|
|
591
591
|
return backend.updateEdge(updateParams);
|
|
@@ -620,7 +620,7 @@ async function applyEdgeHardDelete(ctx, work, backend) {
|
|
|
620
620
|
kind: work.kind
|
|
621
621
|
});
|
|
622
622
|
if (work.holdsCardinalityClaim) {
|
|
623
|
-
await
|
|
623
|
+
await chunkG7OKJDMG_cjs.purgeEdgeClaims(backend, ctx.claimsVerdict(), ctx.graphId, [work.id]);
|
|
624
624
|
}
|
|
625
625
|
}
|
|
626
626
|
|
|
@@ -702,7 +702,7 @@ function assertPortableNodeFallbackCanRun(target, params, projections) {
|
|
|
702
702
|
);
|
|
703
703
|
}
|
|
704
704
|
function assertClaimFreeInsertIfAbsentWork(ctx, work) {
|
|
705
|
-
const derivedPlan =
|
|
705
|
+
const derivedPlan = chunkVNJMM2QQ_cjs.planNodeCreateClaims(ctx, work.claim);
|
|
706
706
|
if (derivedPlan.claims.length === 0 && work.claimPlan.entries.length === 0 && work.claimPlan.claims.length === 0 && work.claimPlan.verdicts.length === 0) {
|
|
707
707
|
return;
|
|
708
708
|
}
|
|
@@ -721,20 +721,20 @@ function edgeBatchClaims(work) {
|
|
|
721
721
|
return work.flatMap((item) => item.claim === void 0 ? [] : [item.claim]);
|
|
722
722
|
}
|
|
723
723
|
function createWriteSession(ctx, target, lock) {
|
|
724
|
-
const writeContext =
|
|
724
|
+
const writeContext = chunkVNJMM2QQ_cjs.createNodeWriteContext(
|
|
725
725
|
ctx.graphId,
|
|
726
726
|
ctx.registry,
|
|
727
727
|
lock,
|
|
728
728
|
ctx.claimsVerdict,
|
|
729
729
|
ctx.uniqueSidecarBatch
|
|
730
730
|
);
|
|
731
|
-
const dispatch =
|
|
731
|
+
const dispatch = chunk6B3LQUYG_cjs.nodeInsertDispatch(target);
|
|
732
732
|
const edgeContext = createEdgeWriteContext(
|
|
733
733
|
ctx.graphId,
|
|
734
734
|
lock,
|
|
735
735
|
ctx.claimsVerdict
|
|
736
736
|
);
|
|
737
|
-
const edgeDispatch =
|
|
737
|
+
const edgeDispatch = chunk6B3LQUYG_cjs.edgeInsertDispatch(target);
|
|
738
738
|
return {
|
|
739
739
|
// The pinned coordination order, spelled once per insert shape:
|
|
740
740
|
// pre-insert claims, the row, post-insert claims, the sync fans. The claim
|
|
@@ -742,7 +742,7 @@ function createWriteSession(ctx, target, lock) {
|
|
|
742
742
|
// owns only "the row write it gates is THIS one".
|
|
743
743
|
createNode: async (work) => {
|
|
744
744
|
const claimPlan = work.claimPlan;
|
|
745
|
-
const insertPlanFused =
|
|
745
|
+
const insertPlanFused = chunkI7SBZJI2_cjs.supportsNodeCreatePlan(target, {
|
|
746
746
|
params: work.params,
|
|
747
747
|
idGenerated: work.idGenerated ?? false,
|
|
748
748
|
mode: { kind: "ordinary" },
|
|
@@ -750,7 +750,7 @@ function createWriteSession(ctx, target, lock) {
|
|
|
750
750
|
projections: work.projections,
|
|
751
751
|
allowNonTransactionalClaims: work.allowNonTransactionalClaims
|
|
752
752
|
});
|
|
753
|
-
const insertPortableNode = () =>
|
|
753
|
+
const insertPortableNode = () => chunkVNJMM2QQ_cjs.withNodeCreateClaims(
|
|
754
754
|
writeContext,
|
|
755
755
|
work.claim,
|
|
756
756
|
target,
|
|
@@ -772,7 +772,7 @@ function createWriteSession(ctx, target, lock) {
|
|
|
772
772
|
projections: work.projections
|
|
773
773
|
}
|
|
774
774
|
};
|
|
775
|
-
const result = await
|
|
775
|
+
const result = await chunk6JRVV2SS_cjs.executeAuthoritativeGraphCommand(
|
|
776
776
|
target.commands,
|
|
777
777
|
command
|
|
778
778
|
);
|
|
@@ -799,11 +799,11 @@ function createWriteSession(ctx, target, lock) {
|
|
|
799
799
|
}
|
|
800
800
|
return { row: result.row, projectionsFused: true };
|
|
801
801
|
} catch (error) {
|
|
802
|
-
|
|
802
|
+
chunkVNJMM2QQ_cjs.refuseNodeCreateClaimError(error, claimPlan);
|
|
803
803
|
}
|
|
804
804
|
};
|
|
805
805
|
const { row, projectionsFused } = await insertPlannedNode();
|
|
806
|
-
await
|
|
806
|
+
await chunkVNJMM2QQ_cjs.applyNodeInsertSyncFans(
|
|
807
807
|
writeContext,
|
|
808
808
|
{
|
|
809
809
|
...work.sideEffects,
|
|
@@ -815,9 +815,9 @@ function createWriteSession(ctx, target, lock) {
|
|
|
815
815
|
},
|
|
816
816
|
createNodeIfAbsent: async (work) => {
|
|
817
817
|
assertClaimFreeInsertIfAbsentWork(ctx, work);
|
|
818
|
-
const row = await
|
|
818
|
+
const row = await chunk6B3LQUYG_cjs.runInsertIfAbsent(dispatch, work.params);
|
|
819
819
|
if (row === void 0) return;
|
|
820
|
-
await
|
|
820
|
+
await chunkVNJMM2QQ_cjs.applyNodeInsertSyncFans(writeContext, work.sideEffects, target);
|
|
821
821
|
return row;
|
|
822
822
|
},
|
|
823
823
|
createNodeIfAbsentWithSchemaFence: async (work, schemaFence) => {
|
|
@@ -826,11 +826,11 @@ function createWriteSession(ctx, target, lock) {
|
|
|
826
826
|
if (insert === void 0) return;
|
|
827
827
|
const row = await insert(work.params, schemaFence);
|
|
828
828
|
if (row === void 0) return;
|
|
829
|
-
await
|
|
829
|
+
await chunkVNJMM2QQ_cjs.applyNodeInsertSyncFans(writeContext, work.sideEffects, target);
|
|
830
830
|
return row;
|
|
831
831
|
},
|
|
832
832
|
createNodeWithSchemaFence: async (work, schemaFence) => {
|
|
833
|
-
const projectionFusionEligible =
|
|
833
|
+
const projectionFusionEligible = chunkI7SBZJI2_cjs.supportsNodeInsertProjections(
|
|
834
834
|
target,
|
|
835
835
|
work.projections
|
|
836
836
|
);
|
|
@@ -852,12 +852,12 @@ function createWriteSession(ctx, target, lock) {
|
|
|
852
852
|
projections: work.projections
|
|
853
853
|
}
|
|
854
854
|
};
|
|
855
|
-
return
|
|
855
|
+
return chunkVNJMM2QQ_cjs.withNodeCreateClaims(
|
|
856
856
|
writeContext,
|
|
857
857
|
work.claim,
|
|
858
858
|
target,
|
|
859
859
|
async () => {
|
|
860
|
-
const result = await
|
|
860
|
+
const result = await chunk6JRVV2SS_cjs.executeAuthoritativeGraphCommand(
|
|
861
861
|
target.commands,
|
|
862
862
|
command
|
|
863
863
|
);
|
|
@@ -883,7 +883,7 @@ function createWriteSession(ctx, target, lock) {
|
|
|
883
883
|
})();
|
|
884
884
|
const { row, projectionsFused } = inserted;
|
|
885
885
|
if (row === void 0) return;
|
|
886
|
-
await
|
|
886
|
+
await chunkVNJMM2QQ_cjs.applyNodeInsertSyncFans(
|
|
887
887
|
writeContext,
|
|
888
888
|
{
|
|
889
889
|
...work.sideEffects,
|
|
@@ -894,25 +894,25 @@ function createWriteSession(ctx, target, lock) {
|
|
|
894
894
|
return row;
|
|
895
895
|
},
|
|
896
896
|
createNodeNoReturn: async (work) => {
|
|
897
|
-
await
|
|
897
|
+
await chunkVNJMM2QQ_cjs.withNodeCreateClaims(
|
|
898
898
|
writeContext,
|
|
899
899
|
work.claim,
|
|
900
900
|
target,
|
|
901
|
-
() =>
|
|
901
|
+
() => chunk6B3LQUYG_cjs.runInsertNoReturn(dispatch, work.params)
|
|
902
902
|
);
|
|
903
|
-
await
|
|
903
|
+
await chunkVNJMM2QQ_cjs.applyNodeInsertSyncFans(writeContext, work.sideEffects, target);
|
|
904
904
|
},
|
|
905
905
|
createNodes: async (work) => {
|
|
906
|
-
const rows = await
|
|
906
|
+
const rows = await chunkVNJMM2QQ_cjs.withNodeCreateClaimsBatch(
|
|
907
907
|
writeContext,
|
|
908
908
|
work.map((item) => item.claim),
|
|
909
909
|
target,
|
|
910
|
-
() =>
|
|
910
|
+
() => chunk6B3LQUYG_cjs.runInsertBatchReturning(
|
|
911
911
|
dispatch,
|
|
912
912
|
work.map((item) => item.params)
|
|
913
913
|
)
|
|
914
914
|
);
|
|
915
|
-
await
|
|
915
|
+
await chunkVNJMM2QQ_cjs.applyNodeInsertSyncFansBatch(
|
|
916
916
|
writeContext,
|
|
917
917
|
work.map((item) => item.sideEffects),
|
|
918
918
|
target
|
|
@@ -920,16 +920,16 @@ function createWriteSession(ctx, target, lock) {
|
|
|
920
920
|
return rows;
|
|
921
921
|
},
|
|
922
922
|
createNodesNoReturn: async (work) => {
|
|
923
|
-
await
|
|
923
|
+
await chunkVNJMM2QQ_cjs.withNodeCreateClaimsBatch(
|
|
924
924
|
writeContext,
|
|
925
925
|
work.map((item) => item.claim),
|
|
926
926
|
target,
|
|
927
|
-
() =>
|
|
927
|
+
() => chunk6B3LQUYG_cjs.runInsertBatch(
|
|
928
928
|
dispatch,
|
|
929
929
|
work.map((item) => item.params)
|
|
930
930
|
)
|
|
931
931
|
);
|
|
932
|
-
await
|
|
932
|
+
await chunkVNJMM2QQ_cjs.applyNodeInsertSyncFansBatch(
|
|
933
933
|
writeContext,
|
|
934
934
|
work.map((item) => item.sideEffects),
|
|
935
935
|
target
|
|
@@ -938,20 +938,20 @@ function createWriteSession(ctx, target, lock) {
|
|
|
938
938
|
reviseNode: (work, fences) => {
|
|
939
939
|
const draft = createWriteParamsDraft();
|
|
940
940
|
applyWriteFences(NODE_UPDATE_FENCE_APPLIERS, fences, draft);
|
|
941
|
-
return
|
|
941
|
+
return chunkVNJMM2QQ_cjs.applyNodeUpdate(writeContext, { ...work, ...draft }, target);
|
|
942
942
|
},
|
|
943
|
-
retireNode: (work, policy) =>
|
|
944
|
-
purgeNode: (work) =>
|
|
945
|
-
reviveNode: (work) =>
|
|
943
|
+
retireNode: (work, policy) => chunkVNJMM2QQ_cjs.applyNodeSoftDelete(writeContext, work, target, policy),
|
|
944
|
+
purgeNode: (work) => chunkVNJMM2QQ_cjs.applyNodeHardDelete(writeContext, work, target),
|
|
945
|
+
reviveNode: (work) => chunkVNJMM2QQ_cjs.applyNodeResurrect(writeContext, work, target),
|
|
946
946
|
reviseNodeSet: (work, fences) => {
|
|
947
947
|
applyWriteFences(
|
|
948
948
|
NODE_SET_UPDATE_FENCE_APPLIERS,
|
|
949
949
|
fences,
|
|
950
950
|
createWriteParamsDraft()
|
|
951
951
|
);
|
|
952
|
-
return
|
|
952
|
+
return chunkVNJMM2QQ_cjs.applyNodeSetUpdate(writeContext, work, target);
|
|
953
953
|
},
|
|
954
|
-
reviseResolvedNodes: (work) =>
|
|
954
|
+
reviseResolvedNodes: (work) => chunkVNJMM2QQ_cjs.applyResolvedNodeUpdateBatch(writeContext, work, target),
|
|
955
955
|
// An edge write obliges no DERIVED data, so these apply no sync fans — but a
|
|
956
956
|
// constrained kind owes its cardinality claim, at the same PRE-INSERT
|
|
957
957
|
// placement a node's scope-spanning claim takes and for the same reason: the
|
|
@@ -961,17 +961,17 @@ function createWriteSession(ctx, target, lock) {
|
|
|
961
961
|
// in the same order.
|
|
962
962
|
createEdge: async (work) => {
|
|
963
963
|
if (work.claim !== void 0) {
|
|
964
|
-
await
|
|
964
|
+
await chunkG7OKJDMG_cjs.claimEdgeCardinality(target, ctx.claimsVerdict(), work.claim);
|
|
965
965
|
}
|
|
966
966
|
return edgeDispatch.one(work.params);
|
|
967
967
|
},
|
|
968
968
|
createEdgeWithPlan: async (command) => {
|
|
969
|
-
const result = await
|
|
969
|
+
const result = await chunk6JRVV2SS_cjs.executeAuthoritativeGraphCommand(
|
|
970
970
|
target.commands,
|
|
971
971
|
command
|
|
972
972
|
);
|
|
973
973
|
if (result.outcome === "unsupported" && result.dimensions.length === 1 && result.dimensions[0] === "cardinalityClaim" && command.plan.schemaFence === void 0 && command.plan.cardinalityClaim !== void 0) {
|
|
974
|
-
await
|
|
974
|
+
await chunkG7OKJDMG_cjs.claimEdgeCardinality(
|
|
975
975
|
target,
|
|
976
976
|
ctx.claimsVerdict(),
|
|
977
977
|
command.plan.cardinalityClaim
|
|
@@ -983,7 +983,7 @@ function createWriteSession(ctx, target, lock) {
|
|
|
983
983
|
params: command.plan.params
|
|
984
984
|
}
|
|
985
985
|
};
|
|
986
|
-
const retryResult = await
|
|
986
|
+
const retryResult = await chunk6JRVV2SS_cjs.executeAuthoritativeGraphCommand(
|
|
987
987
|
target.commands,
|
|
988
988
|
retryCommand
|
|
989
989
|
);
|
|
@@ -993,17 +993,17 @@ function createWriteSession(ctx, target, lock) {
|
|
|
993
993
|
},
|
|
994
994
|
createEdgeNoReturn: async (work) => {
|
|
995
995
|
if (work.claim !== void 0) {
|
|
996
|
-
await
|
|
996
|
+
await chunkG7OKJDMG_cjs.claimEdgeCardinality(target, ctx.claimsVerdict(), work.claim);
|
|
997
997
|
}
|
|
998
|
-
await
|
|
998
|
+
await chunk6B3LQUYG_cjs.runInsertNoReturn(edgeDispatch, work.params);
|
|
999
999
|
},
|
|
1000
1000
|
createEdges: async (work) => {
|
|
1001
|
-
await
|
|
1001
|
+
await chunkG7OKJDMG_cjs.claimEdgeCardinalityBatch(
|
|
1002
1002
|
target,
|
|
1003
1003
|
ctx.claimsVerdict(),
|
|
1004
1004
|
edgeBatchClaims(work)
|
|
1005
1005
|
);
|
|
1006
|
-
return
|
|
1006
|
+
return chunk6B3LQUYG_cjs.runInsertBatchReturning(
|
|
1007
1007
|
edgeDispatch,
|
|
1008
1008
|
work.map((item) => item.params)
|
|
1009
1009
|
);
|
|
@@ -1019,7 +1019,7 @@ function createWriteSession(ctx, target, lock) {
|
|
|
1019
1019
|
}
|
|
1020
1020
|
);
|
|
1021
1021
|
}
|
|
1022
|
-
await
|
|
1022
|
+
await chunkG7OKJDMG_cjs.claimEdgeCardinalityBatch(
|
|
1023
1023
|
target,
|
|
1024
1024
|
ctx.claimsVerdict(),
|
|
1025
1025
|
edgeBatchClaims(work)
|
|
@@ -1027,12 +1027,12 @@ function createWriteSession(ctx, target, lock) {
|
|
|
1027
1027
|
return insert(work.map((item) => item.params));
|
|
1028
1028
|
},
|
|
1029
1029
|
createEdgesNoReturn: async (work) => {
|
|
1030
|
-
await
|
|
1030
|
+
await chunkG7OKJDMG_cjs.claimEdgeCardinalityBatch(
|
|
1031
1031
|
target,
|
|
1032
1032
|
ctx.claimsVerdict(),
|
|
1033
1033
|
edgeBatchClaims(work)
|
|
1034
1034
|
);
|
|
1035
|
-
await
|
|
1035
|
+
await chunk6B3LQUYG_cjs.runInsertBatch(
|
|
1036
1036
|
edgeDispatch,
|
|
1037
1037
|
work.map((item) => item.params)
|
|
1038
1038
|
);
|
|
@@ -1068,7 +1068,7 @@ function planFrame(ctx, plan, rowWork) {
|
|
|
1068
1068
|
await acquireIdentityLock(target);
|
|
1069
1069
|
}
|
|
1070
1070
|
const mintSessionOver = (sessionTarget) => createWriteSession(ctx, sessionTarget, lock);
|
|
1071
|
-
const mintOverlaidSession = (reads) => mintSessionOver(
|
|
1071
|
+
const mintOverlaidSession = (reads) => mintSessionOver(chunk6JRVV2SS_cjs.deriveBackend(target, reads));
|
|
1072
1072
|
return rowWork(
|
|
1073
1073
|
mintSessionOver(target),
|
|
1074
1074
|
target,
|
|
@@ -1082,7 +1082,7 @@ function planTransactionOptions(plan, options) {
|
|
|
1082
1082
|
return { ...options, fencesConstraintProbe: plan.constraintProbe };
|
|
1083
1083
|
}
|
|
1084
1084
|
function runWritePlan(ctx, plan, backend, rowWork, options) {
|
|
1085
|
-
return
|
|
1085
|
+
return chunk6B3LQUYG_cjs.runInWriteTransaction(
|
|
1086
1086
|
ctx,
|
|
1087
1087
|
backend,
|
|
1088
1088
|
planFrame(ctx, plan, rowWork),
|
|
@@ -1090,7 +1090,7 @@ function runWritePlan(ctx, plan, backend, rowWork, options) {
|
|
|
1090
1090
|
);
|
|
1091
1091
|
}
|
|
1092
1092
|
function runHookedWritePlan(ctx, opContext, plan, backend, rowWork, options) {
|
|
1093
|
-
return
|
|
1093
|
+
return chunk6B3LQUYG_cjs.runHookedWriteOperation(
|
|
1094
1094
|
ctx,
|
|
1095
1095
|
opContext,
|
|
1096
1096
|
backend,
|
|
@@ -1108,7 +1108,7 @@ function runAutocommitSingleStatementWritePlan(ctx, opContext, plan, backend, ro
|
|
|
1108
1108
|
try {
|
|
1109
1109
|
return await planFrame(ctx, plan, rowWork)(
|
|
1110
1110
|
backend,
|
|
1111
|
-
|
|
1111
|
+
chunk6B3LQUYG_cjs.uncapturedGraphWriteLock(),
|
|
1112
1112
|
"none"
|
|
1113
1113
|
);
|
|
1114
1114
|
} catch (error) {
|
|
@@ -1154,7 +1154,7 @@ var ResolvedMutationSetMoved = class extends Error {
|
|
|
1154
1154
|
executor;
|
|
1155
1155
|
/** Only the exact bundled root/executor that minted the signal may retry. */
|
|
1156
1156
|
isOwnedBy(entity, backend) {
|
|
1157
|
-
const profile =
|
|
1157
|
+
const profile = chunkMRUOOAIQ_cjs.resolveAtomicMutationPrograms(backend);
|
|
1158
1158
|
return (entity === "node" ? profile?.mutateNodes : profile?.mutateEdges) === this.executor;
|
|
1159
1159
|
}
|
|
1160
1160
|
};
|
|
@@ -1281,20 +1281,20 @@ async function withAlreadyExistsTranslation(entity, run) {
|
|
|
1281
1281
|
|
|
1282
1282
|
// src/store/operations/atomic-mutation-program.ts
|
|
1283
1283
|
function resolveAtomicMutationProfile(input) {
|
|
1284
|
-
if (!
|
|
1284
|
+
if (!chunk6JRVV2SS_cjs.supportsAtomicBatch(input.backend)) return;
|
|
1285
1285
|
if (input.schemaVersion === void 0) return;
|
|
1286
1286
|
if (input.historyEnabled || input.revisionTrackingEnabled) return;
|
|
1287
|
-
return
|
|
1287
|
+
return chunkMRUOOAIQ_cjs.resolveAtomicMutationPrograms(input.backend);
|
|
1288
1288
|
}
|
|
1289
1289
|
function atomicNodeProjectionFamilies(registration) {
|
|
1290
1290
|
return [
|
|
1291
|
-
...
|
|
1291
|
+
...chunkVNJMM2QQ_cjs.getEmbeddingFields(registration.type.schema).length === 0 ? [] : ["embedding"],
|
|
1292
1292
|
...chunkHAHNRASW_cjs.getSearchableFields(registration.type.schema).length === 0 ? [] : ["fulltext"]
|
|
1293
1293
|
];
|
|
1294
1294
|
}
|
|
1295
1295
|
async function assertAtomicDeleteSchemaFenceMatched(matched, ctx, backend, entity) {
|
|
1296
1296
|
if (matched) return;
|
|
1297
|
-
await
|
|
1297
|
+
await chunk6B3LQUYG_cjs.diagnoseFusedSchemaFenceNoRow(ctx, backend);
|
|
1298
1298
|
throw new chunk7XYPLAPL_cjs.DatabaseOperationError(
|
|
1299
1299
|
"Atomic delete reported a stale schema fence, but the current schema matched during diagnosis. The schema may have changed concurrently, or the backend returned inconsistent fence evidence.",
|
|
1300
1300
|
{ operation: "delete", entity }
|
|
@@ -1310,10 +1310,10 @@ function resolveAtomicNodeBatchExecutor(input) {
|
|
|
1310
1310
|
if (!chunkBXHAPCQG_cjs.hasOwnKey(input.graph.nodes, item.kind)) return false;
|
|
1311
1311
|
const registration = input.graph.nodes[item.kind];
|
|
1312
1312
|
if (registration === void 0) return false;
|
|
1313
|
-
if (input.registry.getDisjointKinds(item.kind).length > 0 && !
|
|
1313
|
+
if (input.registry.getDisjointKinds(item.kind).length > 0 && !chunkMRUOOAIQ_cjs.supportsAtomicNodeClaimFamily(claimSupport, "disjointness")) {
|
|
1314
1314
|
return false;
|
|
1315
1315
|
}
|
|
1316
|
-
if (!
|
|
1316
|
+
if (!chunkMRUOOAIQ_cjs.supportsAtomicNodeProjections(
|
|
1317
1317
|
projectionSupport,
|
|
1318
1318
|
atomicNodeProjectionFamilies(registration)
|
|
1319
1319
|
)) {
|
|
@@ -1324,7 +1324,7 @@ function resolveAtomicNodeBatchExecutor(input) {
|
|
|
1324
1324
|
if (registrations.includes(false)) return;
|
|
1325
1325
|
if (registrations.some(
|
|
1326
1326
|
(registration) => registration !== false && (registration.unique ?? []).length > 0
|
|
1327
|
-
) && !
|
|
1327
|
+
) && !chunkMRUOOAIQ_cjs.supportsAtomicNodeClaimFamily(claimSupport, "uniqueness")) {
|
|
1328
1328
|
return;
|
|
1329
1329
|
}
|
|
1330
1330
|
return profile.createNodes;
|
|
@@ -1341,13 +1341,13 @@ function resolveAtomicNodeReplacementBatchProgram(input) {
|
|
|
1341
1341
|
const hasUniqueness = (registration.unique ?? []).length > 0;
|
|
1342
1342
|
const maxEntries = hasDisjointness || hasUniqueness ? executor.maxEntries.claimed : executor.maxEntries.plain;
|
|
1343
1343
|
if (input.entryCount > maxEntries) return;
|
|
1344
|
-
if (hasDisjointness && (!
|
|
1344
|
+
if (hasDisjointness && (!chunkMRUOOAIQ_cjs.supportsAtomicNodeClaimFamily(executor.claimSupport, "disjointness") || !releasedClaimFamilies.has("disjointness"))) {
|
|
1345
1345
|
return;
|
|
1346
1346
|
}
|
|
1347
|
-
if (hasUniqueness && (!
|
|
1347
|
+
if (hasUniqueness && (!chunkMRUOOAIQ_cjs.supportsAtomicNodeClaimFamily(executor.claimSupport, "uniqueness") || !releasedClaimFamilies.has("uniqueness"))) {
|
|
1348
1348
|
return;
|
|
1349
1349
|
}
|
|
1350
|
-
if (!
|
|
1350
|
+
if (!chunkMRUOOAIQ_cjs.supportsAtomicNodeProjections(
|
|
1351
1351
|
executor.projectionSupport,
|
|
1352
1352
|
atomicNodeProjectionFamilies(registration)
|
|
1353
1353
|
)) {
|
|
@@ -1415,7 +1415,7 @@ function resolveAtomicNodeDeleteBatchExecutor(input) {
|
|
|
1415
1415
|
return;
|
|
1416
1416
|
}
|
|
1417
1417
|
if (chunkHAHNRASW_cjs.getSearchableFields(registration.type.schema).length > 0) return;
|
|
1418
|
-
if (
|
|
1418
|
+
if (chunkVNJMM2QQ_cjs.getEmbeddingFields(registration.type.schema).length > 0) return;
|
|
1419
1419
|
return executor;
|
|
1420
1420
|
}
|
|
1421
1421
|
function isAtomicResolvedNodeKindEligible(input) {
|
|
@@ -1427,7 +1427,7 @@ function isAtomicResolvedNodeKindEligible(input) {
|
|
|
1427
1427
|
}
|
|
1428
1428
|
function supportsAtomicResolvedNodeKindProjections(input, support) {
|
|
1429
1429
|
const registration = input.graph.nodes[input.kind];
|
|
1430
|
-
return registration !== void 0 &&
|
|
1430
|
+
return registration !== void 0 && chunkMRUOOAIQ_cjs.supportsAtomicNodeProjections(
|
|
1431
1431
|
support,
|
|
1432
1432
|
atomicNodeProjectionFamilies(registration)
|
|
1433
1433
|
);
|
|
@@ -1621,7 +1621,7 @@ function createNodeBatchValidationSeams(graphId, registry, backend) {
|
|
|
1621
1621
|
});
|
|
1622
1622
|
}
|
|
1623
1623
|
function registerPendingUniqueEntries(kind, id, props, constraints) {
|
|
1624
|
-
for (const entry of
|
|
1624
|
+
for (const entry of chunkVNJMM2QQ_cjs.nodeClaimEntries(
|
|
1625
1625
|
registry,
|
|
1626
1626
|
kind,
|
|
1627
1627
|
id,
|
|
@@ -1643,12 +1643,12 @@ function createNodeBatchValidationSeams(graphId, registry, backend) {
|
|
|
1643
1643
|
function registerAppliedNodeUpdate(kind, id, oldProps, newProps, constraints) {
|
|
1644
1644
|
const owner = { concreteKind: kind, nodeId: id };
|
|
1645
1645
|
const oldEntries = new Map(
|
|
1646
|
-
|
|
1646
|
+
chunkVNJMM2QQ_cjs.nodeClaimEntries(registry, kind, id, oldProps, constraints, "update").map(
|
|
1647
1647
|
(entry) => [entry.constraintName, entry]
|
|
1648
1648
|
)
|
|
1649
1649
|
);
|
|
1650
1650
|
const newEntries = new Map(
|
|
1651
|
-
|
|
1651
|
+
chunkVNJMM2QQ_cjs.nodeClaimEntries(registry, kind, id, newProps, constraints, "update").map(
|
|
1652
1652
|
(entry) => [entry.constraintName, entry]
|
|
1653
1653
|
)
|
|
1654
1654
|
);
|
|
@@ -1707,7 +1707,7 @@ function createNodeBatchValidationSeams(graphId, registry, backend) {
|
|
|
1707
1707
|
};
|
|
1708
1708
|
return {
|
|
1709
1709
|
reads,
|
|
1710
|
-
reader:
|
|
1710
|
+
reader: chunk6JRVV2SS_cjs.deriveBackend(backend, reads),
|
|
1711
1711
|
registerPendingNode,
|
|
1712
1712
|
registerPendingUniqueEntries,
|
|
1713
1713
|
registerAppliedNodeUpdate,
|
|
@@ -1719,7 +1719,7 @@ function draftNodeCreate(ctx, input, id, options) {
|
|
|
1719
1719
|
const kind = input.kind;
|
|
1720
1720
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
1721
1721
|
const nodeKind = registration.type;
|
|
1722
|
-
const validatedProps = options?.propsPreValidated === true ? input.props :
|
|
1722
|
+
const validatedProps = options?.propsPreValidated === true ? input.props : chunk6B3LQUYG_cjs.validateNodeProps(nodeKind.schema, input.props, {
|
|
1723
1723
|
kind,
|
|
1724
1724
|
operation: "create"
|
|
1725
1725
|
});
|
|
@@ -1742,11 +1742,11 @@ function draftNodeCreate(ctx, input, id, options) {
|
|
|
1742
1742
|
}
|
|
1743
1743
|
async function finishNodeCreatePreparation(ctx, draft, backend, allowInsertIfAbsent = true, mode = "probe", preparedClaimPlan) {
|
|
1744
1744
|
const { kind, id, validatedProps, uniqueConstraints } = draft;
|
|
1745
|
-
const claimPlan = preparedClaimPlan ??
|
|
1745
|
+
const claimPlan = preparedClaimPlan ?? chunkVNJMM2QQ_cjs.planNodeCreateClaims(
|
|
1746
1746
|
{ graphId: ctx.graphId, registry: ctx.registry },
|
|
1747
1747
|
{ kind, id, props: validatedProps, constraints: uniqueConstraints }
|
|
1748
1748
|
);
|
|
1749
|
-
const insertIfAbsent = allowInsertIfAbsent && draft.idProvided && backend.insertNodeIfAbsent !== void 0 &&
|
|
1749
|
+
const insertIfAbsent = allowInsertIfAbsent && draft.idProvided && backend.insertNodeIfAbsent !== void 0 && chunkVNJMM2QQ_cjs.nodeClaimEntries(
|
|
1750
1750
|
ctx.registry,
|
|
1751
1751
|
kind,
|
|
1752
1752
|
id,
|
|
@@ -1768,8 +1768,8 @@ async function finishNodeCreatePreparation(ctx, draft, backend, allowInsertIfAbs
|
|
|
1768
1768
|
if (draft.idProvided && !insertIfAbsent) {
|
|
1769
1769
|
await checkDisjointnessConstraint(constraintContext, kind, id);
|
|
1770
1770
|
}
|
|
1771
|
-
await
|
|
1772
|
-
|
|
1771
|
+
await chunkVNJMM2QQ_cjs.checkUniquenessConstraints(
|
|
1772
|
+
chunkVNJMM2QQ_cjs.createUniquenessContext(
|
|
1773
1773
|
ctx.graphId,
|
|
1774
1774
|
ctx.registry,
|
|
1775
1775
|
backend,
|
|
@@ -1819,17 +1819,17 @@ function nodeCreateClaimItem(prepared) {
|
|
|
1819
1819
|
};
|
|
1820
1820
|
}
|
|
1821
1821
|
function resolveNodeInsertProjections(schema, props) {
|
|
1822
|
-
const fulltext =
|
|
1822
|
+
const fulltext = chunkVNJMM2QQ_cjs.resolveNodeFulltextProjection(schema, props);
|
|
1823
1823
|
return [
|
|
1824
1824
|
...fulltext === void 0 ? [] : [fulltext],
|
|
1825
|
-
...
|
|
1825
|
+
...chunkVNJMM2QQ_cjs.resolveNodeEmbeddingProjections(schema, props)
|
|
1826
1826
|
];
|
|
1827
1827
|
}
|
|
1828
1828
|
function resolveAtomicNodeProjections(schema, props, options) {
|
|
1829
|
-
const fulltext =
|
|
1829
|
+
const fulltext = chunkVNJMM2QQ_cjs.resolveNodeFulltextProjection(schema, props);
|
|
1830
1830
|
return [
|
|
1831
1831
|
...fulltext === void 0 ? [] : [fulltext],
|
|
1832
|
-
...
|
|
1832
|
+
...chunkVNJMM2QQ_cjs.resolveNodeEmbeddingProjectionTransitions(schema, props, {
|
|
1833
1833
|
omitDeletes: options?.omitEmbeddingDeletes === true
|
|
1834
1834
|
})
|
|
1835
1835
|
];
|
|
@@ -1850,7 +1850,7 @@ function foldReferences(preparedCreates) {
|
|
|
1850
1850
|
}
|
|
1851
1851
|
function computeNodeUpdate(ctx, kind, id, existingProps, inputProps) {
|
|
1852
1852
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
1853
|
-
const validatedProps =
|
|
1853
|
+
const validatedProps = chunk6B3LQUYG_cjs.validateNodeProps(
|
|
1854
1854
|
registration.type.schema,
|
|
1855
1855
|
{ ...existingProps, ...inputProps },
|
|
1856
1856
|
{ kind, operation: "update", id }
|
|
@@ -1858,7 +1858,7 @@ function computeNodeUpdate(ctx, kind, id, existingProps, inputProps) {
|
|
|
1858
1858
|
return { registration, validatedProps };
|
|
1859
1859
|
}
|
|
1860
1860
|
function resolveNodeUpdateProps(ctx, existing, inputProps) {
|
|
1861
|
-
const existingProps =
|
|
1861
|
+
const existingProps = chunk6JRVV2SS_cjs.rowPropsToObject(existing.props);
|
|
1862
1862
|
const { registration, validatedProps } = computeNodeUpdate(
|
|
1863
1863
|
ctx,
|
|
1864
1864
|
existing.kind,
|
|
@@ -1878,7 +1878,7 @@ function nodeUpsertDirtyCheck(ctx, kind, id, existingProps, inputProps) {
|
|
|
1878
1878
|
);
|
|
1879
1879
|
return {
|
|
1880
1880
|
validatedProps,
|
|
1881
|
-
unchanged:
|
|
1881
|
+
unchanged: chunk5JOCIMQ3_cjs.canonicalEqual(validatedProps, existingProps)
|
|
1882
1882
|
};
|
|
1883
1883
|
}
|
|
1884
1884
|
async function performNodeUpdate(ctx, input, session, target, options, resolvedExisting) {
|
|
@@ -1933,7 +1933,7 @@ async function performNodeUpdate(ctx, input, session, target, options, resolvedE
|
|
|
1933
1933
|
);
|
|
1934
1934
|
return rowToNode(row2);
|
|
1935
1935
|
}
|
|
1936
|
-
if (!
|
|
1936
|
+
if (!chunk6JRVV2SS_cjs.isLiveNodeRow(existing)) throw new chunk7XYPLAPL_cjs.NodeNotFoundError(kind, id);
|
|
1937
1937
|
const row = await session.reviseNode(
|
|
1938
1938
|
// An in-place update must not rewrite the stored bound, so it keeps the
|
|
1939
1939
|
// conditional spread: `buildUpdateNode` ignores `validFrom` off the
|
|
@@ -1981,10 +1981,10 @@ function nodeUpdateRaceError(input, error) {
|
|
|
1981
1981
|
);
|
|
1982
1982
|
}
|
|
1983
1983
|
async function primeBatchValidationCaches(ctx, drafts, backend, seams) {
|
|
1984
|
-
const boundGetNodes =
|
|
1984
|
+
const boundGetNodes = chunk6JRVV2SS_cjs.bindExtraIfReachable(
|
|
1985
1985
|
backend,
|
|
1986
1986
|
ctx.batchPointRead.extras.getNodes,
|
|
1987
|
-
|
|
1987
|
+
chunk6JRVV2SS_cjs.BATCH_POINT_READ.id
|
|
1988
1988
|
);
|
|
1989
1989
|
if (boundGetNodes !== void 0) {
|
|
1990
1990
|
const idsByKind = /* @__PURE__ */ new Map();
|
|
@@ -2003,17 +2003,17 @@ async function primeBatchValidationCaches(ctx, drafts, backend, seams) {
|
|
|
2003
2003
|
}
|
|
2004
2004
|
}
|
|
2005
2005
|
}
|
|
2006
|
-
const boundCheckUniqueBatch =
|
|
2006
|
+
const boundCheckUniqueBatch = chunk6JRVV2SS_cjs.bindExtraIfReachable(
|
|
2007
2007
|
backend,
|
|
2008
2008
|
ctx.uniqueSidecarBatch.extras.checkUniqueBatch,
|
|
2009
|
-
|
|
2009
|
+
chunk6JRVV2SS_cjs.UNIQUE_SIDECAR_BATCH.id
|
|
2010
2010
|
);
|
|
2011
2011
|
if (boundCheckUniqueBatch !== void 0) {
|
|
2012
|
-
const groups =
|
|
2012
|
+
const groups = chunkVNJMM2QQ_cjs.groupNodeUniquenessProbes(
|
|
2013
2013
|
ctx.registry,
|
|
2014
2014
|
drafts.map((draft) => ({
|
|
2015
2015
|
kind: draft.kind,
|
|
2016
|
-
entries:
|
|
2016
|
+
entries: chunkVNJMM2QQ_cjs.nodeClaimEntries(
|
|
2017
2017
|
ctx.registry,
|
|
2018
2018
|
draft.kind,
|
|
2019
2019
|
draft.id,
|
|
@@ -2051,7 +2051,7 @@ async function prepareBatchCreates(ctx, inputs, backend, options) {
|
|
|
2051
2051
|
seedUniqueRow
|
|
2052
2052
|
} = createNodeBatchValidationSeams(ctx.graphId, ctx.registry, backend);
|
|
2053
2053
|
const drafts = inputs.map(
|
|
2054
|
-
(input) => draftNodeCreate(ctx, input, input.id ??
|
|
2054
|
+
(input) => draftNodeCreate(ctx, input, input.id ?? chunk6B3LQUYG_cjs.generateId(), options)
|
|
2055
2055
|
);
|
|
2056
2056
|
await primeBatchValidationCaches(ctx, drafts, backend, {
|
|
2057
2057
|
seedNodeRow,
|
|
@@ -2078,7 +2078,7 @@ async function prepareBatchCreates(ctx, inputs, backend, options) {
|
|
|
2078
2078
|
}
|
|
2079
2079
|
async function prepareAtomicBatchCreates(ctx, inputs, backend, options) {
|
|
2080
2080
|
const drafts = inputs.map(
|
|
2081
|
-
(input) => draftNodeCreate(ctx, input, input.id ??
|
|
2081
|
+
(input) => draftNodeCreate(ctx, input, input.id ?? chunk6B3LQUYG_cjs.generateId(), options)
|
|
2082
2082
|
);
|
|
2083
2083
|
const seen = /* @__PURE__ */ new Set();
|
|
2084
2084
|
for (const draft of drafts) {
|
|
@@ -2090,7 +2090,7 @@ async function prepareAtomicBatchCreates(ctx, inputs, backend, options) {
|
|
|
2090
2090
|
}
|
|
2091
2091
|
return Promise.all(
|
|
2092
2092
|
drafts.map(async (draft) => {
|
|
2093
|
-
const claimPlan =
|
|
2093
|
+
const claimPlan = chunkVNJMM2QQ_cjs.planNodeCreateClaims(
|
|
2094
2094
|
{ graphId: ctx.graphId, registry: ctx.registry },
|
|
2095
2095
|
{
|
|
2096
2096
|
kind: draft.kind,
|
|
@@ -2127,7 +2127,7 @@ function atomicNodeBatchEntries(preparedCreates, claimSupport) {
|
|
|
2127
2127
|
});
|
|
2128
2128
|
continue;
|
|
2129
2129
|
}
|
|
2130
|
-
const rephased =
|
|
2130
|
+
const rephased = chunkI7SBZJI2_cjs.rephaseAtomicNodeClaimPlan(
|
|
2131
2131
|
{
|
|
2132
2132
|
entity: "node",
|
|
2133
2133
|
params: prepared.insertParams,
|
|
@@ -2156,7 +2156,7 @@ function atomicNodeBatchEntries(preparedCreates, claimSupport) {
|
|
|
2156
2156
|
fields: claim.verdict.kind === "uniqueness" ? claim.verdict.fields : [],
|
|
2157
2157
|
axis: claim.axis
|
|
2158
2158
|
});
|
|
2159
|
-
|
|
2159
|
+
chunkVNJMM2QQ_cjs.refuseNodeCreateClaimError(error, prepared.claimPlan);
|
|
2160
2160
|
}
|
|
2161
2161
|
ownerByClaimTarget.set(targetKey, {
|
|
2162
2162
|
kind: prepared.kind,
|
|
@@ -2171,7 +2171,7 @@ function atomicNodeBatchEntries(preparedCreates, claimSupport) {
|
|
|
2171
2171
|
});
|
|
2172
2172
|
}
|
|
2173
2173
|
if (entries.some(
|
|
2174
|
-
(entry) => !
|
|
2174
|
+
(entry) => !chunkMRUOOAIQ_cjs.supportsAtomicNodeClaims(claimSupport, entry.claims ?? [])
|
|
2175
2175
|
)) {
|
|
2176
2176
|
return;
|
|
2177
2177
|
}
|
|
@@ -2179,7 +2179,7 @@ function atomicNodeBatchEntries(preparedCreates, claimSupport) {
|
|
|
2179
2179
|
}
|
|
2180
2180
|
function prepareNodeReplacement(ctx, kind, props) {
|
|
2181
2181
|
const schema = getNodeRegistration(ctx.graph, kind).type.schema;
|
|
2182
|
-
return
|
|
2182
|
+
return chunk6B3LQUYG_cjs.validateNodeProps(schema, props, { kind, operation: "update" });
|
|
2183
2183
|
}
|
|
2184
2184
|
async function executeNodeReplacementBatch(ctx, kind, items, backend) {
|
|
2185
2185
|
if (items.length === 0) return appliedResolvedMutationSet([]);
|
|
@@ -2246,7 +2246,7 @@ async function executeNodeReplacementBatch(ctx, kind, items, backend) {
|
|
|
2246
2246
|
}
|
|
2247
2247
|
);
|
|
2248
2248
|
}
|
|
2249
|
-
|
|
2249
|
+
chunk6B3LQUYG_cjs.memoizeLeasedSchemaFence(ctx, backend);
|
|
2250
2250
|
return appliedResolvedMutationSet(
|
|
2251
2251
|
restoreAtomicNodeBatchRows(ctx.graphId, preparedCreates, returnedRows).map(
|
|
2252
2252
|
(row) => rowToNode(row)
|
|
@@ -2257,7 +2257,7 @@ async function withAtomicNodeClaimTranslation(preparedCreates, execute) {
|
|
|
2257
2257
|
try {
|
|
2258
2258
|
return await execute();
|
|
2259
2259
|
} catch (error) {
|
|
2260
|
-
|
|
2260
|
+
chunkVNJMM2QQ_cjs.refuseNodeCreateClaimError(error, {
|
|
2261
2261
|
entries: preparedCreates.flatMap(
|
|
2262
2262
|
(prepared) => prepared.claimPlan.entries
|
|
2263
2263
|
),
|
|
@@ -2283,7 +2283,7 @@ async function captureAtomicNodeClaimDiagnosticVerdicts(preparedCreates, diagnos
|
|
|
2283
2283
|
);
|
|
2284
2284
|
}
|
|
2285
2285
|
async function runAtomicNodeClaimDiagnosticGroups(groups, read) {
|
|
2286
|
-
for (const window of
|
|
2286
|
+
for (const window of chunk5JOCIMQ3_cjs.chunk(
|
|
2287
2287
|
groups,
|
|
2288
2288
|
ATOMIC_NODE_CLAIM_DIAGNOSTIC_WINDOW_SIZE
|
|
2289
2289
|
)) {
|
|
@@ -2291,10 +2291,10 @@ async function runAtomicNodeClaimDiagnosticGroups(groups, read) {
|
|
|
2291
2291
|
}
|
|
2292
2292
|
}
|
|
2293
2293
|
async function diagnoseAtomicNodeDisjointness(ctx, backend, preparedCreates) {
|
|
2294
|
-
const boundGetNodes =
|
|
2294
|
+
const boundGetNodes = chunk6JRVV2SS_cjs.bindExtraIfReachable(
|
|
2295
2295
|
backend,
|
|
2296
2296
|
ctx.batchPointRead.extras.getNodes,
|
|
2297
|
-
|
|
2297
|
+
chunk6JRVV2SS_cjs.BATCH_POINT_READ.id
|
|
2298
2298
|
);
|
|
2299
2299
|
const constraintContext = {
|
|
2300
2300
|
graphId: ctx.graphId,
|
|
@@ -2330,16 +2330,16 @@ async function diagnoseAtomicNodeDisjointness(ctx, backend, preparedCreates) {
|
|
|
2330
2330
|
...group.ids
|
|
2331
2331
|
]);
|
|
2332
2332
|
for (const row of rows) {
|
|
2333
|
-
rowsByReference.set(
|
|
2333
|
+
rowsByReference.set(chunkEBQX7MYL_cjs.refKey({ kind: row.kind, id: row.id }), row);
|
|
2334
2334
|
}
|
|
2335
2335
|
}
|
|
2336
2336
|
);
|
|
2337
2337
|
return preparedCreates.map((prepared, index) => {
|
|
2338
2338
|
for (const conflictingKind of chunkBXHAPCQG_cjs.requireDefined(disjointKindsByInput[index])) {
|
|
2339
2339
|
const row = rowsByReference.get(
|
|
2340
|
-
|
|
2340
|
+
chunkEBQX7MYL_cjs.refKey({ kind: conflictingKind, id: prepared.id })
|
|
2341
2341
|
);
|
|
2342
|
-
if (row === void 0 || !
|
|
2342
|
+
if (row === void 0 || !chunk6JRVV2SS_cjs.isLiveNodeRow(row)) continue;
|
|
2343
2343
|
const error = chunk5ICDVLI3_cjs.checkDisjointness(
|
|
2344
2344
|
prepared.id,
|
|
2345
2345
|
prepared.kind,
|
|
@@ -2352,12 +2352,12 @@ async function diagnoseAtomicNodeDisjointness(ctx, backend, preparedCreates) {
|
|
|
2352
2352
|
});
|
|
2353
2353
|
}
|
|
2354
2354
|
async function diagnoseAtomicNodeUniqueness(ctx, backend, preparedCreates) {
|
|
2355
|
-
const boundCheckUniqueBatch =
|
|
2355
|
+
const boundCheckUniqueBatch = chunk6JRVV2SS_cjs.bindExtraIfReachable(
|
|
2356
2356
|
backend,
|
|
2357
2357
|
ctx.uniqueSidecarBatch.extras.checkUniqueBatch,
|
|
2358
|
-
|
|
2358
|
+
chunk6JRVV2SS_cjs.UNIQUE_SIDECAR_BATCH.id
|
|
2359
2359
|
);
|
|
2360
|
-
const uniquenessContext =
|
|
2360
|
+
const uniquenessContext = chunkVNJMM2QQ_cjs.createUniquenessContext(
|
|
2361
2361
|
ctx.graphId,
|
|
2362
2362
|
ctx.registry,
|
|
2363
2363
|
backend,
|
|
@@ -2366,7 +2366,7 @@ async function diagnoseAtomicNodeUniqueness(ctx, backend, preparedCreates) {
|
|
|
2366
2366
|
if (boundCheckUniqueBatch === void 0) {
|
|
2367
2367
|
return captureAtomicNodeClaimDiagnosticVerdicts(
|
|
2368
2368
|
preparedCreates,
|
|
2369
|
-
async (prepared) =>
|
|
2369
|
+
async (prepared) => chunkVNJMM2QQ_cjs.checkUniquenessConstraints(
|
|
2370
2370
|
uniquenessContext,
|
|
2371
2371
|
prepared.kind,
|
|
2372
2372
|
prepared.id,
|
|
@@ -2377,7 +2377,7 @@ async function diagnoseAtomicNodeUniqueness(ctx, backend, preparedCreates) {
|
|
|
2377
2377
|
}
|
|
2378
2378
|
const probeItems = preparedCreates.map((prepared) => ({
|
|
2379
2379
|
kind: prepared.kind,
|
|
2380
|
-
entries:
|
|
2380
|
+
entries: chunkVNJMM2QQ_cjs.nodeClaimEntries(
|
|
2381
2381
|
ctx.registry,
|
|
2382
2382
|
prepared.kind,
|
|
2383
2383
|
prepared.id,
|
|
@@ -2386,7 +2386,7 @@ async function diagnoseAtomicNodeUniqueness(ctx, backend, preparedCreates) {
|
|
|
2386
2386
|
"create"
|
|
2387
2387
|
)
|
|
2388
2388
|
}));
|
|
2389
|
-
const groups =
|
|
2389
|
+
const groups = chunkVNJMM2QQ_cjs.groupNodeUniquenessProbes(ctx.registry, probeItems);
|
|
2390
2390
|
const rowsByTarget = /* @__PURE__ */ new Map();
|
|
2391
2391
|
await runAtomicNodeClaimDiagnosticGroups(groups, async (group) => {
|
|
2392
2392
|
const rows = await boundCheckUniqueBatch.checkUniqueBatch({
|
|
@@ -2405,9 +2405,9 @@ async function diagnoseAtomicNodeUniqueness(ctx, backend, preparedCreates) {
|
|
|
2405
2405
|
return Promise.all(
|
|
2406
2406
|
preparedCreates.map(async (prepared, index) => {
|
|
2407
2407
|
for (const entry of chunkBXHAPCQG_cjs.requireDefined(probeItems[index]).entries) {
|
|
2408
|
-
if (!
|
|
2408
|
+
if (!chunkVNJMM2QQ_cjs.isUniquenessClaimEntry(entry)) continue;
|
|
2409
2409
|
try {
|
|
2410
|
-
await
|
|
2410
|
+
await chunkVNJMM2QQ_cjs.probeUniqueKey(
|
|
2411
2411
|
uniquenessContext,
|
|
2412
2412
|
prepared.kind,
|
|
2413
2413
|
prepared.id,
|
|
@@ -2429,17 +2429,17 @@ async function diagnoseAtomicNodeUniqueness(ctx, backend, preparedCreates) {
|
|
|
2429
2429
|
);
|
|
2430
2430
|
}
|
|
2431
2431
|
async function diagnoseAtomicNodeBatchNoRow(ctx, backend, preparedCreates) {
|
|
2432
|
-
await
|
|
2433
|
-
const hasSetOrientedDiagnosis =
|
|
2432
|
+
await chunk6B3LQUYG_cjs.diagnoseFusedSchemaFenceNoRow(ctx, backend);
|
|
2433
|
+
const hasSetOrientedDiagnosis = chunk6JRVV2SS_cjs.bindExtraIfReachable(
|
|
2434
2434
|
backend,
|
|
2435
2435
|
ctx.batchPointRead.extras.getNodes,
|
|
2436
|
-
|
|
2437
|
-
) !== void 0 &&
|
|
2436
|
+
chunk6JRVV2SS_cjs.BATCH_POINT_READ.id
|
|
2437
|
+
) !== void 0 && chunk6JRVV2SS_cjs.bindExtraIfReachable(
|
|
2438
2438
|
backend,
|
|
2439
2439
|
ctx.uniqueSidecarBatch.extras.checkUniqueBatch,
|
|
2440
|
-
|
|
2440
|
+
chunk6JRVV2SS_cjs.UNIQUE_SIDECAR_BATCH.id
|
|
2441
2441
|
) !== void 0;
|
|
2442
|
-
const diagnosticWindows = hasSetOrientedDiagnosis ? [preparedCreates] :
|
|
2442
|
+
const diagnosticWindows = hasSetOrientedDiagnosis ? [preparedCreates] : chunk5JOCIMQ3_cjs.chunk(preparedCreates, ATOMIC_NODE_CLAIM_DIAGNOSTIC_WINDOW_SIZE);
|
|
2443
2443
|
for (const window of diagnosticWindows) {
|
|
2444
2444
|
const [disjointnessVerdicts, uniquenessVerdicts] = hasSetOrientedDiagnosis ? await Promise.all([
|
|
2445
2445
|
diagnoseAtomicNodeDisjointness(ctx, backend, window),
|
|
@@ -2476,7 +2476,7 @@ function restoreAtomicNodeBatchRows(graphId, preparedCreates, returnedRows) {
|
|
|
2476
2476
|
{ expectedGraphId: graphId, actualGraphId: row.graph_id }
|
|
2477
2477
|
);
|
|
2478
2478
|
}
|
|
2479
|
-
const key =
|
|
2479
|
+
const key = chunkEBQX7MYL_cjs.refKey({ kind: row.kind, id: row.id });
|
|
2480
2480
|
if (rowsByReference.has(key)) {
|
|
2481
2481
|
throw new chunk7XYPLAPL_cjs.CompilerInvariantError(
|
|
2482
2482
|
"Atomic node batch returned duplicate node references.",
|
|
@@ -2487,7 +2487,7 @@ function restoreAtomicNodeBatchRows(graphId, preparedCreates, returnedRows) {
|
|
|
2487
2487
|
}
|
|
2488
2488
|
return preparedCreates.map((prepared) => {
|
|
2489
2489
|
const row = rowsByReference.get(
|
|
2490
|
-
|
|
2490
|
+
chunkEBQX7MYL_cjs.refKey({ kind: prepared.kind, id: prepared.id })
|
|
2491
2491
|
);
|
|
2492
2492
|
if (row === void 0) {
|
|
2493
2493
|
throw new chunk7XYPLAPL_cjs.CompilerInvariantError(
|
|
@@ -2586,10 +2586,10 @@ async function findUniqueRowAcrossKinds(backend, graphId, constraintName, key, k
|
|
|
2586
2586
|
}
|
|
2587
2587
|
async function batchCheckUniqueAcrossKinds(backend, uniqueSidecarBatch, graphId, constraintName, uniqueKeys, kindsToCheck, includeDeleted) {
|
|
2588
2588
|
const existingByKey = /* @__PURE__ */ new Map();
|
|
2589
|
-
const boundCheckUniqueBatch =
|
|
2589
|
+
const boundCheckUniqueBatch = chunk6JRVV2SS_cjs.bindExtraIfReachable(
|
|
2590
2590
|
backend,
|
|
2591
2591
|
uniqueSidecarBatch.extras.checkUniqueBatch,
|
|
2592
|
-
|
|
2592
|
+
chunk6JRVV2SS_cjs.UNIQUE_SIDECAR_BATCH.id
|
|
2593
2593
|
);
|
|
2594
2594
|
for (const kindToCheck of kindsToCheck) {
|
|
2595
2595
|
if (boundCheckUniqueBatch === void 0) {
|
|
@@ -2628,10 +2628,10 @@ async function batchCheckUniqueAcrossKinds(backend, uniqueSidecarBatch, graphId,
|
|
|
2628
2628
|
}
|
|
2629
2629
|
async function executeNodeCreateInternal(ctx, input, backend, options) {
|
|
2630
2630
|
const kind = input.kind;
|
|
2631
|
-
const id = input.id ??
|
|
2631
|
+
const id = input.id ?? chunk6B3LQUYG_cjs.generateId();
|
|
2632
2632
|
const opContext = ctx.createOperationContext("create", "node", kind, id);
|
|
2633
2633
|
const shouldReturnRow = options?.returnRow ?? true;
|
|
2634
|
-
const autocommitBackend =
|
|
2634
|
+
const autocommitBackend = chunkI7SBZJI2_cjs.isBundledRootAutocommitEligible(backend) ? backend : void 0;
|
|
2635
2635
|
const registeredKind = chunkBXHAPCQG_cjs.hasOwnKey(ctx.graph.nodes, kind) ? getNodeRegistration(ctx.graph, kind) : void 0;
|
|
2636
2636
|
const candidate = registeredKind === void 0 ? void 0 : {
|
|
2637
2637
|
backend,
|
|
@@ -2653,13 +2653,13 @@ async function executeNodeCreateInternal(ctx, input, backend, options) {
|
|
|
2653
2653
|
);
|
|
2654
2654
|
const rowWork = async (session, target, _overlaidSession, _lock, transactionMode) => {
|
|
2655
2655
|
const targetBackend = unfencedTarget(target);
|
|
2656
|
-
const fuseSchemaFenceInFirstWrite = schemaFenceInFirstWrite &&
|
|
2656
|
+
const fuseSchemaFenceInFirstWrite = schemaFenceInFirstWrite && chunk6JRVV2SS_cjs.isSchemaFencedInsertEligible(targetBackend) && !chunk6B3LQUYG_cjs.hasLeasedSchemaFence(ctx, targetBackend);
|
|
2657
2657
|
if (schemaFenceInFirstWrite && !fuseSchemaFenceInFirstWrite) {
|
|
2658
|
-
await
|
|
2658
|
+
await chunk6B3LQUYG_cjs.lockSchemaVersionForStoreWrite(ctx, targetBackend);
|
|
2659
2659
|
}
|
|
2660
2660
|
const identity = ctx.identity;
|
|
2661
2661
|
const draft = draftNodeCreate(ctx, input, id, options);
|
|
2662
|
-
const claimPlan =
|
|
2662
|
+
const claimPlan = chunkVNJMM2QQ_cjs.planNodeCreateClaims(
|
|
2663
2663
|
{ graphId: ctx.graphId, registry: ctx.registry },
|
|
2664
2664
|
{
|
|
2665
2665
|
kind: draft.kind,
|
|
@@ -2672,7 +2672,7 @@ async function executeNodeCreateInternal(ctx, input, backend, options) {
|
|
|
2672
2672
|
draft.nodeKind.schema,
|
|
2673
2673
|
draft.validatedProps
|
|
2674
2674
|
);
|
|
2675
|
-
const preparationMode = shouldReturnRow && !fuseSchemaFenceInFirstWrite &&
|
|
2675
|
+
const preparationMode = shouldReturnRow && !fuseSchemaFenceInFirstWrite && chunkI7SBZJI2_cjs.supportsNodeCreatePlan(target, {
|
|
2676
2676
|
params: buildInsertNodeParams(
|
|
2677
2677
|
ctx.graphId,
|
|
2678
2678
|
draft.kind,
|
|
@@ -2696,8 +2696,8 @@ async function executeNodeCreateInternal(ctx, input, backend, options) {
|
|
|
2696
2696
|
claimPlan
|
|
2697
2697
|
);
|
|
2698
2698
|
const projectionFusionEligible = shouldReturnRow && !prepared.idProvided && projections.length > 0;
|
|
2699
|
-
const fuseProjections = projectionFusionEligible &&
|
|
2700
|
-
const fuseSchemaFenceProjections = fuseSchemaFenceInFirstWrite && projectionFusionEligible &&
|
|
2699
|
+
const fuseProjections = projectionFusionEligible && chunkI7SBZJI2_cjs.supportsNodeInsertProjections(target, projections);
|
|
2700
|
+
const fuseSchemaFenceProjections = fuseSchemaFenceInFirstWrite && projectionFusionEligible && chunkI7SBZJI2_cjs.supportsNodeInsertProjections(target, projections);
|
|
2701
2701
|
const existing = prepared.tombstone;
|
|
2702
2702
|
if (existing !== void 0) {
|
|
2703
2703
|
const resurrected = await resurrectPreparedNode(
|
|
@@ -2719,17 +2719,17 @@ async function executeNodeCreateInternal(ctx, input, backend, options) {
|
|
|
2719
2719
|
const work = fuseSchemaFenceProjections ? nodeCreateWork(prepared, projections, false) : nodeCreateWork(prepared, [], false);
|
|
2720
2720
|
const inserted = prepared.insertIfAbsent ? await session.createNodeIfAbsentWithSchemaFence(work, schemaFence) : await session.createNodeWithSchemaFence(work, schemaFence);
|
|
2721
2721
|
if (inserted !== void 0) {
|
|
2722
|
-
|
|
2722
|
+
chunk6B3LQUYG_cjs.memoizeLeasedSchemaFence(ctx, targetBackend);
|
|
2723
2723
|
return shouldReturnRow ? rowToNode(inserted) : void 0;
|
|
2724
2724
|
}
|
|
2725
|
-
await
|
|
2725
|
+
await chunk6B3LQUYG_cjs.diagnoseFusedSchemaFenceNoRow(ctx, targetBackend);
|
|
2726
2726
|
const directInteractiveAutocommit = autocommitSingleStatement && transactionMode === "none" && targetBackend.capabilities.execution.interactiveTransactions;
|
|
2727
2727
|
if (directInteractiveAutocommit) {
|
|
2728
2728
|
throw new AutocommitWriteRequiresTransaction();
|
|
2729
2729
|
}
|
|
2730
2730
|
if (!prepared.insertIfAbsent) {
|
|
2731
2731
|
if (transactionMode !== "none") {
|
|
2732
|
-
await
|
|
2732
|
+
await chunk6B3LQUYG_cjs.lockSchemaVersionForStoreWrite(ctx, targetBackend);
|
|
2733
2733
|
}
|
|
2734
2734
|
throw new chunk7XYPLAPL_cjs.DatabaseOperationError(
|
|
2735
2735
|
`Fresh node insert returned no row: ${prepared.kind} ${prepared.id}`,
|
|
@@ -2737,7 +2737,7 @@ async function executeNodeCreateInternal(ctx, input, backend, options) {
|
|
|
2737
2737
|
);
|
|
2738
2738
|
}
|
|
2739
2739
|
if (transactionMode !== "none") {
|
|
2740
|
-
await
|
|
2740
|
+
await chunk6B3LQUYG_cjs.lockSchemaVersionForStoreWrite(ctx, targetBackend);
|
|
2741
2741
|
}
|
|
2742
2742
|
}
|
|
2743
2743
|
if (fuseProjections && !fuseSchemaFenceProjections) {
|
|
@@ -2776,7 +2776,7 @@ async function executeNodeCreateInternal(ctx, input, backend, options) {
|
|
|
2776
2776
|
throw createAlreadyExistsError("node", prepared.kind, prepared.id);
|
|
2777
2777
|
}
|
|
2778
2778
|
if (fuseSchemaFenceInFirstWrite && transactionMode === "none") {
|
|
2779
|
-
await
|
|
2779
|
+
await chunk6B3LQUYG_cjs.lockSchemaVersionForStoreWrite(ctx, targetBackend);
|
|
2780
2780
|
}
|
|
2781
2781
|
const resurrected = await resurrectPreparedNode(
|
|
2782
2782
|
ctx,
|
|
@@ -2890,7 +2890,7 @@ async function executeNodeCreateNoReturnBatch(ctx, inputs, backend) {
|
|
|
2890
2890
|
}
|
|
2891
2891
|
);
|
|
2892
2892
|
}
|
|
2893
|
-
|
|
2893
|
+
chunk6B3LQUYG_cjs.memoizeLeasedSchemaFence(ctx, backend);
|
|
2894
2894
|
return;
|
|
2895
2895
|
}
|
|
2896
2896
|
}
|
|
@@ -2972,7 +2972,7 @@ async function executeNodeCreateBatch(ctx, inputs, backend, options) {
|
|
|
2972
2972
|
}
|
|
2973
2973
|
);
|
|
2974
2974
|
}
|
|
2975
|
-
|
|
2975
|
+
chunk6B3LQUYG_cjs.memoizeLeasedSchemaFence(ctx, backend);
|
|
2976
2976
|
return restoreAtomicNodeBatchRows(
|
|
2977
2977
|
ctx.graphId,
|
|
2978
2978
|
preparedCreates,
|
|
@@ -3010,13 +3010,13 @@ async function executeNodeCreateBatch(ctx, inputs, backend, options) {
|
|
|
3010
3010
|
}
|
|
3011
3011
|
const byReference = new Map(
|
|
3012
3012
|
[...inserted, ...resurrected].map((row) => [
|
|
3013
|
-
|
|
3013
|
+
chunkEBQX7MYL_cjs.refKey({ kind: row.kind, id: row.id }),
|
|
3014
3014
|
row
|
|
3015
3015
|
])
|
|
3016
3016
|
);
|
|
3017
3017
|
const rows = preparedCreates.map(
|
|
3018
3018
|
(prepared) => chunkBXHAPCQG_cjs.requireDefined(
|
|
3019
|
-
byReference.get(
|
|
3019
|
+
byReference.get(chunkEBQX7MYL_cjs.refKey({ kind: prepared.kind, id: prepared.id })),
|
|
3020
3020
|
`Missing written row for ${prepared.kind} ${prepared.id}`
|
|
3021
3021
|
)
|
|
3022
3022
|
);
|
|
@@ -3156,7 +3156,7 @@ function normalizeCompareAndSetExpectations(schema, kind, inputExpected) {
|
|
|
3156
3156
|
const expected = chunkBXHAPCQG_cjs.createDataKeyedBag();
|
|
3157
3157
|
const scalarExpectedInput = chunkBXHAPCQG_cjs.createDataKeyedBag();
|
|
3158
3158
|
for (const [property, value] of Object.entries(inputExpected)) {
|
|
3159
|
-
if (value ===
|
|
3159
|
+
if (value === chunk6B3LQUYG_cjs.compareAndSetAbsent) {
|
|
3160
3160
|
expected[property] = { kind: "absent" };
|
|
3161
3161
|
continue;
|
|
3162
3162
|
}
|
|
@@ -3178,7 +3178,7 @@ function normalizeCompareAndSetExpectations(schema, kind, inputExpected) {
|
|
|
3178
3178
|
}
|
|
3179
3179
|
scalarExpectedInput[property] = value;
|
|
3180
3180
|
}
|
|
3181
|
-
const parsedExpected =
|
|
3181
|
+
const parsedExpected = chunk6B3LQUYG_cjs.validateNodeProps(
|
|
3182
3182
|
schema.partial(),
|
|
3183
3183
|
scalarExpectedInput,
|
|
3184
3184
|
{ kind, operation: "update" }
|
|
@@ -3255,7 +3255,7 @@ async function executeNodeSetUpdate(ctx, kind, inputPatch, candidateIds, candida
|
|
|
3255
3255
|
}
|
|
3256
3256
|
);
|
|
3257
3257
|
}
|
|
3258
|
-
const parsedPatch =
|
|
3258
|
+
const parsedPatch = chunk6B3LQUYG_cjs.validateNodeProps(schema.partial(), inputPatch, {
|
|
3259
3259
|
kind,
|
|
3260
3260
|
operation: "update"
|
|
3261
3261
|
});
|
|
@@ -3283,8 +3283,8 @@ async function executeNodeSetUpdate(ctx, kind, inputPatch, candidateIds, candida
|
|
|
3283
3283
|
);
|
|
3284
3284
|
}
|
|
3285
3285
|
const expected = request.operation === "compareAndSet" ? normalizeCompareAndSetExpectations(schema, kind, request.expected) : chunkBXHAPCQG_cjs.createDataKeyedBag();
|
|
3286
|
-
if (uniqueConstraints.length > 0 &&
|
|
3287
|
-
|
|
3286
|
+
if (uniqueConstraints.length > 0 && chunk7LQTDGV5_cjs.missingRequiredExtras(
|
|
3287
|
+
chunk6JRVV2SS_cjs.UNIQUE_SIDECAR_BATCH,
|
|
3288
3288
|
ctx.uniqueSidecarBatch,
|
|
3289
3289
|
"set-based node update"
|
|
3290
3290
|
).length > 0) {
|
|
@@ -3295,22 +3295,22 @@ async function executeNodeSetUpdate(ctx, kind, inputPatch, candidateIds, candida
|
|
|
3295
3295
|
}
|
|
3296
3296
|
if (chunkHAHNRASW_cjs.getSearchableFields(schema).length > 0) {
|
|
3297
3297
|
if (chunkR255UE5U_cjs.resolveBackendFulltext(backend) === false) {
|
|
3298
|
-
|
|
3298
|
+
chunkVNJMM2QQ_cjs.refuseFulltextUnavailable(backend, kind);
|
|
3299
3299
|
}
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3300
|
+
chunkVNJMM2QQ_cjs.assertFulltextMember(backend.upsertFulltext, "upsertFulltext", backend);
|
|
3301
|
+
chunkVNJMM2QQ_cjs.assertFulltextMember(backend.deleteFulltext, "deleteFulltext", backend);
|
|
3302
|
+
chunkVNJMM2QQ_cjs.assertFulltextMember(
|
|
3303
3303
|
backend.upsertFulltextBatch,
|
|
3304
3304
|
"upsertFulltextBatch",
|
|
3305
3305
|
backend
|
|
3306
3306
|
);
|
|
3307
|
-
|
|
3307
|
+
chunkVNJMM2QQ_cjs.assertFulltextMember(
|
|
3308
3308
|
backend.deleteFulltextBatch,
|
|
3309
3309
|
"deleteFulltextBatch",
|
|
3310
3310
|
backend
|
|
3311
3311
|
);
|
|
3312
3312
|
}
|
|
3313
|
-
if (
|
|
3313
|
+
if (chunkVNJMM2QQ_cjs.getEmbeddingFields(schema).length > 0 && (backend.upsertEmbedding === void 0 || backend.deleteEmbedding === void 0 || backend.upsertEmbeddingBatch === void 0 || backend.deleteEmbeddingBatch === void 0)) {
|
|
3314
3314
|
throw new chunk7XYPLAPL_cjs.ConfigurationError(
|
|
3315
3315
|
"updateWhere() requires batched vector sidecar operations for embedded nodes",
|
|
3316
3316
|
{ code: "SET_UPDATE_VECTOR_UNSUPPORTED", kind }
|
|
@@ -3471,7 +3471,7 @@ async function executeNodeResolvedMutationSet(ctx, creates, updates, backend) {
|
|
|
3471
3471
|
})
|
|
3472
3472
|
);
|
|
3473
3473
|
if (result.created.length === 0 && result.updated.length === 0) {
|
|
3474
|
-
await
|
|
3474
|
+
await chunk6B3LQUYG_cjs.diagnoseFusedSchemaFenceNoRow(ctx, backend);
|
|
3475
3475
|
throw new ResolvedMutationSetMoved("node", executor);
|
|
3476
3476
|
}
|
|
3477
3477
|
if (result.created.length !== creates.length || result.updated.length !== updates.length) {
|
|
@@ -3479,7 +3479,7 @@ async function executeNodeResolvedMutationSet(ctx, creates, updates, backend) {
|
|
|
3479
3479
|
"Atomic resolved node mutation set returned a partial result."
|
|
3480
3480
|
);
|
|
3481
3481
|
}
|
|
3482
|
-
|
|
3482
|
+
chunk6B3LQUYG_cjs.memoizeLeasedSchemaFence(ctx, backend);
|
|
3483
3483
|
const created = restoreAtomicNodeBatchRows(
|
|
3484
3484
|
ctx.graphId,
|
|
3485
3485
|
preparedCreates,
|
|
@@ -3521,14 +3521,14 @@ async function executeNodeUpsertUpdateBatch(ctx, entries, backend) {
|
|
|
3521
3521
|
),
|
|
3522
3522
|
backend,
|
|
3523
3523
|
async (session, target) => {
|
|
3524
|
-
const resolvedRows = target.capabilities.execution.interactiveTransactions && distinctIds.size === entries.length ? await
|
|
3524
|
+
const resolvedRows = target.capabilities.execution.interactiveTransactions && distinctIds.size === entries.length ? await chunk6B3LQUYG_cjs.getNodeRowsByIds(
|
|
3525
3525
|
target,
|
|
3526
3526
|
ctx.batchPointRead,
|
|
3527
3527
|
ctx.graphId,
|
|
3528
3528
|
first.input.kind,
|
|
3529
3529
|
[...distinctIds]
|
|
3530
3530
|
) : void 0;
|
|
3531
|
-
const canBatchResolvedUpdates = resolvedRows !== void 0 &&
|
|
3531
|
+
const canBatchResolvedUpdates = resolvedRows !== void 0 && chunkI7SBZJI2_cjs.resolvedNodeUpdateBatchFitsBindBudget(
|
|
3532
3532
|
entries.length,
|
|
3533
3533
|
target.capabilities.maxBindParameters
|
|
3534
3534
|
) && entries.every(
|
|
@@ -3538,7 +3538,7 @@ async function executeNodeUpsertUpdateBatch(ctx, entries, backend) {
|
|
|
3538
3538
|
if (canBatchResolvedUpdates) {
|
|
3539
3539
|
const resolvedEntries = entries.map((entry) => {
|
|
3540
3540
|
const existing = resolvedRows.get(entry.input.id);
|
|
3541
|
-
if (existing === void 0 || !
|
|
3541
|
+
if (existing === void 0 || !chunk6JRVV2SS_cjs.isLiveNodeRow(existing)) {
|
|
3542
3542
|
throw new chunk7XYPLAPL_cjs.NodeNotFoundError(entry.input.kind, entry.input.id);
|
|
3543
3543
|
}
|
|
3544
3544
|
const props = entry.replacementProps ?? resolveNodeUpdateProps(ctx, existing, entry.input.props).validatedProps;
|
|
@@ -3551,8 +3551,8 @@ async function executeNodeUpsertUpdateBatch(ctx, entries, backend) {
|
|
|
3551
3551
|
};
|
|
3552
3552
|
});
|
|
3553
3553
|
const registration = getNodeRegistration(ctx.graph, first.input.kind);
|
|
3554
|
-
const uniqueSidecarsReachable = registration.unique === void 0 || registration.unique.length === 0 ||
|
|
3555
|
-
|
|
3554
|
+
const uniqueSidecarsReachable = registration.unique === void 0 || registration.unique.length === 0 || chunkVNJMM2QQ_cjs.resolvedNodeUniqueSidecarBatchIsReachable(
|
|
3555
|
+
chunkVNJMM2QQ_cjs.createUniquenessContext(
|
|
3556
3556
|
ctx.graphId,
|
|
3557
3557
|
ctx.registry,
|
|
3558
3558
|
target,
|
|
@@ -3561,11 +3561,11 @@ async function executeNodeUpsertUpdateBatch(ctx, entries, backend) {
|
|
|
3561
3561
|
);
|
|
3562
3562
|
const preservesClaimKeys = resolvedEntries.every((entry) => {
|
|
3563
3563
|
const existing = chunkBXHAPCQG_cjs.requireDefined(resolvedRows.get(entry.id));
|
|
3564
|
-
return
|
|
3564
|
+
return chunkVNJMM2QQ_cjs.resolvedNodeUpdatePreservesClaimKeys(
|
|
3565
3565
|
ctx.registry,
|
|
3566
3566
|
entry.kind,
|
|
3567
3567
|
entry.id,
|
|
3568
|
-
|
|
3568
|
+
chunk6JRVV2SS_cjs.rowPropsToObject(existing.props),
|
|
3569
3569
|
entry.props,
|
|
3570
3570
|
registration.unique ?? []
|
|
3571
3571
|
);
|
|
@@ -3622,7 +3622,7 @@ async function executeAtomicNodeResolvedUpdates(ctx, entries, backend, atomicExe
|
|
|
3622
3622
|
const supplied = entries.flatMap(
|
|
3623
3623
|
(entry) => entry.existing === void 0 ? [] : [entry.existing]
|
|
3624
3624
|
);
|
|
3625
|
-
const fetched = supplied.length === entries.length ? void 0 : await
|
|
3625
|
+
const fetched = supplied.length === entries.length ? void 0 : await chunk6B3LQUYG_cjs.getNodeRowsByIds(
|
|
3626
3626
|
backend,
|
|
3627
3627
|
ctx.batchPointRead,
|
|
3628
3628
|
ctx.graphId,
|
|
@@ -3662,7 +3662,7 @@ async function executeAtomicNodeResolvedUpdates(ctx, entries, backend, atomicExe
|
|
|
3662
3662
|
}
|
|
3663
3663
|
});
|
|
3664
3664
|
if (rows.length === entries.length) {
|
|
3665
|
-
|
|
3665
|
+
chunk6B3LQUYG_cjs.memoizeLeasedSchemaFence(ctx, backend);
|
|
3666
3666
|
const returned = new Map(rows.map((row) => [row.id, row]));
|
|
3667
3667
|
return entries.map(
|
|
3668
3668
|
(entry) => rowToNode(chunkBXHAPCQG_cjs.requireDefined(returned.get(entry.input.id)))
|
|
@@ -3674,7 +3674,7 @@ async function executeAtomicNodeResolvedUpdates(ctx, entries, backend, atomicExe
|
|
|
3674
3674
|
{ expected: entries.length, actual: rows.length }
|
|
3675
3675
|
);
|
|
3676
3676
|
}
|
|
3677
|
-
await
|
|
3677
|
+
await chunk6B3LQUYG_cjs.diagnoseFusedSchemaFenceNoRow(ctx, backend);
|
|
3678
3678
|
if (attempt === maxAttempts) {
|
|
3679
3679
|
throw new chunk7XYPLAPL_cjs.DatabaseOperationError(
|
|
3680
3680
|
`Atomic node update could not be applied to stable rows after ${maxAttempts} attempts.`,
|
|
@@ -3688,7 +3688,7 @@ async function executeAtomicNodeResolvedUpdates(ctx, entries, backend, atomicExe
|
|
|
3688
3688
|
}
|
|
3689
3689
|
);
|
|
3690
3690
|
}
|
|
3691
|
-
const refreshed = await
|
|
3691
|
+
const refreshed = await chunk6B3LQUYG_cjs.getNodeRowsByIds(
|
|
3692
3692
|
backend,
|
|
3693
3693
|
ctx.batchPointRead,
|
|
3694
3694
|
ctx.graphId,
|
|
@@ -3734,7 +3734,7 @@ async function executeNodeDelete(ctx, kind, id, backend) {
|
|
|
3734
3734
|
const identity = ctx.identity;
|
|
3735
3735
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
3736
3736
|
const preflight = await target.getNode(ctx.graphId, kind, id);
|
|
3737
|
-
if (!preflight || !
|
|
3737
|
+
if (!preflight || !chunk6JRVV2SS_cjs.isLiveNodeRow(preflight)) return false;
|
|
3738
3738
|
await session.retireNode({
|
|
3739
3739
|
existing: preflight,
|
|
3740
3740
|
schema: registration.type.schema,
|
|
@@ -3811,7 +3811,7 @@ async function executeNodeDeleteBatch(ctx, kind, ids, backend) {
|
|
|
3811
3811
|
let affectedCount = 0;
|
|
3812
3812
|
for (const id of ids) {
|
|
3813
3813
|
const preflight = await target.getNode(ctx.graphId, kind, id);
|
|
3814
|
-
if (!preflight || !
|
|
3814
|
+
if (!preflight || !chunk6JRVV2SS_cjs.isLiveNodeRow(preflight)) continue;
|
|
3815
3815
|
await session.retireNode({
|
|
3816
3816
|
existing: preflight,
|
|
3817
3817
|
schema: registration.type.schema,
|
|
@@ -3847,7 +3847,7 @@ async function executeAtomicNodeDeletes(ctx, kind, ids, backend, atomicExecutor)
|
|
|
3847
3847
|
);
|
|
3848
3848
|
return result.affectedCount;
|
|
3849
3849
|
} catch (error) {
|
|
3850
|
-
if (!(error instanceof
|
|
3850
|
+
if (!(error instanceof chunkMRUOOAIQ_cjs.AtomicNodeDeleteRestrictedRefusalError)) throw error;
|
|
3851
3851
|
const connectedById = await findConnectedEdgesForNodeBatch(
|
|
3852
3852
|
ctx,
|
|
3853
3853
|
kind,
|
|
@@ -3903,7 +3903,7 @@ async function executeNodeGetOrCreateByConstraint(ctx, kind, constraintName, pro
|
|
|
3903
3903
|
const ifExists = options?.ifExists ?? "return";
|
|
3904
3904
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
3905
3905
|
const nodeKind = registration.type;
|
|
3906
|
-
const validatedProps =
|
|
3906
|
+
const validatedProps = chunk6B3LQUYG_cjs.validateNodeProps(nodeKind.schema, props, {
|
|
3907
3907
|
kind,
|
|
3908
3908
|
operation: "create"
|
|
3909
3909
|
});
|
|
@@ -3986,7 +3986,7 @@ async function executeNodeGetOrCreateByConstraint(ctx, kind, constraintName, pro
|
|
|
3986
3986
|
async function executeNodeFindByConstraint(ctx, kind, constraintName, props, backend) {
|
|
3987
3987
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
3988
3988
|
const nodeKind = registration.type;
|
|
3989
|
-
const validatedProps =
|
|
3989
|
+
const validatedProps = chunk6B3LQUYG_cjs.validateNodeProps(nodeKind.schema, props, {
|
|
3990
3990
|
kind,
|
|
3991
3991
|
operation: "create"
|
|
3992
3992
|
});
|
|
@@ -4023,7 +4023,7 @@ async function executeNodeFindByConstraint(ctx, kind, constraintName, props, bac
|
|
|
4023
4023
|
function validateAndComputeKeys(nodeKind, kind, constraint, items) {
|
|
4024
4024
|
const validated = [];
|
|
4025
4025
|
for (const item of items) {
|
|
4026
|
-
const validatedProps =
|
|
4026
|
+
const validatedProps = chunk6B3LQUYG_cjs.validateNodeProps(nodeKind.schema, item.props, {
|
|
4027
4027
|
kind,
|
|
4028
4028
|
operation: "create"
|
|
4029
4029
|
});
|
|
@@ -4238,7 +4238,7 @@ async function executeNodeBulkFindByIndex(ctx, kind, indexName, items, backend,
|
|
|
4238
4238
|
}
|
|
4239
4239
|
groupToInputs[existing]?.push(inputIndex);
|
|
4240
4240
|
}
|
|
4241
|
-
const schema = backend.tableNames ?
|
|
4241
|
+
const schema = backend.tableNames ? chunk6JRVV2SS_cjs.createSqlSchema(backend.tableNames) : chunk6JRVV2SS_cjs.DEFAULT_SQL_SCHEMA;
|
|
4242
4242
|
const compileContext = {
|
|
4243
4243
|
dialect: backend.dialect,
|
|
4244
4244
|
propsColumn: chunkXPSPDFKO_cjs.sql.raw(`"props"`),
|
|
@@ -4312,7 +4312,7 @@ function capMatchesPerGroup(matches, limitPerInput) {
|
|
|
4312
4312
|
return capped;
|
|
4313
4313
|
}
|
|
4314
4314
|
async function hydrateNodesById(backend, batchPointRead, graphId, kind, ids) {
|
|
4315
|
-
const rowsById = await
|
|
4315
|
+
const rowsById = await chunk6B3LQUYG_cjs.getNodeRowsByIds(
|
|
4316
4316
|
backend,
|
|
4317
4317
|
batchPointRead,
|
|
4318
4318
|
graphId,
|
|
@@ -4506,5 +4506,5 @@ exports.unsupportedResolvedMutationSet = unsupportedResolvedMutationSet;
|
|
|
4506
4506
|
exports.validityEndAfterMutation = validityEndAfterMutation;
|
|
4507
4507
|
exports.withAlreadyExistsTranslation = withAlreadyExistsTranslation;
|
|
4508
4508
|
exports.writeResultAlwaysChanges = writeResultAlwaysChanges;
|
|
4509
|
-
//# sourceMappingURL=chunk-
|
|
4510
|
-
//# sourceMappingURL=chunk-
|
|
4509
|
+
//# sourceMappingURL=chunk-WY3IFEKV.cjs.map
|
|
4510
|
+
//# sourceMappingURL=chunk-WY3IFEKV.cjs.map
|