@nicia-ai/typegraph 0.59.0 → 0.60.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 +20 -0
- package/README.md +3 -0
- package/dist/backend/postgres/pglite-store.cjs +1 -1
- package/dist/backend/postgres/pglite-store.d.cts +2 -2
- package/dist/backend/postgres/pglite-store.d.ts +2 -2
- package/dist/backend/postgres/pglite-store.js +1 -1
- package/dist/backend/sqlite/local-store.cjs +1 -1
- package/dist/backend/sqlite/local-store.d.cts +2 -2
- package/dist/backend/sqlite/local-store.d.ts +2 -2
- package/dist/backend/sqlite/local-store.js +1 -1
- package/dist/{chunk-MKQY4ZLZ.js → chunk-2DKIJP2R.js} +73 -41
- package/dist/chunk-2DKIJP2R.js.map +1 -0
- package/dist/{chunk-6BVZHDAZ.js → chunk-43DOTETB.js} +3 -3
- package/dist/{chunk-6BVZHDAZ.js.map → chunk-43DOTETB.js.map} +1 -1
- package/dist/{chunk-IV5W7LKW.cjs → chunk-A22XPVBQ.cjs} +2 -2
- package/dist/chunk-A22XPVBQ.cjs.map +1 -0
- package/dist/{chunk-W4NT4IMI.js → chunk-B4P4DAW3.js} +3 -3
- package/dist/{chunk-W4NT4IMI.js.map → chunk-B4P4DAW3.js.map} +1 -1
- package/dist/{chunk-CA76FVJB.cjs → chunk-CNFKFE5L.cjs} +399 -367
- package/dist/chunk-CNFKFE5L.cjs.map +1 -0
- package/dist/{chunk-EN67I47R.cjs → chunk-EHDLHPMK.cjs} +9 -9
- package/dist/{chunk-EN67I47R.cjs.map → chunk-EHDLHPMK.cjs.map} +1 -1
- package/dist/{chunk-V3JKR2CN.js → chunk-FTDRMXIJ.js} +5 -5
- package/dist/{chunk-V3JKR2CN.js.map → chunk-FTDRMXIJ.js.map} +1 -1
- package/dist/{chunk-3GX5HTPP.js → chunk-ILVXUOQY.js} +3 -3
- package/dist/{chunk-3GX5HTPP.js.map → chunk-ILVXUOQY.js.map} +1 -1
- package/dist/{chunk-XGYUUUHY.cjs → chunk-KGQVK2II.cjs} +40 -40
- package/dist/{chunk-XGYUUUHY.cjs.map → chunk-KGQVK2II.cjs.map} +1 -1
- package/dist/{chunk-BPYZUJX5.cjs → chunk-MTJAT6UO.cjs} +5 -5
- package/dist/{chunk-BPYZUJX5.cjs.map → chunk-MTJAT6UO.cjs.map} +1 -1
- package/dist/{chunk-2GZL5ED3.cjs → chunk-OKA6H3B3.cjs} +19 -19
- package/dist/{chunk-2GZL5ED3.cjs.map → chunk-OKA6H3B3.cjs.map} +1 -1
- package/dist/{chunk-26CL47SW.cjs → chunk-PTFO3JI5.cjs} +110 -110
- package/dist/{chunk-26CL47SW.cjs.map → chunk-PTFO3JI5.cjs.map} +1 -1
- package/dist/{chunk-UOHFBYYH.cjs → chunk-Q6ZVQWH7.cjs} +36 -36
- package/dist/{chunk-UOHFBYYH.cjs.map → chunk-Q6ZVQWH7.cjs.map} +1 -1
- package/dist/{chunk-HWWPL2YL.js → chunk-QWIR5533.js} +2 -2
- package/dist/chunk-QWIR5533.js.map +1 -0
- package/dist/{chunk-DZ3ETMXF.js → chunk-UVQMUBZ6.js} +6 -6
- package/dist/{chunk-DZ3ETMXF.js.map → chunk-UVQMUBZ6.js.map} +1 -1
- package/dist/{chunk-E6PU35DE.js → chunk-W6K6NSRT.js} +4 -4
- package/dist/{chunk-E6PU35DE.js.map → chunk-W6K6NSRT.js.map} +1 -1
- package/dist/graph-merge/index.cjs +119 -119
- package/dist/graph-merge/index.d.cts +2 -2
- package/dist/graph-merge/index.d.ts +2 -2
- package/dist/graph-merge/index.js +7 -7
- package/dist/{graph-templates-DQnmCPkd.d.ts → graph-templates-ClBhrXiA.d.ts} +1 -1
- package/dist/{graph-templates-Buh-RlmQ.d.cts → graph-templates-DfmKDARd.d.cts} +1 -1
- package/dist/index.cjs +68 -68
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +8 -8
- package/dist/interchange/index.cjs +28 -28
- package/dist/interchange/index.d.cts +2 -2
- package/dist/interchange/index.d.ts +2 -2
- package/dist/interchange/index.js +5 -5
- package/dist/{local-store-impl-GFBZBCTN.cjs → local-store-impl-QGSRYFZF.cjs} +9 -9
- package/dist/{local-store-impl-GFBZBCTN.cjs.map → local-store-impl-QGSRYFZF.cjs.map} +1 -1
- package/dist/{local-store-impl-EPUMDNQJ.js → local-store-impl-VEVK2VGA.js} +8 -8
- package/dist/{local-store-impl-EPUMDNQJ.js.map → local-store-impl-VEVK2VGA.js.map} +1 -1
- package/dist/{pglite-store-impl-DB4RRLB7.cjs → pglite-store-impl-33CI3P3M.cjs} +9 -9
- package/dist/{pglite-store-impl-DB4RRLB7.cjs.map → pglite-store-impl-33CI3P3M.cjs.map} +1 -1
- package/dist/{pglite-store-impl-M5PWKN7Z.js → pglite-store-impl-RDPTOOP3.js} +8 -8
- package/dist/{pglite-store-impl-M5PWKN7Z.js.map → pglite-store-impl-RDPTOOP3.js.map} +1 -1
- package/dist/profiler/index.d.cts +2 -2
- package/dist/profiler/index.d.ts +2 -2
- package/dist/provenance/index.cjs +15 -15
- package/dist/provenance/index.d.cts +2 -2
- package/dist/provenance/index.d.ts +2 -2
- package/dist/provenance/index.js +2 -2
- package/dist/schema/index.cjs +34 -34
- package/dist/schema/index.d.cts +3 -3
- package/dist/schema/index.d.ts +3 -3
- package/dist/schema/index.js +4 -4
- package/dist/{store-sLu0hcRm.d.ts → store-B5WZ8E5m.d.ts} +225 -215
- package/dist/{store-CvtRQ8Nb.d.cts → store-DdhFpX53.d.cts} +225 -215
- package/package.json +1 -1
- package/dist/chunk-CA76FVJB.cjs.map +0 -1
- package/dist/chunk-HWWPL2YL.js.map +0 -1
- package/dist/chunk-IV5W7LKW.cjs.map +0 -1
- package/dist/chunk-MKQY4ZLZ.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkMTJAT6UO_cjs = require('./chunk-MTJAT6UO.cjs');
|
|
4
4
|
var chunkY6M5BFRJ_cjs = require('./chunk-Y6M5BFRJ.cjs');
|
|
5
5
|
var chunkGD7IWK36_cjs = require('./chunk-GD7IWK36.cjs');
|
|
6
6
|
var chunkR255UE5U_cjs = require('./chunk-R255UE5U.cjs');
|
|
7
7
|
var chunkXUCVGEJT_cjs = require('./chunk-XUCVGEJT.cjs');
|
|
8
|
-
var
|
|
9
|
-
var
|
|
8
|
+
var chunkQ6ZVQWH7_cjs = require('./chunk-Q6ZVQWH7.cjs');
|
|
9
|
+
var chunkA22XPVBQ_cjs = require('./chunk-A22XPVBQ.cjs');
|
|
10
10
|
var chunkWEXAMJTA_cjs = require('./chunk-WEXAMJTA.cjs');
|
|
11
11
|
var chunkOGK7F2J3_cjs = require('./chunk-OGK7F2J3.cjs');
|
|
12
12
|
var chunkEOLNL35G_cjs = require('./chunk-EOLNL35G.cjs');
|
|
@@ -74,14 +74,14 @@ function edgeWriteNeedsConstraintFence(cardinality) {
|
|
|
74
74
|
return cardinality === "many" ? void 0 : "edgeCardinality";
|
|
75
75
|
}
|
|
76
76
|
function nodeWriteNeedsConstraintFence(registry, kind, uniqueConstraints, operation) {
|
|
77
|
-
return
|
|
77
|
+
return chunkMTJAT6UO_cjs.nodeClaimSites(registry, kind, uniqueConstraints, operation).find(
|
|
78
78
|
(site) => site.needsLockFence
|
|
79
79
|
)?.refusalReason;
|
|
80
80
|
}
|
|
81
81
|
function graphOwesClaims(graph, registry) {
|
|
82
82
|
for (const [kind, registration] of Object.entries(graph.nodes)) {
|
|
83
83
|
for (const operation of ["create", "update"]) {
|
|
84
|
-
const gating =
|
|
84
|
+
const gating = chunkMTJAT6UO_cjs.nodeClaimSites(
|
|
85
85
|
registry,
|
|
86
86
|
kind,
|
|
87
87
|
registration.unique ?? [],
|
|
@@ -502,8 +502,8 @@ function isAutocommitSingleStatementWrite(input) {
|
|
|
502
502
|
// unitOfWork, so it takes `runHookedWritePlan`'s route instead,
|
|
503
503
|
// where `canFuseSchemaFenceInFirstWrite` already selects the
|
|
504
504
|
// correct statement per id.
|
|
505
|
-
candidate.idGenerated && candidate.kindRegistered && candidate.uniqueConstraintCount === 0 && candidate.disjointKindCount === 0 && (
|
|
506
|
-
embedding:
|
|
505
|
+
candidate.idGenerated && candidate.kindRegistered && candidate.uniqueConstraintCount === 0 && candidate.disjointKindCount === 0 && (chunkMTJAT6UO_cjs.getEmbeddingFields(candidate.schema).length > 0 || chunkHAHNRASW_cjs.getSearchableFields(candidate.schema).length > 0 ? chunkY6M5BFRJ_cjs.supportsNodeInsertProjectionRequirements(candidate.backend, {
|
|
506
|
+
embedding: chunkMTJAT6UO_cjs.getEmbeddingFields(candidate.schema).length > 0,
|
|
507
507
|
fulltext: chunkHAHNRASW_cjs.getSearchableFields(candidate.schema).length > 0
|
|
508
508
|
}) : candidate.backend.insertNodeWithSchemaFence !== void 0);
|
|
509
509
|
}
|
|
@@ -638,7 +638,7 @@ function assertPortableNodeFallbackCanRun(target, params, projections) {
|
|
|
638
638
|
);
|
|
639
639
|
}
|
|
640
640
|
function assertClaimFreeInsertIfAbsentWork(ctx, work) {
|
|
641
|
-
const derivedPlan =
|
|
641
|
+
const derivedPlan = chunkMTJAT6UO_cjs.planNodeCreateClaims(ctx, work.claim);
|
|
642
642
|
if (derivedPlan.claims.length === 0 && work.claimPlan.entries.length === 0 && work.claimPlan.claims.length === 0 && work.claimPlan.verdicts.length === 0) {
|
|
643
643
|
return;
|
|
644
644
|
}
|
|
@@ -657,20 +657,20 @@ function edgeBatchClaims(work) {
|
|
|
657
657
|
return work.flatMap((item) => item.claim === void 0 ? [] : [item.claim]);
|
|
658
658
|
}
|
|
659
659
|
function createWriteSession(ctx, target, lock) {
|
|
660
|
-
const writeContext =
|
|
660
|
+
const writeContext = chunkMTJAT6UO_cjs.createNodeWriteContext(
|
|
661
661
|
ctx.graphId,
|
|
662
662
|
ctx.registry,
|
|
663
663
|
lock,
|
|
664
664
|
ctx.claimsVerdict,
|
|
665
665
|
ctx.uniqueSidecarBatch
|
|
666
666
|
);
|
|
667
|
-
const dispatch =
|
|
667
|
+
const dispatch = chunkA22XPVBQ_cjs.nodeInsertDispatch(target);
|
|
668
668
|
const edgeContext = createEdgeWriteContext(
|
|
669
669
|
ctx.graphId,
|
|
670
670
|
lock,
|
|
671
671
|
ctx.claimsVerdict
|
|
672
672
|
);
|
|
673
|
-
const edgeDispatch =
|
|
673
|
+
const edgeDispatch = chunkA22XPVBQ_cjs.edgeInsertDispatch(target);
|
|
674
674
|
return {
|
|
675
675
|
// The pinned coordination order, spelled once per insert shape:
|
|
676
676
|
// pre-insert claims, the row, post-insert claims, the sync fans. The claim
|
|
@@ -686,7 +686,7 @@ function createWriteSession(ctx, target, lock) {
|
|
|
686
686
|
projections: work.projections,
|
|
687
687
|
allowNonTransactionalClaims: work.allowNonTransactionalClaims
|
|
688
688
|
});
|
|
689
|
-
const insertPortableNode = () =>
|
|
689
|
+
const insertPortableNode = () => chunkMTJAT6UO_cjs.withNodeCreateClaims(
|
|
690
690
|
writeContext,
|
|
691
691
|
work.claim,
|
|
692
692
|
target,
|
|
@@ -735,11 +735,11 @@ function createWriteSession(ctx, target, lock) {
|
|
|
735
735
|
}
|
|
736
736
|
return { row: result.row, projectionsFused: true };
|
|
737
737
|
} catch (error) {
|
|
738
|
-
|
|
738
|
+
chunkMTJAT6UO_cjs.refuseNodeCreateClaimError(error, claimPlan);
|
|
739
739
|
}
|
|
740
740
|
};
|
|
741
741
|
const { row, projectionsFused } = await insertPlannedNode();
|
|
742
|
-
await
|
|
742
|
+
await chunkMTJAT6UO_cjs.applyNodeInsertSyncFans(
|
|
743
743
|
writeContext,
|
|
744
744
|
{
|
|
745
745
|
...work.sideEffects,
|
|
@@ -751,9 +751,9 @@ function createWriteSession(ctx, target, lock) {
|
|
|
751
751
|
},
|
|
752
752
|
createNodeIfAbsent: async (work) => {
|
|
753
753
|
assertClaimFreeInsertIfAbsentWork(ctx, work);
|
|
754
|
-
const row = await
|
|
754
|
+
const row = await chunkA22XPVBQ_cjs.runInsertIfAbsent(dispatch, work.params);
|
|
755
755
|
if (row === void 0) return;
|
|
756
|
-
await
|
|
756
|
+
await chunkMTJAT6UO_cjs.applyNodeInsertSyncFans(writeContext, work.sideEffects, target);
|
|
757
757
|
return row;
|
|
758
758
|
},
|
|
759
759
|
createNodeIfAbsentWithSchemaFence: async (work, schemaFence) => {
|
|
@@ -762,7 +762,7 @@ function createWriteSession(ctx, target, lock) {
|
|
|
762
762
|
if (insert === void 0) return;
|
|
763
763
|
const row = await insert(work.params, schemaFence);
|
|
764
764
|
if (row === void 0) return;
|
|
765
|
-
await
|
|
765
|
+
await chunkMTJAT6UO_cjs.applyNodeInsertSyncFans(writeContext, work.sideEffects, target);
|
|
766
766
|
return row;
|
|
767
767
|
},
|
|
768
768
|
createNodeWithSchemaFence: async (work, schemaFence) => {
|
|
@@ -788,7 +788,7 @@ function createWriteSession(ctx, target, lock) {
|
|
|
788
788
|
projections: work.projections
|
|
789
789
|
}
|
|
790
790
|
};
|
|
791
|
-
return
|
|
791
|
+
return chunkMTJAT6UO_cjs.withNodeCreateClaims(
|
|
792
792
|
writeContext,
|
|
793
793
|
work.claim,
|
|
794
794
|
target,
|
|
@@ -819,7 +819,7 @@ function createWriteSession(ctx, target, lock) {
|
|
|
819
819
|
})();
|
|
820
820
|
const { row, projectionsFused } = inserted;
|
|
821
821
|
if (row === void 0) return;
|
|
822
|
-
await
|
|
822
|
+
await chunkMTJAT6UO_cjs.applyNodeInsertSyncFans(
|
|
823
823
|
writeContext,
|
|
824
824
|
{
|
|
825
825
|
...work.sideEffects,
|
|
@@ -830,25 +830,25 @@ function createWriteSession(ctx, target, lock) {
|
|
|
830
830
|
return row;
|
|
831
831
|
},
|
|
832
832
|
createNodeNoReturn: async (work) => {
|
|
833
|
-
await
|
|
833
|
+
await chunkMTJAT6UO_cjs.withNodeCreateClaims(
|
|
834
834
|
writeContext,
|
|
835
835
|
work.claim,
|
|
836
836
|
target,
|
|
837
|
-
() =>
|
|
837
|
+
() => chunkA22XPVBQ_cjs.runInsertNoReturn(dispatch, work.params)
|
|
838
838
|
);
|
|
839
|
-
await
|
|
839
|
+
await chunkMTJAT6UO_cjs.applyNodeInsertSyncFans(writeContext, work.sideEffects, target);
|
|
840
840
|
},
|
|
841
841
|
createNodes: async (work) => {
|
|
842
|
-
const rows = await
|
|
842
|
+
const rows = await chunkMTJAT6UO_cjs.withNodeCreateClaimsBatch(
|
|
843
843
|
writeContext,
|
|
844
844
|
work.map((item) => item.claim),
|
|
845
845
|
target,
|
|
846
|
-
() =>
|
|
846
|
+
() => chunkA22XPVBQ_cjs.runInsertBatchReturning(
|
|
847
847
|
dispatch,
|
|
848
848
|
work.map((item) => item.params)
|
|
849
849
|
)
|
|
850
850
|
);
|
|
851
|
-
await
|
|
851
|
+
await chunkMTJAT6UO_cjs.applyNodeInsertSyncFansBatch(
|
|
852
852
|
writeContext,
|
|
853
853
|
work.map((item) => item.sideEffects),
|
|
854
854
|
target
|
|
@@ -856,16 +856,16 @@ function createWriteSession(ctx, target, lock) {
|
|
|
856
856
|
return rows;
|
|
857
857
|
},
|
|
858
858
|
createNodesNoReturn: async (work) => {
|
|
859
|
-
await
|
|
859
|
+
await chunkMTJAT6UO_cjs.withNodeCreateClaimsBatch(
|
|
860
860
|
writeContext,
|
|
861
861
|
work.map((item) => item.claim),
|
|
862
862
|
target,
|
|
863
|
-
() =>
|
|
863
|
+
() => chunkA22XPVBQ_cjs.runInsertBatch(
|
|
864
864
|
dispatch,
|
|
865
865
|
work.map((item) => item.params)
|
|
866
866
|
)
|
|
867
867
|
);
|
|
868
|
-
await
|
|
868
|
+
await chunkMTJAT6UO_cjs.applyNodeInsertSyncFansBatch(
|
|
869
869
|
writeContext,
|
|
870
870
|
work.map((item) => item.sideEffects),
|
|
871
871
|
target
|
|
@@ -874,18 +874,18 @@ function createWriteSession(ctx, target, lock) {
|
|
|
874
874
|
reviseNode: (work, fences) => {
|
|
875
875
|
const draft = createWriteParamsDraft();
|
|
876
876
|
applyWriteFences(NODE_UPDATE_FENCE_APPLIERS, fences, draft);
|
|
877
|
-
return
|
|
877
|
+
return chunkMTJAT6UO_cjs.applyNodeUpdate(writeContext, { ...work, ...draft }, target);
|
|
878
878
|
},
|
|
879
|
-
retireNode: (work, policy) =>
|
|
880
|
-
purgeNode: (work) =>
|
|
881
|
-
reviveNode: (work) =>
|
|
879
|
+
retireNode: (work, policy) => chunkMTJAT6UO_cjs.applyNodeSoftDelete(writeContext, work, target, policy),
|
|
880
|
+
purgeNode: (work) => chunkMTJAT6UO_cjs.applyNodeHardDelete(writeContext, work, target),
|
|
881
|
+
reviveNode: (work) => chunkMTJAT6UO_cjs.applyNodeResurrect(writeContext, work, target),
|
|
882
882
|
reviseNodeSet: (work, fences) => {
|
|
883
883
|
applyWriteFences(
|
|
884
884
|
NODE_SET_UPDATE_FENCE_APPLIERS,
|
|
885
885
|
fences,
|
|
886
886
|
createWriteParamsDraft()
|
|
887
887
|
);
|
|
888
|
-
return
|
|
888
|
+
return chunkMTJAT6UO_cjs.applyNodeSetUpdate(writeContext, work, target);
|
|
889
889
|
},
|
|
890
890
|
// An edge write obliges no DERIVED data, so these apply no sync fans — but a
|
|
891
891
|
// constrained kind owes its cardinality claim, at the same PRE-INSERT
|
|
@@ -930,7 +930,7 @@ function createWriteSession(ctx, target, lock) {
|
|
|
930
930
|
if (work.claim !== void 0) {
|
|
931
931
|
await chunkGD7IWK36_cjs.claimEdgeCardinality(target, ctx.claimsVerdict(), work.claim);
|
|
932
932
|
}
|
|
933
|
-
await
|
|
933
|
+
await chunkA22XPVBQ_cjs.runInsertNoReturn(edgeDispatch, work.params);
|
|
934
934
|
},
|
|
935
935
|
createEdges: async (work) => {
|
|
936
936
|
await chunkGD7IWK36_cjs.claimEdgeCardinalityBatch(
|
|
@@ -938,7 +938,7 @@ function createWriteSession(ctx, target, lock) {
|
|
|
938
938
|
ctx.claimsVerdict(),
|
|
939
939
|
edgeBatchClaims(work)
|
|
940
940
|
);
|
|
941
|
-
return
|
|
941
|
+
return chunkA22XPVBQ_cjs.runInsertBatchReturning(
|
|
942
942
|
edgeDispatch,
|
|
943
943
|
work.map((item) => item.params)
|
|
944
944
|
);
|
|
@@ -967,7 +967,7 @@ function createWriteSession(ctx, target, lock) {
|
|
|
967
967
|
ctx.claimsVerdict(),
|
|
968
968
|
edgeBatchClaims(work)
|
|
969
969
|
);
|
|
970
|
-
await
|
|
970
|
+
await chunkA22XPVBQ_cjs.runInsertBatch(
|
|
971
971
|
edgeDispatch,
|
|
972
972
|
work.map((item) => item.params)
|
|
973
973
|
);
|
|
@@ -1017,7 +1017,7 @@ function planTransactionOptions(plan, options) {
|
|
|
1017
1017
|
return { ...options, fencesConstraintProbe: plan.constraintProbe };
|
|
1018
1018
|
}
|
|
1019
1019
|
function runWritePlan(ctx, plan, backend, rowWork, options) {
|
|
1020
|
-
return
|
|
1020
|
+
return chunkA22XPVBQ_cjs.runInWriteTransaction(
|
|
1021
1021
|
ctx,
|
|
1022
1022
|
backend,
|
|
1023
1023
|
planFrame(ctx, plan, rowWork),
|
|
@@ -1025,7 +1025,7 @@ function runWritePlan(ctx, plan, backend, rowWork, options) {
|
|
|
1025
1025
|
);
|
|
1026
1026
|
}
|
|
1027
1027
|
function runHookedWritePlan(ctx, opContext, plan, backend, rowWork, options) {
|
|
1028
|
-
return
|
|
1028
|
+
return chunkA22XPVBQ_cjs.runHookedWriteOperation(
|
|
1029
1029
|
ctx,
|
|
1030
1030
|
opContext,
|
|
1031
1031
|
backend,
|
|
@@ -1043,7 +1043,7 @@ function runAutocommitSingleStatementWritePlan(ctx, opContext, plan, backend, ro
|
|
|
1043
1043
|
try {
|
|
1044
1044
|
return await planFrame(ctx, plan, rowWork)(
|
|
1045
1045
|
backend,
|
|
1046
|
-
|
|
1046
|
+
chunkA22XPVBQ_cjs.uncapturedGraphWriteLock(),
|
|
1047
1047
|
"none"
|
|
1048
1048
|
);
|
|
1049
1049
|
} catch (error) {
|
|
@@ -1223,13 +1223,13 @@ function resolveAtomicMutationProfile(input) {
|
|
|
1223
1223
|
}
|
|
1224
1224
|
function atomicNodeProjectionFamilies(registration) {
|
|
1225
1225
|
return [
|
|
1226
|
-
...
|
|
1226
|
+
...chunkMTJAT6UO_cjs.getEmbeddingFields(registration.type.schema).length === 0 ? [] : ["embedding"],
|
|
1227
1227
|
...chunkHAHNRASW_cjs.getSearchableFields(registration.type.schema).length === 0 ? [] : ["fulltext"]
|
|
1228
1228
|
];
|
|
1229
1229
|
}
|
|
1230
1230
|
async function assertAtomicDeleteSchemaFenceMatched(matched, ctx, backend, entity) {
|
|
1231
1231
|
if (matched) return;
|
|
1232
|
-
await
|
|
1232
|
+
await chunkA22XPVBQ_cjs.diagnoseFusedSchemaFenceNoRow(ctx, backend);
|
|
1233
1233
|
throw new chunkG7W67PZO_cjs.DatabaseOperationError(
|
|
1234
1234
|
"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.",
|
|
1235
1235
|
{ operation: "delete", entity }
|
|
@@ -1350,7 +1350,7 @@ function resolveAtomicNodeDeleteBatchExecutor(input) {
|
|
|
1350
1350
|
return;
|
|
1351
1351
|
}
|
|
1352
1352
|
if (chunkHAHNRASW_cjs.getSearchableFields(registration.type.schema).length > 0) return;
|
|
1353
|
-
if (
|
|
1353
|
+
if (chunkMTJAT6UO_cjs.getEmbeddingFields(registration.type.schema).length > 0) return;
|
|
1354
1354
|
return executor;
|
|
1355
1355
|
}
|
|
1356
1356
|
function isAtomicResolvedNodeKindEligible(input) {
|
|
@@ -1556,7 +1556,7 @@ function createNodeBatchValidationSeams(graphId, registry, backend) {
|
|
|
1556
1556
|
});
|
|
1557
1557
|
}
|
|
1558
1558
|
function registerPendingUniqueEntries(kind, id, props, constraints) {
|
|
1559
|
-
for (const entry of
|
|
1559
|
+
for (const entry of chunkMTJAT6UO_cjs.nodeClaimEntries(
|
|
1560
1560
|
registry,
|
|
1561
1561
|
kind,
|
|
1562
1562
|
id,
|
|
@@ -1578,12 +1578,12 @@ function createNodeBatchValidationSeams(graphId, registry, backend) {
|
|
|
1578
1578
|
function registerAppliedNodeUpdate(kind, id, oldProps, newProps, constraints) {
|
|
1579
1579
|
const owner = { concreteKind: kind, nodeId: id };
|
|
1580
1580
|
const oldEntries = new Map(
|
|
1581
|
-
|
|
1581
|
+
chunkMTJAT6UO_cjs.nodeClaimEntries(registry, kind, id, oldProps, constraints, "update").map(
|
|
1582
1582
|
(entry) => [entry.constraintName, entry]
|
|
1583
1583
|
)
|
|
1584
1584
|
);
|
|
1585
1585
|
const newEntries = new Map(
|
|
1586
|
-
|
|
1586
|
+
chunkMTJAT6UO_cjs.nodeClaimEntries(registry, kind, id, newProps, constraints, "update").map(
|
|
1587
1587
|
(entry) => [entry.constraintName, entry]
|
|
1588
1588
|
)
|
|
1589
1589
|
);
|
|
@@ -1654,7 +1654,7 @@ function draftNodeCreate(ctx, input, id, options) {
|
|
|
1654
1654
|
const kind = input.kind;
|
|
1655
1655
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
1656
1656
|
const nodeKind = registration.type;
|
|
1657
|
-
const validatedProps = options?.propsPreValidated === true ? input.props :
|
|
1657
|
+
const validatedProps = options?.propsPreValidated === true ? input.props : chunkA22XPVBQ_cjs.validateNodeProps(nodeKind.schema, input.props, {
|
|
1658
1658
|
kind,
|
|
1659
1659
|
operation: "create"
|
|
1660
1660
|
});
|
|
@@ -1677,11 +1677,11 @@ function draftNodeCreate(ctx, input, id, options) {
|
|
|
1677
1677
|
}
|
|
1678
1678
|
async function finishNodeCreatePreparation(ctx, draft, backend, allowInsertIfAbsent = true, mode = "probe", preparedClaimPlan) {
|
|
1679
1679
|
const { kind, id, validatedProps, uniqueConstraints } = draft;
|
|
1680
|
-
const claimPlan = preparedClaimPlan ??
|
|
1680
|
+
const claimPlan = preparedClaimPlan ?? chunkMTJAT6UO_cjs.planNodeCreateClaims(
|
|
1681
1681
|
{ graphId: ctx.graphId, registry: ctx.registry },
|
|
1682
1682
|
{ kind, id, props: validatedProps, constraints: uniqueConstraints }
|
|
1683
1683
|
);
|
|
1684
|
-
const insertIfAbsent = allowInsertIfAbsent && draft.idProvided && backend.insertNodeIfAbsent !== void 0 &&
|
|
1684
|
+
const insertIfAbsent = allowInsertIfAbsent && draft.idProvided && backend.insertNodeIfAbsent !== void 0 && chunkMTJAT6UO_cjs.nodeClaimEntries(
|
|
1685
1685
|
ctx.registry,
|
|
1686
1686
|
kind,
|
|
1687
1687
|
id,
|
|
@@ -1703,8 +1703,8 @@ async function finishNodeCreatePreparation(ctx, draft, backend, allowInsertIfAbs
|
|
|
1703
1703
|
if (draft.idProvided && !insertIfAbsent) {
|
|
1704
1704
|
await checkDisjointnessConstraint(constraintContext, kind, id);
|
|
1705
1705
|
}
|
|
1706
|
-
await
|
|
1707
|
-
|
|
1706
|
+
await chunkMTJAT6UO_cjs.checkUniquenessConstraints(
|
|
1707
|
+
chunkMTJAT6UO_cjs.createUniquenessContext(
|
|
1708
1708
|
ctx.graphId,
|
|
1709
1709
|
ctx.registry,
|
|
1710
1710
|
backend,
|
|
@@ -1754,17 +1754,17 @@ function nodeCreateClaimItem(prepared) {
|
|
|
1754
1754
|
};
|
|
1755
1755
|
}
|
|
1756
1756
|
function resolveNodeInsertProjections(schema, props) {
|
|
1757
|
-
const fulltext =
|
|
1757
|
+
const fulltext = chunkMTJAT6UO_cjs.resolveNodeFulltextProjection(schema, props);
|
|
1758
1758
|
return [
|
|
1759
1759
|
...fulltext === void 0 ? [] : [fulltext],
|
|
1760
|
-
...
|
|
1760
|
+
...chunkMTJAT6UO_cjs.resolveNodeEmbeddingProjections(schema, props)
|
|
1761
1761
|
];
|
|
1762
1762
|
}
|
|
1763
1763
|
function resolveAtomicNodeProjections(schema, props, options) {
|
|
1764
|
-
const fulltext =
|
|
1764
|
+
const fulltext = chunkMTJAT6UO_cjs.resolveNodeFulltextProjection(schema, props);
|
|
1765
1765
|
return [
|
|
1766
1766
|
...fulltext === void 0 ? [] : [fulltext],
|
|
1767
|
-
...
|
|
1767
|
+
...chunkMTJAT6UO_cjs.resolveNodeEmbeddingProjectionTransitions(schema, props, {
|
|
1768
1768
|
omitDeletes: options?.omitEmbeddingDeletes === true
|
|
1769
1769
|
})
|
|
1770
1770
|
];
|
|
@@ -1785,7 +1785,7 @@ function foldReferences(preparedCreates) {
|
|
|
1785
1785
|
}
|
|
1786
1786
|
function computeNodeUpdate(ctx, kind, id, existingProps, inputProps) {
|
|
1787
1787
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
1788
|
-
const validatedProps =
|
|
1788
|
+
const validatedProps = chunkA22XPVBQ_cjs.validateNodeProps(
|
|
1789
1789
|
registration.type.schema,
|
|
1790
1790
|
{ ...existingProps, ...inputProps },
|
|
1791
1791
|
{ kind, operation: "update", id }
|
|
@@ -1944,11 +1944,11 @@ async function primeBatchValidationCaches(ctx, drafts, backend, seams) {
|
|
|
1944
1944
|
chunkEOLNL35G_cjs.UNIQUE_SIDECAR_BATCH.id
|
|
1945
1945
|
);
|
|
1946
1946
|
if (boundCheckUniqueBatch !== void 0) {
|
|
1947
|
-
const groups =
|
|
1947
|
+
const groups = chunkMTJAT6UO_cjs.groupNodeUniquenessProbes(
|
|
1948
1948
|
ctx.registry,
|
|
1949
1949
|
drafts.map((draft) => ({
|
|
1950
1950
|
kind: draft.kind,
|
|
1951
|
-
entries:
|
|
1951
|
+
entries: chunkMTJAT6UO_cjs.nodeClaimEntries(
|
|
1952
1952
|
ctx.registry,
|
|
1953
1953
|
draft.kind,
|
|
1954
1954
|
draft.id,
|
|
@@ -1986,7 +1986,7 @@ async function prepareBatchCreates(ctx, inputs, backend, options) {
|
|
|
1986
1986
|
seedUniqueRow
|
|
1987
1987
|
} = createNodeBatchValidationSeams(ctx.graphId, ctx.registry, backend);
|
|
1988
1988
|
const drafts = inputs.map(
|
|
1989
|
-
(input) => draftNodeCreate(ctx, input, input.id ??
|
|
1989
|
+
(input) => draftNodeCreate(ctx, input, input.id ?? chunkA22XPVBQ_cjs.generateId(), options)
|
|
1990
1990
|
);
|
|
1991
1991
|
await primeBatchValidationCaches(ctx, drafts, backend, {
|
|
1992
1992
|
seedNodeRow,
|
|
@@ -2013,7 +2013,7 @@ async function prepareBatchCreates(ctx, inputs, backend, options) {
|
|
|
2013
2013
|
}
|
|
2014
2014
|
async function prepareAtomicBatchCreates(ctx, inputs, backend, options) {
|
|
2015
2015
|
const drafts = inputs.map(
|
|
2016
|
-
(input) => draftNodeCreate(ctx, input, input.id ??
|
|
2016
|
+
(input) => draftNodeCreate(ctx, input, input.id ?? chunkA22XPVBQ_cjs.generateId(), options)
|
|
2017
2017
|
);
|
|
2018
2018
|
const seen = /* @__PURE__ */ new Set();
|
|
2019
2019
|
for (const draft of drafts) {
|
|
@@ -2025,7 +2025,7 @@ async function prepareAtomicBatchCreates(ctx, inputs, backend, options) {
|
|
|
2025
2025
|
}
|
|
2026
2026
|
return Promise.all(
|
|
2027
2027
|
drafts.map(async (draft) => {
|
|
2028
|
-
const claimPlan =
|
|
2028
|
+
const claimPlan = chunkMTJAT6UO_cjs.planNodeCreateClaims(
|
|
2029
2029
|
{ graphId: ctx.graphId, registry: ctx.registry },
|
|
2030
2030
|
{
|
|
2031
2031
|
kind: draft.kind,
|
|
@@ -2091,7 +2091,7 @@ function atomicNodeBatchEntries(preparedCreates, claimSupport) {
|
|
|
2091
2091
|
fields: claim.verdict.kind === "uniqueness" ? claim.verdict.fields : [],
|
|
2092
2092
|
axis: claim.axis
|
|
2093
2093
|
});
|
|
2094
|
-
|
|
2094
|
+
chunkMTJAT6UO_cjs.refuseNodeCreateClaimError(error, prepared.claimPlan);
|
|
2095
2095
|
}
|
|
2096
2096
|
ownerByClaimTarget.set(targetKey, {
|
|
2097
2097
|
kind: prepared.kind,
|
|
@@ -2114,7 +2114,7 @@ function atomicNodeBatchEntries(preparedCreates, claimSupport) {
|
|
|
2114
2114
|
}
|
|
2115
2115
|
function prepareNodeReplacement(ctx, kind, props) {
|
|
2116
2116
|
const schema = getNodeRegistration(ctx.graph, kind).type.schema;
|
|
2117
|
-
return
|
|
2117
|
+
return chunkA22XPVBQ_cjs.validateNodeProps(schema, props, { kind, operation: "update" });
|
|
2118
2118
|
}
|
|
2119
2119
|
async function executeNodeReplacementBatch(ctx, kind, items, backend) {
|
|
2120
2120
|
if (items.length === 0) return appliedResolvedMutationSet([]);
|
|
@@ -2181,7 +2181,7 @@ async function executeNodeReplacementBatch(ctx, kind, items, backend) {
|
|
|
2181
2181
|
}
|
|
2182
2182
|
);
|
|
2183
2183
|
}
|
|
2184
|
-
|
|
2184
|
+
chunkA22XPVBQ_cjs.memoizeLeasedSchemaFence(ctx, backend);
|
|
2185
2185
|
return appliedResolvedMutationSet(
|
|
2186
2186
|
restoreAtomicNodeBatchRows(ctx.graphId, preparedCreates, returnedRows).map(
|
|
2187
2187
|
(row) => rowToNode(row)
|
|
@@ -2192,7 +2192,7 @@ async function withAtomicNodeClaimTranslation(preparedCreates, execute) {
|
|
|
2192
2192
|
try {
|
|
2193
2193
|
return await execute();
|
|
2194
2194
|
} catch (error) {
|
|
2195
|
-
|
|
2195
|
+
chunkMTJAT6UO_cjs.refuseNodeCreateClaimError(error, {
|
|
2196
2196
|
entries: preparedCreates.flatMap(
|
|
2197
2197
|
(prepared) => prepared.claimPlan.entries
|
|
2198
2198
|
),
|
|
@@ -2265,14 +2265,14 @@ async function diagnoseAtomicNodeDisjointness(ctx, backend, preparedCreates) {
|
|
|
2265
2265
|
...group.ids
|
|
2266
2266
|
]);
|
|
2267
2267
|
for (const row of rows) {
|
|
2268
|
-
rowsByReference.set(
|
|
2268
|
+
rowsByReference.set(chunkQ6ZVQWH7_cjs.refKey({ kind: row.kind, id: row.id }), row);
|
|
2269
2269
|
}
|
|
2270
2270
|
}
|
|
2271
2271
|
);
|
|
2272
2272
|
return preparedCreates.map((prepared, index) => {
|
|
2273
2273
|
for (const conflictingKind of chunkBXHAPCQG_cjs.requireDefined(disjointKindsByInput[index])) {
|
|
2274
2274
|
const row = rowsByReference.get(
|
|
2275
|
-
|
|
2275
|
+
chunkQ6ZVQWH7_cjs.refKey({ kind: conflictingKind, id: prepared.id })
|
|
2276
2276
|
);
|
|
2277
2277
|
if (row === void 0 || !chunkEOLNL35G_cjs.isLiveNodeRow(row)) continue;
|
|
2278
2278
|
const error = chunkFSSQ4YNU_cjs.checkDisjointness(
|
|
@@ -2292,7 +2292,7 @@ async function diagnoseAtomicNodeUniqueness(ctx, backend, preparedCreates) {
|
|
|
2292
2292
|
ctx.uniqueSidecarBatch.extras.checkUniqueBatch,
|
|
2293
2293
|
chunkEOLNL35G_cjs.UNIQUE_SIDECAR_BATCH.id
|
|
2294
2294
|
);
|
|
2295
|
-
const uniquenessContext =
|
|
2295
|
+
const uniquenessContext = chunkMTJAT6UO_cjs.createUniquenessContext(
|
|
2296
2296
|
ctx.graphId,
|
|
2297
2297
|
ctx.registry,
|
|
2298
2298
|
backend,
|
|
@@ -2301,7 +2301,7 @@ async function diagnoseAtomicNodeUniqueness(ctx, backend, preparedCreates) {
|
|
|
2301
2301
|
if (boundCheckUniqueBatch === void 0) {
|
|
2302
2302
|
return captureAtomicNodeClaimDiagnosticVerdicts(
|
|
2303
2303
|
preparedCreates,
|
|
2304
|
-
async (prepared) =>
|
|
2304
|
+
async (prepared) => chunkMTJAT6UO_cjs.checkUniquenessConstraints(
|
|
2305
2305
|
uniquenessContext,
|
|
2306
2306
|
prepared.kind,
|
|
2307
2307
|
prepared.id,
|
|
@@ -2312,7 +2312,7 @@ async function diagnoseAtomicNodeUniqueness(ctx, backend, preparedCreates) {
|
|
|
2312
2312
|
}
|
|
2313
2313
|
const probeItems = preparedCreates.map((prepared) => ({
|
|
2314
2314
|
kind: prepared.kind,
|
|
2315
|
-
entries:
|
|
2315
|
+
entries: chunkMTJAT6UO_cjs.nodeClaimEntries(
|
|
2316
2316
|
ctx.registry,
|
|
2317
2317
|
prepared.kind,
|
|
2318
2318
|
prepared.id,
|
|
@@ -2321,7 +2321,7 @@ async function diagnoseAtomicNodeUniqueness(ctx, backend, preparedCreates) {
|
|
|
2321
2321
|
"create"
|
|
2322
2322
|
)
|
|
2323
2323
|
}));
|
|
2324
|
-
const groups =
|
|
2324
|
+
const groups = chunkMTJAT6UO_cjs.groupNodeUniquenessProbes(ctx.registry, probeItems);
|
|
2325
2325
|
const rowsByTarget = /* @__PURE__ */ new Map();
|
|
2326
2326
|
await runAtomicNodeClaimDiagnosticGroups(groups, async (group) => {
|
|
2327
2327
|
const rows = await boundCheckUniqueBatch.checkUniqueBatch({
|
|
@@ -2340,9 +2340,9 @@ async function diagnoseAtomicNodeUniqueness(ctx, backend, preparedCreates) {
|
|
|
2340
2340
|
return Promise.all(
|
|
2341
2341
|
preparedCreates.map(async (prepared, index) => {
|
|
2342
2342
|
for (const entry of chunkBXHAPCQG_cjs.requireDefined(probeItems[index]).entries) {
|
|
2343
|
-
if (!
|
|
2343
|
+
if (!chunkMTJAT6UO_cjs.isUniquenessClaimEntry(entry)) continue;
|
|
2344
2344
|
try {
|
|
2345
|
-
await
|
|
2345
|
+
await chunkMTJAT6UO_cjs.probeUniqueKey(
|
|
2346
2346
|
uniquenessContext,
|
|
2347
2347
|
prepared.kind,
|
|
2348
2348
|
prepared.id,
|
|
@@ -2364,7 +2364,7 @@ async function diagnoseAtomicNodeUniqueness(ctx, backend, preparedCreates) {
|
|
|
2364
2364
|
);
|
|
2365
2365
|
}
|
|
2366
2366
|
async function diagnoseAtomicNodeBatchNoRow(ctx, backend, preparedCreates) {
|
|
2367
|
-
await
|
|
2367
|
+
await chunkA22XPVBQ_cjs.diagnoseFusedSchemaFenceNoRow(ctx, backend);
|
|
2368
2368
|
const hasSetOrientedDiagnosis = chunkEOLNL35G_cjs.bindExtraIfReachable(
|
|
2369
2369
|
backend,
|
|
2370
2370
|
ctx.batchPointRead.extras.getNodes,
|
|
@@ -2411,7 +2411,7 @@ function restoreAtomicNodeBatchRows(graphId, preparedCreates, returnedRows) {
|
|
|
2411
2411
|
{ expectedGraphId: graphId, actualGraphId: row.graph_id }
|
|
2412
2412
|
);
|
|
2413
2413
|
}
|
|
2414
|
-
const key =
|
|
2414
|
+
const key = chunkQ6ZVQWH7_cjs.refKey({ kind: row.kind, id: row.id });
|
|
2415
2415
|
if (rowsByReference.has(key)) {
|
|
2416
2416
|
throw new chunkG7W67PZO_cjs.CompilerInvariantError(
|
|
2417
2417
|
"Atomic node batch returned duplicate node references.",
|
|
@@ -2422,7 +2422,7 @@ function restoreAtomicNodeBatchRows(graphId, preparedCreates, returnedRows) {
|
|
|
2422
2422
|
}
|
|
2423
2423
|
return preparedCreates.map((prepared) => {
|
|
2424
2424
|
const row = rowsByReference.get(
|
|
2425
|
-
|
|
2425
|
+
chunkQ6ZVQWH7_cjs.refKey({ kind: prepared.kind, id: prepared.id })
|
|
2426
2426
|
);
|
|
2427
2427
|
if (row === void 0) {
|
|
2428
2428
|
throw new chunkG7W67PZO_cjs.CompilerInvariantError(
|
|
@@ -2563,7 +2563,7 @@ async function batchCheckUniqueAcrossKinds(backend, uniqueSidecarBatch, graphId,
|
|
|
2563
2563
|
}
|
|
2564
2564
|
async function executeNodeCreateInternal(ctx, input, backend, options) {
|
|
2565
2565
|
const kind = input.kind;
|
|
2566
|
-
const id = input.id ??
|
|
2566
|
+
const id = input.id ?? chunkA22XPVBQ_cjs.generateId();
|
|
2567
2567
|
const opContext = ctx.createOperationContext("create", "node", kind, id);
|
|
2568
2568
|
const shouldReturnRow = options?.returnRow ?? true;
|
|
2569
2569
|
const autocommitBackend = chunkY6M5BFRJ_cjs.isBundledRootAutocommitEligible(backend) ? backend : void 0;
|
|
@@ -2588,13 +2588,13 @@ async function executeNodeCreateInternal(ctx, input, backend, options) {
|
|
|
2588
2588
|
);
|
|
2589
2589
|
const rowWork = async (session, target, _overlaidSession, _lock, transactionMode) => {
|
|
2590
2590
|
const targetBackend = unfencedTarget(target);
|
|
2591
|
-
const fuseSchemaFenceInFirstWrite = schemaFenceInFirstWrite && chunkEOLNL35G_cjs.isSchemaFencedInsertEligible(targetBackend) && !
|
|
2591
|
+
const fuseSchemaFenceInFirstWrite = schemaFenceInFirstWrite && chunkEOLNL35G_cjs.isSchemaFencedInsertEligible(targetBackend) && !chunkA22XPVBQ_cjs.hasLeasedSchemaFence(ctx, targetBackend);
|
|
2592
2592
|
if (schemaFenceInFirstWrite && !fuseSchemaFenceInFirstWrite) {
|
|
2593
|
-
await
|
|
2593
|
+
await chunkA22XPVBQ_cjs.lockSchemaVersionForStoreWrite(ctx, targetBackend);
|
|
2594
2594
|
}
|
|
2595
2595
|
const identity = ctx.identity;
|
|
2596
2596
|
const draft = draftNodeCreate(ctx, input, id, options);
|
|
2597
|
-
const claimPlan =
|
|
2597
|
+
const claimPlan = chunkMTJAT6UO_cjs.planNodeCreateClaims(
|
|
2598
2598
|
{ graphId: ctx.graphId, registry: ctx.registry },
|
|
2599
2599
|
{
|
|
2600
2600
|
kind: draft.kind,
|
|
@@ -2654,17 +2654,17 @@ async function executeNodeCreateInternal(ctx, input, backend, options) {
|
|
|
2654
2654
|
const work = fuseSchemaFenceProjections ? nodeCreateWork(prepared, projections, false) : nodeCreateWork(prepared, [], false);
|
|
2655
2655
|
const inserted = prepared.insertIfAbsent ? await session.createNodeIfAbsentWithSchemaFence(work, schemaFence) : await session.createNodeWithSchemaFence(work, schemaFence);
|
|
2656
2656
|
if (inserted !== void 0) {
|
|
2657
|
-
|
|
2657
|
+
chunkA22XPVBQ_cjs.memoizeLeasedSchemaFence(ctx, targetBackend);
|
|
2658
2658
|
return shouldReturnRow ? rowToNode(inserted) : void 0;
|
|
2659
2659
|
}
|
|
2660
|
-
await
|
|
2660
|
+
await chunkA22XPVBQ_cjs.diagnoseFusedSchemaFenceNoRow(ctx, targetBackend);
|
|
2661
2661
|
const directInteractiveAutocommit = autocommitSingleStatement && transactionMode === "none" && targetBackend.capabilities.execution.interactiveTransactions;
|
|
2662
2662
|
if (directInteractiveAutocommit) {
|
|
2663
2663
|
throw new AutocommitWriteRequiresTransaction();
|
|
2664
2664
|
}
|
|
2665
2665
|
if (!prepared.insertIfAbsent) {
|
|
2666
2666
|
if (transactionMode !== "none") {
|
|
2667
|
-
await
|
|
2667
|
+
await chunkA22XPVBQ_cjs.lockSchemaVersionForStoreWrite(ctx, targetBackend);
|
|
2668
2668
|
}
|
|
2669
2669
|
throw new chunkG7W67PZO_cjs.DatabaseOperationError(
|
|
2670
2670
|
`Fresh node insert returned no row: ${prepared.kind} ${prepared.id}`,
|
|
@@ -2672,7 +2672,7 @@ async function executeNodeCreateInternal(ctx, input, backend, options) {
|
|
|
2672
2672
|
);
|
|
2673
2673
|
}
|
|
2674
2674
|
if (transactionMode !== "none") {
|
|
2675
|
-
await
|
|
2675
|
+
await chunkA22XPVBQ_cjs.lockSchemaVersionForStoreWrite(ctx, targetBackend);
|
|
2676
2676
|
}
|
|
2677
2677
|
}
|
|
2678
2678
|
if (fuseProjections && !fuseSchemaFenceProjections) {
|
|
@@ -2711,7 +2711,7 @@ async function executeNodeCreateInternal(ctx, input, backend, options) {
|
|
|
2711
2711
|
throw createAlreadyExistsError("node", prepared.kind, prepared.id);
|
|
2712
2712
|
}
|
|
2713
2713
|
if (fuseSchemaFenceInFirstWrite && transactionMode === "none") {
|
|
2714
|
-
await
|
|
2714
|
+
await chunkA22XPVBQ_cjs.lockSchemaVersionForStoreWrite(ctx, targetBackend);
|
|
2715
2715
|
}
|
|
2716
2716
|
const resurrected = await resurrectPreparedNode(
|
|
2717
2717
|
ctx,
|
|
@@ -2825,7 +2825,7 @@ async function executeNodeCreateNoReturnBatch(ctx, inputs, backend) {
|
|
|
2825
2825
|
}
|
|
2826
2826
|
);
|
|
2827
2827
|
}
|
|
2828
|
-
|
|
2828
|
+
chunkA22XPVBQ_cjs.memoizeLeasedSchemaFence(ctx, backend);
|
|
2829
2829
|
return;
|
|
2830
2830
|
}
|
|
2831
2831
|
}
|
|
@@ -2907,7 +2907,7 @@ async function executeNodeCreateBatch(ctx, inputs, backend, options) {
|
|
|
2907
2907
|
}
|
|
2908
2908
|
);
|
|
2909
2909
|
}
|
|
2910
|
-
|
|
2910
|
+
chunkA22XPVBQ_cjs.memoizeLeasedSchemaFence(ctx, backend);
|
|
2911
2911
|
return restoreAtomicNodeBatchRows(
|
|
2912
2912
|
ctx.graphId,
|
|
2913
2913
|
preparedCreates,
|
|
@@ -2945,13 +2945,13 @@ async function executeNodeCreateBatch(ctx, inputs, backend, options) {
|
|
|
2945
2945
|
}
|
|
2946
2946
|
const byReference = new Map(
|
|
2947
2947
|
[...inserted, ...resurrected].map((row) => [
|
|
2948
|
-
|
|
2948
|
+
chunkQ6ZVQWH7_cjs.refKey({ kind: row.kind, id: row.id }),
|
|
2949
2949
|
row
|
|
2950
2950
|
])
|
|
2951
2951
|
);
|
|
2952
2952
|
const rows = preparedCreates.map(
|
|
2953
2953
|
(prepared) => chunkBXHAPCQG_cjs.requireDefined(
|
|
2954
|
-
byReference.get(
|
|
2954
|
+
byReference.get(chunkQ6ZVQWH7_cjs.refKey({ kind: prepared.kind, id: prepared.id })),
|
|
2955
2955
|
`Missing written row for ${prepared.kind} ${prepared.id}`
|
|
2956
2956
|
)
|
|
2957
2957
|
);
|
|
@@ -3091,7 +3091,7 @@ function normalizeCompareAndSetExpectations(schema, kind, inputExpected) {
|
|
|
3091
3091
|
const expected = chunkBXHAPCQG_cjs.createDataKeyedBag();
|
|
3092
3092
|
const scalarExpectedInput = chunkBXHAPCQG_cjs.createDataKeyedBag();
|
|
3093
3093
|
for (const [property, value] of Object.entries(inputExpected)) {
|
|
3094
|
-
if (value ===
|
|
3094
|
+
if (value === chunkA22XPVBQ_cjs.compareAndSetAbsent) {
|
|
3095
3095
|
expected[property] = { kind: "absent" };
|
|
3096
3096
|
continue;
|
|
3097
3097
|
}
|
|
@@ -3113,7 +3113,7 @@ function normalizeCompareAndSetExpectations(schema, kind, inputExpected) {
|
|
|
3113
3113
|
}
|
|
3114
3114
|
scalarExpectedInput[property] = value;
|
|
3115
3115
|
}
|
|
3116
|
-
const parsedExpected =
|
|
3116
|
+
const parsedExpected = chunkA22XPVBQ_cjs.validateNodeProps(
|
|
3117
3117
|
schema.partial(),
|
|
3118
3118
|
scalarExpectedInput,
|
|
3119
3119
|
{ kind, operation: "update" }
|
|
@@ -3190,7 +3190,7 @@ async function executeNodeSetUpdate(ctx, kind, inputPatch, candidateIds, candida
|
|
|
3190
3190
|
}
|
|
3191
3191
|
);
|
|
3192
3192
|
}
|
|
3193
|
-
const parsedPatch =
|
|
3193
|
+
const parsedPatch = chunkA22XPVBQ_cjs.validateNodeProps(schema.partial(), inputPatch, {
|
|
3194
3194
|
kind,
|
|
3195
3195
|
operation: "update"
|
|
3196
3196
|
});
|
|
@@ -3230,22 +3230,22 @@ async function executeNodeSetUpdate(ctx, kind, inputPatch, candidateIds, candida
|
|
|
3230
3230
|
}
|
|
3231
3231
|
if (chunkHAHNRASW_cjs.getSearchableFields(schema).length > 0) {
|
|
3232
3232
|
if (chunkR255UE5U_cjs.resolveBackendFulltext(backend) === false) {
|
|
3233
|
-
|
|
3233
|
+
chunkMTJAT6UO_cjs.refuseFulltextUnavailable(backend, kind);
|
|
3234
3234
|
}
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3235
|
+
chunkMTJAT6UO_cjs.assertFulltextMember(backend.upsertFulltext, "upsertFulltext", backend);
|
|
3236
|
+
chunkMTJAT6UO_cjs.assertFulltextMember(backend.deleteFulltext, "deleteFulltext", backend);
|
|
3237
|
+
chunkMTJAT6UO_cjs.assertFulltextMember(
|
|
3238
3238
|
backend.upsertFulltextBatch,
|
|
3239
3239
|
"upsertFulltextBatch",
|
|
3240
3240
|
backend
|
|
3241
3241
|
);
|
|
3242
|
-
|
|
3242
|
+
chunkMTJAT6UO_cjs.assertFulltextMember(
|
|
3243
3243
|
backend.deleteFulltextBatch,
|
|
3244
3244
|
"deleteFulltextBatch",
|
|
3245
3245
|
backend
|
|
3246
3246
|
);
|
|
3247
3247
|
}
|
|
3248
|
-
if (
|
|
3248
|
+
if (chunkMTJAT6UO_cjs.getEmbeddingFields(schema).length > 0 && (backend.upsertEmbedding === void 0 || backend.deleteEmbedding === void 0 || backend.upsertEmbeddingBatch === void 0 || backend.deleteEmbeddingBatch === void 0)) {
|
|
3249
3249
|
throw new chunkG7W67PZO_cjs.ConfigurationError(
|
|
3250
3250
|
"updateWhere() requires batched vector sidecar operations for embedded nodes",
|
|
3251
3251
|
{ code: "SET_UPDATE_VECTOR_UNSUPPORTED", kind }
|
|
@@ -3406,7 +3406,7 @@ async function executeNodeResolvedMutationSet(ctx, creates, updates, backend) {
|
|
|
3406
3406
|
})
|
|
3407
3407
|
);
|
|
3408
3408
|
if (result.created.length === 0 && result.updated.length === 0) {
|
|
3409
|
-
await
|
|
3409
|
+
await chunkA22XPVBQ_cjs.diagnoseFusedSchemaFenceNoRow(ctx, backend);
|
|
3410
3410
|
throw new ResolvedMutationSetMoved("node", executor);
|
|
3411
3411
|
}
|
|
3412
3412
|
if (result.created.length !== creates.length || result.updated.length !== updates.length) {
|
|
@@ -3414,7 +3414,7 @@ async function executeNodeResolvedMutationSet(ctx, creates, updates, backend) {
|
|
|
3414
3414
|
"Atomic resolved node mutation set returned a partial result."
|
|
3415
3415
|
);
|
|
3416
3416
|
}
|
|
3417
|
-
|
|
3417
|
+
chunkA22XPVBQ_cjs.memoizeLeasedSchemaFence(ctx, backend);
|
|
3418
3418
|
const created = restoreAtomicNodeBatchRows(
|
|
3419
3419
|
ctx.graphId,
|
|
3420
3420
|
preparedCreates,
|
|
@@ -3456,7 +3456,7 @@ async function executeNodeUpsertUpdateBatch(ctx, entries, backend) {
|
|
|
3456
3456
|
),
|
|
3457
3457
|
backend,
|
|
3458
3458
|
async (session, target) => {
|
|
3459
|
-
const resolvedRows = target.capabilities.execution.interactiveTransactions && distinctIds.size === entries.length ? await
|
|
3459
|
+
const resolvedRows = target.capabilities.execution.interactiveTransactions && distinctIds.size === entries.length ? await chunkA22XPVBQ_cjs.getNodeRowsByIds(
|
|
3460
3460
|
target,
|
|
3461
3461
|
ctx.batchPointRead,
|
|
3462
3462
|
ctx.graphId,
|
|
@@ -3499,7 +3499,7 @@ async function executeAtomicNodeResolvedUpdates(ctx, entries, backend, atomicExe
|
|
|
3499
3499
|
const supplied = entries.flatMap(
|
|
3500
3500
|
(entry) => entry.existing === void 0 ? [] : [entry.existing]
|
|
3501
3501
|
);
|
|
3502
|
-
const fetched = supplied.length === entries.length ? void 0 : await
|
|
3502
|
+
const fetched = supplied.length === entries.length ? void 0 : await chunkA22XPVBQ_cjs.getNodeRowsByIds(
|
|
3503
3503
|
backend,
|
|
3504
3504
|
ctx.batchPointRead,
|
|
3505
3505
|
ctx.graphId,
|
|
@@ -3539,7 +3539,7 @@ async function executeAtomicNodeResolvedUpdates(ctx, entries, backend, atomicExe
|
|
|
3539
3539
|
}
|
|
3540
3540
|
});
|
|
3541
3541
|
if (rows.length === entries.length) {
|
|
3542
|
-
|
|
3542
|
+
chunkA22XPVBQ_cjs.memoizeLeasedSchemaFence(ctx, backend);
|
|
3543
3543
|
const returned = new Map(rows.map((row) => [row.id, row]));
|
|
3544
3544
|
return entries.map(
|
|
3545
3545
|
(entry) => rowToNode(chunkBXHAPCQG_cjs.requireDefined(returned.get(entry.input.id)))
|
|
@@ -3551,7 +3551,7 @@ async function executeAtomicNodeResolvedUpdates(ctx, entries, backend, atomicExe
|
|
|
3551
3551
|
{ expected: entries.length, actual: rows.length }
|
|
3552
3552
|
);
|
|
3553
3553
|
}
|
|
3554
|
-
await
|
|
3554
|
+
await chunkA22XPVBQ_cjs.diagnoseFusedSchemaFenceNoRow(ctx, backend);
|
|
3555
3555
|
if (attempt === maxAttempts) {
|
|
3556
3556
|
throw new chunkG7W67PZO_cjs.DatabaseOperationError(
|
|
3557
3557
|
`Atomic node update could not be applied to stable rows after ${maxAttempts} attempts.`,
|
|
@@ -3565,7 +3565,7 @@ async function executeAtomicNodeResolvedUpdates(ctx, entries, backend, atomicExe
|
|
|
3565
3565
|
}
|
|
3566
3566
|
);
|
|
3567
3567
|
}
|
|
3568
|
-
const refreshed = await
|
|
3568
|
+
const refreshed = await chunkA22XPVBQ_cjs.getNodeRowsByIds(
|
|
3569
3569
|
backend,
|
|
3570
3570
|
ctx.batchPointRead,
|
|
3571
3571
|
ctx.graphId,
|
|
@@ -3780,7 +3780,7 @@ async function executeNodeGetOrCreateByConstraint(ctx, kind, constraintName, pro
|
|
|
3780
3780
|
const ifExists = options?.ifExists ?? "return";
|
|
3781
3781
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
3782
3782
|
const nodeKind = registration.type;
|
|
3783
|
-
const validatedProps =
|
|
3783
|
+
const validatedProps = chunkA22XPVBQ_cjs.validateNodeProps(nodeKind.schema, props, {
|
|
3784
3784
|
kind,
|
|
3785
3785
|
operation: "create"
|
|
3786
3786
|
});
|
|
@@ -3863,7 +3863,7 @@ async function executeNodeGetOrCreateByConstraint(ctx, kind, constraintName, pro
|
|
|
3863
3863
|
async function executeNodeFindByConstraint(ctx, kind, constraintName, props, backend) {
|
|
3864
3864
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
3865
3865
|
const nodeKind = registration.type;
|
|
3866
|
-
const validatedProps =
|
|
3866
|
+
const validatedProps = chunkA22XPVBQ_cjs.validateNodeProps(nodeKind.schema, props, {
|
|
3867
3867
|
kind,
|
|
3868
3868
|
operation: "create"
|
|
3869
3869
|
});
|
|
@@ -3900,7 +3900,7 @@ async function executeNodeFindByConstraint(ctx, kind, constraintName, props, bac
|
|
|
3900
3900
|
function validateAndComputeKeys(nodeKind, kind, constraint, items) {
|
|
3901
3901
|
const validated = [];
|
|
3902
3902
|
for (const item of items) {
|
|
3903
|
-
const validatedProps =
|
|
3903
|
+
const validatedProps = chunkA22XPVBQ_cjs.validateNodeProps(nodeKind.schema, item.props, {
|
|
3904
3904
|
kind,
|
|
3905
3905
|
operation: "create"
|
|
3906
3906
|
});
|
|
@@ -4189,7 +4189,7 @@ function capMatchesPerGroup(matches, limitPerInput) {
|
|
|
4189
4189
|
return capped;
|
|
4190
4190
|
}
|
|
4191
4191
|
async function hydrateNodesById(backend, batchPointRead, graphId, kind, ids) {
|
|
4192
|
-
const rowsById = await
|
|
4192
|
+
const rowsById = await chunkA22XPVBQ_cjs.getNodeRowsByIds(
|
|
4193
4193
|
backend,
|
|
4194
4194
|
batchPointRead,
|
|
4195
4195
|
graphId,
|
|
@@ -4383,5 +4383,5 @@ exports.unsupportedResolvedMutationSet = unsupportedResolvedMutationSet;
|
|
|
4383
4383
|
exports.validityEndAfterMutation = validityEndAfterMutation;
|
|
4384
4384
|
exports.withAlreadyExistsTranslation = withAlreadyExistsTranslation;
|
|
4385
4385
|
exports.writeResultAlwaysChanges = writeResultAlwaysChanges;
|
|
4386
|
-
//# sourceMappingURL=chunk-
|
|
4387
|
-
//# sourceMappingURL=chunk-
|
|
4386
|
+
//# sourceMappingURL=chunk-PTFO3JI5.cjs.map
|
|
4387
|
+
//# sourceMappingURL=chunk-PTFO3JI5.cjs.map
|