@nicia-ai/typegraph 0.46.0 → 0.46.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backend/index.cjs +5 -5
- package/dist/backend/index.js +2 -2
- package/dist/backend/postgres/pglite-store.cjs +8 -8
- 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 +7 -7
- package/dist/backend/sqlite/local-store.cjs +8 -8
- 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 +7 -7
- package/dist/{chunk-CNV4TXJG.js → chunk-2Z2Z3ZD6.js} +3 -3
- package/dist/{chunk-CNV4TXJG.js.map → chunk-2Z2Z3ZD6.js.map} +1 -1
- package/dist/{chunk-N3257XE6.cjs → chunk-65E3XWGF.cjs} +21 -21
- package/dist/{chunk-N3257XE6.cjs.map → chunk-65E3XWGF.cjs.map} +1 -1
- package/dist/{chunk-ONU3HIED.cjs → chunk-CMWHLBVN.cjs} +29 -29
- package/dist/{chunk-ONU3HIED.cjs.map → chunk-CMWHLBVN.cjs.map} +1 -1
- package/dist/{chunk-XNLIZYRZ.cjs → chunk-DTVWX77L.cjs} +56 -56
- package/dist/{chunk-XNLIZYRZ.cjs.map → chunk-DTVWX77L.cjs.map} +1 -1
- package/dist/{chunk-JIVMTW7W.js → chunk-GF3KXUTW.js} +4 -4
- package/dist/{chunk-JIVMTW7W.js.map → chunk-GF3KXUTW.js.map} +1 -1
- package/dist/{chunk-QWX5YA3K.js → chunk-L65OU2U3.js} +11 -9
- package/dist/chunk-L65OU2U3.js.map +1 -0
- package/dist/{chunk-QLRESYPU.js → chunk-LGHCOKTT.js} +5 -5
- package/dist/{chunk-QLRESYPU.js.map → chunk-LGHCOKTT.js.map} +1 -1
- package/dist/{chunk-WEVQJ5LH.js → chunk-M3WP7RQZ.js} +2 -2
- package/dist/chunk-M3WP7RQZ.js.map +1 -0
- package/dist/{chunk-Q7Q4WSLJ.cjs → chunk-MCLYU6BN.cjs} +6 -2
- package/dist/chunk-MCLYU6BN.cjs.map +1 -0
- package/dist/{chunk-RJS7DECT.js → chunk-MZLPX2R7.js} +3 -3
- package/dist/{chunk-RJS7DECT.js.map → chunk-MZLPX2R7.js.map} +1 -1
- package/dist/{chunk-NQ6BRJBE.js → chunk-NLI2AVEF.js} +3 -3
- package/dist/{chunk-NQ6BRJBE.js.map → chunk-NLI2AVEF.js.map} +1 -1
- package/dist/{chunk-XMQSEJCF.cjs → chunk-PF6F5NLJ.cjs} +20 -20
- package/dist/{chunk-XMQSEJCF.cjs.map → chunk-PF6F5NLJ.cjs.map} +1 -1
- package/dist/{chunk-XDF2UPEQ.cjs → chunk-PNTCATDE.cjs} +431 -421
- package/dist/chunk-PNTCATDE.cjs.map +1 -0
- package/dist/{chunk-7GT72YHH.cjs → chunk-PT7RIRIZ.cjs} +66 -64
- package/dist/chunk-PT7RIRIZ.cjs.map +1 -0
- package/dist/{chunk-TTAITEPJ.cjs → chunk-Q3G6A4I3.cjs} +2 -2
- package/dist/chunk-Q3G6A4I3.cjs.map +1 -0
- package/dist/{chunk-7Z5OR7KO.js → chunk-S6PW7VV5.js} +19 -9
- package/dist/chunk-S6PW7VV5.js.map +1 -0
- package/dist/{chunk-XQSCL77R.cjs → chunk-VLT6PEWR.cjs} +4 -4
- package/dist/{chunk-XQSCL77R.cjs.map → chunk-VLT6PEWR.cjs.map} +1 -1
- package/dist/{chunk-OH5E5KIO.js → chunk-WQZLUGVR.js} +6 -6
- package/dist/{chunk-OH5E5KIO.js.map → chunk-WQZLUGVR.js.map} +1 -1
- package/dist/{chunk-DLNROMQ7.js → chunk-XL7SLCXS.js} +6 -3
- package/dist/chunk-XL7SLCXS.js.map +1 -0
- package/dist/{chunk-XNSI2FJO.cjs → chunk-YBQOHKHN.cjs} +8 -8
- package/dist/{chunk-XNSI2FJO.cjs.map → chunk-YBQOHKHN.cjs.map} +1 -1
- package/dist/core/index.cjs +5 -5
- package/dist/core/index.js +1 -1
- package/dist/graph-merge/index.cjs +149 -149
- package/dist/graph-merge/index.d.cts +1 -1
- package/dist/graph-merge/index.d.ts +1 -1
- package/dist/graph-merge/index.js +8 -8
- package/dist/index.cjs +79 -79
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +9 -9
- package/dist/interchange/index.cjs +34 -34
- package/dist/interchange/index.d.cts +1 -1
- package/dist/interchange/index.d.ts +1 -1
- package/dist/interchange/index.js +7 -7
- package/dist/profiler/index.d.cts +1 -1
- package/dist/profiler/index.d.ts +1 -1
- package/dist/provenance/index.cjs +16 -16
- package/dist/provenance/index.d.cts +1 -1
- package/dist/provenance/index.d.ts +1 -1
- package/dist/provenance/index.js +3 -3
- package/dist/schema/index.cjs +32 -32
- package/dist/schema/index.js +5 -5
- package/dist/{store-RwTJx8LX.d.cts → store-B0h6x7wo.d.cts} +12 -3
- package/dist/{store-DawaWWjJ.d.ts → store-ClQ-MZQS.d.ts} +12 -3
- package/package.json +3 -3
- package/dist/chunk-7GT72YHH.cjs.map +0 -1
- package/dist/chunk-7Z5OR7KO.js.map +0 -1
- package/dist/chunk-DLNROMQ7.js.map +0 -1
- package/dist/chunk-Q7Q4WSLJ.cjs.map +0 -1
- package/dist/chunk-QWX5YA3K.js.map +0 -1
- package/dist/chunk-TTAITEPJ.cjs.map +0 -1
- package/dist/chunk-WEVQJ5LH.js.map +0 -1
- package/dist/chunk-XDF2UPEQ.cjs.map +0 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkYAAM3M2S_cjs = require('./chunk-YAAM3M2S.cjs');
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
4
|
+
var chunkPT7RIRIZ_cjs = require('./chunk-PT7RIRIZ.cjs');
|
|
5
|
+
var chunkQ3G6A4I3_cjs = require('./chunk-Q3G6A4I3.cjs');
|
|
6
|
+
var chunk65E3XWGF_cjs = require('./chunk-65E3XWGF.cjs');
|
|
7
7
|
var chunkNK5Q7UNE_cjs = require('./chunk-NK5Q7UNE.cjs');
|
|
8
|
-
var
|
|
9
|
-
var
|
|
8
|
+
var chunkDTVWX77L_cjs = require('./chunk-DTVWX77L.cjs');
|
|
9
|
+
var chunkPF6F5NLJ_cjs = require('./chunk-PF6F5NLJ.cjs');
|
|
10
10
|
var chunkPWLJ77UV_cjs = require('./chunk-PWLJ77UV.cjs');
|
|
11
11
|
var chunkBSFJMMV3_cjs = require('./chunk-BSFJMMV3.cjs');
|
|
12
12
|
var chunkNFCVHQ5P_cjs = require('./chunk-NFCVHQ5P.cjs');
|
|
13
13
|
var chunkXBYVV3MP_cjs = require('./chunk-XBYVV3MP.cjs');
|
|
14
14
|
var chunkCXBHOOIQ_cjs = require('./chunk-CXBHOOIQ.cjs');
|
|
15
15
|
var chunkE4WNQBEF_cjs = require('./chunk-E4WNQBEF.cjs');
|
|
16
|
-
var
|
|
16
|
+
var chunkMCLYU6BN_cjs = require('./chunk-MCLYU6BN.cjs');
|
|
17
17
|
var chunk62ZP23AW_cjs = require('./chunk-62ZP23AW.cjs');
|
|
18
18
|
var chunkXCAGZAKP_cjs = require('./chunk-XCAGZAKP.cjs');
|
|
19
19
|
var chunkU63GDNRC_cjs = require('./chunk-U63GDNRC.cjs');
|
|
@@ -116,7 +116,7 @@ function resolveTemporalReadParams(options, defaultTemporalMode) {
|
|
|
116
116
|
message: "Broad collection reads cannot honor recorded-time coordinates.",
|
|
117
117
|
suggestion: "Use store.asOfRecorded(...).nodes.Kind.getById/getByIds for point reads, or query() for recorded-time scans."
|
|
118
118
|
});
|
|
119
|
-
const { valid } =
|
|
119
|
+
const { valid } = chunkMCLYU6BN_cjs.resolveReadCoordinate(
|
|
120
120
|
options?.temporalMode ?? defaultTemporalMode,
|
|
121
121
|
options?.asOf
|
|
122
122
|
);
|
|
@@ -128,7 +128,7 @@ function resolveTemporalReadParams(options, defaultTemporalMode) {
|
|
|
128
128
|
if (mode === "current" || mode === "asOf") {
|
|
129
129
|
return {
|
|
130
130
|
...base,
|
|
131
|
-
asOf: asOf ??
|
|
131
|
+
asOf: asOf ?? chunkMCLYU6BN_cjs.nowIso()
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
134
|
return base;
|
|
@@ -147,12 +147,12 @@ var NON_KIND_KEYS = /* @__PURE__ */ new Set([
|
|
|
147
147
|
function createReadOnlyRefusal(entity, method, coordinate) {
|
|
148
148
|
return () => {
|
|
149
149
|
throw new chunkNI72YOJB_cjs.ConfigurationError(
|
|
150
|
-
`'${method}' is not available on a read-only StoreView (${
|
|
150
|
+
`'${method}' is not available on a read-only StoreView (${chunkMCLYU6BN_cjs.describeCoordinate(coordinate)}). A time-pinned view is a read perspective \u2014 perform writes on the live Store.`,
|
|
151
151
|
{
|
|
152
152
|
code: "STORE_VIEW_READ_ONLY",
|
|
153
153
|
entity,
|
|
154
154
|
method,
|
|
155
|
-
...
|
|
155
|
+
...chunkMCLYU6BN_cjs.coordinateContext(coordinate)
|
|
156
156
|
}
|
|
157
157
|
);
|
|
158
158
|
};
|
|
@@ -160,12 +160,12 @@ function createReadOnlyRefusal(entity, method, coordinate) {
|
|
|
160
160
|
function createCurrentOnlyRefusal(entity, method, coordinate) {
|
|
161
161
|
return () => Promise.reject(
|
|
162
162
|
new chunkNI72YOJB_cjs.ConfigurationError(
|
|
163
|
-
`'${method}' is not available on a StoreView (${
|
|
163
|
+
`'${method}' is not available on a StoreView (${chunkMCLYU6BN_cjs.describeCoordinate(coordinate)}). Constraint / index / endpoint lookups read current state only and cannot honor a temporal coordinate \u2014 use a current-mode view or the live Store.`,
|
|
164
164
|
{
|
|
165
165
|
code: "STORE_VIEW_CURRENT_ONLY",
|
|
166
166
|
entity,
|
|
167
167
|
method,
|
|
168
|
-
...
|
|
168
|
+
...chunkMCLYU6BN_cjs.coordinateContext(coordinate)
|
|
169
169
|
}
|
|
170
170
|
)
|
|
171
171
|
);
|
|
@@ -173,12 +173,12 @@ function createCurrentOnlyRefusal(entity, method, coordinate) {
|
|
|
173
173
|
function createBatchReadRefusal(entity, method, coordinate) {
|
|
174
174
|
return () => {
|
|
175
175
|
throw new chunkNI72YOJB_cjs.ConfigurationError(
|
|
176
|
-
`'${method}' is not available on a read-only StoreView (${
|
|
176
|
+
`'${method}' is not available on a read-only StoreView (${chunkMCLYU6BN_cjs.describeCoordinate(coordinate)}). Batch endpoint reads resolve through store.batch(...), which a view does not expose \u2014 use the live Store's batch(...), or the view's findFrom / findTo / findByEndpoints for single reads.`,
|
|
177
177
|
{
|
|
178
178
|
code: "STORE_VIEW_BATCH_UNAVAILABLE",
|
|
179
179
|
entity,
|
|
180
180
|
method,
|
|
181
|
-
...
|
|
181
|
+
...chunkMCLYU6BN_cjs.coordinateContext(coordinate)
|
|
182
182
|
}
|
|
183
183
|
);
|
|
184
184
|
};
|
|
@@ -186,12 +186,12 @@ function createBatchReadRefusal(entity, method, coordinate) {
|
|
|
186
186
|
function createRecordedUnsupportedRefusal(entity, method, coordinate) {
|
|
187
187
|
return () => Promise.reject(
|
|
188
188
|
new chunkNI72YOJB_cjs.ConfigurationError(
|
|
189
|
-
`'${method}' is not available on a RecordedStoreView (${
|
|
189
|
+
`'${method}' is not available on a RecordedStoreView (${chunkMCLYU6BN_cjs.describeCoordinate(coordinate)}). Recorded-time reads are reconstructing reads; this view exposes only query, subgraph, graph algorithms, and collection getById/getByIds/scan reads.`,
|
|
190
190
|
{
|
|
191
191
|
code: "RECORDED_STORE_VIEW_UNSUPPORTED",
|
|
192
192
|
entity,
|
|
193
193
|
method,
|
|
194
|
-
...
|
|
194
|
+
...chunkMCLYU6BN_cjs.coordinateContext(coordinate)
|
|
195
195
|
}
|
|
196
196
|
)
|
|
197
197
|
);
|
|
@@ -318,17 +318,17 @@ function pinnedEdgeCollectionsFor(store, coordinate, wrap) {
|
|
|
318
318
|
}
|
|
319
319
|
function recordedNodeCollection(store, kind, live, coordinate) {
|
|
320
320
|
const reads = {
|
|
321
|
-
getById: (id) =>
|
|
322
|
-
getByIds: (ids) =>
|
|
323
|
-
scan: (options) =>
|
|
321
|
+
getById: (id) => chunkQ3G6A4I3_cjs.storeRuntime(store).recordedNodeGetById(kind, id, coordinate),
|
|
322
|
+
getByIds: (ids) => chunkQ3G6A4I3_cjs.storeRuntime(store).recordedNodeGetByIds(kind, ids, coordinate),
|
|
323
|
+
scan: (options) => chunkQ3G6A4I3_cjs.storeRuntime(store).recordedNodeScan(kind, coordinate, options)
|
|
324
324
|
};
|
|
325
325
|
return recordedCollectionProxy(reads, live, coordinate, "node");
|
|
326
326
|
}
|
|
327
327
|
function recordedEdgeCollection(store, kind, live, coordinate) {
|
|
328
328
|
const reads = {
|
|
329
|
-
getById: (id) =>
|
|
330
|
-
getByIds: (ids) =>
|
|
331
|
-
scan: (options) =>
|
|
329
|
+
getById: (id) => chunkQ3G6A4I3_cjs.storeRuntime(store).recordedEdgeGetById(kind, id, coordinate),
|
|
330
|
+
getByIds: (ids) => chunkQ3G6A4I3_cjs.storeRuntime(store).recordedEdgeGetByIds(kind, ids, coordinate),
|
|
331
|
+
scan: (options) => chunkQ3G6A4I3_cjs.storeRuntime(store).recordedEdgeScan(kind, coordinate, options)
|
|
332
332
|
};
|
|
333
333
|
return recordedCollectionProxy(reads, live, coordinate, "edge");
|
|
334
334
|
}
|
|
@@ -366,14 +366,14 @@ function searchRefusal(method, coordinate, isCurrent) {
|
|
|
366
366
|
{
|
|
367
367
|
code: "STORE_VIEW_READ_ONLY",
|
|
368
368
|
method,
|
|
369
|
-
...
|
|
369
|
+
...chunkMCLYU6BN_cjs.coordinateContext(coordinate)
|
|
370
370
|
}
|
|
371
371
|
) : new chunkNI72YOJB_cjs.ConfigurationError(
|
|
372
|
-
`store.search.${method} is not available on a StoreView (${
|
|
372
|
+
`store.search.${method} is not available on a StoreView (${chunkMCLYU6BN_cjs.describeCoordinate(coordinate)}). The fulltext / vector index reflects current state only; historical relevance is out of scope for a temporal view. Use a current-mode view or query the live Store.`,
|
|
373
373
|
{
|
|
374
374
|
code: "STORE_VIEW_SEARCH_UNSUPPORTED",
|
|
375
375
|
method,
|
|
376
|
-
...
|
|
376
|
+
...chunkMCLYU6BN_cjs.coordinateContext(coordinate)
|
|
377
377
|
}
|
|
378
378
|
);
|
|
379
379
|
}
|
|
@@ -392,11 +392,11 @@ function pinnedSearch(store, coordinate) {
|
|
|
392
392
|
}
|
|
393
393
|
function recordedSearchRefusal(method, coordinate) {
|
|
394
394
|
return new chunkNI72YOJB_cjs.ConfigurationError(
|
|
395
|
-
`store.search.${method} is not available on a RecordedStoreView (${
|
|
395
|
+
`store.search.${method} is not available on a RecordedStoreView (${chunkMCLYU6BN_cjs.describeCoordinate(coordinate)}). The fulltext / vector index reflects current state only and cannot answer a recorded-time query. Run search on the live Store.`,
|
|
396
396
|
{
|
|
397
397
|
code: "RECORDED_STORE_VIEW_SEARCH_UNSUPPORTED",
|
|
398
398
|
method,
|
|
399
|
-
...
|
|
399
|
+
...chunkMCLYU6BN_cjs.coordinateContext(coordinate)
|
|
400
400
|
}
|
|
401
401
|
);
|
|
402
402
|
}
|
|
@@ -415,7 +415,7 @@ var CoordinatePinnedView = class {
|
|
|
415
415
|
this.coordinate = coordinate;
|
|
416
416
|
Object.defineProperty(this, "identity", {
|
|
417
417
|
enumerable: false,
|
|
418
|
-
get: () =>
|
|
418
|
+
get: () => chunkQ3G6A4I3_cjs.storeRuntime(this.store).identityAtCoordinate(this.coordinate)
|
|
419
419
|
});
|
|
420
420
|
}
|
|
421
421
|
/** The temporal mode this view reads in. */
|
|
@@ -432,10 +432,10 @@ var CoordinatePinnedView = class {
|
|
|
432
432
|
* view's coordinate cannot be overridden on a per-query basis.
|
|
433
433
|
*/
|
|
434
434
|
query() {
|
|
435
|
-
return
|
|
435
|
+
return chunkQ3G6A4I3_cjs.storeRuntime(this.store).sealedQuery(this.coordinate);
|
|
436
436
|
}
|
|
437
437
|
internalAlgorithms() {
|
|
438
|
-
this.#internalAlgorithms ??=
|
|
438
|
+
this.#internalAlgorithms ??= chunkQ3G6A4I3_cjs.storeRuntime(
|
|
439
439
|
this.store
|
|
440
440
|
).algorithmsAtCoordinate(this.coordinate);
|
|
441
441
|
return this.#internalAlgorithms;
|
|
@@ -462,7 +462,7 @@ var CoordinatePinnedView = class {
|
|
|
462
462
|
...options,
|
|
463
463
|
...withCoordinate(this.coordinate)
|
|
464
464
|
};
|
|
465
|
-
return
|
|
465
|
+
return chunkQ3G6A4I3_cjs.storeRuntime(this.store).subgraphAtCoordinate(
|
|
466
466
|
rootId,
|
|
467
467
|
internalOptions
|
|
468
468
|
);
|
|
@@ -545,7 +545,7 @@ var StoreViewImplementation = class extends CoordinatePinnedView {
|
|
|
545
545
|
constructor(store, coordinate) {
|
|
546
546
|
super(
|
|
547
547
|
store,
|
|
548
|
-
isReadCoordinate(coordinate) ? coordinate :
|
|
548
|
+
isReadCoordinate(coordinate) ? coordinate : chunkMCLYU6BN_cjs.resolveReadCoordinate(
|
|
549
549
|
coordinate.mode,
|
|
550
550
|
coordinate.asOf,
|
|
551
551
|
'Use store.asOf("2026-01-01T00:00:00.000Z") or store.view({ mode: "asOf", asOf }).'
|
|
@@ -556,7 +556,7 @@ var StoreViewImplementation = class extends CoordinatePinnedView {
|
|
|
556
556
|
asOfRecorded(recordedAsOf) {
|
|
557
557
|
return new RecordedStoreView(
|
|
558
558
|
this.store,
|
|
559
|
-
|
|
559
|
+
chunkMCLYU6BN_cjs.withRecordedCoordinate(this.coordinate, recordedAsOf)
|
|
560
560
|
);
|
|
561
561
|
}
|
|
562
562
|
/** Read-only node collections pinned to this view's coordinate. */
|
|
@@ -1083,7 +1083,7 @@ var CURRENT_SEED_CLASS_ALIAS = "identity_seed_class";
|
|
|
1083
1083
|
var CURRENT_MEMBER_NODE_ALIAS = "identity_peer_node";
|
|
1084
1084
|
function historicalCoordinate(input) {
|
|
1085
1085
|
const { ast, temporalFilterPass } = input;
|
|
1086
|
-
const recorded =
|
|
1086
|
+
const recorded = chunkMCLYU6BN_cjs.optionalRecordedInstantParts(
|
|
1087
1087
|
ast.recordedAsOf,
|
|
1088
1088
|
"recordedAsOf"
|
|
1089
1089
|
);
|
|
@@ -1105,14 +1105,14 @@ function compileIdentityClassCte(input) {
|
|
|
1105
1105
|
if (!expandsIdentity) return void 0;
|
|
1106
1106
|
const coordinate = historicalCoordinate({ ast, temporalFilterPass });
|
|
1107
1107
|
if (coordinate === void 0) return void 0;
|
|
1108
|
-
const peerClasses =
|
|
1108
|
+
const peerClasses = chunkPF6F5NLJ_cjs.historicalIdentityPeerClassQuery({
|
|
1109
1109
|
schema: ctx.schema,
|
|
1110
1110
|
graphId,
|
|
1111
1111
|
coordinate,
|
|
1112
1112
|
sameIdAcrossKinds: ctx.identitySameIdAcrossKinds ?? "fold"
|
|
1113
1113
|
});
|
|
1114
1114
|
return chunkVCRRKBLN_cjs.sql`
|
|
1115
|
-
${chunkVCRRKBLN_cjs.sql.identifier(IDENTITY_CLASS_CTE_ALIAS)}(${
|
|
1115
|
+
${chunkVCRRKBLN_cjs.sql.identifier(IDENTITY_CLASS_CTE_ALIAS)}(${chunkPF6F5NLJ_cjs.IDENTITY_PEER_CLASS_COLUMNS}) AS MATERIALIZED (
|
|
1116
1116
|
${peerClasses}
|
|
1117
1117
|
)
|
|
1118
1118
|
`;
|
|
@@ -1292,7 +1292,7 @@ function markSelectiveFieldAsRequired(requiredColumnsByAlias, field2) {
|
|
|
1292
1292
|
addRequiredColumn(requiredColumnsByAlias, field2.alias, "props");
|
|
1293
1293
|
}
|
|
1294
1294
|
function getTopLevelPropsFieldName(field2) {
|
|
1295
|
-
const pointer =
|
|
1295
|
+
const pointer = chunkPF6F5NLJ_cjs.getFieldPointer(field2);
|
|
1296
1296
|
if (pointer === void 0) return void 0;
|
|
1297
1297
|
const segments = chunkA7J2YDDI_cjs.parseJsonPointer(pointer);
|
|
1298
1298
|
return segments.length === 1 ? segments[0] : void 0;
|
|
@@ -1393,11 +1393,11 @@ function buildStandardStartCte(input) {
|
|
|
1393
1393
|
const alias = ast.start.alias;
|
|
1394
1394
|
const kinds = ast.start.kinds;
|
|
1395
1395
|
const cteMaterialization = ctx.dialect.capabilities.emitNotMaterializedHint ? chunkVCRRKBLN_cjs.sql`NOT MATERIALIZED ` : chunkVCRRKBLN_cjs.sql``;
|
|
1396
|
-
const kindFilter =
|
|
1396
|
+
const kindFilter = chunkPF6F5NLJ_cjs.compileKindFilter(chunkVCRRKBLN_cjs.sql.raw("kind"), kinds);
|
|
1397
1397
|
const temporalFilter = input.temporalFilterPass.forAlias();
|
|
1398
1398
|
const cteContext = { ...ctx, cteColumnPrefix: "" };
|
|
1399
|
-
const predicateClauses =
|
|
1400
|
-
|
|
1399
|
+
const predicateClauses = chunkPF6F5NLJ_cjs.compilePredicateClauses(
|
|
1400
|
+
chunkPF6F5NLJ_cjs.getPredicatesForAlias(predicateIndex, alias, "node"),
|
|
1401
1401
|
cteContext
|
|
1402
1402
|
);
|
|
1403
1403
|
const whereClauses = [
|
|
@@ -1444,27 +1444,27 @@ function buildStandardTraversalCte(input) {
|
|
|
1444
1444
|
} = input;
|
|
1445
1445
|
const traversal = chunkN66HCGCY_cjs.requireDefined(ast.traversals[traversalIndex]);
|
|
1446
1446
|
const traversalLimitValue = traversalIndex === ast.traversals.length - 1 ? traversalLimit : void 0;
|
|
1447
|
-
const previousNodeKinds =
|
|
1447
|
+
const previousNodeKinds = chunkPF6F5NLJ_cjs.getNodeKindsForAlias(ast, traversal.joinFromAlias);
|
|
1448
1448
|
const directEdgeKinds = [...new Set(traversal.edgeKinds)];
|
|
1449
1449
|
const inverseEdgeKinds = traversal.inverseEdgeKinds === void 0 ? [] : [...new Set(traversal.inverseEdgeKinds)];
|
|
1450
1450
|
const nodeKinds = traversal.nodeKinds;
|
|
1451
|
-
const nodeKindFilter =
|
|
1451
|
+
const nodeKindFilter = chunkPF6F5NLJ_cjs.compileKindFilter(chunkVCRRKBLN_cjs.sql.raw("n.kind"), nodeKinds);
|
|
1452
1452
|
const edgeTemporalFilter = temporalFilterPass.forAlias("e");
|
|
1453
1453
|
const nodeTemporalFilter = temporalFilterPass.forAlias("n");
|
|
1454
1454
|
const nodeCteContext = {
|
|
1455
1455
|
...ctx,
|
|
1456
1456
|
cteColumnPrefix: "n"
|
|
1457
1457
|
};
|
|
1458
|
-
const nodePredicateClauses =
|
|
1459
|
-
|
|
1458
|
+
const nodePredicateClauses = chunkPF6F5NLJ_cjs.compilePredicateClauses(
|
|
1459
|
+
chunkPF6F5NLJ_cjs.getPredicatesForAlias(predicateIndex, traversal.nodeAlias, "node"),
|
|
1460
1460
|
nodeCteContext
|
|
1461
1461
|
);
|
|
1462
1462
|
const edgeCteContext = {
|
|
1463
1463
|
...ctx,
|
|
1464
1464
|
cteColumnPrefix: "e"
|
|
1465
1465
|
};
|
|
1466
|
-
const edgePredicateClauses =
|
|
1467
|
-
|
|
1466
|
+
const edgePredicateClauses = chunkPF6F5NLJ_cjs.compilePredicateClauses(
|
|
1467
|
+
chunkPF6F5NLJ_cjs.getPredicatesForAlias(predicateIndex, traversal.edgeAlias, "edge"),
|
|
1468
1468
|
edgeCteContext
|
|
1469
1469
|
);
|
|
1470
1470
|
const baseWhereClauses = [
|
|
@@ -1534,12 +1534,12 @@ function buildStandardTraversalCte(input) {
|
|
|
1534
1534
|
// currently the member-visibility guard. Every branch of the step carries
|
|
1535
1535
|
// them, because every branch reads the widened frontier.
|
|
1536
1536
|
...identityFrontierExpansion?.whereClauses ?? [],
|
|
1537
|
-
|
|
1538
|
-
|
|
1537
|
+
chunkPF6F5NLJ_cjs.compileKindFilter(chunkVCRRKBLN_cjs.sql.raw("e.kind"), branch.edgeKinds),
|
|
1538
|
+
chunkPF6F5NLJ_cjs.compileKindFilter(chunkVCRRKBLN_cjs.sql.raw(`e.${branch.targetKindField}`), nodeKinds)
|
|
1539
1539
|
];
|
|
1540
1540
|
if (traversal.includeIdentityMembers !== true) {
|
|
1541
1541
|
whereClauses.push(
|
|
1542
|
-
|
|
1542
|
+
chunkPF6F5NLJ_cjs.compileKindFilter(
|
|
1543
1543
|
chunkVCRRKBLN_cjs.sql.raw(`e.${branch.joinKindField}`),
|
|
1544
1544
|
previousNodeKinds
|
|
1545
1545
|
)
|
|
@@ -1608,7 +1608,7 @@ function buildStandardTraversalCte(input) {
|
|
|
1608
1608
|
const duplicateGuard = compileInverseTraversalDuplicateGuard(
|
|
1609
1609
|
directEdgeKinds,
|
|
1610
1610
|
inverseEdgeKinds,
|
|
1611
|
-
(overlappingKinds) =>
|
|
1611
|
+
(overlappingKinds) => chunkPF6F5NLJ_cjs.compileKindFilter(chunkVCRRKBLN_cjs.sql.raw("e.kind"), overlappingKinds)
|
|
1612
1612
|
);
|
|
1613
1613
|
const inverseBranch = compileTraversalBranch({
|
|
1614
1614
|
duplicateGuard,
|
|
@@ -1649,7 +1649,7 @@ function compileAggregateExprFromSource(expr, dialect) {
|
|
|
1649
1649
|
case "min":
|
|
1650
1650
|
case "max": {
|
|
1651
1651
|
const cteAlias = `cte_${field2.alias}`;
|
|
1652
|
-
const column =
|
|
1652
|
+
const column = chunkPF6F5NLJ_cjs.compileFieldValue(
|
|
1653
1653
|
field2,
|
|
1654
1654
|
dialect,
|
|
1655
1655
|
field2.valueType,
|
|
@@ -1672,7 +1672,7 @@ function compileProjectedSource(field2, dialect) {
|
|
|
1672
1672
|
return compileAggregateExprFromSource(field2.source, dialect);
|
|
1673
1673
|
}
|
|
1674
1674
|
const cteAlias = field2.cteAlias ?? `cte_${field2.source.alias}`;
|
|
1675
|
-
return
|
|
1675
|
+
return chunkPF6F5NLJ_cjs.compileFieldValue(
|
|
1676
1676
|
field2.source,
|
|
1677
1677
|
dialect,
|
|
1678
1678
|
field2.source.valueType,
|
|
@@ -1728,10 +1728,10 @@ function compileOrderFieldValue(ast, field2, dialect, cteAlias) {
|
|
|
1728
1728
|
if (selectiveField !== void 0) {
|
|
1729
1729
|
return chunkVCRRKBLN_cjs.sql`${chunkVCRRKBLN_cjs.sql.raw(cteAlias)}.${quoteIdentifier(selectivePropsCteColumnName(selectiveField))}`;
|
|
1730
1730
|
}
|
|
1731
|
-
return
|
|
1731
|
+
return chunkPF6F5NLJ_cjs.compileFieldValue(field2, dialect, field2.valueType, cteAlias);
|
|
1732
1732
|
}
|
|
1733
1733
|
function buildRelevanceJoins(vectorPredicate, fulltextPredicate) {
|
|
1734
|
-
const hybridTargetAlias =
|
|
1734
|
+
const hybridTargetAlias = chunkPF6F5NLJ_cjs.getHybridTargetAlias(
|
|
1735
1735
|
vectorPredicate,
|
|
1736
1736
|
fulltextPredicate
|
|
1737
1737
|
);
|
|
@@ -1972,7 +1972,7 @@ function buildStandardGroupBy(input) {
|
|
|
1972
1972
|
}
|
|
1973
1973
|
const aliasToCte = buildAliasToCteMap(ast);
|
|
1974
1974
|
const parts = allFields.map(
|
|
1975
|
-
(field2) =>
|
|
1975
|
+
(field2) => chunkPF6F5NLJ_cjs.compileFieldValue(
|
|
1976
1976
|
field2,
|
|
1977
1977
|
dialect,
|
|
1978
1978
|
field2.valueType,
|
|
@@ -1986,7 +1986,7 @@ function buildStandardHaving(input) {
|
|
|
1986
1986
|
if (!ast.having) {
|
|
1987
1987
|
return void 0;
|
|
1988
1988
|
}
|
|
1989
|
-
const condition =
|
|
1989
|
+
const condition = chunkPF6F5NLJ_cjs.compilePredicateExpression(ast.having, ctx);
|
|
1990
1990
|
return chunkVCRRKBLN_cjs.sql`HAVING ${condition}`;
|
|
1991
1991
|
}
|
|
1992
1992
|
function buildStandardEmbeddingsCte(input) {
|
|
@@ -2150,7 +2150,7 @@ function buildStandardFulltextCte(input) {
|
|
|
2150
2150
|
);
|
|
2151
2151
|
const conditions = [
|
|
2152
2152
|
chunkVCRRKBLN_cjs.sql`${qualifyColumn(tableName, "graph_id")} = ${graphId}`,
|
|
2153
|
-
|
|
2153
|
+
chunkPF6F5NLJ_cjs.compileKindFilter(qualifyColumn(tableName, "node_kind"), nodeKinds),
|
|
2154
2154
|
matchCondition
|
|
2155
2155
|
];
|
|
2156
2156
|
if (minScore !== void 0) {
|
|
@@ -2268,7 +2268,7 @@ function buildLimitOffsetClause(input) {
|
|
|
2268
2268
|
|
|
2269
2269
|
// src/query/compiler/passes/fulltext.ts
|
|
2270
2270
|
function runFulltextPredicatePass(ast, dialect) {
|
|
2271
|
-
const fulltextPredicates =
|
|
2271
|
+
const fulltextPredicates = chunkPF6F5NLJ_cjs.extractFulltextMatchPredicates(ast.predicates);
|
|
2272
2272
|
if (fulltextPredicates.length > 1) {
|
|
2273
2273
|
throw new chunkNI72YOJB_cjs.UnsupportedPredicateError(
|
|
2274
2274
|
"Multiple fulltext match predicates in a single query are not supported"
|
|
@@ -2365,11 +2365,11 @@ function runCompilerPass(state, pass) {
|
|
|
2365
2365
|
|
|
2366
2366
|
// src/query/compiler/passes/temporal.ts
|
|
2367
2367
|
function createTemporalFilterPass(ast, readInstant = "literal") {
|
|
2368
|
-
const currentTimestamp =
|
|
2368
|
+
const currentTimestamp = chunkPF6F5NLJ_cjs.currentReadInstantFor(readInstant);
|
|
2369
2369
|
return {
|
|
2370
2370
|
forAlias(tableAlias) {
|
|
2371
|
-
return
|
|
2372
|
-
...
|
|
2371
|
+
return chunkPF6F5NLJ_cjs.compileTemporalFilter({
|
|
2372
|
+
...chunkPF6F5NLJ_cjs.extractTemporalOptions(ast, tableAlias),
|
|
2373
2373
|
currentTimestamp
|
|
2374
2374
|
});
|
|
2375
2375
|
},
|
|
@@ -2379,7 +2379,7 @@ function createTemporalFilterPass(ast, readInstant = "literal") {
|
|
|
2379
2379
|
|
|
2380
2380
|
// src/query/compiler/passes/vector.ts
|
|
2381
2381
|
function runVectorPredicatePass(ast, dialect, vectorStrategy) {
|
|
2382
|
-
const vectorPredicates =
|
|
2382
|
+
const vectorPredicates = chunkPF6F5NLJ_cjs.extractVectorSimilarityPredicates(ast.predicates);
|
|
2383
2383
|
if (vectorPredicates.length > 1) {
|
|
2384
2384
|
throw new chunkNI72YOJB_cjs.UnsupportedPredicateError(
|
|
2385
2385
|
"Multiple vector similarity predicates in a single query are not supported"
|
|
@@ -2792,8 +2792,8 @@ function assertRecordedQueryDoesNotUseCurrentIndexes(ast, vectorPredicate, fullt
|
|
|
2792
2792
|
}
|
|
2793
2793
|
function assertRecordedQueryAstDoesNotUseCurrentIndexes(ast) {
|
|
2794
2794
|
if (ast.recordedAsOf === void 0) return;
|
|
2795
|
-
const vectorPredicates =
|
|
2796
|
-
const fulltextPredicates =
|
|
2795
|
+
const vectorPredicates = chunkPF6F5NLJ_cjs.extractVectorSimilarityPredicates(ast.predicates);
|
|
2796
|
+
const fulltextPredicates = chunkPF6F5NLJ_cjs.extractFulltextMatchPredicates(ast.predicates);
|
|
2797
2797
|
assertRecordedQueryHasNoCurrentIndexUsage(ast, {
|
|
2798
2798
|
usesVectorPredicate: vectorPredicates.length > 0,
|
|
2799
2799
|
usesFulltextPredicate: fulltextPredicates.length > 0
|
|
@@ -3207,13 +3207,13 @@ function compileRecursiveCte(ast, traversal, graphId, ctx, requiredColumnsByAlia
|
|
|
3207
3207
|
`;
|
|
3208
3208
|
}
|
|
3209
3209
|
function compileKindFilter2(kinds, columnExpr) {
|
|
3210
|
-
return
|
|
3210
|
+
return chunkPF6F5NLJ_cjs.compileKindFilter(chunkVCRRKBLN_cjs.sql.raw(columnExpr), kinds);
|
|
3211
3211
|
}
|
|
3212
3212
|
function compileNodePredicates(ast, alias, ctx) {
|
|
3213
|
-
return ast.predicates.filter((p) => p.targetAlias === alias && p.targetType !== "edge").map((p) =>
|
|
3213
|
+
return ast.predicates.filter((p) => p.targetAlias === alias && p.targetType !== "edge").map((p) => chunkPF6F5NLJ_cjs.compilePredicateExpression(p.expression, ctx));
|
|
3214
3214
|
}
|
|
3215
3215
|
function compileEdgePredicates(ast, edgeAlias, ctx) {
|
|
3216
|
-
return ast.predicates.filter((p) => p.targetAlias === edgeAlias && p.targetType === "edge").map((p) =>
|
|
3216
|
+
return ast.predicates.filter((p) => p.targetAlias === edgeAlias && p.targetType === "edge").map((p) => chunkPF6F5NLJ_cjs.compilePredicateExpression(p.expression, ctx));
|
|
3217
3217
|
}
|
|
3218
3218
|
function collectRequiredColumnsByAlias(ast, traversal) {
|
|
3219
3219
|
const selectiveFields = ast.selectiveFields;
|
|
@@ -3332,7 +3332,7 @@ function compileRecursiveOrderBy(ast, dialect) {
|
|
|
3332
3332
|
"Ordering by JSON arrays or objects is not supported"
|
|
3333
3333
|
);
|
|
3334
3334
|
}
|
|
3335
|
-
const field2 =
|
|
3335
|
+
const field2 = chunkPF6F5NLJ_cjs.compileFieldValue(orderSpec.field, dialect, valueType);
|
|
3336
3336
|
const direction = chunkVCRRKBLN_cjs.sql.raw(orderSpec.direction.toUpperCase());
|
|
3337
3337
|
const nulls = orderSpec.nulls ?? (orderSpec.direction === "asc" ? "last" : "first");
|
|
3338
3338
|
const nullsDirection = chunkVCRRKBLN_cjs.sql.raw(nulls === "first" ? "DESC" : "ASC");
|
|
@@ -3414,19 +3414,19 @@ function decodeByValueType(value, valueType) {
|
|
|
3414
3414
|
// src/store/recursive-cte.ts
|
|
3415
3415
|
function buildReachableCte(options) {
|
|
3416
3416
|
const trackPath = options.cyclePolicy === "prevent" || options.includePath;
|
|
3417
|
-
const edgeKindFilter =
|
|
3417
|
+
const edgeKindFilter = chunkPF6F5NLJ_cjs.compileKindFilter(
|
|
3418
3418
|
chunkVCRRKBLN_cjs.sql.raw("e.kind"),
|
|
3419
3419
|
options.edgeKinds
|
|
3420
3420
|
);
|
|
3421
|
-
const currentTimestamp =
|
|
3422
|
-
const nodeTemporalFilter =
|
|
3421
|
+
const currentTimestamp = chunkPF6F5NLJ_cjs.currentReadInstant();
|
|
3422
|
+
const nodeTemporalFilter = chunkPF6F5NLJ_cjs.compileTemporalFilter({
|
|
3423
3423
|
mode: options.temporalMode,
|
|
3424
3424
|
asOf: options.asOf,
|
|
3425
3425
|
recordedAsOf: options.recordedAsOf,
|
|
3426
3426
|
tableAlias: "n",
|
|
3427
3427
|
currentTimestamp
|
|
3428
3428
|
});
|
|
3429
|
-
const edgeTemporalFilter =
|
|
3429
|
+
const edgeTemporalFilter = chunkPF6F5NLJ_cjs.compileTemporalFilter({
|
|
3430
3430
|
mode: options.temporalMode,
|
|
3431
3431
|
asOf: options.asOf,
|
|
3432
3432
|
recordedAsOf: options.recordedAsOf,
|
|
@@ -3549,7 +3549,7 @@ function defineSubgraphProject(_graph) {
|
|
|
3549
3549
|
}
|
|
3550
3550
|
async function executeSubgraph(params) {
|
|
3551
3551
|
const { options } = params;
|
|
3552
|
-
const { valid: coordinate } =
|
|
3552
|
+
const { valid: coordinate } = chunkMCLYU6BN_cjs.resolveReadCoordinate(
|
|
3553
3553
|
options.temporalMode ?? params.graph.defaults.temporalMode,
|
|
3554
3554
|
options.asOf
|
|
3555
3555
|
);
|
|
@@ -3737,7 +3737,7 @@ function dedupeStrings(values) {
|
|
|
3737
3737
|
function buildIncludedIdsCte(ctx) {
|
|
3738
3738
|
const filters = [];
|
|
3739
3739
|
if (ctx.includeKinds !== void 0 && ctx.includeKinds.length > 0) {
|
|
3740
|
-
filters.push(
|
|
3740
|
+
filters.push(chunkPF6F5NLJ_cjs.compileKindFilter(chunkVCRRKBLN_cjs.sql.raw("kind"), ctx.includeKinds));
|
|
3741
3741
|
}
|
|
3742
3742
|
if (ctx.excludeRoot) {
|
|
3743
3743
|
filters.push(chunkVCRRKBLN_cjs.sql`id != ${ctx.rootId}`);
|
|
@@ -3760,12 +3760,12 @@ async function fetchIncludedIds(ctx, reachableCte, includedIdsCte) {
|
|
|
3760
3760
|
return rows.map((row) => row.id);
|
|
3761
3761
|
}
|
|
3762
3762
|
async function fetchSubgraphNodes(ctx, membership, projectionPlan) {
|
|
3763
|
-
const nodeTemporalFilter =
|
|
3763
|
+
const nodeTemporalFilter = chunkPF6F5NLJ_cjs.compileTemporalFilter({
|
|
3764
3764
|
mode: ctx.temporalMode,
|
|
3765
3765
|
asOf: ctx.asOf,
|
|
3766
3766
|
recordedAsOf: ctx.recordedAsOf,
|
|
3767
3767
|
tableAlias: "n",
|
|
3768
|
-
currentTimestamp:
|
|
3768
|
+
currentTimestamp: chunkPF6F5NLJ_cjs.currentReadInstant()
|
|
3769
3769
|
});
|
|
3770
3770
|
const columns = [
|
|
3771
3771
|
chunkVCRRKBLN_cjs.sql`n.kind`,
|
|
@@ -3788,13 +3788,13 @@ async function fetchSubgraphNodes(ctx, membership, projectionPlan) {
|
|
|
3788
3788
|
);
|
|
3789
3789
|
}
|
|
3790
3790
|
async function fetchSubgraphEdges(ctx, membership, projectionPlan) {
|
|
3791
|
-
const edgeKindFilter =
|
|
3792
|
-
const edgeTemporalFilter =
|
|
3791
|
+
const edgeKindFilter = chunkPF6F5NLJ_cjs.compileKindFilter(chunkVCRRKBLN_cjs.sql.raw("e.kind"), ctx.edgeKinds);
|
|
3792
|
+
const edgeTemporalFilter = chunkPF6F5NLJ_cjs.compileTemporalFilter({
|
|
3793
3793
|
mode: ctx.temporalMode,
|
|
3794
3794
|
asOf: ctx.asOf,
|
|
3795
3795
|
recordedAsOf: ctx.recordedAsOf,
|
|
3796
3796
|
tableAlias: "e",
|
|
3797
|
-
currentTimestamp:
|
|
3797
|
+
currentTimestamp: chunkPF6F5NLJ_cjs.currentReadInstant()
|
|
3798
3798
|
});
|
|
3799
3799
|
const columns = [
|
|
3800
3800
|
chunkVCRRKBLN_cjs.sql`e.id`,
|
|
@@ -3833,7 +3833,7 @@ function buildMetadataColumns(alias, plan, columns) {
|
|
|
3833
3833
|
if (metaKinds.length === plan.fullKinds.length + plan.projectedKinds.size) {
|
|
3834
3834
|
return columns.map((col) => chunkVCRRKBLN_cjs.sql`${chunkVCRRKBLN_cjs.sql.raw(`${alias}.${col}`)}`);
|
|
3835
3835
|
}
|
|
3836
|
-
const filter =
|
|
3836
|
+
const filter = chunkPF6F5NLJ_cjs.compileKindFilter(chunkVCRRKBLN_cjs.sql.raw(`${alias}.kind`), metaKinds);
|
|
3837
3837
|
return columns.map(
|
|
3838
3838
|
(col) => chunkVCRRKBLN_cjs.sql`CASE WHEN ${filter} THEN ${chunkVCRRKBLN_cjs.sql.raw(`${alias}.${col}`)} ELSE NULL END AS ${chunkVCRRKBLN_cjs.sql.raw(col)}`
|
|
3839
3839
|
);
|
|
@@ -3845,7 +3845,7 @@ function buildFullPropsColumn(alias, plan) {
|
|
|
3845
3845
|
if (plan.fullKinds.length === 0) {
|
|
3846
3846
|
return chunkVCRRKBLN_cjs.sql`NULL AS props`;
|
|
3847
3847
|
}
|
|
3848
|
-
const filter =
|
|
3848
|
+
const filter = chunkPF6F5NLJ_cjs.compileKindFilter(chunkVCRRKBLN_cjs.sql.raw(`${alias}.kind`), plan.fullKinds);
|
|
3849
3849
|
return chunkVCRRKBLN_cjs.sql`CASE WHEN ${filter} THEN ${chunkVCRRKBLN_cjs.sql.raw(`${alias}.props`)} ELSE NULL END AS props`;
|
|
3850
3850
|
}
|
|
3851
3851
|
function buildProjectedPropertyColumns(alias, plan, dialect) {
|
|
@@ -3889,7 +3889,7 @@ function applyProjectedFields(target, row, kindPlan) {
|
|
|
3889
3889
|
function mapSubgraphNodeRow(row, projectionPlan) {
|
|
3890
3890
|
const kindPlan = projectionPlan.projectedKinds.get(row.kind);
|
|
3891
3891
|
if (kindPlan === void 0) {
|
|
3892
|
-
return
|
|
3892
|
+
return chunkPT7RIRIZ_cjs.rowToNode({
|
|
3893
3893
|
...row,
|
|
3894
3894
|
props: normalizeProps(row.props)
|
|
3895
3895
|
});
|
|
@@ -3899,7 +3899,7 @@ function mapSubgraphNodeRow(row, projectionPlan) {
|
|
|
3899
3899
|
id: row.id
|
|
3900
3900
|
};
|
|
3901
3901
|
if (kindPlan.includeMeta) {
|
|
3902
|
-
projectedNode["meta"] =
|
|
3902
|
+
projectedNode["meta"] = chunkPT7RIRIZ_cjs.rowToNodeMeta(row);
|
|
3903
3903
|
}
|
|
3904
3904
|
applyProjectedFields(projectedNode, row, kindPlan);
|
|
3905
3905
|
return projectedNode;
|
|
@@ -3907,7 +3907,7 @@ function mapSubgraphNodeRow(row, projectionPlan) {
|
|
|
3907
3907
|
function mapSubgraphEdgeRow(row, projectionPlan) {
|
|
3908
3908
|
const kindPlan = projectionPlan.projectedKinds.get(row.kind);
|
|
3909
3909
|
if (kindPlan === void 0) {
|
|
3910
|
-
return
|
|
3910
|
+
return chunkPT7RIRIZ_cjs.rowToEdge({
|
|
3911
3911
|
...row,
|
|
3912
3912
|
props: normalizeProps(row.props)
|
|
3913
3913
|
});
|
|
@@ -3921,7 +3921,7 @@ function mapSubgraphEdgeRow(row, projectionPlan) {
|
|
|
3921
3921
|
toId: row.to_id
|
|
3922
3922
|
};
|
|
3923
3923
|
if (kindPlan.includeMeta) {
|
|
3924
|
-
projectedEdge["meta"] =
|
|
3924
|
+
projectedEdge["meta"] = chunkPT7RIRIZ_cjs.rowToEdgeMeta(row);
|
|
3925
3925
|
}
|
|
3926
3926
|
applyProjectedFields(projectedEdge, row, kindPlan);
|
|
3927
3927
|
return projectedEdge;
|
|
@@ -4247,7 +4247,7 @@ function hasIdEqualityPredicate(expression, alias) {
|
|
|
4247
4247
|
}
|
|
4248
4248
|
}
|
|
4249
4249
|
function isStartAliasBoundToSingleId(ast, predicateIndex) {
|
|
4250
|
-
return
|
|
4250
|
+
return chunkPF6F5NLJ_cjs.getPredicatesForAlias(predicateIndex, ast.start.alias, "node").some(
|
|
4251
4251
|
(predicate) => hasIdEqualityPredicate(predicate.expression, ast.start.alias)
|
|
4252
4252
|
);
|
|
4253
4253
|
}
|
|
@@ -4331,7 +4331,7 @@ function runStandardQueryPassPipeline(ast, graphId, ctx) {
|
|
|
4331
4331
|
fulltextPredicate: void 0,
|
|
4332
4332
|
fusion: void 0,
|
|
4333
4333
|
logicalPlan: void 0,
|
|
4334
|
-
predicateIndex:
|
|
4334
|
+
predicateIndex: chunkPF6F5NLJ_cjs.buildPredicateIndex(ast),
|
|
4335
4335
|
requiredColumnsByAlias: void 0,
|
|
4336
4336
|
shouldCollapseSelectiveTraversalRowset: false,
|
|
4337
4337
|
temporalFilterPass: void 0,
|
|
@@ -4572,7 +4572,7 @@ function compileSetOperation2(op, graphId, options = "sqlite") {
|
|
|
4572
4572
|
}
|
|
4573
4573
|
return compiled;
|
|
4574
4574
|
};
|
|
4575
|
-
const combined =
|
|
4575
|
+
const combined = chunkPF6F5NLJ_cjs.withPinnedReadInstant(
|
|
4576
4576
|
() => compileSetOperation(op, graphId, adapter, compileOperand, options_.vectorStrategy)
|
|
4577
4577
|
);
|
|
4578
4578
|
if (annIndexTypes.size > 0) {
|
|
@@ -4720,7 +4720,7 @@ function compileCountAggregateFastPath(ast, graphId, ctx, logicalPlan, requiredC
|
|
|
4720
4720
|
const nodeCountDistinctColumn = `${traversal.nodeAlias}_count_distinct`;
|
|
4721
4721
|
const edgeCountColumn = `${traversal.edgeAlias}_count`;
|
|
4722
4722
|
const edgeCountDistinctColumn = `${traversal.edgeAlias}_count_distinct`;
|
|
4723
|
-
const previousNodeKinds =
|
|
4723
|
+
const previousNodeKinds = chunkPF6F5NLJ_cjs.getNodeKindsForAlias(ast, traversal.joinFromAlias);
|
|
4724
4724
|
const edgeKinds = [...new Set(traversal.edgeKinds)];
|
|
4725
4725
|
const nodeKinds = traversal.nodeKinds;
|
|
4726
4726
|
const edgeTemporalFilter = temporalFilterPass.forAlias("e");
|
|
@@ -4729,16 +4729,16 @@ function compileCountAggregateFastPath(ast, graphId, ctx, logicalPlan, requiredC
|
|
|
4729
4729
|
...ctx,
|
|
4730
4730
|
cteColumnPrefix: "n"
|
|
4731
4731
|
};
|
|
4732
|
-
const nodePredicateClauses =
|
|
4733
|
-
|
|
4732
|
+
const nodePredicateClauses = chunkPF6F5NLJ_cjs.compilePredicateClauses(
|
|
4733
|
+
chunkPF6F5NLJ_cjs.getPredicatesForAlias(predicateIndex, traversal.nodeAlias, "node"),
|
|
4734
4734
|
nodePredicateContext
|
|
4735
4735
|
);
|
|
4736
4736
|
const edgePredicateContext = {
|
|
4737
4737
|
...ctx,
|
|
4738
4738
|
cteColumnPrefix: "e"
|
|
4739
4739
|
};
|
|
4740
|
-
const edgePredicateClauses =
|
|
4741
|
-
|
|
4740
|
+
const edgePredicateClauses = chunkPF6F5NLJ_cjs.compilePredicateClauses(
|
|
4741
|
+
chunkPF6F5NLJ_cjs.getPredicatesForAlias(predicateIndex, traversal.edgeAlias, "edge"),
|
|
4742
4742
|
edgePredicateContext
|
|
4743
4743
|
);
|
|
4744
4744
|
const joinField = traversal.direction === "out" ? "from_id" : "to_id";
|
|
@@ -4750,14 +4750,14 @@ function compileCountAggregateFastPath(ast, graphId, ctx, logicalPlan, requiredC
|
|
|
4750
4750
|
const useInnerJoin = hasNodePredicates;
|
|
4751
4751
|
const whereClauses = [
|
|
4752
4752
|
chunkVCRRKBLN_cjs.sql`e.graph_id = ${graphId}`,
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4753
|
+
chunkPF6F5NLJ_cjs.compileKindFilter(chunkVCRRKBLN_cjs.sql.raw("e.kind"), edgeKinds),
|
|
4754
|
+
chunkPF6F5NLJ_cjs.compileKindFilter(chunkVCRRKBLN_cjs.sql.raw(`e.${joinKindField}`), previousNodeKinds),
|
|
4755
|
+
chunkPF6F5NLJ_cjs.compileKindFilter(chunkVCRRKBLN_cjs.sql.raw(`e.${targetKindField}`), nodeKinds),
|
|
4756
4756
|
edgeTemporalFilter,
|
|
4757
4757
|
...edgePredicateClauses,
|
|
4758
4758
|
// INNER JOIN mode: node-side filters in WHERE constrain every aggregate.
|
|
4759
4759
|
...requiresNodeJoin && useInnerJoin ? [
|
|
4760
|
-
|
|
4760
|
+
chunkPF6F5NLJ_cjs.compileKindFilter(chunkVCRRKBLN_cjs.sql.raw("n.kind"), nodeKinds),
|
|
4761
4761
|
nodeTemporalFilter,
|
|
4762
4762
|
...nodePredicateClauses
|
|
4763
4763
|
] : []
|
|
@@ -4773,7 +4773,7 @@ function compileCountAggregateFastPath(ast, graphId, ctx, logicalPlan, requiredC
|
|
|
4773
4773
|
chunkVCRRKBLN_cjs.sql`n.graph_id = e.graph_id`,
|
|
4774
4774
|
chunkVCRRKBLN_cjs.sql`n.id = e.${chunkVCRRKBLN_cjs.sql.raw(targetField)}`,
|
|
4775
4775
|
chunkVCRRKBLN_cjs.sql`n.kind = e.${chunkVCRRKBLN_cjs.sql.raw(targetKindField)}`,
|
|
4776
|
-
|
|
4776
|
+
chunkPF6F5NLJ_cjs.compileKindFilter(chunkVCRRKBLN_cjs.sql.raw("n.kind"), nodeKinds),
|
|
4777
4777
|
nodeTemporalFilter
|
|
4778
4778
|
] : [];
|
|
4779
4779
|
const aggregateColumns = [];
|
|
@@ -4833,7 +4833,7 @@ function compileCountAggregateFastPath(ast, graphId, ctx, logicalPlan, requiredC
|
|
|
4833
4833
|
ast.projection.fields.map((projectedField) => {
|
|
4834
4834
|
const source = projectedField.source;
|
|
4835
4835
|
if (!isAggregateExpr(source)) {
|
|
4836
|
-
const value =
|
|
4836
|
+
const value = chunkPF6F5NLJ_cjs.compileFieldValue(
|
|
4837
4837
|
source,
|
|
4838
4838
|
dialect,
|
|
4839
4839
|
source.valueType,
|
|
@@ -5173,7 +5173,7 @@ function compileStandardQueryWithCteStrategy(ast, graphId, ctx) {
|
|
|
5173
5173
|
traversalLimit: traversalCteLimit
|
|
5174
5174
|
});
|
|
5175
5175
|
if (vectorPredicate) {
|
|
5176
|
-
const nodeKinds =
|
|
5176
|
+
const nodeKinds = chunkPF6F5NLJ_cjs.getNodeKindsForAlias(ast, vectorPredicate.field.alias);
|
|
5177
5177
|
ctes.push(
|
|
5178
5178
|
buildStandardEmbeddingsCte({
|
|
5179
5179
|
ctx,
|
|
@@ -5184,7 +5184,7 @@ function compileStandardQueryWithCteStrategy(ast, graphId, ctx) {
|
|
|
5184
5184
|
);
|
|
5185
5185
|
}
|
|
5186
5186
|
if (fulltextPredicate) {
|
|
5187
|
-
const nodeKinds =
|
|
5187
|
+
const nodeKinds = chunkPF6F5NLJ_cjs.getNodeKindsForAlias(ast, fulltextPredicate.field.alias);
|
|
5188
5188
|
ctes.push(
|
|
5189
5189
|
buildStandardFulltextCte({
|
|
5190
5190
|
ctx,
|
|
@@ -5194,7 +5194,7 @@ function compileStandardQueryWithCteStrategy(ast, graphId, ctx) {
|
|
|
5194
5194
|
})
|
|
5195
5195
|
);
|
|
5196
5196
|
}
|
|
5197
|
-
if (
|
|
5197
|
+
if (chunkPF6F5NLJ_cjs.getHybridTargetAlias(vectorPredicate, fulltextPredicate) !== void 0) {
|
|
5198
5198
|
ctes.push(buildStandardHybridCandidateCte());
|
|
5199
5199
|
}
|
|
5200
5200
|
const projection = buildStandardProjection({
|
|
@@ -5817,9 +5817,9 @@ function buildSelectiveFields(accessedFields, options) {
|
|
|
5817
5817
|
valueType: typeInfo?.valueType
|
|
5818
5818
|
};
|
|
5819
5819
|
}).toSorted((a, b) => {
|
|
5820
|
-
const aliasCompare =
|
|
5820
|
+
const aliasCompare = chunkPF6F5NLJ_cjs.compareStrings(a.alias, b.alias);
|
|
5821
5821
|
if (aliasCompare !== 0) return aliasCompare;
|
|
5822
|
-
return
|
|
5822
|
+
return chunkPF6F5NLJ_cjs.compareStrings(a.field, b.field);
|
|
5823
5823
|
});
|
|
5824
5824
|
}
|
|
5825
5825
|
function buildAliasKindMap(state) {
|
|
@@ -6039,7 +6039,7 @@ function buildAliasPlans(state, selectiveFields, schemaIntrospector) {
|
|
|
6039
6039
|
systemOutputNames: new Set(systemFields.map((f) => f.outputName))
|
|
6040
6040
|
});
|
|
6041
6041
|
}
|
|
6042
|
-
return plans.toSorted((a, b) =>
|
|
6042
|
+
return plans.toSorted((a, b) => chunkPF6F5NLJ_cjs.compareStrings(a.alias, b.alias));
|
|
6043
6043
|
}
|
|
6044
6044
|
function buildSelectiveContext(row, plans, traversals) {
|
|
6045
6045
|
const context = chunkN66HCGCY_cjs.createDataKeyedBag();
|
|
@@ -6118,7 +6118,7 @@ function createGuardedProxy(target, debugPath) {
|
|
|
6118
6118
|
// src/query/builder/read-instant-template.ts
|
|
6119
6119
|
function templateHasReadInstant(template) {
|
|
6120
6120
|
return template.params.some(
|
|
6121
|
-
(parameter) => chunkVCRRKBLN_cjs.isSqlPlaceholder(parameter) && parameter.name ===
|
|
6121
|
+
(parameter) => chunkVCRRKBLN_cjs.isSqlPlaceholder(parameter) && parameter.name === chunkPF6F5NLJ_cjs.CURRENT_READ_INSTANT_PLACEHOLDER
|
|
6122
6122
|
);
|
|
6123
6123
|
}
|
|
6124
6124
|
function queryAstNeedsCurrentReadInstant(ast) {
|
|
@@ -6157,8 +6157,8 @@ function fillTemplateParams(params, bindings, dialect, listParameters = EMPTY_LI
|
|
|
6157
6157
|
return params.map((parameter) => {
|
|
6158
6158
|
if (!chunkVCRRKBLN_cjs.isSqlPlaceholder(parameter)) return parameter;
|
|
6159
6159
|
const name = parameter.name;
|
|
6160
|
-
if (name ===
|
|
6161
|
-
readInstant ??=
|
|
6160
|
+
if (name === chunkPF6F5NLJ_cjs.CURRENT_READ_INSTANT_PLACEHOLDER) {
|
|
6161
|
+
readInstant ??= chunkMCLYU6BN_cjs.nowIso();
|
|
6162
6162
|
return readInstant;
|
|
6163
6163
|
}
|
|
6164
6164
|
const value = chunkN66HCGCY_cjs.readOwnProperty(bindings, name);
|
|
@@ -6217,7 +6217,7 @@ function toLiteralList(parameterName, value) {
|
|
|
6217
6217
|
function substitutePredicateExpression(expr, bindings) {
|
|
6218
6218
|
switch (expr.__type) {
|
|
6219
6219
|
case "comparison": {
|
|
6220
|
-
if (
|
|
6220
|
+
if (chunkPF6F5NLJ_cjs.isParameterRef(expr.right)) {
|
|
6221
6221
|
const value = resolveBinding(bindings, expr.right.name);
|
|
6222
6222
|
return {
|
|
6223
6223
|
...expr,
|
|
@@ -6227,7 +6227,7 @@ function substitutePredicateExpression(expr, bindings) {
|
|
|
6227
6227
|
return expr;
|
|
6228
6228
|
}
|
|
6229
6229
|
case "string_op": {
|
|
6230
|
-
if (
|
|
6230
|
+
if (chunkPF6F5NLJ_cjs.isParameterRef(expr.pattern)) {
|
|
6231
6231
|
const value = chunkN66HCGCY_cjs.readOwnProperty(bindings, expr.pattern.name);
|
|
6232
6232
|
if (value === void 0) {
|
|
6233
6233
|
throw new chunkNI72YOJB_cjs.ConfigurationError(
|
|
@@ -6249,8 +6249,8 @@ function substitutePredicateExpression(expr, bindings) {
|
|
|
6249
6249
|
return expr;
|
|
6250
6250
|
}
|
|
6251
6251
|
case "between": {
|
|
6252
|
-
const lowerIsParam =
|
|
6253
|
-
const upperIsParam =
|
|
6252
|
+
const lowerIsParam = chunkPF6F5NLJ_cjs.isParameterRef(expr.lower);
|
|
6253
|
+
const upperIsParam = chunkPF6F5NLJ_cjs.isParameterRef(expr.upper);
|
|
6254
6254
|
if (!lowerIsParam && !upperIsParam) return expr;
|
|
6255
6255
|
const lower = lowerIsParam ? toLiteral(resolveBinding(bindings, expr.lower.name)) : expr.lower;
|
|
6256
6256
|
const upper = upperIsParam ? toLiteral(resolveBinding(bindings, expr.upper.name)) : expr.upper;
|
|
@@ -6520,14 +6520,14 @@ function collectParameterMetadataFromAst(ast, accumulator) {
|
|
|
6520
6520
|
function collectParameterMetadataFromExpression(expression, accumulator) {
|
|
6521
6521
|
switch (expression.__type) {
|
|
6522
6522
|
case "comparison": {
|
|
6523
|
-
if (
|
|
6523
|
+
if (chunkPF6F5NLJ_cjs.isParameterRef(expression.right)) {
|
|
6524
6524
|
const name = expression.right.name;
|
|
6525
6525
|
accumulator.names.add(name);
|
|
6526
6526
|
if (isListComparisonOp(expression.op)) {
|
|
6527
6527
|
recordListElementType(
|
|
6528
6528
|
accumulator,
|
|
6529
6529
|
name,
|
|
6530
|
-
|
|
6530
|
+
chunkPF6F5NLJ_cjs.resolveParameterValueType(expression.left, expression.right)
|
|
6531
6531
|
);
|
|
6532
6532
|
} else {
|
|
6533
6533
|
accumulator.scalarParameters.add(name);
|
|
@@ -6536,7 +6536,7 @@ function collectParameterMetadataFromExpression(expression, accumulator) {
|
|
|
6536
6536
|
return;
|
|
6537
6537
|
}
|
|
6538
6538
|
case "string_op": {
|
|
6539
|
-
if (
|
|
6539
|
+
if (chunkPF6F5NLJ_cjs.isParameterRef(expression.pattern)) {
|
|
6540
6540
|
accumulator.names.add(expression.pattern.name);
|
|
6541
6541
|
accumulator.scalarParameters.add(expression.pattern.name);
|
|
6542
6542
|
accumulator.stringOpParameters.add(expression.pattern.name);
|
|
@@ -6545,7 +6545,7 @@ function collectParameterMetadataFromExpression(expression, accumulator) {
|
|
|
6545
6545
|
}
|
|
6546
6546
|
case "between": {
|
|
6547
6547
|
for (const bound of [expression.lower, expression.upper]) {
|
|
6548
|
-
if (
|
|
6548
|
+
if (chunkPF6F5NLJ_cjs.isParameterRef(bound)) {
|
|
6549
6549
|
accumulator.names.add(bound.name);
|
|
6550
6550
|
accumulator.scalarParameters.add(bound.name);
|
|
6551
6551
|
}
|
|
@@ -7100,10 +7100,10 @@ var ExecutableQuery = class _ExecutableQuery {
|
|
|
7100
7100
|
}
|
|
7101
7101
|
}
|
|
7102
7102
|
const orderSpec = isSystem ? {
|
|
7103
|
-
field:
|
|
7103
|
+
field: chunkPF6F5NLJ_cjs.fieldRef(alias, [field2], { valueType: "string" }),
|
|
7104
7104
|
direction
|
|
7105
7105
|
} : {
|
|
7106
|
-
field:
|
|
7106
|
+
field: chunkPF6F5NLJ_cjs.fieldRef(alias, ["props"], {
|
|
7107
7107
|
jsonPointer: chunkA7J2YDDI_cjs.jsonPointer([field2]),
|
|
7108
7108
|
valueType: typeInfo?.valueType,
|
|
7109
7109
|
elementType: typeInfo?.elementType
|
|
@@ -7619,9 +7619,9 @@ var ExecutableQuery = class _ExecutableQuery {
|
|
|
7619
7619
|
add(traversal.edgeAlias);
|
|
7620
7620
|
}
|
|
7621
7621
|
return result.toSorted((a, b) => {
|
|
7622
|
-
const aliasCompare =
|
|
7622
|
+
const aliasCompare = chunkPF6F5NLJ_cjs.compareStrings(a.alias, b.alias);
|
|
7623
7623
|
if (aliasCompare !== 0) return aliasCompare;
|
|
7624
|
-
return
|
|
7624
|
+
return chunkPF6F5NLJ_cjs.compareStrings(a.field, b.field);
|
|
7625
7625
|
});
|
|
7626
7626
|
}
|
|
7627
7627
|
async #tryOptimizedPaginate(cursorData, direction, pageLimit, fetchLimit, cursor, isBackward) {
|
|
@@ -8214,12 +8214,12 @@ function createDynamicFieldBuilder(introspector, alias, name, kindNames, entity)
|
|
|
8214
8214
|
if (typeInfo === void 0) {
|
|
8215
8215
|
throw new Error(`Property "${name}" is not declared on ${where}.`);
|
|
8216
8216
|
}
|
|
8217
|
-
const ref =
|
|
8217
|
+
const ref = chunkPF6F5NLJ_cjs.fieldRef(alias, ["props"], {
|
|
8218
8218
|
jsonPointer: chunkA7J2YDDI_cjs.jsonPointer([name]),
|
|
8219
8219
|
valueType: typeInfo.valueType,
|
|
8220
8220
|
elementType: typeInfo.elementType
|
|
8221
8221
|
});
|
|
8222
|
-
const base =
|
|
8222
|
+
const base = chunkPF6F5NLJ_cjs.buildFieldBuilderForTypeInfo(ref, typeInfo);
|
|
8223
8223
|
const expect = (asserted) => {
|
|
8224
8224
|
if (typeInfo.valueType !== asserted) {
|
|
8225
8225
|
throw new TypeError(
|
|
@@ -8395,17 +8395,17 @@ var TraversalBuilder = class _TraversalBuilder {
|
|
|
8395
8395
|
(kind) => !this.#edgeKinds.includes(kind)
|
|
8396
8396
|
)
|
|
8397
8397
|
];
|
|
8398
|
-
const idAccessor =
|
|
8399
|
-
|
|
8398
|
+
const idAccessor = chunkPF6F5NLJ_cjs.stringField(
|
|
8399
|
+
chunkPF6F5NLJ_cjs.fieldRef(alias, ["id"], { valueType: "string" })
|
|
8400
8400
|
);
|
|
8401
|
-
const kindAccessor =
|
|
8402
|
-
|
|
8401
|
+
const kindAccessor = chunkPF6F5NLJ_cjs.stringField(
|
|
8402
|
+
chunkPF6F5NLJ_cjs.fieldRef(alias, ["kind"], { valueType: "string" })
|
|
8403
8403
|
);
|
|
8404
|
-
const fromIdAccessor =
|
|
8405
|
-
|
|
8404
|
+
const fromIdAccessor = chunkPF6F5NLJ_cjs.stringField(
|
|
8405
|
+
chunkPF6F5NLJ_cjs.fieldRef(alias, ["from_id"], { valueType: "string" })
|
|
8406
8406
|
);
|
|
8407
|
-
const toIdAccessor =
|
|
8408
|
-
|
|
8407
|
+
const toIdAccessor = chunkPF6F5NLJ_cjs.stringField(
|
|
8408
|
+
chunkPF6F5NLJ_cjs.fieldRef(alias, ["to_id"], { valueType: "string" })
|
|
8409
8409
|
);
|
|
8410
8410
|
const buildFieldAccessor = (propertyName) => {
|
|
8411
8411
|
const typeInfo = this.#config.schemaIntrospector.getSharedEdgeFieldTypeInfo(
|
|
@@ -8414,34 +8414,34 @@ var TraversalBuilder = class _TraversalBuilder {
|
|
|
8414
8414
|
);
|
|
8415
8415
|
const valueType = typeInfo?.valueType;
|
|
8416
8416
|
const elementType = typeInfo?.elementType;
|
|
8417
|
-
const ref =
|
|
8417
|
+
const ref = chunkPF6F5NLJ_cjs.fieldRef(alias, ["props"], {
|
|
8418
8418
|
jsonPointer: chunkA7J2YDDI_cjs.jsonPointer([propertyName]),
|
|
8419
8419
|
valueType,
|
|
8420
8420
|
elementType
|
|
8421
8421
|
});
|
|
8422
8422
|
switch (valueType) {
|
|
8423
8423
|
case "string": {
|
|
8424
|
-
return
|
|
8424
|
+
return chunkPF6F5NLJ_cjs.stringField(ref);
|
|
8425
8425
|
}
|
|
8426
8426
|
case "number": {
|
|
8427
|
-
return
|
|
8427
|
+
return chunkPF6F5NLJ_cjs.numberField(ref);
|
|
8428
8428
|
}
|
|
8429
8429
|
case "boolean": {
|
|
8430
|
-
return
|
|
8430
|
+
return chunkPF6F5NLJ_cjs.baseField(ref);
|
|
8431
8431
|
}
|
|
8432
8432
|
case "date": {
|
|
8433
|
-
return
|
|
8433
|
+
return chunkPF6F5NLJ_cjs.dateField(ref);
|
|
8434
8434
|
}
|
|
8435
8435
|
case "array": {
|
|
8436
|
-
return
|
|
8436
|
+
return chunkPF6F5NLJ_cjs.arrayField(ref);
|
|
8437
8437
|
}
|
|
8438
8438
|
case "object": {
|
|
8439
|
-
return
|
|
8439
|
+
return chunkPF6F5NLJ_cjs.objectField(ref);
|
|
8440
8440
|
}
|
|
8441
8441
|
case "embedding":
|
|
8442
8442
|
case "unknown":
|
|
8443
8443
|
case void 0: {
|
|
8444
|
-
return
|
|
8444
|
+
return chunkPF6F5NLJ_cjs.baseField(ref);
|
|
8445
8445
|
}
|
|
8446
8446
|
}
|
|
8447
8447
|
};
|
|
@@ -8591,39 +8591,39 @@ function buildNodeFields(alias) {
|
|
|
8591
8591
|
return [
|
|
8592
8592
|
{
|
|
8593
8593
|
outputName: `${alias}_id`,
|
|
8594
|
-
source:
|
|
8594
|
+
source: chunkPF6F5NLJ_cjs.fieldRef(alias, ["id"])
|
|
8595
8595
|
},
|
|
8596
8596
|
{
|
|
8597
8597
|
outputName: `${alias}_kind`,
|
|
8598
|
-
source:
|
|
8598
|
+
source: chunkPF6F5NLJ_cjs.fieldRef(alias, ["kind"])
|
|
8599
8599
|
},
|
|
8600
8600
|
{
|
|
8601
8601
|
outputName: `${alias}_props`,
|
|
8602
|
-
source:
|
|
8602
|
+
source: chunkPF6F5NLJ_cjs.fieldRef(alias, ["props"])
|
|
8603
8603
|
},
|
|
8604
8604
|
{
|
|
8605
8605
|
outputName: `${alias}_version`,
|
|
8606
|
-
source:
|
|
8606
|
+
source: chunkPF6F5NLJ_cjs.fieldRef(alias, ["version"])
|
|
8607
8607
|
},
|
|
8608
8608
|
{
|
|
8609
8609
|
outputName: `${alias}_valid_from`,
|
|
8610
|
-
source:
|
|
8610
|
+
source: chunkPF6F5NLJ_cjs.fieldRef(alias, ["valid_from"])
|
|
8611
8611
|
},
|
|
8612
8612
|
{
|
|
8613
8613
|
outputName: `${alias}_valid_to`,
|
|
8614
|
-
source:
|
|
8614
|
+
source: chunkPF6F5NLJ_cjs.fieldRef(alias, ["valid_to"])
|
|
8615
8615
|
},
|
|
8616
8616
|
{
|
|
8617
8617
|
outputName: `${alias}_created_at`,
|
|
8618
|
-
source:
|
|
8618
|
+
source: chunkPF6F5NLJ_cjs.fieldRef(alias, ["created_at"])
|
|
8619
8619
|
},
|
|
8620
8620
|
{
|
|
8621
8621
|
outputName: `${alias}_updated_at`,
|
|
8622
|
-
source:
|
|
8622
|
+
source: chunkPF6F5NLJ_cjs.fieldRef(alias, ["updated_at"])
|
|
8623
8623
|
},
|
|
8624
8624
|
{
|
|
8625
8625
|
outputName: `${alias}_deleted_at`,
|
|
8626
|
-
source:
|
|
8626
|
+
source: chunkPF6F5NLJ_cjs.fieldRef(alias, ["deleted_at"])
|
|
8627
8627
|
}
|
|
8628
8628
|
];
|
|
8629
8629
|
}
|
|
@@ -8632,52 +8632,52 @@ function buildEdgeFields(edgeAlias, nodeCteAlias) {
|
|
|
8632
8632
|
return [
|
|
8633
8633
|
{
|
|
8634
8634
|
outputName: `${edgeAlias}_id`,
|
|
8635
|
-
source:
|
|
8635
|
+
source: chunkPF6F5NLJ_cjs.fieldRef(edgeAlias, ["id"]),
|
|
8636
8636
|
cteAlias
|
|
8637
8637
|
},
|
|
8638
8638
|
{
|
|
8639
8639
|
outputName: `${edgeAlias}_kind`,
|
|
8640
|
-
source:
|
|
8640
|
+
source: chunkPF6F5NLJ_cjs.fieldRef(edgeAlias, ["kind"]),
|
|
8641
8641
|
cteAlias
|
|
8642
8642
|
},
|
|
8643
8643
|
{
|
|
8644
8644
|
outputName: `${edgeAlias}_from_id`,
|
|
8645
|
-
source:
|
|
8645
|
+
source: chunkPF6F5NLJ_cjs.fieldRef(edgeAlias, ["from_id"]),
|
|
8646
8646
|
cteAlias
|
|
8647
8647
|
},
|
|
8648
8648
|
{
|
|
8649
8649
|
outputName: `${edgeAlias}_to_id`,
|
|
8650
|
-
source:
|
|
8650
|
+
source: chunkPF6F5NLJ_cjs.fieldRef(edgeAlias, ["to_id"]),
|
|
8651
8651
|
cteAlias
|
|
8652
8652
|
},
|
|
8653
8653
|
{
|
|
8654
8654
|
outputName: `${edgeAlias}_props`,
|
|
8655
|
-
source:
|
|
8655
|
+
source: chunkPF6F5NLJ_cjs.fieldRef(edgeAlias, ["props"]),
|
|
8656
8656
|
cteAlias
|
|
8657
8657
|
},
|
|
8658
8658
|
{
|
|
8659
8659
|
outputName: `${edgeAlias}_valid_from`,
|
|
8660
|
-
source:
|
|
8660
|
+
source: chunkPF6F5NLJ_cjs.fieldRef(edgeAlias, ["valid_from"]),
|
|
8661
8661
|
cteAlias
|
|
8662
8662
|
},
|
|
8663
8663
|
{
|
|
8664
8664
|
outputName: `${edgeAlias}_valid_to`,
|
|
8665
|
-
source:
|
|
8665
|
+
source: chunkPF6F5NLJ_cjs.fieldRef(edgeAlias, ["valid_to"]),
|
|
8666
8666
|
cteAlias
|
|
8667
8667
|
},
|
|
8668
8668
|
{
|
|
8669
8669
|
outputName: `${edgeAlias}_created_at`,
|
|
8670
|
-
source:
|
|
8670
|
+
source: chunkPF6F5NLJ_cjs.fieldRef(edgeAlias, ["created_at"]),
|
|
8671
8671
|
cteAlias
|
|
8672
8672
|
},
|
|
8673
8673
|
{
|
|
8674
8674
|
outputName: `${edgeAlias}_updated_at`,
|
|
8675
|
-
source:
|
|
8675
|
+
source: chunkPF6F5NLJ_cjs.fieldRef(edgeAlias, ["updated_at"]),
|
|
8676
8676
|
cteAlias
|
|
8677
8677
|
},
|
|
8678
8678
|
{
|
|
8679
8679
|
outputName: `${edgeAlias}_deleted_at`,
|
|
8680
|
-
source:
|
|
8680
|
+
source: chunkPF6F5NLJ_cjs.fieldRef(edgeAlias, ["deleted_at"]),
|
|
8681
8681
|
cteAlias
|
|
8682
8682
|
}
|
|
8683
8683
|
];
|
|
@@ -8707,15 +8707,15 @@ var QueryBuilder = class _QueryBuilder {
|
|
|
8707
8707
|
if (sealedCoordinate !== void 0) {
|
|
8708
8708
|
const coordinate2 = sealedCoordinate;
|
|
8709
8709
|
throw new chunkNI72YOJB_cjs.ConfigurationError(
|
|
8710
|
-
`.temporal() is not available on a StoreView query \u2014 the view's temporal coordinate (${
|
|
8710
|
+
`.temporal() is not available on a StoreView query \u2014 the view's temporal coordinate (${chunkMCLYU6BN_cjs.describeCoordinate(coordinate2)}) is sealed. Re-coordinate on the live Store via store.query() or store.view(...).`,
|
|
8711
8711
|
{
|
|
8712
8712
|
code: "STORE_VIEW_SEALED_QUERY",
|
|
8713
|
-
...
|
|
8713
|
+
...chunkMCLYU6BN_cjs.coordinateContext(coordinate2),
|
|
8714
8714
|
requestedMode: mode
|
|
8715
8715
|
}
|
|
8716
8716
|
);
|
|
8717
8717
|
}
|
|
8718
|
-
const coordinate =
|
|
8718
|
+
const coordinate = chunkMCLYU6BN_cjs.resolveReadCoordinate(
|
|
8719
8719
|
mode,
|
|
8720
8720
|
asOf,
|
|
8721
8721
|
`Use .temporal("asOf", "2024-01-15T10:00:00.000Z") or .temporal("current") for current time.`
|
|
@@ -9008,10 +9008,10 @@ var QueryBuilder = class _QueryBuilder {
|
|
|
9008
9008
|
field2
|
|
9009
9009
|
) : this.#getOrderByTypeInfo(alias, field2);
|
|
9010
9010
|
const orderSpec = isSystem ? {
|
|
9011
|
-
field:
|
|
9011
|
+
field: chunkPF6F5NLJ_cjs.fieldRef(alias, [field2], { valueType: "string" }),
|
|
9012
9012
|
direction
|
|
9013
9013
|
} : {
|
|
9014
|
-
field:
|
|
9014
|
+
field: chunkPF6F5NLJ_cjs.fieldRef(alias, ["props"], {
|
|
9015
9015
|
jsonPointer: chunkA7J2YDDI_cjs.jsonPointer([field2]),
|
|
9016
9016
|
valueType: typeInfo?.valueType,
|
|
9017
9017
|
elementType: typeInfo?.elementType
|
|
@@ -9187,7 +9187,7 @@ var QueryBuilder = class _QueryBuilder {
|
|
|
9187
9187
|
kindNames,
|
|
9188
9188
|
property
|
|
9189
9189
|
) : void 0;
|
|
9190
|
-
const ref =
|
|
9190
|
+
const ref = chunkPF6F5NLJ_cjs.fieldRef(alias, ["props"], {
|
|
9191
9191
|
jsonPointer: chunkA7J2YDDI_cjs.jsonPointer([property]),
|
|
9192
9192
|
valueType: typeInfo?.valueType,
|
|
9193
9193
|
elementType: typeInfo?.elementType
|
|
@@ -9195,17 +9195,17 @@ var QueryBuilder = class _QueryBuilder {
|
|
|
9195
9195
|
return this.#buildFieldBuilderForTypeInfo(ref, typeInfo);
|
|
9196
9196
|
}
|
|
9197
9197
|
#buildFieldBuilderForTypeInfo(ref, typeInfo) {
|
|
9198
|
-
return
|
|
9198
|
+
return chunkPF6F5NLJ_cjs.buildFieldBuilderForTypeInfo(ref, typeInfo);
|
|
9199
9199
|
}
|
|
9200
9200
|
#createNodeAccessor(alias) {
|
|
9201
9201
|
const kindNames = this.#getKindNamesForAlias(alias);
|
|
9202
|
-
const idAccessor =
|
|
9203
|
-
|
|
9202
|
+
const idAccessor = chunkPF6F5NLJ_cjs.stringField(
|
|
9203
|
+
chunkPF6F5NLJ_cjs.fieldRef(alias, ["id"], { valueType: "string" })
|
|
9204
9204
|
);
|
|
9205
|
-
const kindAccessor =
|
|
9206
|
-
|
|
9205
|
+
const kindAccessor = chunkPF6F5NLJ_cjs.stringField(
|
|
9206
|
+
chunkPF6F5NLJ_cjs.fieldRef(alias, ["kind"], { valueType: "string" })
|
|
9207
9207
|
);
|
|
9208
|
-
const fulltextAccessor =
|
|
9208
|
+
const fulltextAccessor = chunkPF6F5NLJ_cjs.createFulltextAccessor(
|
|
9209
9209
|
alias,
|
|
9210
9210
|
() => this.#hasSearchableField(kindNames)
|
|
9211
9211
|
);
|
|
@@ -9299,7 +9299,7 @@ var QueryBuilder = class _QueryBuilder {
|
|
|
9299
9299
|
edgeKindNames,
|
|
9300
9300
|
property
|
|
9301
9301
|
) : void 0;
|
|
9302
|
-
const ref =
|
|
9302
|
+
const ref = chunkPF6F5NLJ_cjs.fieldRef(alias, ["props"], {
|
|
9303
9303
|
jsonPointer: chunkA7J2YDDI_cjs.jsonPointer([property]),
|
|
9304
9304
|
valueType: typeInfo?.valueType,
|
|
9305
9305
|
elementType: typeInfo?.elementType
|
|
@@ -9308,17 +9308,17 @@ var QueryBuilder = class _QueryBuilder {
|
|
|
9308
9308
|
}
|
|
9309
9309
|
#createEdgeAccessor(alias) {
|
|
9310
9310
|
const edgeKindNames = this.#getEdgeKindNamesForAlias(alias);
|
|
9311
|
-
const idAccessor =
|
|
9312
|
-
|
|
9311
|
+
const idAccessor = chunkPF6F5NLJ_cjs.stringField(
|
|
9312
|
+
chunkPF6F5NLJ_cjs.fieldRef(alias, ["id"], { valueType: "string" })
|
|
9313
9313
|
);
|
|
9314
|
-
const kindAccessor =
|
|
9315
|
-
|
|
9314
|
+
const kindAccessor = chunkPF6F5NLJ_cjs.stringField(
|
|
9315
|
+
chunkPF6F5NLJ_cjs.fieldRef(alias, ["kind"], { valueType: "string" })
|
|
9316
9316
|
);
|
|
9317
|
-
const fromIdAccessor =
|
|
9318
|
-
|
|
9317
|
+
const fromIdAccessor = chunkPF6F5NLJ_cjs.stringField(
|
|
9318
|
+
chunkPF6F5NLJ_cjs.fieldRef(alias, ["from_id"], { valueType: "string" })
|
|
9319
9319
|
);
|
|
9320
|
-
const toIdAccessor =
|
|
9321
|
-
|
|
9320
|
+
const toIdAccessor = chunkPF6F5NLJ_cjs.stringField(
|
|
9321
|
+
chunkPF6F5NLJ_cjs.fieldRef(alias, ["to_id"], { valueType: "string" })
|
|
9322
9322
|
);
|
|
9323
9323
|
if (this.#state.dynamicEdgeAliases.has(alias)) {
|
|
9324
9324
|
return {
|
|
@@ -10044,7 +10044,7 @@ function processPage(schema, rows) {
|
|
|
10044
10044
|
skippedIds.push(row.id);
|
|
10045
10045
|
continue;
|
|
10046
10046
|
}
|
|
10047
|
-
const computed =
|
|
10047
|
+
const computed = chunkQ3G6A4I3_cjs.computeFulltextContent(schema, parsed);
|
|
10048
10048
|
if (computed === void 0) {
|
|
10049
10049
|
toDelete.push(row.id);
|
|
10050
10050
|
} else {
|
|
@@ -10125,7 +10125,7 @@ async function fetchNodesForRows(backend, graphId, rows) {
|
|
|
10125
10125
|
function tryResolveSearchSlot(ctx, nodeKind, fieldPath) {
|
|
10126
10126
|
const nodeType = ctx.registry.getNodeType(nodeKind);
|
|
10127
10127
|
if (nodeType === void 0) return void 0;
|
|
10128
|
-
const fields =
|
|
10128
|
+
const fields = chunkQ3G6A4I3_cjs.getEmbeddingFields(nodeType.schema);
|
|
10129
10129
|
const field2 = fields.find((entry2) => entry2.fieldPath === fieldPath);
|
|
10130
10130
|
if (field2 === void 0) return void 0;
|
|
10131
10131
|
return {
|
|
@@ -10191,7 +10191,7 @@ async function executeFulltextSearch(ctx, nodeKind, options) {
|
|
|
10191
10191
|
})
|
|
10192
10192
|
);
|
|
10193
10193
|
const merged = singleKind ? chunkN66HCGCY_cjs.requireDefined(perKindRows[0]) : perKindRows.flat().toSorted(
|
|
10194
|
-
(a, b) => b.score - a.score ||
|
|
10194
|
+
(a, b) => b.score - a.score || chunkPF6F5NLJ_cjs.compareCodePoints(a.kind, b.kind) || chunkPF6F5NLJ_cjs.compareCodePoints(a.nodeId, b.nodeId)
|
|
10195
10195
|
).slice(offset, offset + options.limit);
|
|
10196
10196
|
if (merged.length === 0) return [];
|
|
10197
10197
|
const nodeMap = await fetchNodesForRows(backend, graphId, merged);
|
|
@@ -10316,12 +10316,12 @@ function resolveVectorSearchKinds(ctx, nodeKind, fieldPath, includeSubClasses, l
|
|
|
10316
10316
|
function mergeVectorRows(perKindRows, metric) {
|
|
10317
10317
|
const descending = scoreDescending(metric);
|
|
10318
10318
|
return perKindRows.flat().toSorted(
|
|
10319
|
-
(a, b) => (descending ? b.score - a.score : a.score - b.score) ||
|
|
10319
|
+
(a, b) => (descending ? b.score - a.score : a.score - b.score) || chunkPF6F5NLJ_cjs.compareCodePoints(a.kind, b.kind) || chunkPF6F5NLJ_cjs.compareCodePoints(a.nodeId, b.nodeId)
|
|
10320
10320
|
);
|
|
10321
10321
|
}
|
|
10322
10322
|
function mergeFulltextRows(perKindRows) {
|
|
10323
10323
|
return perKindRows.flat().toSorted(
|
|
10324
|
-
(a, b) => b.score - a.score ||
|
|
10324
|
+
(a, b) => b.score - a.score || chunkPF6F5NLJ_cjs.compareCodePoints(a.kind, b.kind) || chunkPF6F5NLJ_cjs.compareCodePoints(a.nodeId, b.nodeId)
|
|
10325
10325
|
);
|
|
10326
10326
|
}
|
|
10327
10327
|
async function executeHybridSearch(ctx, nodeKind, options) {
|
|
@@ -10435,7 +10435,7 @@ async function executeHybridSearch(ctx, nodeKind, options) {
|
|
|
10435
10435
|
...candidates === void 0 ? {} : { candidates }
|
|
10436
10436
|
});
|
|
10437
10437
|
return rows.map((row, index) => {
|
|
10438
|
-
const typedNode =
|
|
10438
|
+
const typedNode = chunkPT7RIRIZ_cjs.rowToNode(row.node);
|
|
10439
10439
|
return {
|
|
10440
10440
|
node: typedNode,
|
|
10441
10441
|
score: row.fusedScore,
|
|
@@ -10548,7 +10548,7 @@ async function executeHybridSearch(ctx, nodeKind, options) {
|
|
|
10548
10548
|
fused.set(key, entry2);
|
|
10549
10549
|
}
|
|
10550
10550
|
const ranked = [...fused.values()].toSorted(
|
|
10551
|
-
(a, b) => b.fusedScore - a.fusedScore ||
|
|
10551
|
+
(a, b) => b.fusedScore - a.fusedScore || chunkPF6F5NLJ_cjs.compareCodePoints(a.kind, b.kind) || chunkPF6F5NLJ_cjs.compareCodePoints(a.nodeId, b.nodeId)
|
|
10552
10552
|
).slice(offset, offset + options.limit);
|
|
10553
10553
|
const nodeMap = await fetchNodesForRows(
|
|
10554
10554
|
backend,
|
|
@@ -10699,13 +10699,13 @@ async function fetchNodesByIds(backend, graphId, nodeKind, ids) {
|
|
|
10699
10699
|
const rows = await backend.getNodes(graphId, nodeKind, ids);
|
|
10700
10700
|
for (const row of rows) {
|
|
10701
10701
|
if (row.deleted_at !== void 0) continue;
|
|
10702
|
-
map.set(row.id,
|
|
10702
|
+
map.set(row.id, chunkPT7RIRIZ_cjs.rowToNode(row));
|
|
10703
10703
|
}
|
|
10704
10704
|
return map;
|
|
10705
10705
|
}
|
|
10706
10706
|
for (const id of ids) {
|
|
10707
10707
|
const row = await backend.getNode(graphId, nodeKind, id);
|
|
10708
|
-
if (row && row.deleted_at === void 0) map.set(row.id,
|
|
10708
|
+
if (row && row.deleted_at === void 0) map.set(row.id, chunkPT7RIRIZ_cjs.rowToNode(row));
|
|
10709
10709
|
}
|
|
10710
10710
|
return map;
|
|
10711
10711
|
}
|
|
@@ -11193,12 +11193,12 @@ function pickTemporalOptions(options) {
|
|
|
11193
11193
|
};
|
|
11194
11194
|
}
|
|
11195
11195
|
function resolveTemporalOptions(ctx, options) {
|
|
11196
|
-
const { valid } =
|
|
11196
|
+
const { valid } = chunkMCLYU6BN_cjs.resolveReadCoordinate(
|
|
11197
11197
|
options.temporalMode ?? ctx.defaultTemporalMode,
|
|
11198
11198
|
options.asOf
|
|
11199
11199
|
);
|
|
11200
11200
|
if (options.recordedAsOf !== void 0) {
|
|
11201
|
-
|
|
11201
|
+
chunkMCLYU6BN_cjs.assertValidRecordedInstant(options.recordedAsOf, "recordedAsOf");
|
|
11202
11202
|
}
|
|
11203
11203
|
return {
|
|
11204
11204
|
temporalMode: valid.mode,
|
|
@@ -11221,9 +11221,9 @@ function resolveTemporalFilter(ctx, options, tableAlias) {
|
|
|
11221
11221
|
asOf: resolved.asOf,
|
|
11222
11222
|
recordedAsOf: resolved.recordedAsOf,
|
|
11223
11223
|
tableAlias,
|
|
11224
|
-
currentTimestamp:
|
|
11224
|
+
currentTimestamp: chunkPF6F5NLJ_cjs.currentReadInstant()
|
|
11225
11225
|
};
|
|
11226
|
-
return
|
|
11226
|
+
return chunkPF6F5NLJ_cjs.compileTemporalFilter(filterOptions);
|
|
11227
11227
|
}
|
|
11228
11228
|
function resolveMaxHops(rawMaxHops, fallback, optionName) {
|
|
11229
11229
|
const value = rawMaxHops ?? fallback;
|
|
@@ -11299,7 +11299,7 @@ async function executeDegree(ctx, nodeId, options = {}) {
|
|
|
11299
11299
|
compileDirectionFilter(ctx, direction, nodeId, schema.nodesTable)
|
|
11300
11300
|
];
|
|
11301
11301
|
if (options.edges !== void 0) {
|
|
11302
|
-
whereClauses.push(
|
|
11302
|
+
whereClauses.push(chunkPF6F5NLJ_cjs.compileKindFilter(chunkVCRRKBLN_cjs.sql.raw("kind"), options.edges));
|
|
11303
11303
|
}
|
|
11304
11304
|
const countExpr = direction === "both" ? chunkVCRRKBLN_cjs.sql`COUNT(DISTINCT id)` : chunkVCRRKBLN_cjs.sql`COUNT(*)`;
|
|
11305
11305
|
const query = chunkVCRRKBLN_cjs.sql`SELECT ${countExpr} AS count FROM ${schema.edgesTable} WHERE ${chunkVCRRKBLN_cjs.sql.join(whereClauses, chunkVCRRKBLN_cjs.sql` AND `)}`;
|
|
@@ -11380,11 +11380,11 @@ async function seedWorkingTableFromNodes(context, nodeKinds, seedColumns) {
|
|
|
11380
11380
|
return;
|
|
11381
11381
|
}
|
|
11382
11382
|
const normalizedKinds = [...new Set(nodeKinds)].toSorted(
|
|
11383
|
-
(left, right) =>
|
|
11383
|
+
(left, right) => chunkPF6F5NLJ_cjs.compareCodePoints(left, right)
|
|
11384
11384
|
);
|
|
11385
11385
|
for (const kindChunk of chunkValues(normalizedKinds, kindBindBudget)) {
|
|
11386
11386
|
await context.executeTemporary(
|
|
11387
|
-
compileSeedStatement(
|
|
11387
|
+
compileSeedStatement(chunkPF6F5NLJ_cjs.compileKindFilter(chunkVCRRKBLN_cjs.sql.raw("n.kind"), kindChunk))
|
|
11388
11388
|
);
|
|
11389
11389
|
}
|
|
11390
11390
|
}
|
|
@@ -11483,7 +11483,7 @@ function temporaryTableCapabilityError(ctx, algorithm, sqlState, cause) {
|
|
|
11483
11483
|
}
|
|
11484
11484
|
async function runWorkingTableRounds(ctx, options, plan, backend) {
|
|
11485
11485
|
const temporaryBackend = requireTemporaryStatements(backend);
|
|
11486
|
-
const runId =
|
|
11486
|
+
const runId = chunkPF6F5NLJ_cjs.generateId();
|
|
11487
11487
|
const workingTable = chunkVCRRKBLN_cjs.sql.identifier(
|
|
11488
11488
|
`typegraph_iterative_${runId.replaceAll("-", "_")}`
|
|
11489
11489
|
);
|
|
@@ -11586,7 +11586,7 @@ async function cleanupWorkingTables(context, cleanup, operationFailure) {
|
|
|
11586
11586
|
async function fetchVisibleWorkingNodes(operation, nodeIds) {
|
|
11587
11587
|
const nodes = /* @__PURE__ */ new Map();
|
|
11588
11588
|
for (const chunk2 of chunkValues(nodeIds, operation.maxWorkingSetSize)) {
|
|
11589
|
-
const query = chunkVCRRKBLN_cjs.sql`SELECT n.id, n.kind FROM ${operation.schema.nodesTable} n WHERE n.graph_id = ${operation.ctx.graphId} AND n.id IN (${
|
|
11589
|
+
const query = chunkVCRRKBLN_cjs.sql`SELECT n.id, n.kind FROM ${operation.schema.nodesTable} n WHERE n.graph_id = ${operation.ctx.graphId} AND n.id IN (${chunkPF6F5NLJ_cjs.sqlValueList(chunk2)}) AND ${operation.nodeTemporalFilter}`;
|
|
11590
11590
|
const rows = await operation.backend.execute(
|
|
11591
11591
|
chunkVCRRKBLN_cjs.asCompiledRowsSql(query)
|
|
11592
11592
|
);
|
|
@@ -11633,7 +11633,7 @@ function nodeIdentityKeyFromRow(id, kind) {
|
|
|
11633
11633
|
return nodeIdentityKey({ id, kind });
|
|
11634
11634
|
}
|
|
11635
11635
|
function compareNodeIdentity(left, right) {
|
|
11636
|
-
return
|
|
11636
|
+
return chunkPF6F5NLJ_cjs.compareCodePoints(left.id, right.id) || chunkPF6F5NLJ_cjs.compareCodePoints(left.kind, right.kind);
|
|
11637
11637
|
}
|
|
11638
11638
|
var OUTGOING_DIRECTION_FIELDS = {
|
|
11639
11639
|
joinField: "from_id",
|
|
@@ -11733,7 +11733,7 @@ function compileDirectionalExpansion(operation, workingRelation, sourceFilter, e
|
|
|
11733
11733
|
return chunkVCRRKBLN_cjs.sql`SELECT expanded.source_id, expanded.source_kind, n.id AS target_id, n.kind AS target_kind${weightColumn} FROM (${edgeExpansion}) expanded JOIN ${operation.schema.nodesTable} n ON n.graph_id = ${operation.ctx.graphId} AND n.id = expanded.target_id AND n.kind = expanded.target_kind WHERE ${operation.nodeTemporalFilter}`;
|
|
11734
11734
|
}
|
|
11735
11735
|
function compileDirectionalEdgeExpansion(operation, workingRelation, sourceFilter, edgeKinds, joinField, joinKindField, targetField, targetKindField, sourceProjection) {
|
|
11736
|
-
const edgeKindFilter =
|
|
11736
|
+
const edgeKindFilter = chunkPF6F5NLJ_cjs.compileKindFilter(chunkVCRRKBLN_cjs.sql.raw("e.kind"), edgeKinds);
|
|
11737
11737
|
const weightColumn = operation.weightExpression === void 0 ? chunkVCRRKBLN_cjs.sql`` : chunkVCRRKBLN_cjs.sql`, ${operation.weightExpression} AS weight`;
|
|
11738
11738
|
const sourceColumns = sourceProjection === void 0 ? chunkVCRRKBLN_cjs.sql`` : chunkVCRRKBLN_cjs.sql`, ${sourceProjection}`;
|
|
11739
11739
|
return chunkVCRRKBLN_cjs.sql`SELECT w.node_id AS source_id, w.node_kind AS source_kind${sourceColumns}, e.${chunkVCRRKBLN_cjs.sql.raw(targetField)} AS target_id, e.${chunkVCRRKBLN_cjs.sql.raw(targetKindField)} AS target_kind${weightColumn} FROM ${workingRelation} w JOIN ${operation.schema.edgesTable} e ON e.${chunkVCRRKBLN_cjs.sql.raw(joinField)} = w.node_id AND e.${chunkVCRRKBLN_cjs.sql.raw(joinKindField)} = w.node_kind AND e.graph_id = ${operation.ctx.graphId} WHERE ${sourceFilter} AND ${edgeKindFilter} AND ${operation.edgeTemporalFilter}`;
|
|
@@ -11747,15 +11747,15 @@ function chunkValues(values, chunkSize) {
|
|
|
11747
11747
|
}
|
|
11748
11748
|
function createOperation(ctx, options, backend) {
|
|
11749
11749
|
const temporal = resolveTemporalOptions(ctx, options);
|
|
11750
|
-
const currentTimestamp =
|
|
11751
|
-
const nodeTemporalFilter =
|
|
11750
|
+
const currentTimestamp = chunkPF6F5NLJ_cjs.currentReadInstant();
|
|
11751
|
+
const nodeTemporalFilter = chunkPF6F5NLJ_cjs.compileTemporalFilter({
|
|
11752
11752
|
mode: temporal.temporalMode,
|
|
11753
11753
|
...temporal.asOf === void 0 ? {} : { asOf: temporal.asOf },
|
|
11754
11754
|
...temporal.recordedAsOf === void 0 ? {} : { recordedAsOf: temporal.recordedAsOf },
|
|
11755
11755
|
tableAlias: "n",
|
|
11756
11756
|
currentTimestamp
|
|
11757
11757
|
});
|
|
11758
|
-
const edgeTemporalFilter =
|
|
11758
|
+
const edgeTemporalFilter = chunkPF6F5NLJ_cjs.compileTemporalFilter({
|
|
11759
11759
|
mode: temporal.temporalMode,
|
|
11760
11760
|
...temporal.asOf === void 0 ? {} : { asOf: temporal.asOf },
|
|
11761
11761
|
...temporal.recordedAsOf === void 0 ? {} : { recordedAsOf: temporal.recordedAsOf },
|
|
@@ -11782,7 +11782,7 @@ function createOperation(ctx, options, backend) {
|
|
|
11782
11782
|
}
|
|
11783
11783
|
const edgeKindChunks = chunkValues(
|
|
11784
11784
|
[...new Set(options.edges)].toSorted(
|
|
11785
|
-
(left, right) =>
|
|
11785
|
+
(left, right) => chunkPF6F5NLJ_cjs.compareStrings(left, right)
|
|
11786
11786
|
),
|
|
11787
11787
|
maxEdgeKindsPerQuery
|
|
11788
11788
|
);
|
|
@@ -13380,7 +13380,7 @@ async function assertValidEdgeWeights(operation, weightProperty, defaultWeight)
|
|
|
13380
13380
|
const negativeViolation = chunkVCRRKBLN_cjs.sql`audited.is_number = 1 AND audited.weight_number < 0`;
|
|
13381
13381
|
const outOfRangeViolation = chunkVCRRKBLN_cjs.sql`audited.is_number = 1 AND (ABS(audited.weight_number) > CAST(${MAX_EDGE_WEIGHT} AS NUMERIC) OR (audited.weight_number <> 0 AND ABS(audited.weight_number) < CAST(${MIN_EDGE_WEIGHT} AS NUMERIC)))`;
|
|
13382
13382
|
for (const edgeKinds of operation.edgeKindChunks) {
|
|
13383
|
-
const edgeKindFilter =
|
|
13383
|
+
const edgeKindFilter = chunkPF6F5NLJ_cjs.compileKindFilter(chunkVCRRKBLN_cjs.sql.raw("e.kind"), edgeKinds);
|
|
13384
13384
|
const rows = await operation.backend.execute(
|
|
13385
13385
|
chunkVCRRKBLN_cjs.asCompiledRowsSql(chunkVCRRKBLN_cjs.sql`
|
|
13386
13386
|
SELECT audited.edge_id, audited.edge_kind, audited.weight_text,
|
|
@@ -13940,13 +13940,20 @@ function windowFieldChanges(requested, stored) {
|
|
|
13940
13940
|
if (requested === void 0) {
|
|
13941
13941
|
return false;
|
|
13942
13942
|
}
|
|
13943
|
-
if (!
|
|
13943
|
+
if (!chunkMCLYU6BN_cjs.isCanonicalIsoDate(requested)) {
|
|
13944
13944
|
return true;
|
|
13945
13945
|
}
|
|
13946
|
-
return !
|
|
13946
|
+
return !chunkMCLYU6BN_cjs.statedBoundMatchesStored(requested, stored);
|
|
13947
|
+
}
|
|
13948
|
+
function lowerBoundRequiresWrite(requested, stored) {
|
|
13949
|
+
const requestedValidFrom = requested?.validFrom;
|
|
13950
|
+
if (!chunkMCLYU6BN_cjs.preservesImmutableLowerBound(requested?.onImmutableLowerBound)) {
|
|
13951
|
+
return windowFieldChanges(requestedValidFrom, stored);
|
|
13952
|
+
}
|
|
13953
|
+
return requestedValidFrom !== void 0 && !chunkMCLYU6BN_cjs.isCanonicalIsoDate(requestedValidFrom);
|
|
13947
13954
|
}
|
|
13948
13955
|
function upsertWindowChanges(requested, current) {
|
|
13949
|
-
return
|
|
13956
|
+
return lowerBoundRequiresWrite(requested, current.valid_from) || windowFieldChanges(requested?.validTo, current.valid_to);
|
|
13950
13957
|
}
|
|
13951
13958
|
function windowAfterUpsertCreate(requested) {
|
|
13952
13959
|
return { valid_from: requested.validFrom, valid_to: requested.validTo };
|
|
@@ -14012,7 +14019,7 @@ function buildUpsertUpdateEdgeInput(kind, id, from, to, props, options) {
|
|
|
14012
14019
|
return input;
|
|
14013
14020
|
}
|
|
14014
14021
|
function endpointKey(endpointKind, id) {
|
|
14015
|
-
return
|
|
14022
|
+
return chunkDTVWX77L_cjs.encodeTupleKey([endpointKind, id]);
|
|
14016
14023
|
}
|
|
14017
14024
|
function groupEndpointIdsByKind(references) {
|
|
14018
14025
|
const referencesByKind = chunkBSFJMMV3_cjs.groupBy(references, (ref) => ref.kind);
|
|
@@ -14156,7 +14163,7 @@ function createEdgeCollection(config) {
|
|
|
14156
14163
|
},
|
|
14157
14164
|
async getByIds(ids, options) {
|
|
14158
14165
|
if (ids.length === 0) return [];
|
|
14159
|
-
const rowsById = await
|
|
14166
|
+
const rowsById = await chunkPF6F5NLJ_cjs.getEdgeRowsByIds(backend, graphId, ids);
|
|
14160
14167
|
const matches = temporalRowMatcher(options);
|
|
14161
14168
|
return ids.map((id) => {
|
|
14162
14169
|
const row = rowsById.get(id);
|
|
@@ -14264,7 +14271,7 @@ function createEdgeCollection(config) {
|
|
|
14264
14271
|
if (items.length === 0) return [];
|
|
14265
14272
|
const upsertAll = async (target) => {
|
|
14266
14273
|
const ids = items.map((item) => item.id);
|
|
14267
|
-
const existingMap = await
|
|
14274
|
+
const existingMap = await chunkPF6F5NLJ_cjs.getEdgeRowsByIds(target, graphId, ids);
|
|
14268
14275
|
const results2 = Array.from({ length: items.length });
|
|
14269
14276
|
const toCreate = [];
|
|
14270
14277
|
const toUpdate = [];
|
|
@@ -14550,6 +14557,9 @@ function buildUpsertUpdateInput(kind, id, props, options) {
|
|
|
14550
14557
|
const input = { kind, id, props };
|
|
14551
14558
|
if (options?.validFrom !== void 0) input.validFrom = options.validFrom;
|
|
14552
14559
|
if (options?.validTo !== void 0) input.validTo = options.validTo;
|
|
14560
|
+
if (options?.onImmutableLowerBound !== void 0) {
|
|
14561
|
+
input.onImmutableLowerBound = options.onImmutableLowerBound;
|
|
14562
|
+
}
|
|
14553
14563
|
return input;
|
|
14554
14564
|
}
|
|
14555
14565
|
function mapBulkNodeInputs(kind, items) {
|
|
@@ -14598,7 +14608,7 @@ function createNodeCollection(config) {
|
|
|
14598
14608
|
},
|
|
14599
14609
|
async getByIds(ids, options) {
|
|
14600
14610
|
if (ids.length === 0) return [];
|
|
14601
|
-
const rowsById = await
|
|
14611
|
+
const rowsById = await chunkPF6F5NLJ_cjs.getNodeRowsByIds(backend, graphId, kind, ids);
|
|
14602
14612
|
const matches = temporalRowMatcher(options);
|
|
14603
14613
|
return ids.map((id) => {
|
|
14604
14614
|
const row = rowsById.get(id);
|
|
@@ -14629,7 +14639,7 @@ function createNodeCollection(config) {
|
|
|
14629
14639
|
);
|
|
14630
14640
|
}
|
|
14631
14641
|
const rootAlias = "update_candidate";
|
|
14632
|
-
const readInstant =
|
|
14642
|
+
const readInstant = chunkMCLYU6BN_cjs.nowIso();
|
|
14633
14643
|
let base = createQuery().fromDynamic(kind, rootAlias).temporal("asOf", readInstant);
|
|
14634
14644
|
const where = params.where;
|
|
14635
14645
|
if (where !== void 0) {
|
|
@@ -15132,14 +15142,14 @@ var HISTORY_STORE_BACKEND_KEYS = [
|
|
|
15132
15142
|
];
|
|
15133
15143
|
function createHistoryStoreBackendProjection(backend) {
|
|
15134
15144
|
return Object.freeze(
|
|
15135
|
-
|
|
15145
|
+
chunkPF6F5NLJ_cjs.projectBackendMembers(backend, HISTORY_STORE_BACKEND_KEYS)
|
|
15136
15146
|
);
|
|
15137
15147
|
}
|
|
15138
15148
|
|
|
15139
15149
|
// src/store/introspect.ts
|
|
15140
15150
|
function introspectSchema(graph, context) {
|
|
15141
15151
|
const extension = graph.extension;
|
|
15142
|
-
const { nodes: runtimeNodeNames, edges: runtimeEdgeNames } =
|
|
15152
|
+
const { nodes: runtimeNodeNames, edges: runtimeEdgeNames } = chunk65E3XWGF_cjs.extensionKindNames(extension);
|
|
15143
15153
|
const deprecated = graph.deprecatedKinds;
|
|
15144
15154
|
const kinds = [];
|
|
15145
15155
|
for (const [name, registration] of Object.entries(graph.nodes)) {
|
|
@@ -15150,7 +15160,7 @@ function introspectSchema(graph, context) {
|
|
|
15150
15160
|
description: reg.type.description,
|
|
15151
15161
|
annotations: reg.type.annotations,
|
|
15152
15162
|
deprecated: deprecated.has(name),
|
|
15153
|
-
properties:
|
|
15163
|
+
properties: chunk65E3XWGF_cjs.serializeSchemaProperties(reg.type.schema),
|
|
15154
15164
|
unique: (reg.unique ?? []).map((constraint) => ({
|
|
15155
15165
|
name: constraint.name,
|
|
15156
15166
|
fields: [...constraint.fields],
|
|
@@ -15171,17 +15181,17 @@ function introspectSchema(graph, context) {
|
|
|
15171
15181
|
to: reg.to.map((entry2) => entry2.kind),
|
|
15172
15182
|
cardinality: reg.cardinality ?? "many",
|
|
15173
15183
|
endpointExistence: reg.endpointExistence ?? "notDeleted",
|
|
15174
|
-
properties:
|
|
15184
|
+
properties: chunk65E3XWGF_cjs.serializeSchemaProperties(edgeType.schema),
|
|
15175
15185
|
annotations: edgeType.annotations,
|
|
15176
15186
|
deprecated: deprecated.has(name)
|
|
15177
15187
|
});
|
|
15178
15188
|
}
|
|
15179
|
-
const runtimeOntologyKeys =
|
|
15189
|
+
const runtimeOntologyKeys = chunk65E3XWGF_cjs.buildGraphExtensionOntologyKeySet(extension);
|
|
15180
15190
|
const ontology = graph.ontology.map((relation) => ({
|
|
15181
15191
|
metaEdge: relation.metaEdge.name,
|
|
15182
15192
|
from: chunkNK5Q7UNE_cjs.getTypeName(relation.from),
|
|
15183
15193
|
to: chunkNK5Q7UNE_cjs.getTypeName(relation.to),
|
|
15184
|
-
origin: runtimeOntologyKeys.has(
|
|
15194
|
+
origin: runtimeOntologyKeys.has(chunk65E3XWGF_cjs.compileTimeOntologyKey(relation)) ? "runtime" : "compile-time"
|
|
15185
15195
|
}));
|
|
15186
15196
|
return {
|
|
15187
15197
|
graphId: context.graphId,
|
|
@@ -15495,7 +15505,7 @@ async function materializeOne(declaration, backend, graphId, schemaVersion, acti
|
|
|
15495
15505
|
}
|
|
15496
15506
|
try {
|
|
15497
15507
|
await run();
|
|
15498
|
-
const attemptedAt =
|
|
15508
|
+
const attemptedAt = chunkMCLYU6BN_cjs.nowIso();
|
|
15499
15509
|
await recordIndexMaterialization(
|
|
15500
15510
|
buildAttempt({
|
|
15501
15511
|
declaration,
|
|
@@ -15556,7 +15566,7 @@ async function materializeWithClaim(declaration, backend, graphId, schemaVersion
|
|
|
15556
15566
|
const recordIndexMaterialization = chunkN66HCGCY_cjs.requireDefined(
|
|
15557
15567
|
backend.recordIndexMaterialization
|
|
15558
15568
|
);
|
|
15559
|
-
const token = `${statusKey}:${
|
|
15569
|
+
const token = `${statusKey}:${chunkMCLYU6BN_cjs.nowIso()}:${Math.floor(performance.now() * 1e3)}`;
|
|
15560
15570
|
const deadline = Date.now() + CLAIM_WAIT_TIMEOUT_MS;
|
|
15561
15571
|
for (; ; ) {
|
|
15562
15572
|
const claimed = await chunkN66HCGCY_cjs.requireDefined(backend.claimIndexMaterialization)({
|
|
@@ -15608,7 +15618,7 @@ async function materializeWithClaim(declaration, backend, graphId, schemaVersion
|
|
|
15608
15618
|
}
|
|
15609
15619
|
try {
|
|
15610
15620
|
await run();
|
|
15611
|
-
const attemptedAt =
|
|
15621
|
+
const attemptedAt = chunkMCLYU6BN_cjs.nowIso();
|
|
15612
15622
|
await recordIndexMaterialization(
|
|
15613
15623
|
buildAttempt({
|
|
15614
15624
|
declaration,
|
|
@@ -15685,7 +15695,7 @@ async function preloadExistingTables(backend, tableNames) {
|
|
|
15685
15695
|
chunkVCRRKBLN_cjs.asCompiledRowsSql(chunkVCRRKBLN_cjs.sql`
|
|
15686
15696
|
SELECT c.relname AS name
|
|
15687
15697
|
FROM pg_class c
|
|
15688
|
-
WHERE c.relname IN (${
|
|
15698
|
+
WHERE c.relname IN (${chunkPF6F5NLJ_cjs.sqlValueList(tableNames)})
|
|
15689
15699
|
AND c.relkind IN ('r', 'p')
|
|
15690
15700
|
AND pg_catalog.pg_table_is_visible(c.oid)
|
|
15691
15701
|
`)
|
|
@@ -15698,7 +15708,7 @@ async function preloadExistingTables(backend, tableNames) {
|
|
|
15698
15708
|
SELECT name
|
|
15699
15709
|
FROM sqlite_master
|
|
15700
15710
|
WHERE type = 'table'
|
|
15701
|
-
AND name IN (${
|
|
15711
|
+
AND name IN (${chunkPF6F5NLJ_cjs.sqlValueList(tableNames)})
|
|
15702
15712
|
`)
|
|
15703
15713
|
);
|
|
15704
15714
|
return new Set(rows.map((row) => row.name));
|
|
@@ -15719,7 +15729,7 @@ async function preloadPhysicalIndexStates(backend, physicalIndexNames) {
|
|
|
15719
15729
|
SELECT c.relname AS name, i.indisvalid AS valid
|
|
15720
15730
|
FROM pg_class c
|
|
15721
15731
|
JOIN pg_index i ON i.indexrelid = c.oid
|
|
15722
|
-
WHERE c.relname IN (${
|
|
15732
|
+
WHERE c.relname IN (${chunkPF6F5NLJ_cjs.sqlValueList(physicalIndexNames)})
|
|
15723
15733
|
AND pg_catalog.pg_table_is_visible(c.oid)
|
|
15724
15734
|
`)
|
|
15725
15735
|
);
|
|
@@ -15732,7 +15742,7 @@ async function preloadPhysicalIndexStates(backend, physicalIndexNames) {
|
|
|
15732
15742
|
SELECT name
|
|
15733
15743
|
FROM sqlite_master
|
|
15734
15744
|
WHERE type = 'index'
|
|
15735
|
-
AND name IN (${
|
|
15745
|
+
AND name IN (${chunkPF6F5NLJ_cjs.sqlValueList(physicalIndexNames)})
|
|
15736
15746
|
`)
|
|
15737
15747
|
);
|
|
15738
15748
|
for (const row of rows) valid.add(row.name);
|
|
@@ -15796,7 +15806,7 @@ function buildAttempt(args) {
|
|
|
15796
15806
|
kind: args.declaration.kind,
|
|
15797
15807
|
signature: args.signature,
|
|
15798
15808
|
schemaVersion: args.schemaVersion,
|
|
15799
|
-
attemptedAt: args.attemptedAt ??
|
|
15809
|
+
attemptedAt: args.attemptedAt ?? chunkMCLYU6BN_cjs.nowIso(),
|
|
15800
15810
|
materializedAt: args.materializedAt,
|
|
15801
15811
|
error: args.error?.message
|
|
15802
15812
|
};
|
|
@@ -15920,7 +15930,7 @@ async function computeIndexSignature(dialect, targetTableName, declaration) {
|
|
|
15920
15930
|
const hashable = {
|
|
15921
15931
|
dialect,
|
|
15922
15932
|
targetTableName,
|
|
15923
|
-
declaration:
|
|
15933
|
+
declaration: chunk65E3XWGF_cjs.serializeIndexDeclaration(declaration)
|
|
15924
15934
|
};
|
|
15925
15935
|
const json = JSON.stringify(hashable, chunkPWLJ77UV_cjs.sortedReplacer);
|
|
15926
15936
|
return chunkZY4GXIVN_cjs.sha256Hex(json, 16);
|
|
@@ -15942,7 +15952,7 @@ async function materializeRemovals(context, options = {}) {
|
|
|
15942
15952
|
await ensureFocusedStatusTable(backend, backend.ensureKindRemovalsTable);
|
|
15943
15953
|
await reconcilePendingRemovals(context);
|
|
15944
15954
|
const activeRow = await backend.getActiveSchema(graphId);
|
|
15945
|
-
const activeSchema = activeRow === void 0 ? void 0 :
|
|
15955
|
+
const activeSchema = activeRow === void 0 ? void 0 : chunk65E3XWGF_cjs.parseSerializedSchema(activeRow.schema_doc);
|
|
15946
15956
|
const reclaimedVectorFields = await reclaimRemovedVectorFieldTables(
|
|
15947
15957
|
context,
|
|
15948
15958
|
activeRow
|
|
@@ -16009,14 +16019,14 @@ async function reconcilePendingRemovals(context) {
|
|
|
16009
16019
|
const reconciliations = [];
|
|
16010
16020
|
const stopAtVersion = marker ?? 1;
|
|
16011
16021
|
let currentRow = activeRow;
|
|
16012
|
-
let currentSchema =
|
|
16022
|
+
let currentSchema = chunk65E3XWGF_cjs.parseSerializedSchema(activeRow.schema_doc);
|
|
16013
16023
|
while (currentRow.version > stopAtVersion) {
|
|
16014
16024
|
const priorRow = await backend.getSchemaVersion(
|
|
16015
16025
|
graphId,
|
|
16016
16026
|
currentRow.version - 1
|
|
16017
16027
|
);
|
|
16018
16028
|
if (priorRow === void 0) break;
|
|
16019
|
-
const priorSchema =
|
|
16029
|
+
const priorSchema = chunk65E3XWGF_cjs.parseSerializedSchema(priorRow.schema_doc);
|
|
16020
16030
|
for (const entity of ENTITY_KINDS) {
|
|
16021
16031
|
const priorEntries = priorSchema[entity === "node" ? "nodes" : "edges"];
|
|
16022
16032
|
const currentEntries = currentSchema[entity === "node" ? "nodes" : "edges"];
|
|
@@ -16036,7 +16046,7 @@ async function reconcilePendingRemovals(context) {
|
|
|
16036
16046
|
currentSchema = priorSchema;
|
|
16037
16047
|
}
|
|
16038
16048
|
if (reconciliations.length > 0) {
|
|
16039
|
-
const attemptedAt =
|
|
16049
|
+
const attemptedAt = chunkMCLYU6BN_cjs.nowIso();
|
|
16040
16050
|
await Promise.all(
|
|
16041
16051
|
reconciliations.map(
|
|
16042
16052
|
(entry2) => recordKindRemoval(
|
|
@@ -16081,7 +16091,7 @@ async function materializeOne2(row, ctx) {
|
|
|
16081
16091
|
ctx.graphId,
|
|
16082
16092
|
async (target) => {
|
|
16083
16093
|
const activeRow = await target.getActiveSchema(ctx.graphId);
|
|
16084
|
-
const activeSchema = activeRow === void 0 ? void 0 :
|
|
16094
|
+
const activeSchema = activeRow === void 0 ? void 0 : chunk65E3XWGF_cjs.parseSerializedSchema(activeRow.schema_doc);
|
|
16085
16095
|
if (liveKindNamesFrom(activeSchema)[row.entity].has(row.kindName)) {
|
|
16086
16096
|
return "skipped";
|
|
16087
16097
|
}
|
|
@@ -16098,7 +16108,7 @@ async function materializeOne2(row, ctx) {
|
|
|
16098
16108
|
reason: "kind-is-live"
|
|
16099
16109
|
};
|
|
16100
16110
|
}
|
|
16101
|
-
const removedAt =
|
|
16111
|
+
const removedAt = chunkMCLYU6BN_cjs.nowIso();
|
|
16102
16112
|
await recordKindRemoval({
|
|
16103
16113
|
graphId: ctx.graphId,
|
|
16104
16114
|
kindName: row.kindName,
|
|
@@ -16120,7 +16130,7 @@ async function materializeOne2(row, ctx) {
|
|
|
16120
16130
|
kindName: row.kindName,
|
|
16121
16131
|
entity: row.entity,
|
|
16122
16132
|
schemaVersion: row.schemaVersion,
|
|
16123
|
-
attemptedAt:
|
|
16133
|
+
attemptedAt: chunkMCLYU6BN_cjs.nowIso(),
|
|
16124
16134
|
removedAt: void 0,
|
|
16125
16135
|
error: error.message
|
|
16126
16136
|
});
|
|
@@ -16151,7 +16161,7 @@ async function closeRecordedAndDeleteLiveRows(ctx, row, target) {
|
|
|
16151
16161
|
await executeDeleteStatements(target, deleteStatements);
|
|
16152
16162
|
return;
|
|
16153
16163
|
}
|
|
16154
|
-
await
|
|
16164
|
+
await chunkPF6F5NLJ_cjs.closeRecordedHardDeletedKind(
|
|
16155
16165
|
target,
|
|
16156
16166
|
recordedSchema,
|
|
16157
16167
|
ctx.graphId,
|
|
@@ -16205,7 +16215,7 @@ async function resolveRemovedKindEmbeddingSlots(backend, row) {
|
|
|
16205
16215
|
if (priorVersion < 1) return [];
|
|
16206
16216
|
const priorRow = await backend.getSchemaVersion(row.graphId, priorVersion);
|
|
16207
16217
|
if (priorRow === void 0) return [];
|
|
16208
|
-
const priorSchema =
|
|
16218
|
+
const priorSchema = chunk65E3XWGF_cjs.parseSerializedSchema(priorRow.schema_doc);
|
|
16209
16219
|
const slots = /* @__PURE__ */ new Map();
|
|
16210
16220
|
for (const declaration of priorSchema.indexes ?? []) {
|
|
16211
16221
|
if (declaration.entity === "vector" && declaration.kind === row.kindName) {
|
|
@@ -16242,14 +16252,14 @@ async function reclaimRemovedVectorFieldTables(context, activeRow) {
|
|
|
16242
16252
|
let perBackend = reclaimCache.get(backend);
|
|
16243
16253
|
const cached = perBackend?.get(cacheKey);
|
|
16244
16254
|
if (cached !== void 0) return cached;
|
|
16245
|
-
const activeSchema =
|
|
16255
|
+
const activeSchema = chunk65E3XWGF_cjs.parseSerializedSchema(activeRow.schema_doc);
|
|
16246
16256
|
const activeVectorFields = vectorFieldKeysFrom(activeSchema);
|
|
16247
16257
|
const survivingKinds = new Set(Object.keys(activeSchema.nodes));
|
|
16248
16258
|
const historical = /* @__PURE__ */ new Map();
|
|
16249
16259
|
for (let version = activeRow.version - 1; version >= 1; version -= 1) {
|
|
16250
16260
|
const priorRow = await backend.getSchemaVersion(graphId, version);
|
|
16251
16261
|
if (priorRow === void 0) continue;
|
|
16252
|
-
const priorSchema =
|
|
16262
|
+
const priorSchema = chunk65E3XWGF_cjs.parseSerializedSchema(priorRow.schema_doc);
|
|
16253
16263
|
for (const declaration of priorSchema.indexes ?? []) {
|
|
16254
16264
|
if (declaration.entity !== "vector") continue;
|
|
16255
16265
|
const key = vectorFieldKey(declaration.kind, declaration.fieldPath);
|
|
@@ -16287,7 +16297,7 @@ async function reclaimRemovedVectorFieldTables(context, activeRow) {
|
|
|
16287
16297
|
async (target) => {
|
|
16288
16298
|
const lockedActiveRow = await target.getActiveSchema(graphId);
|
|
16289
16299
|
if (lockedActiveRow === void 0) return false;
|
|
16290
|
-
const lockedActiveSchema =
|
|
16300
|
+
const lockedActiveSchema = chunk65E3XWGF_cjs.parseSerializedSchema(
|
|
16291
16301
|
lockedActiveRow.schema_doc
|
|
16292
16302
|
);
|
|
16293
16303
|
const lockedVectorFields = vectorFieldKeysFrom(lockedActiveSchema);
|
|
@@ -16348,17 +16358,17 @@ function getEdgeRegistration(graph, kind) {
|
|
|
16348
16358
|
return registration;
|
|
16349
16359
|
}
|
|
16350
16360
|
function buildEdgeEndpointCacheKey(graphId, kind, id) {
|
|
16351
|
-
return
|
|
16361
|
+
return chunkDTVWX77L_cjs.encodeTupleKey([graphId, kind, id]);
|
|
16352
16362
|
}
|
|
16353
16363
|
function buildEdgeFromCacheKey(graphId, edgeKind, fromKind, fromId) {
|
|
16354
|
-
return
|
|
16364
|
+
return chunkDTVWX77L_cjs.encodeTupleKey([graphId, edgeKind, fromKind, fromId]);
|
|
16355
16365
|
}
|
|
16356
16366
|
function buildEdgeBetweenCacheKey(graphId, edgeKind, fromKind, fromId, toKind, toId) {
|
|
16357
|
-
return
|
|
16367
|
+
return chunkDTVWX77L_cjs.encodeTupleKey([graphId, edgeKind, fromKind, fromId, toKind, toId]);
|
|
16358
16368
|
}
|
|
16359
16369
|
function buildCountEdgesFromCacheKey(params) {
|
|
16360
16370
|
const activeOnly = params.activeOnly === true ? "1" : "0";
|
|
16361
|
-
return
|
|
16371
|
+
return chunkDTVWX77L_cjs.encodeTupleKey([
|
|
16362
16372
|
params.graphId,
|
|
16363
16373
|
params.edgeKind,
|
|
16364
16374
|
params.fromKind,
|
|
@@ -16513,23 +16523,23 @@ async function validateAndPrepareEdgeCreate(ctx, input, id, backend) {
|
|
|
16513
16523
|
nodeId: input.toId
|
|
16514
16524
|
});
|
|
16515
16525
|
}
|
|
16516
|
-
const validatedProps =
|
|
16526
|
+
const validatedProps = chunkDTVWX77L_cjs.validateEdgeProps(edgeKind.schema, input.props, {
|
|
16517
16527
|
kind,
|
|
16518
16528
|
operation: "create"
|
|
16519
16529
|
});
|
|
16520
|
-
const validFrom =
|
|
16530
|
+
const validFrom = chunkMCLYU6BN_cjs.validateOptionalCanonicalIsoDate(
|
|
16521
16531
|
input.validFrom,
|
|
16522
16532
|
"validFrom"
|
|
16523
16533
|
);
|
|
16524
|
-
const validTo =
|
|
16525
|
-
|
|
16534
|
+
const validTo = chunkMCLYU6BN_cjs.validateOptionalCanonicalIsoDate(input.validTo, "validTo");
|
|
16535
|
+
chunkMCLYU6BN_cjs.assertOrderedValidityWindow(`edge "${id}"`, validFrom, validTo);
|
|
16526
16536
|
const cardinality = registration.cardinality ?? "many";
|
|
16527
16537
|
const constraintContext = {
|
|
16528
16538
|
graphId: ctx.graphId,
|
|
16529
16539
|
registry: ctx.registry,
|
|
16530
16540
|
backend
|
|
16531
16541
|
};
|
|
16532
|
-
await
|
|
16542
|
+
await chunkPT7RIRIZ_cjs.checkCardinalityConstraint(
|
|
16533
16543
|
constraintContext,
|
|
16534
16544
|
kind,
|
|
16535
16545
|
cardinality,
|
|
@@ -16569,11 +16579,11 @@ var EdgeConvergenceRaced = class extends Error {
|
|
|
16569
16579
|
};
|
|
16570
16580
|
async function executeEdgeCreateInternal(ctx, input, backend, options) {
|
|
16571
16581
|
const kind = input.kind;
|
|
16572
|
-
const id = input.id ??
|
|
16582
|
+
const id = input.id ?? chunkPF6F5NLJ_cjs.generateId();
|
|
16573
16583
|
const opContext = ctx.createOperationContext("create", "edge", kind, id);
|
|
16574
16584
|
const shouldReturnRow = options?.returnRow ?? true;
|
|
16575
16585
|
const convergeOn = options?.convergeOn;
|
|
16576
|
-
return
|
|
16586
|
+
return chunkDTVWX77L_cjs.runHookedWriteOperation(
|
|
16577
16587
|
ctx,
|
|
16578
16588
|
opContext,
|
|
16579
16589
|
backend,
|
|
@@ -16604,21 +16614,21 @@ async function executeEdgeCreateInternal(ctx, input, backend, options) {
|
|
|
16604
16614
|
id,
|
|
16605
16615
|
target
|
|
16606
16616
|
);
|
|
16607
|
-
const row = await
|
|
16617
|
+
const row = await chunkPT7RIRIZ_cjs.withAlreadyExistsTranslation("edge", async () => {
|
|
16608
16618
|
if (shouldReturnRow) return target.insertEdge(prepared.insertParams);
|
|
16609
|
-
await
|
|
16610
|
-
|
|
16619
|
+
await chunkPF6F5NLJ_cjs.runInsertNoReturn(
|
|
16620
|
+
chunkPF6F5NLJ_cjs.edgeInsertDispatch(target),
|
|
16611
16621
|
prepared.insertParams
|
|
16612
16622
|
);
|
|
16613
16623
|
return;
|
|
16614
16624
|
});
|
|
16615
|
-
return row === void 0 ? void 0 :
|
|
16625
|
+
return row === void 0 ? void 0 : chunkPT7RIRIZ_cjs.rowToEdge(row);
|
|
16616
16626
|
},
|
|
16617
16627
|
{
|
|
16618
16628
|
// A create that runs a cardinality probe, or one converging on a match
|
|
16619
16629
|
// key, decides something the write must not have invalidated. A plain
|
|
16620
16630
|
// `many` create decides nothing and takes no lock.
|
|
16621
|
-
fencesConstraintProbe: convergeOn === void 0 ?
|
|
16631
|
+
fencesConstraintProbe: convergeOn === void 0 ? chunkPT7RIRIZ_cjs.edgeWriteNeedsConstraintFence(edgeCardinality(ctx, kind)) : "edgeMatchKeyConvergence"
|
|
16622
16632
|
}
|
|
16623
16633
|
);
|
|
16624
16634
|
}
|
|
@@ -16664,7 +16674,7 @@ async function prepareEdgeBatchCreates(ctx, inputs, backend) {
|
|
|
16664
16674
|
await primeEdgeBatchValidationCache(ctx, inputs, backend, seedEndpointRow);
|
|
16665
16675
|
const preparedCreates = [];
|
|
16666
16676
|
for (const input of inputs) {
|
|
16667
|
-
const id = input.id ??
|
|
16677
|
+
const id = input.id ?? chunkPF6F5NLJ_cjs.generateId();
|
|
16668
16678
|
const prepared = await validateAndPrepareEdgeCreate(
|
|
16669
16679
|
ctx,
|
|
16670
16680
|
input,
|
|
@@ -16686,7 +16696,7 @@ async function executeEdgeCreateNoReturnBatch(ctx, inputs, backend) {
|
|
|
16686
16696
|
if (inputs.length === 0) {
|
|
16687
16697
|
return;
|
|
16688
16698
|
}
|
|
16689
|
-
await
|
|
16699
|
+
await chunkDTVWX77L_cjs.runInWriteTransaction(
|
|
16690
16700
|
ctx,
|
|
16691
16701
|
backend,
|
|
16692
16702
|
async (target) => {
|
|
@@ -16695,9 +16705,9 @@ async function executeEdgeCreateNoReturnBatch(ctx, inputs, backend) {
|
|
|
16695
16705
|
inputs,
|
|
16696
16706
|
target
|
|
16697
16707
|
);
|
|
16698
|
-
await
|
|
16708
|
+
await chunkPT7RIRIZ_cjs.withAlreadyExistsTranslation(
|
|
16699
16709
|
"edge",
|
|
16700
|
-
() =>
|
|
16710
|
+
() => chunkPF6F5NLJ_cjs.runInsertBatch(chunkPF6F5NLJ_cjs.edgeInsertDispatch(target), batchInsertParams)
|
|
16701
16711
|
);
|
|
16702
16712
|
},
|
|
16703
16713
|
{ fencesConstraintProbe: batchFencesConstraintProbe(ctx, inputs) }
|
|
@@ -16707,7 +16717,7 @@ async function executeEdgeCreateBatch(ctx, inputs, backend) {
|
|
|
16707
16717
|
if (inputs.length === 0) {
|
|
16708
16718
|
return [];
|
|
16709
16719
|
}
|
|
16710
|
-
return
|
|
16720
|
+
return chunkDTVWX77L_cjs.runInWriteTransaction(
|
|
16711
16721
|
ctx,
|
|
16712
16722
|
backend,
|
|
16713
16723
|
async (target) => {
|
|
@@ -16716,18 +16726,18 @@ async function executeEdgeCreateBatch(ctx, inputs, backend) {
|
|
|
16716
16726
|
inputs,
|
|
16717
16727
|
target
|
|
16718
16728
|
);
|
|
16719
|
-
const rows = await
|
|
16729
|
+
const rows = await chunkPT7RIRIZ_cjs.withAlreadyExistsTranslation(
|
|
16720
16730
|
"edge",
|
|
16721
|
-
() =>
|
|
16731
|
+
() => chunkPF6F5NLJ_cjs.runInsertBatchReturning(chunkPF6F5NLJ_cjs.edgeInsertDispatch(target), batchInsertParams)
|
|
16722
16732
|
);
|
|
16723
|
-
return rows.map((row) =>
|
|
16733
|
+
return rows.map((row) => chunkPT7RIRIZ_cjs.rowToEdge(row));
|
|
16724
16734
|
},
|
|
16725
16735
|
{ fencesConstraintProbe: batchFencesConstraintProbe(ctx, inputs) }
|
|
16726
16736
|
);
|
|
16727
16737
|
}
|
|
16728
16738
|
function batchFencesConstraintProbe(ctx, inputs) {
|
|
16729
16739
|
for (const input of inputs) {
|
|
16730
|
-
const reason =
|
|
16740
|
+
const reason = chunkPT7RIRIZ_cjs.edgeWriteNeedsConstraintFence(
|
|
16731
16741
|
edgeCardinality(ctx, input.kind)
|
|
16732
16742
|
);
|
|
16733
16743
|
if (reason !== void 0) return reason;
|
|
@@ -16736,7 +16746,7 @@ function batchFencesConstraintProbe(ctx, inputs) {
|
|
|
16736
16746
|
}
|
|
16737
16747
|
function computeEdgeUpdate(ctx, kind, id, existingProps, inputProps) {
|
|
16738
16748
|
const registration = getEdgeRegistration(ctx.graph, kind);
|
|
16739
|
-
return
|
|
16749
|
+
return chunkDTVWX77L_cjs.validateEdgeProps(
|
|
16740
16750
|
registration.type.schema,
|
|
16741
16751
|
{ ...existingProps, ...inputProps },
|
|
16742
16752
|
{ kind, operation: "update", id }
|
|
@@ -16779,12 +16789,12 @@ async function performEdgeUpdate(ctx, input, target, options) {
|
|
|
16779
16789
|
"update"
|
|
16780
16790
|
);
|
|
16781
16791
|
const { validatedProps } = resolveEdgeUpdateProps(ctx, existing, input.props);
|
|
16782
|
-
const validFrom =
|
|
16792
|
+
const validFrom = chunkMCLYU6BN_cjs.validateOptionalCanonicalIsoDate(
|
|
16783
16793
|
input.validFrom,
|
|
16784
16794
|
"validFrom"
|
|
16785
16795
|
);
|
|
16786
|
-
const validTo =
|
|
16787
|
-
const windowVerdict =
|
|
16796
|
+
const validTo = chunkMCLYU6BN_cjs.validateOptionalCanonicalIsoDate(input.validTo, "validTo");
|
|
16797
|
+
const windowVerdict = chunkMCLYU6BN_cjs.assertWritableValidityWindow(
|
|
16788
16798
|
`edge "${id}"`,
|
|
16789
16799
|
validFrom,
|
|
16790
16800
|
{
|
|
@@ -16831,7 +16841,7 @@ async function performEdgeUpdate(ctx, input, target, options) {
|
|
|
16831
16841
|
updateParams.expectedValidFrom !== void 0,
|
|
16832
16842
|
() => target.updateEdge(updateParams)
|
|
16833
16843
|
);
|
|
16834
|
-
return
|
|
16844
|
+
return chunkPT7RIRIZ_cjs.rowToEdge(row);
|
|
16835
16845
|
}
|
|
16836
16846
|
function isEdgeUpdateNoRowError(error) {
|
|
16837
16847
|
return error instanceof chunkNI72YOJB_cjs.DatabaseOperationError && error.details.operation === "update" && error.details.entity === "edge" && error.details.reason === "no_row_returned";
|
|
@@ -16895,7 +16905,7 @@ async function executeEdgeUpdate(ctx, input, backend) {
|
|
|
16895
16905
|
"update"
|
|
16896
16906
|
);
|
|
16897
16907
|
const opContext = ctx.createOperationContext("update", "edge", gate.kind, id);
|
|
16898
|
-
return
|
|
16908
|
+
return chunkDTVWX77L_cjs.runHookedWriteOperation(
|
|
16899
16909
|
ctx,
|
|
16900
16910
|
opContext,
|
|
16901
16911
|
backend,
|
|
@@ -16904,12 +16914,12 @@ async function executeEdgeUpdate(ctx, input, backend) {
|
|
|
16904
16914
|
}
|
|
16905
16915
|
async function executeEdgeUpsertUpdate(ctx, input, backend, options) {
|
|
16906
16916
|
const resurrectCardinality = options?.resurrectCardinality;
|
|
16907
|
-
return
|
|
16917
|
+
return chunkDTVWX77L_cjs.runInWriteTransaction(
|
|
16908
16918
|
ctx,
|
|
16909
16919
|
backend,
|
|
16910
16920
|
async (target) => {
|
|
16911
16921
|
if (resurrectCardinality !== void 0) {
|
|
16912
|
-
await
|
|
16922
|
+
await chunkPT7RIRIZ_cjs.checkCardinalityConstraint(
|
|
16913
16923
|
{
|
|
16914
16924
|
graphId: ctx.graphId,
|
|
16915
16925
|
registry: ctx.registry,
|
|
@@ -16929,7 +16939,7 @@ async function executeEdgeUpsertUpdate(ctx, input, backend, options) {
|
|
|
16929
16939
|
{
|
|
16930
16940
|
// An in-place props update re-derives no constraint verdict: endpoints
|
|
16931
16941
|
// are immutable, so cardinality cannot change under it.
|
|
16932
|
-
fencesConstraintProbe: resurrectCardinality === void 0 ? void 0 :
|
|
16942
|
+
fencesConstraintProbe: resurrectCardinality === void 0 ? void 0 : chunkPT7RIRIZ_cjs.edgeWriteNeedsConstraintFence(resurrectCardinality.cardinality)
|
|
16933
16943
|
}
|
|
16934
16944
|
);
|
|
16935
16945
|
}
|
|
@@ -16944,7 +16954,7 @@ async function executeEdgeDelete(ctx, expectedKind, id, backend) {
|
|
|
16944
16954
|
);
|
|
16945
16955
|
if (gate.deleted_at) return;
|
|
16946
16956
|
const opContext = ctx.createOperationContext("delete", "edge", gate.kind, id);
|
|
16947
|
-
return
|
|
16957
|
+
return chunkDTVWX77L_cjs.runHookedWriteOperation(ctx, opContext, backend, async (target) => {
|
|
16948
16958
|
await target.deleteEdge({
|
|
16949
16959
|
graphId: ctx.graphId,
|
|
16950
16960
|
id,
|
|
@@ -16953,7 +16963,7 @@ async function executeEdgeDelete(ctx, expectedKind, id, backend) {
|
|
|
16953
16963
|
});
|
|
16954
16964
|
}
|
|
16955
16965
|
async function executeEdgeDeleteBatch(ctx, expectedKind, ids, backend) {
|
|
16956
|
-
await
|
|
16966
|
+
await chunkDTVWX77L_cjs.runInWriteTransaction(
|
|
16957
16967
|
ctx,
|
|
16958
16968
|
backend,
|
|
16959
16969
|
async (target) => {
|
|
@@ -16990,7 +17000,7 @@ async function executeEdgeHardDelete(ctx, expectedKind, id, backend) {
|
|
|
16990
17000
|
"hardDelete"
|
|
16991
17001
|
);
|
|
16992
17002
|
const opContext = ctx.createOperationContext("delete", "edge", gate.kind, id);
|
|
16993
|
-
return
|
|
17003
|
+
return chunkDTVWX77L_cjs.runHookedWriteOperation(ctx, opContext, backend, async (target) => {
|
|
16994
17004
|
await target.hardDeleteEdge({
|
|
16995
17005
|
graphId: ctx.graphId,
|
|
16996
17006
|
id,
|
|
@@ -17044,7 +17054,7 @@ function stableStringify(value) {
|
|
|
17044
17054
|
}
|
|
17045
17055
|
function buildEdgeCompositeKey(fromKind, fromId, toKind, toId, props, matchOn) {
|
|
17046
17056
|
const sortedFields = [...matchOn].toSorted();
|
|
17047
|
-
return
|
|
17057
|
+
return chunkDTVWX77L_cjs.encodeTupleKey([
|
|
17048
17058
|
fromKind,
|
|
17049
17059
|
fromId,
|
|
17050
17060
|
toKind,
|
|
@@ -17056,7 +17066,7 @@ function buildEdgeCompositeKey(fromKind, fromId, toKind, toId, props, matchOn) {
|
|
|
17056
17066
|
]);
|
|
17057
17067
|
}
|
|
17058
17068
|
function buildEndpointPairKey(fromKind, fromId, toKind, toId) {
|
|
17059
|
-
return
|
|
17069
|
+
return chunkDTVWX77L_cjs.encodeTupleKey([fromKind, fromId, toKind, toId]);
|
|
17060
17070
|
}
|
|
17061
17071
|
function findMatchingEdge(rows, matchOn, inputProps) {
|
|
17062
17072
|
let liveRow;
|
|
@@ -17100,26 +17110,26 @@ async function executeEdgeFindByEndpoints(ctx, kind, fromKind, fromId, toKind, t
|
|
|
17100
17110
|
...options?.asOf !== void 0 && { asOf: options.asOf }
|
|
17101
17111
|
});
|
|
17102
17112
|
if (candidateRows.length === 0) return void 0;
|
|
17103
|
-
if (matchOn.length === 0) return
|
|
17113
|
+
if (matchOn.length === 0) return chunkPT7RIRIZ_cjs.rowToEdge(chunkN66HCGCY_cjs.requireDefined(candidateRows[0]));
|
|
17104
17114
|
const { liveRow } = findMatchingEdge(candidateRows, matchOn, props);
|
|
17105
|
-
return liveRow === void 0 ? void 0 :
|
|
17115
|
+
return liveRow === void 0 ? void 0 : chunkPT7RIRIZ_cjs.rowToEdge(liveRow);
|
|
17106
17116
|
}
|
|
17107
17117
|
async function executeEdgeGetOrCreateByEndpoints(ctx, kind, fromKind, fromId, toKind, toId, props, backend, options) {
|
|
17108
17118
|
const ifExists = options?.ifExists ?? "return";
|
|
17109
17119
|
const matchOn = options?.matchOn ?? [];
|
|
17110
17120
|
const registration = getEdgeRegistration(ctx.graph, kind);
|
|
17111
17121
|
const edgeKind = registration.type;
|
|
17112
|
-
const validatedProps =
|
|
17122
|
+
const validatedProps = chunkDTVWX77L_cjs.validateEdgeProps(edgeKind.schema, props, {
|
|
17113
17123
|
kind,
|
|
17114
17124
|
operation: "create"
|
|
17115
17125
|
});
|
|
17116
17126
|
validateMatchOnFields(edgeKind.schema, matchOn, kind);
|
|
17117
|
-
const validFrom =
|
|
17127
|
+
const validFrom = chunkMCLYU6BN_cjs.validateOptionalCanonicalIsoDate(
|
|
17118
17128
|
options?.validFrom,
|
|
17119
17129
|
"validFrom"
|
|
17120
17130
|
);
|
|
17121
|
-
const validTo =
|
|
17122
|
-
|
|
17131
|
+
const validTo = chunkMCLYU6BN_cjs.validateOptionalCanonicalIsoDate(options?.validTo, "validTo");
|
|
17132
|
+
chunkMCLYU6BN_cjs.assertOrderedValidityWindow(
|
|
17123
17133
|
`${kind} edge between ${fromKind} "${fromId}" and ${toKind} "${toId}"`,
|
|
17124
17134
|
validFrom,
|
|
17125
17135
|
validTo
|
|
@@ -17141,7 +17151,7 @@ async function executeEdgeGetOrCreateByEndpoints(ctx, kind, fromKind, fromId, to
|
|
|
17141
17151
|
validatedProps
|
|
17142
17152
|
);
|
|
17143
17153
|
if (probedLiveRow !== void 0) {
|
|
17144
|
-
return { edge:
|
|
17154
|
+
return { edge: chunkPT7RIRIZ_cjs.rowToEdge(probedLiveRow), action: "found" };
|
|
17145
17155
|
}
|
|
17146
17156
|
}
|
|
17147
17157
|
async function attempt() {
|
|
@@ -17185,7 +17195,7 @@ async function executeEdgeGetOrCreateByEndpoints(ctx, kind, fromKind, fromId, to
|
|
|
17185
17195
|
}
|
|
17186
17196
|
if (liveRow !== void 0) {
|
|
17187
17197
|
if (ifExists === "return") {
|
|
17188
|
-
return { edge:
|
|
17198
|
+
return { edge: chunkPT7RIRIZ_cjs.rowToEdge(liveRow), action: "found" };
|
|
17189
17199
|
}
|
|
17190
17200
|
const edge2 = await executeEdgeUpsertUpdate(
|
|
17191
17201
|
ctx,
|
|
@@ -17261,16 +17271,16 @@ async function executeEdgeBulkGetOrCreateByEndpoints(ctx, kind, items, backend,
|
|
|
17261
17271
|
validateMatchOnFields(edgeKind.schema, matchOn, kind);
|
|
17262
17272
|
const validated = [];
|
|
17263
17273
|
for (const item of items) {
|
|
17264
|
-
const validatedProps =
|
|
17274
|
+
const validatedProps = chunkDTVWX77L_cjs.validateEdgeProps(edgeKind.schema, item.props, {
|
|
17265
17275
|
kind,
|
|
17266
17276
|
operation: "create"
|
|
17267
17277
|
});
|
|
17268
|
-
const validFrom =
|
|
17278
|
+
const validFrom = chunkMCLYU6BN_cjs.validateOptionalCanonicalIsoDate(
|
|
17269
17279
|
item.validFrom,
|
|
17270
17280
|
"validFrom"
|
|
17271
17281
|
);
|
|
17272
|
-
const validTo =
|
|
17273
|
-
|
|
17282
|
+
const validTo = chunkMCLYU6BN_cjs.validateOptionalCanonicalIsoDate(item.validTo, "validTo");
|
|
17283
|
+
chunkMCLYU6BN_cjs.assertOrderedValidityWindow(
|
|
17274
17284
|
`${kind} edge between ${item.fromKind} "${item.fromId}" and ${item.toKind} "${item.toId}"`,
|
|
17275
17285
|
validFrom,
|
|
17276
17286
|
validTo
|
|
@@ -17392,7 +17402,7 @@ async function executeEdgeBulkGetOrCreateByEndpoints(ctx, kind, items, backend,
|
|
|
17392
17402
|
if (allFoundLive) {
|
|
17393
17403
|
const found = Array.from({ length: items.length });
|
|
17394
17404
|
for (const entry2 of probe.toFetch) {
|
|
17395
|
-
found[entry2.index] = { edge:
|
|
17405
|
+
found[entry2.index] = { edge: chunkPT7RIRIZ_cjs.rowToEdge(entry2.row), action: "found" };
|
|
17396
17406
|
}
|
|
17397
17407
|
for (const { index, sourceIndex } of probe.duplicateOf) {
|
|
17398
17408
|
found[index] = {
|
|
@@ -17404,7 +17414,7 @@ async function executeEdgeBulkGetOrCreateByEndpoints(ctx, kind, items, backend,
|
|
|
17404
17414
|
}
|
|
17405
17415
|
}
|
|
17406
17416
|
function runBatch() {
|
|
17407
|
-
return
|
|
17417
|
+
return chunkDTVWX77L_cjs.runInWriteTransaction(
|
|
17408
17418
|
ctx,
|
|
17409
17419
|
backend,
|
|
17410
17420
|
async (target) => {
|
|
@@ -17482,7 +17492,7 @@ async function executeEdgeBulkGetOrCreateByEndpoints(ctx, kind, items, backend,
|
|
|
17482
17492
|
results[entry2.index] = { edge, action: "updated" };
|
|
17483
17493
|
} else {
|
|
17484
17494
|
results[entry2.index] = {
|
|
17485
|
-
edge:
|
|
17495
|
+
edge: chunkPT7RIRIZ_cjs.rowToEdge(entry2.row),
|
|
17486
17496
|
action: "found"
|
|
17487
17497
|
};
|
|
17488
17498
|
}
|
|
@@ -17511,7 +17521,7 @@ async function executeEdgeBulkGetOrCreateByEndpoints(ctx, kind, items, backend,
|
|
|
17511
17521
|
var RECORDED_POINT_READ_FIXED_BIND_PARAMS = 8;
|
|
17512
17522
|
var RECORDED_SCAN_LIMIT = 1e3;
|
|
17513
17523
|
function recordedPointReadIdChunk(backend) {
|
|
17514
|
-
const budget =
|
|
17524
|
+
const budget = chunkPF6F5NLJ_cjs.recordedBindParamBudget(backend);
|
|
17515
17525
|
return Math.max(1, budget - RECORDED_POINT_READ_FIXED_BIND_PARAMS);
|
|
17516
17526
|
}
|
|
17517
17527
|
function recordedRelationErrorDetails(backend, surface) {
|
|
@@ -17524,7 +17534,7 @@ function withRelationsPrecondition(backend, promise, surface) {
|
|
|
17524
17534
|
);
|
|
17525
17535
|
}
|
|
17526
17536
|
function createRecordedReadBackend(backend, surface) {
|
|
17527
|
-
const projectedBackend =
|
|
17537
|
+
const projectedBackend = chunkPF6F5NLJ_cjs.createGraphBackendProjection(backend);
|
|
17528
17538
|
return chunkXBYVV3MP_cjs.createBackendOverlay(projectedBackend, {
|
|
17529
17539
|
execute: (query) => withRelationsPrecondition(backend, backend.execute(query), surface),
|
|
17530
17540
|
...backend.executeRaw === void 0 ? {} : {
|
|
@@ -17544,12 +17554,12 @@ function recordedTemporalFilter(backend, coordinate, tableAlias) {
|
|
|
17544
17554
|
{ code: "RECORDED_POINT_READ_MISSING_COORDINATE" }
|
|
17545
17555
|
);
|
|
17546
17556
|
}
|
|
17547
|
-
return
|
|
17557
|
+
return chunkPF6F5NLJ_cjs.compileTemporalFilter({
|
|
17548
17558
|
mode: coordinate.valid.mode,
|
|
17549
17559
|
asOf: coordinate.valid.asOf,
|
|
17550
17560
|
recordedAsOf,
|
|
17551
17561
|
tableAlias,
|
|
17552
|
-
currentTimestamp:
|
|
17562
|
+
currentTimestamp: chunkPF6F5NLJ_cjs.currentReadInstant()
|
|
17553
17563
|
});
|
|
17554
17564
|
}
|
|
17555
17565
|
function recordedRelationInvariantError(params) {
|
|
@@ -17650,7 +17660,7 @@ function createRecordedReadService(params) {
|
|
|
17650
17660
|
SELECT * FROM ${table} ${aliasSql}
|
|
17651
17661
|
WHERE ${aliasSql}.graph_id = ${graphId}
|
|
17652
17662
|
AND ${aliasSql}.kind = ${kind}
|
|
17653
|
-
AND ${aliasSql}.id IN (${
|
|
17663
|
+
AND ${aliasSql}.id IN (${chunkPF6F5NLJ_cjs.sqlValueList(idChunk)})
|
|
17654
17664
|
AND ${temporalFilter}
|
|
17655
17665
|
ORDER BY ${aliasSql}.recorded_from
|
|
17656
17666
|
`)
|
|
@@ -17729,7 +17739,7 @@ function createRecordedReadService(params) {
|
|
|
17729
17739
|
kind,
|
|
17730
17740
|
ids,
|
|
17731
17741
|
coordinate,
|
|
17732
|
-
toEntity: (row) =>
|
|
17742
|
+
toEntity: (row) => chunkPT7RIRIZ_cjs.rowToNode(mapRecordedNodeRow(row))
|
|
17733
17743
|
});
|
|
17734
17744
|
}
|
|
17735
17745
|
function edgeGetByIds(kind, ids, coordinate) {
|
|
@@ -17741,7 +17751,7 @@ function createRecordedReadService(params) {
|
|
|
17741
17751
|
kind,
|
|
17742
17752
|
ids,
|
|
17743
17753
|
coordinate,
|
|
17744
|
-
toEntity: (row) =>
|
|
17754
|
+
toEntity: (row) => chunkPT7RIRIZ_cjs.rowToEdge(mapRecordedEdgeRow(row))
|
|
17745
17755
|
});
|
|
17746
17756
|
}
|
|
17747
17757
|
function nodeScan(kind, coordinate, options) {
|
|
@@ -17753,7 +17763,7 @@ function createRecordedReadService(params) {
|
|
|
17753
17763
|
kind,
|
|
17754
17764
|
coordinate,
|
|
17755
17765
|
options,
|
|
17756
|
-
toEntity: (row) =>
|
|
17766
|
+
toEntity: (row) => chunkPT7RIRIZ_cjs.rowToNode(mapRecordedNodeRow(row))
|
|
17757
17767
|
});
|
|
17758
17768
|
}
|
|
17759
17769
|
function edgeScan(kind, coordinate, options) {
|
|
@@ -17765,7 +17775,7 @@ function createRecordedReadService(params) {
|
|
|
17765
17775
|
kind,
|
|
17766
17776
|
coordinate,
|
|
17767
17777
|
options,
|
|
17768
|
-
toEntity: (row) =>
|
|
17778
|
+
toEntity: (row) => chunkPT7RIRIZ_cjs.rowToEdge(mapRecordedEdgeRow(row))
|
|
17769
17779
|
});
|
|
17770
17780
|
}
|
|
17771
17781
|
return {
|
|
@@ -18079,7 +18089,7 @@ function transactionOutcome(result, recorder, recordedByGraph, graphId) {
|
|
|
18079
18089
|
return {
|
|
18080
18090
|
result,
|
|
18081
18091
|
receipt: recorder.snapshot(
|
|
18082
|
-
recorded === void 0 ? void 0 :
|
|
18092
|
+
recorded === void 0 ? void 0 : chunkMCLYU6BN_cjs.asRecordedInstant(recorded)
|
|
18083
18093
|
)
|
|
18084
18094
|
};
|
|
18085
18095
|
}
|
|
@@ -18101,7 +18111,7 @@ function syncStoreReplacementRef(ref, replacement) {
|
|
|
18101
18111
|
ref.current = replacement;
|
|
18102
18112
|
}
|
|
18103
18113
|
async function commitEvolvedSchemaWhenRequiredKindsAreEmpty(backend, graph, currentVersion, classification) {
|
|
18104
|
-
const result = await
|
|
18114
|
+
const result = await chunk65E3XWGF_cjs.commitNewSchemaVersionIfKindsEmpty(
|
|
18105
18115
|
backend,
|
|
18106
18116
|
graph,
|
|
18107
18117
|
currentVersion,
|
|
@@ -18148,7 +18158,7 @@ async function assertEvolvedSchemaRequiredKindsEmpty(backend, graphId, classific
|
|
|
18148
18158
|
}
|
|
18149
18159
|
var IDENTITY_FACADES = /* @__PURE__ */ new WeakMap();
|
|
18150
18160
|
var StoreImplementation = class _StoreImplementation {
|
|
18151
|
-
[
|
|
18161
|
+
[chunkQ3G6A4I3_cjs.STORE_RUNTIME];
|
|
18152
18162
|
#graph;
|
|
18153
18163
|
/**
|
|
18154
18164
|
* Bare backend for DDL, vector-storage, and bulk-materialization work that must
|
|
@@ -18196,7 +18206,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
18196
18206
|
this.#captureEnabled = options?.history === true;
|
|
18197
18207
|
this.#revisionTrackingEnabled = this.#captureEnabled || options?.revisionTracking === true;
|
|
18198
18208
|
if (this.#revisionTrackingEnabled) {
|
|
18199
|
-
|
|
18209
|
+
chunkPF6F5NLJ_cjs.assertRevisionTrackableBackend(backend);
|
|
18200
18210
|
}
|
|
18201
18211
|
const explicitSchema = options?.schema === void 0 ? void 0 : chunkNFCVHQ5P_cjs.requireSqlSchema(options.schema, "store schema");
|
|
18202
18212
|
const resolvedSchema = explicitSchema ?? (backend.tableNames ? chunkNFCVHQ5P_cjs.createSqlSchema(backend.tableNames) : void 0);
|
|
@@ -18214,7 +18224,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
18214
18224
|
options?.recordedRead
|
|
18215
18225
|
);
|
|
18216
18226
|
this.#recordedReadBinding = this.#captureEnabled ? chunkNFCVHQ5P_cjs.createRecordedReadBinding(readSchema) : externalRecordedRead;
|
|
18217
|
-
this.#backend = this.#captureEnabled ? asGraphWriteBackend(
|
|
18227
|
+
this.#backend = this.#captureEnabled ? asGraphWriteBackend(chunkPF6F5NLJ_cjs.createRecordedBackend(backend, resolvedSchema)) : asGraphWriteBackend(backend);
|
|
18218
18228
|
this.#schema = resolvedSchema;
|
|
18219
18229
|
const rowMapperConfig = rowMapperConfigFor(this.#backend);
|
|
18220
18230
|
this.#recordedReads = createRecordedReadService({
|
|
@@ -18224,12 +18234,12 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
18224
18234
|
mapRecordedNodeRow: chunkYAAM3M2S_cjs.createNodeRowMapper(rowMapperConfig),
|
|
18225
18235
|
mapRecordedEdgeRow: chunkYAAM3M2S_cjs.createEdgeRowMapper(rowMapperConfig)
|
|
18226
18236
|
});
|
|
18227
|
-
this.#registry =
|
|
18237
|
+
this.#registry = chunk65E3XWGF_cjs.buildKindRegistry(graph);
|
|
18228
18238
|
this.#hooks = options?.hooks ?? {};
|
|
18229
18239
|
this.#defaultTraversalExpansion = options?.queryDefaults?.traversalExpansion ?? "inverse";
|
|
18230
18240
|
this.#options = options;
|
|
18231
18241
|
this.#schemaMetadata = schemaMetadata ?? UNKNOWN_SCHEMA_METADATA;
|
|
18232
|
-
this[
|
|
18242
|
+
this[chunkQ3G6A4I3_cjs.STORE_RUNTIME] = {
|
|
18233
18243
|
backend: this.#backend,
|
|
18234
18244
|
sealedQuery: (coordinate) => this.sealedQuery(coordinate),
|
|
18235
18245
|
recordedNodeGetById: (kind, id, coordinate) => this.recordedNodeGetById(kind, id, coordinate),
|
|
@@ -18245,7 +18255,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
18245
18255
|
validateIdentity: () => this.validateIdentity(),
|
|
18246
18256
|
liveNodesSharingIds: async (ids, target) => {
|
|
18247
18257
|
const backend2 = target ?? this.#baseBackend;
|
|
18248
|
-
const liveKindsById = await
|
|
18258
|
+
const liveKindsById = await chunkDTVWX77L_cjs.liveNodeKindsSharingIds(
|
|
18249
18259
|
this.#identityContext(backend2),
|
|
18250
18260
|
backend2,
|
|
18251
18261
|
ids
|
|
@@ -18260,21 +18270,21 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
18260
18270
|
if (this.#graph.identity === void 0) return /* @__PURE__ */ new Map();
|
|
18261
18271
|
const backend2 = target ?? this.#baseBackend;
|
|
18262
18272
|
const ctx = this.#identityContext(backend2);
|
|
18263
|
-
const rows = await
|
|
18273
|
+
const rows = await chunkDTVWX77L_cjs.loadAssertionsByIds(
|
|
18264
18274
|
backend2,
|
|
18265
18275
|
ctx.schema,
|
|
18266
18276
|
this.graphId,
|
|
18267
18277
|
ids
|
|
18268
18278
|
);
|
|
18269
18279
|
return new Map(
|
|
18270
|
-
[...rows].map(([id, row]) => [id,
|
|
18280
|
+
[...rows].map(([id, row]) => [id, chunkDTVWX77L_cjs.toTransferAssertion(row)])
|
|
18271
18281
|
);
|
|
18272
18282
|
},
|
|
18273
18283
|
structuralIdentityClasses: async (references, target) => {
|
|
18274
18284
|
if (this.#graph.identity === void 0) return /* @__PURE__ */ new Map();
|
|
18275
18285
|
const backend2 = target ?? this.#baseBackend;
|
|
18276
18286
|
const ctx = this.#identityContext(backend2);
|
|
18277
|
-
return
|
|
18287
|
+
return chunkDTVWX77L_cjs.loadCurrentStructuralClasses(
|
|
18278
18288
|
backend2,
|
|
18279
18289
|
ctx.schema,
|
|
18280
18290
|
this.graphId,
|
|
@@ -18290,7 +18300,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
18290
18300
|
applyIdentityMergeAtTarget: (target, retractionIds, assertions) => this.applyIdentityMergeAtTarget(target, retractionIds, assertions),
|
|
18291
18301
|
assertIdentityClassesConsistentAtTarget: (target, seeds) => this.assertIdentityClassesConsistentAtTarget(target, seeds)
|
|
18292
18302
|
};
|
|
18293
|
-
Object.defineProperty(this,
|
|
18303
|
+
Object.defineProperty(this, chunkQ3G6A4I3_cjs.STORE_RUNTIME, {
|
|
18294
18304
|
configurable: false,
|
|
18295
18305
|
enumerable: false,
|
|
18296
18306
|
writable: false
|
|
@@ -18327,7 +18337,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
18327
18337
|
);
|
|
18328
18338
|
const existing = IDENTITY_FACADES.get(this);
|
|
18329
18339
|
if (existing !== void 0) return existing;
|
|
18330
|
-
const facade =
|
|
18340
|
+
const facade = chunkDTVWX77L_cjs.createIdentityFacade(this.#identityContext(this.#backend));
|
|
18331
18341
|
IDENTITY_FACADES.set(this, facade);
|
|
18332
18342
|
return facade;
|
|
18333
18343
|
}
|
|
@@ -18357,7 +18367,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
18357
18367
|
this.#recordedReadBinding,
|
|
18358
18368
|
"recorded-identity"
|
|
18359
18369
|
);
|
|
18360
|
-
return
|
|
18370
|
+
return chunkDTVWX77L_cjs.createIdentityReadFacade({
|
|
18361
18371
|
...this.#identityContext(backend),
|
|
18362
18372
|
schema,
|
|
18363
18373
|
coordinate
|
|
@@ -18366,7 +18376,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
18366
18376
|
/** Rebuilds derived current identity closure without advancing revision. */
|
|
18367
18377
|
async rebuildIdentityClosure() {
|
|
18368
18378
|
this.#requireIdentityEnabled();
|
|
18369
|
-
await
|
|
18379
|
+
await chunkDTVWX77L_cjs.runInWriteTransaction(
|
|
18370
18380
|
{
|
|
18371
18381
|
graphId: this.graphId,
|
|
18372
18382
|
schemaVersion: this.#schemaMetadata.schemaVersion,
|
|
@@ -18375,7 +18385,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
18375
18385
|
revisionSchema: this.#sqlSchema()
|
|
18376
18386
|
},
|
|
18377
18387
|
this.#baseBackend,
|
|
18378
|
-
async (target) =>
|
|
18388
|
+
async (target) => chunkDTVWX77L_cjs.rebuildIdentityClosureForContext(this.#identityContext(target)),
|
|
18379
18389
|
{ didWrite: () => false }
|
|
18380
18390
|
);
|
|
18381
18391
|
}
|
|
@@ -18387,7 +18397,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
18387
18397
|
* fails leaves no half-published derived relation behind.
|
|
18388
18398
|
*/
|
|
18389
18399
|
async identitySchemaPreflight(target, provisionDerivedRelations) {
|
|
18390
|
-
await
|
|
18400
|
+
await chunk65E3XWGF_cjs.identitySchemaCommitPreflight(this.#identityContext(this.#backend), {
|
|
18391
18401
|
enablement: false,
|
|
18392
18402
|
provisionDerivedRelations
|
|
18393
18403
|
})(target);
|
|
@@ -18395,24 +18405,24 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
18395
18405
|
/** @internal Read-only startup integrity verification. */
|
|
18396
18406
|
async validateIdentity() {
|
|
18397
18407
|
if (this.#graph.identity === void 0) return;
|
|
18398
|
-
await
|
|
18408
|
+
await chunkDTVWX77L_cjs.validateIdentityForContext(this.#identityContext(this.#baseBackend));
|
|
18399
18409
|
}
|
|
18400
18410
|
/** @internal Cascades removed kinds in the schema-commit transaction. */
|
|
18401
18411
|
async removeIdentityKindsInSchemaPreflight(target, kinds, options) {
|
|
18402
18412
|
if (!this.#captureEnabled) {
|
|
18403
|
-
await
|
|
18413
|
+
await chunkDTVWX77L_cjs.removeIdentityKindsForContext(
|
|
18404
18414
|
this.#identityContext(target),
|
|
18405
18415
|
kinds,
|
|
18406
18416
|
options
|
|
18407
18417
|
);
|
|
18408
18418
|
return;
|
|
18409
18419
|
}
|
|
18410
|
-
const scope =
|
|
18420
|
+
const scope = chunkPF6F5NLJ_cjs.createRecordedTransactionScope(
|
|
18411
18421
|
target,
|
|
18412
18422
|
this.#sqlSchema(),
|
|
18413
18423
|
target.dialect === "sqlite"
|
|
18414
18424
|
);
|
|
18415
|
-
await
|
|
18425
|
+
await chunkDTVWX77L_cjs.removeIdentityKindsForContext(
|
|
18416
18426
|
this.#identityContext(scope.backend),
|
|
18417
18427
|
kinds,
|
|
18418
18428
|
options
|
|
@@ -18426,7 +18436,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
18426
18436
|
*/
|
|
18427
18437
|
readCurrentIdentityAssertions(mode, options) {
|
|
18428
18438
|
if (this.#graph.identity === void 0) return Promise.resolve([]);
|
|
18429
|
-
return
|
|
18439
|
+
return chunkDTVWX77L_cjs.readIdentityAssertionsForInterchange(
|
|
18430
18440
|
this.#identityContext(this.#baseBackend),
|
|
18431
18441
|
mode,
|
|
18432
18442
|
options
|
|
@@ -18435,7 +18445,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
18435
18445
|
/** @internal Reads identity truth through an already-bound transaction. */
|
|
18436
18446
|
identityAssertionsAtTarget(target, mode = "state") {
|
|
18437
18447
|
if (this.#graph.identity === void 0) return Promise.resolve([]);
|
|
18438
|
-
return
|
|
18448
|
+
return chunkDTVWX77L_cjs.readIdentityAssertionsForInterchange(
|
|
18439
18449
|
this.#identityContext(target),
|
|
18440
18450
|
mode
|
|
18441
18451
|
);
|
|
@@ -18445,7 +18455,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
18445
18455
|
if (this.#graph.identity === void 0) {
|
|
18446
18456
|
return Promise.resolve({ assertions: [], done: true });
|
|
18447
18457
|
}
|
|
18448
|
-
return
|
|
18458
|
+
return chunkDTVWX77L_cjs.readIdentityAssertionPageAtTarget(
|
|
18449
18459
|
this.#identityContext(target),
|
|
18450
18460
|
target,
|
|
18451
18461
|
mode,
|
|
@@ -18454,14 +18464,14 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
18454
18464
|
}
|
|
18455
18465
|
/** @internal Acquires the enabled graph's identity lock for an import. */
|
|
18456
18466
|
lockIdentityImportTarget(target) {
|
|
18457
|
-
return this.#graph.identity === void 0 ? Promise.resolve() :
|
|
18467
|
+
return this.#graph.identity === void 0 ? Promise.resolve() : chunkDTVWX77L_cjs.lockIdentityGraph(target, this.graphId);
|
|
18458
18468
|
}
|
|
18459
18469
|
/** @internal Restores same-id folding after the ops-layer import bypass. */
|
|
18460
18470
|
foldImportedIdentityNodes(target, references) {
|
|
18461
18471
|
if (this.#graph.identity === void 0 || references.length === 0) {
|
|
18462
18472
|
return Promise.resolve();
|
|
18463
18473
|
}
|
|
18464
|
-
return
|
|
18474
|
+
return chunkDTVWX77L_cjs.foldIdentityForCreatedNodes(
|
|
18465
18475
|
{
|
|
18466
18476
|
graphId: this.graphId,
|
|
18467
18477
|
registry: this.#registry,
|
|
@@ -18483,7 +18493,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
18483
18493
|
{ code: "IDENTITY_IMPORT_REQUIRES_PROFILE", graphId: this.graphId }
|
|
18484
18494
|
);
|
|
18485
18495
|
}
|
|
18486
|
-
return
|
|
18496
|
+
return chunkDTVWX77L_cjs.importIdentityAssertionsIntoTarget(
|
|
18487
18497
|
this.#identityContext(target),
|
|
18488
18498
|
target,
|
|
18489
18499
|
assertions,
|
|
@@ -18499,7 +18509,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
18499
18509
|
if (this.#graph.identity === void 0 || seeds.length === 0) {
|
|
18500
18510
|
return Promise.resolve();
|
|
18501
18511
|
}
|
|
18502
|
-
return
|
|
18512
|
+
return chunkDTVWX77L_cjs.assertAffectedIdentityClassesConsistent(
|
|
18503
18513
|
this.#identityContext(target),
|
|
18504
18514
|
target,
|
|
18505
18515
|
seeds
|
|
@@ -18516,7 +18526,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
18516
18526
|
{ code: "IDENTITY_MERGE_REQUIRES_PROFILE", graphId: this.graphId }
|
|
18517
18527
|
);
|
|
18518
18528
|
}
|
|
18519
|
-
return
|
|
18529
|
+
return chunkDTVWX77L_cjs.applyIdentityChangesForContext(
|
|
18520
18530
|
this.#identityContext(target),
|
|
18521
18531
|
retractionIds,
|
|
18522
18532
|
assertions
|
|
@@ -18827,7 +18837,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
18827
18837
|
* between "proceed" and "ask the user" *before* attempting a commit.
|
|
18828
18838
|
*/
|
|
18829
18839
|
async schemaChanges() {
|
|
18830
|
-
return
|
|
18840
|
+
return chunk65E3XWGF_cjs.getSchemaChanges(this.#backend, this.#graph);
|
|
18831
18841
|
}
|
|
18832
18842
|
/**
|
|
18833
18843
|
* Whether committing this store's graph would require a schema migration —
|
|
@@ -18839,7 +18849,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
18839
18849
|
* through a user's request.
|
|
18840
18850
|
*/
|
|
18841
18851
|
async requiresMigration() {
|
|
18842
|
-
return
|
|
18852
|
+
return chunk65E3XWGF_cjs.requiresMigration(this.#backend, this.#graph);
|
|
18843
18853
|
}
|
|
18844
18854
|
/**
|
|
18845
18855
|
* Node operations bound to this store instance.
|
|
@@ -18855,7 +18865,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
18855
18865
|
async #maybeRefreshStatisticsAfterBulk(rowCount) {
|
|
18856
18866
|
const configured = this.#options?.autoRefreshStatistics;
|
|
18857
18867
|
if (configured === false) return;
|
|
18858
|
-
const threshold = configured ??
|
|
18868
|
+
const threshold = configured ?? chunkQ3G6A4I3_cjs.AUTO_REFRESH_STATISTICS_ROW_THRESHOLD;
|
|
18859
18869
|
if (rowCount < threshold) return;
|
|
18860
18870
|
try {
|
|
18861
18871
|
await this.refreshStatistics();
|
|
@@ -18869,13 +18879,13 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
18869
18879
|
#buildNodeOperations(ctx) {
|
|
18870
18880
|
return {
|
|
18871
18881
|
defaultTemporalMode: this.#graph.defaults.temporalMode,
|
|
18872
|
-
rowToNode: (row) =>
|
|
18882
|
+
rowToNode: (row) => chunkPT7RIRIZ_cjs.rowToNode(row),
|
|
18873
18883
|
maybeRefreshStatisticsAfterBulk: (rowCount) => this.#maybeRefreshStatisticsAfterBulk(rowCount),
|
|
18874
|
-
executeCreate: (input, backend) =>
|
|
18875
|
-
executeCreateBatch: (inputs, backend) =>
|
|
18876
|
-
executeCreateNoReturnBatch: (inputs, backend) =>
|
|
18877
|
-
executeUpdate: (input, backend, options) =>
|
|
18878
|
-
executeUpdateWhere: (kind, patch, candidateIds, candidateIdColumn, backend) =>
|
|
18884
|
+
executeCreate: (input, backend) => chunkPT7RIRIZ_cjs.executeNodeCreate(ctx, input, backend),
|
|
18885
|
+
executeCreateBatch: (inputs, backend) => chunkPT7RIRIZ_cjs.executeNodeCreateBatch(ctx, inputs, backend),
|
|
18886
|
+
executeCreateNoReturnBatch: (inputs, backend) => chunkPT7RIRIZ_cjs.executeNodeCreateNoReturnBatch(ctx, inputs, backend),
|
|
18887
|
+
executeUpdate: (input, backend, options) => chunkPT7RIRIZ_cjs.executeNodeUpdate(ctx, { ...input, id: input.id }, backend, options),
|
|
18888
|
+
executeUpdateWhere: (kind, patch, candidateIds, candidateIdColumn, backend) => chunkPT7RIRIZ_cjs.executeNodeUpdateWhere(
|
|
18879
18889
|
ctx,
|
|
18880
18890
|
kind,
|
|
18881
18891
|
patch,
|
|
@@ -18883,7 +18893,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
18883
18893
|
candidateIdColumn,
|
|
18884
18894
|
backend
|
|
18885
18895
|
),
|
|
18886
|
-
executeUpsertUpdate: (input, backend, options) =>
|
|
18896
|
+
executeUpsertUpdate: (input, backend, options) => chunkPT7RIRIZ_cjs.executeNodeUpsertUpdate(
|
|
18887
18897
|
ctx,
|
|
18888
18898
|
{ ...input, id: input.id },
|
|
18889
18899
|
backend,
|
|
@@ -18891,14 +18901,14 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
18891
18901
|
),
|
|
18892
18902
|
// Present only when opted in; its absence is the coalesce off switch.
|
|
18893
18903
|
...this.#options?.coalesceUnchangedUpserts === true && {
|
|
18894
|
-
upsertDirtyCheck: (kind, id, existingProps, inputProps) =>
|
|
18904
|
+
upsertDirtyCheck: (kind, id, existingProps, inputProps) => chunkPT7RIRIZ_cjs.nodeUpsertDirtyCheck(ctx, kind, id, existingProps, inputProps)
|
|
18895
18905
|
},
|
|
18896
|
-
executeDelete: (kind, id, backend) =>
|
|
18897
|
-
executeDeleteBatch: (kind, ids, backend) =>
|
|
18898
|
-
executeHardDelete: (kind, id, backend) =>
|
|
18906
|
+
executeDelete: (kind, id, backend) => chunkPT7RIRIZ_cjs.executeNodeDelete(ctx, kind, id, backend),
|
|
18907
|
+
executeDeleteBatch: (kind, ids, backend) => chunkPT7RIRIZ_cjs.executeNodeDeleteBatch(ctx, kind, ids, backend),
|
|
18908
|
+
executeHardDelete: (kind, id, backend) => chunkPT7RIRIZ_cjs.executeNodeHardDelete(ctx, kind, id, backend),
|
|
18899
18909
|
temporalRowMatcher: (options) => this.#temporalRowMatcher(options),
|
|
18900
18910
|
createQuery: () => this.query(),
|
|
18901
|
-
executeGetOrCreateByConstraint: (kind, constraintName, props, backend, options) =>
|
|
18911
|
+
executeGetOrCreateByConstraint: (kind, constraintName, props, backend, options) => chunkPT7RIRIZ_cjs.executeNodeGetOrCreateByConstraint(
|
|
18902
18912
|
ctx,
|
|
18903
18913
|
kind,
|
|
18904
18914
|
constraintName,
|
|
@@ -18906,7 +18916,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
18906
18916
|
backend,
|
|
18907
18917
|
options
|
|
18908
18918
|
),
|
|
18909
|
-
executeBulkGetOrCreateByConstraint: (kind, constraintName, items, backend, options) =>
|
|
18919
|
+
executeBulkGetOrCreateByConstraint: (kind, constraintName, items, backend, options) => chunkPT7RIRIZ_cjs.executeNodeBulkGetOrCreateByConstraint(
|
|
18910
18920
|
ctx,
|
|
18911
18921
|
kind,
|
|
18912
18922
|
constraintName,
|
|
@@ -18914,15 +18924,15 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
18914
18924
|
backend,
|
|
18915
18925
|
options
|
|
18916
18926
|
),
|
|
18917
|
-
executeFindByConstraint: (kind, constraintName, props, backend) =>
|
|
18918
|
-
executeBulkFindByConstraint: (kind, constraintName, items, backend) =>
|
|
18927
|
+
executeFindByConstraint: (kind, constraintName, props, backend) => chunkPT7RIRIZ_cjs.executeNodeFindByConstraint(ctx, kind, constraintName, props, backend),
|
|
18928
|
+
executeBulkFindByConstraint: (kind, constraintName, items, backend) => chunkPT7RIRIZ_cjs.executeNodeBulkFindByConstraint(
|
|
18919
18929
|
ctx,
|
|
18920
18930
|
kind,
|
|
18921
18931
|
constraintName,
|
|
18922
18932
|
items,
|
|
18923
18933
|
backend
|
|
18924
18934
|
),
|
|
18925
|
-
executeBulkFindByIndex: (kind, indexName, items, backend, options) =>
|
|
18935
|
+
executeBulkFindByIndex: (kind, indexName, items, backend, options) => chunkPT7RIRIZ_cjs.executeNodeBulkFindByIndex(
|
|
18926
18936
|
ctx,
|
|
18927
18937
|
kind,
|
|
18928
18938
|
indexName,
|
|
@@ -18941,7 +18951,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
18941
18951
|
#buildEdgeOperations(ctx) {
|
|
18942
18952
|
return {
|
|
18943
18953
|
defaultTemporalMode: this.#graph.defaults.temporalMode,
|
|
18944
|
-
rowToEdge: (row) =>
|
|
18954
|
+
rowToEdge: (row) => chunkPT7RIRIZ_cjs.rowToEdge(row),
|
|
18945
18955
|
maybeRefreshStatisticsAfterBulk: (rowCount) => this.#maybeRefreshStatisticsAfterBulk(rowCount),
|
|
18946
18956
|
executeCreate: (input, backend) => executeEdgeCreate(ctx, input, backend),
|
|
18947
18957
|
executeCreateBatch: (inputs, backend) => executeEdgeCreateBatch(ctx, inputs, backend),
|
|
@@ -19108,14 +19118,14 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
19108
19118
|
* increments.
|
|
19109
19119
|
*/
|
|
19110
19120
|
asOfRecorded(recordedAsOf) {
|
|
19111
|
-
const validCoordinate =
|
|
19121
|
+
const validCoordinate = chunkMCLYU6BN_cjs.resolveReadCoordinate(
|
|
19112
19122
|
"asOf",
|
|
19113
|
-
|
|
19123
|
+
chunkMCLYU6BN_cjs.recordedInstantWallTime(recordedAsOf),
|
|
19114
19124
|
"Use await store.recordedNow() as the anchor, or asRecordedInstant(value) only for an instant previously read from recordedNow()."
|
|
19115
19125
|
);
|
|
19116
19126
|
return new RecordedStoreView(
|
|
19117
19127
|
this,
|
|
19118
|
-
|
|
19128
|
+
chunkMCLYU6BN_cjs.withRecordedCoordinate(validCoordinate, recordedAsOf)
|
|
19119
19129
|
);
|
|
19120
19130
|
}
|
|
19121
19131
|
/**
|
|
@@ -19153,10 +19163,10 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
19153
19163
|
);
|
|
19154
19164
|
}
|
|
19155
19165
|
const recordedAt = await chunkBSFJMMV3_cjs.withRecordedRelationsPrecondition(
|
|
19156
|
-
|
|
19166
|
+
chunkPF6F5NLJ_cjs.readRecordedClock(this.#backend, this.#sqlSchema(), this.graphId),
|
|
19157
19167
|
{ dialect: this.#backend.dialect, surface: "recorded-now" }
|
|
19158
19168
|
);
|
|
19159
|
-
return recordedAt === void 0 ? void 0 :
|
|
19169
|
+
return recordedAt === void 0 ? void 0 : chunkMCLYU6BN_cjs.asRecordedInstant(recordedAt);
|
|
19160
19170
|
}
|
|
19161
19171
|
/**
|
|
19162
19172
|
* Returns the durable graph revision used by graph branching. It is undefined
|
|
@@ -19168,7 +19178,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
19168
19178
|
*/
|
|
19169
19179
|
async revisionNow() {
|
|
19170
19180
|
if (!this.#revisionTrackingEnabled) return void 0;
|
|
19171
|
-
return
|
|
19181
|
+
return chunkPF6F5NLJ_cjs.readRecordedClock(this.#backend, this.#sqlSchema(), this.graphId);
|
|
19172
19182
|
}
|
|
19173
19183
|
/**
|
|
19174
19184
|
* Returns the durable random namespace for this graph's revision clock. A
|
|
@@ -19185,7 +19195,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
19185
19195
|
{ code: "REVISION_ORIGIN_REQUIRES_TRACKING" }
|
|
19186
19196
|
);
|
|
19187
19197
|
}
|
|
19188
|
-
const pendingOrigin = this.#revisionOrigin ??
|
|
19198
|
+
const pendingOrigin = this.#revisionOrigin ?? chunkPF6F5NLJ_cjs.ensureRevisionOrigin(this.#baseBackend, this.#sqlSchema(), this.graphId);
|
|
19189
19199
|
this.#revisionOrigin = pendingOrigin;
|
|
19190
19200
|
try {
|
|
19191
19201
|
return await pendingOrigin;
|
|
@@ -19231,7 +19241,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
19231
19241
|
* ```
|
|
19232
19242
|
*/
|
|
19233
19243
|
snapshot() {
|
|
19234
|
-
return this.asOf(
|
|
19244
|
+
return this.asOf(chunkMCLYU6BN_cjs.nowIso());
|
|
19235
19245
|
}
|
|
19236
19246
|
// === Search ===
|
|
19237
19247
|
/**
|
|
@@ -19433,7 +19443,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
19433
19443
|
});
|
|
19434
19444
|
const edgesBySource = /* @__PURE__ */ new Map();
|
|
19435
19445
|
for (const row of rows) {
|
|
19436
|
-
const edge =
|
|
19446
|
+
const edge = chunkPT7RIRIZ_cjs.rowToEdge(row);
|
|
19437
19447
|
const key = `${edge.fromKind}\0${edge.fromId}`;
|
|
19438
19448
|
const bucket = edgesBySource.get(key);
|
|
19439
19449
|
if (bucket === void 0) edgesBySource.set(key, [edge]);
|
|
@@ -19489,11 +19499,11 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
19489
19499
|
* @internal
|
|
19490
19500
|
*/
|
|
19491
19501
|
subgraphAtCoordinate(rootId, options) {
|
|
19492
|
-
const coordinate =
|
|
19502
|
+
const coordinate = chunkMCLYU6BN_cjs.resolveReadCoordinate(
|
|
19493
19503
|
options.temporalMode ?? this.#graph.defaults.temporalMode,
|
|
19494
19504
|
options.asOf
|
|
19495
19505
|
);
|
|
19496
|
-
const readCoordinate = options.recordedAsOf === void 0 ? coordinate :
|
|
19506
|
+
const readCoordinate = options.recordedAsOf === void 0 ? coordinate : chunkMCLYU6BN_cjs.withRecordedCoordinate(coordinate, options.recordedAsOf);
|
|
19497
19507
|
return executeSubgraph({
|
|
19498
19508
|
graph: this.#graph,
|
|
19499
19509
|
graphId: this.graphId,
|
|
@@ -19559,7 +19569,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
19559
19569
|
receiptRecorder
|
|
19560
19570
|
));
|
|
19561
19571
|
}
|
|
19562
|
-
const identity = this.#graph.identity === void 0 ? void 0 :
|
|
19572
|
+
const identity = this.#graph.identity === void 0 ? void 0 : chunkDTVWX77L_cjs.createIdentityFacade(this.#identityContext(this.#backend));
|
|
19563
19573
|
const receiptIdentity = identity === void 0 || receiptRecorder === void 0 ? identity : wrapTransactionIdentity(identity, receiptRecorder);
|
|
19564
19574
|
const fallbackContext = {
|
|
19565
19575
|
nodes,
|
|
@@ -19568,7 +19578,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
19568
19578
|
// No real transaction: `tx.sql` is absent and there is no atomicity.
|
|
19569
19579
|
sqlAvailability: "unavailable",
|
|
19570
19580
|
backend: chunkXBYVV3MP_cjs.createTransactionReadBackend(this.#backend),
|
|
19571
|
-
[
|
|
19581
|
+
[chunkQ3G6A4I3_cjs.TRANSACTION_RUNTIME]: {
|
|
19572
19582
|
backend: this.#backend,
|
|
19573
19583
|
runNodeOperationHooks: (operation, kind, id, hookedFunction) => this.#withOperationHooks(
|
|
19574
19584
|
this.#createOperationContext(operation, "node", kind, id),
|
|
@@ -19577,7 +19587,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
19577
19587
|
},
|
|
19578
19588
|
getNodeCollection: (kind) => this.#resolveDynamicNodeCollection(nodes, kind)
|
|
19579
19589
|
};
|
|
19580
|
-
Object.defineProperty(fallbackContext,
|
|
19590
|
+
Object.defineProperty(fallbackContext, chunkQ3G6A4I3_cjs.TRANSACTION_RUNTIME, {
|
|
19581
19591
|
configurable: false,
|
|
19582
19592
|
enumerable: false,
|
|
19583
19593
|
writable: false
|
|
@@ -19591,7 +19601,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
19591
19601
|
const runHooks = this.#createBufferedHookRunner(pending);
|
|
19592
19602
|
const runBulkHooks = this.#createBufferedBulkHookRunner(pending);
|
|
19593
19603
|
let recordedByGraph;
|
|
19594
|
-
const transactionOptions = receiptRecorder !== void 0 && this.#captureEnabled ?
|
|
19604
|
+
const transactionOptions = receiptRecorder !== void 0 && this.#captureEnabled ? chunkPF6F5NLJ_cjs.withRecordedFlushObserver(backendOptions, (instants) => {
|
|
19595
19605
|
recordedByGraph = instants;
|
|
19596
19606
|
}) : backendOptions;
|
|
19597
19607
|
try {
|
|
@@ -19608,7 +19618,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
19608
19618
|
if (!this.#captureEnabled && !this.#revisionTrackingEnabled) {
|
|
19609
19619
|
return invokeTransaction();
|
|
19610
19620
|
}
|
|
19611
|
-
return
|
|
19621
|
+
return chunkDTVWX77L_cjs.withWriteTransactionSession(
|
|
19612
19622
|
txBackend,
|
|
19613
19623
|
{
|
|
19614
19624
|
graphId: this.graphId,
|
|
@@ -19724,7 +19734,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
19724
19734
|
*/
|
|
19725
19735
|
withTransaction(externalTx) {
|
|
19726
19736
|
if (this.#captureEnabled) {
|
|
19727
|
-
throw
|
|
19737
|
+
throw chunkPF6F5NLJ_cjs.recordedCaptureRequiresCallbackTransactionError();
|
|
19728
19738
|
}
|
|
19729
19739
|
const adopt = this.#adapterBackend?.adoptTransaction;
|
|
19730
19740
|
if (adopt === void 0) {
|
|
@@ -19748,8 +19758,8 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
19748
19758
|
}
|
|
19749
19759
|
const txBackend = adopt(externalTx);
|
|
19750
19760
|
if (this.#captureEnabled) {
|
|
19751
|
-
await
|
|
19752
|
-
await
|
|
19761
|
+
await chunkPF6F5NLJ_cjs.assertRecordedCaptureTransactionIsolation(txBackend);
|
|
19762
|
+
await chunkDTVWX77L_cjs.lockSchemaVersionForStoreWrite(
|
|
19753
19763
|
{
|
|
19754
19764
|
graphId: this.graphId,
|
|
19755
19765
|
schemaVersion: this.#schemaMetadata.schemaVersion
|
|
@@ -19757,12 +19767,12 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
19757
19767
|
txBackend
|
|
19758
19768
|
);
|
|
19759
19769
|
}
|
|
19760
|
-
const scope = this.#captureEnabled ?
|
|
19770
|
+
const scope = this.#captureEnabled ? chunkPF6F5NLJ_cjs.createRecordedTransactionScope(txBackend, this.#sqlSchema()) : {
|
|
19761
19771
|
backend: txBackend,
|
|
19762
19772
|
flush: () => Promise.resolve(EMPTY_RECORDED_FLUSH_INSTANTS)
|
|
19763
19773
|
};
|
|
19764
19774
|
if (this.#captureEnabled) {
|
|
19765
|
-
await
|
|
19775
|
+
await chunkPF6F5NLJ_cjs.lockRecordedGraphWrite(scope.backend, this.graphId);
|
|
19766
19776
|
}
|
|
19767
19777
|
const receiptRecorder = createTransactionReceiptRecorder();
|
|
19768
19778
|
const invoke = fn;
|
|
@@ -19867,7 +19877,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
19867
19877
|
receiptRecorder
|
|
19868
19878
|
));
|
|
19869
19879
|
}
|
|
19870
|
-
const identity = this.#graph.identity === void 0 ? void 0 :
|
|
19880
|
+
const identity = this.#graph.identity === void 0 ? void 0 : chunkDTVWX77L_cjs.createIdentityFacade(this.#identityContext(txBackend));
|
|
19871
19881
|
const receiptIdentity = identity === void 0 || receiptRecorder === void 0 ? identity : wrapTransactionIdentity(identity, receiptRecorder);
|
|
19872
19882
|
const getNodeCollection = (kind) => this.#resolveDynamicNodeCollection(nodes, kind);
|
|
19873
19883
|
const base = {
|
|
@@ -19875,7 +19885,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
19875
19885
|
edges,
|
|
19876
19886
|
...receiptIdentity === void 0 ? {} : { identity: receiptIdentity },
|
|
19877
19887
|
backend: chunkXBYVV3MP_cjs.createTransactionReadBackend(txBackend),
|
|
19878
|
-
[
|
|
19888
|
+
[chunkQ3G6A4I3_cjs.TRANSACTION_RUNTIME]: { backend: txBackend, runNodeOperationHooks },
|
|
19879
19889
|
getNodeCollection
|
|
19880
19890
|
};
|
|
19881
19891
|
let withSql;
|
|
@@ -19884,7 +19894,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
19884
19894
|
...base,
|
|
19885
19895
|
sqlAvailability: "history"
|
|
19886
19896
|
};
|
|
19887
|
-
defineUnavailableSqlGuard(withSql, () =>
|
|
19897
|
+
defineUnavailableSqlGuard(withSql, () => chunkPF6F5NLJ_cjs.throwHistoryUnsafeSqlAccess());
|
|
19888
19898
|
} else if (this.#revisionTrackingEnabled) {
|
|
19889
19899
|
withSql = {
|
|
19890
19900
|
...base,
|
|
@@ -19892,14 +19902,14 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
19892
19902
|
};
|
|
19893
19903
|
defineUnavailableSqlGuard(
|
|
19894
19904
|
withSql,
|
|
19895
|
-
() =>
|
|
19905
|
+
() => chunkPF6F5NLJ_cjs.throwRevisionTrackingUnsafeSqlAccess()
|
|
19896
19906
|
);
|
|
19897
19907
|
} else if (sql2 === void 0) {
|
|
19898
19908
|
withSql = { ...base, sqlAvailability: "unavailable" };
|
|
19899
19909
|
} else {
|
|
19900
19910
|
withSql = { ...base, sql: sql2, sqlAvailability: "available" };
|
|
19901
19911
|
}
|
|
19902
|
-
Object.defineProperty(withSql,
|
|
19912
|
+
Object.defineProperty(withSql, chunkQ3G6A4I3_cjs.TRANSACTION_RUNTIME, {
|
|
19903
19913
|
configurable: false,
|
|
19904
19914
|
enumerable: false,
|
|
19905
19915
|
writable: false
|
|
@@ -19940,7 +19950,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
19940
19950
|
for (const [index, node] of nodes.entries()) {
|
|
19941
19951
|
if (node !== void 0) {
|
|
19942
19952
|
loadedByReference.set(
|
|
19943
|
-
|
|
19953
|
+
chunkDTVWX77L_cjs.refKey({ kind, id: chunkN66HCGCY_cjs.requireDefined(ids[index]) }),
|
|
19944
19954
|
node
|
|
19945
19955
|
);
|
|
19946
19956
|
}
|
|
@@ -19955,14 +19965,14 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
19955
19965
|
if (row === void 0) continue;
|
|
19956
19966
|
if (!includeTombstoned && row.deleted_at !== void 0) continue;
|
|
19957
19967
|
loadedByReference.set(
|
|
19958
|
-
|
|
19959
|
-
|
|
19968
|
+
chunkDTVWX77L_cjs.refKey({ kind, id: row.id }),
|
|
19969
|
+
chunkPT7RIRIZ_cjs.rowToNode(row)
|
|
19960
19970
|
);
|
|
19961
19971
|
}
|
|
19962
19972
|
})
|
|
19963
19973
|
);
|
|
19964
19974
|
return references.map(
|
|
19965
|
-
(reference) => loadedByReference.get(
|
|
19975
|
+
(reference) => loadedByReference.get(chunkDTVWX77L_cjs.refKey(reference))
|
|
19966
19976
|
);
|
|
19967
19977
|
}
|
|
19968
19978
|
};
|
|
@@ -19980,15 +19990,15 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
19980
19990
|
async clear() {
|
|
19981
19991
|
const doClear = async (target) => {
|
|
19982
19992
|
if (this.#revisionTrackingEnabled) {
|
|
19983
|
-
await
|
|
19993
|
+
await chunkPF6F5NLJ_cjs.lockRecordedGraphWrite(target, this.graphId);
|
|
19984
19994
|
}
|
|
19985
19995
|
if (this.#graph.identity !== void 0) {
|
|
19986
|
-
await
|
|
19996
|
+
await chunkDTVWX77L_cjs.lockIdentityGraph(target, this.graphId);
|
|
19987
19997
|
}
|
|
19988
|
-
const previousRevision = this.#revisionTrackingEnabled && !this.#captureEnabled ? await
|
|
19998
|
+
const previousRevision = this.#revisionTrackingEnabled && !this.#captureEnabled ? await chunkPF6F5NLJ_cjs.readRecordedClock(target, this.#sqlSchema(), this.graphId) : void 0;
|
|
19989
19999
|
await target.clearGraph(this.graphId);
|
|
19990
20000
|
if (this.#revisionTrackingEnabled && !this.#captureEnabled) {
|
|
19991
|
-
await
|
|
20001
|
+
await chunkPF6F5NLJ_cjs.advanceRevisionClock(
|
|
19992
20002
|
target,
|
|
19993
20003
|
this.#sqlSchema(),
|
|
19994
20004
|
this.graphId,
|
|
@@ -20119,7 +20129,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
20119
20129
|
*/
|
|
20120
20130
|
async evolve(extension, options) {
|
|
20121
20131
|
const { activeRow, baseline } = await this.#loadCaughtUp("evolve");
|
|
20122
|
-
const merged =
|
|
20132
|
+
const merged = chunk65E3XWGF_cjs.mergeGraphExtension(baseline, extension);
|
|
20123
20133
|
if (merged === baseline) {
|
|
20124
20134
|
if (baseline === this.#graph) {
|
|
20125
20135
|
syncStoreReplacementRef(options?.ref, this);
|
|
@@ -20148,7 +20158,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
20148
20158
|
);
|
|
20149
20159
|
}
|
|
20150
20160
|
const identityCandidate = merged.identity === void 0 ? void 0 : this.#cloneWithGraph(merged, void 0);
|
|
20151
|
-
const identityProvisioning = identityCandidate === void 0 ? void 0 : await
|
|
20161
|
+
const identityProvisioning = identityCandidate === void 0 ? void 0 : await chunk65E3XWGF_cjs.ensureIdentitySchemaStorage(
|
|
20152
20162
|
this.#baseBackend,
|
|
20153
20163
|
this.#sqlSchema(),
|
|
20154
20164
|
{
|
|
@@ -20157,7 +20167,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
20157
20167
|
// The evolved graph's registry — the one the candidate's own
|
|
20158
20168
|
// preflight rebuilds through, so the predicate and the fill agree
|
|
20159
20169
|
// on which assertions count.
|
|
20160
|
-
registry:
|
|
20170
|
+
registry: chunk65E3XWGF_cjs.buildKindRegistry(merged)
|
|
20161
20171
|
}
|
|
20162
20172
|
);
|
|
20163
20173
|
const committed = identityCandidate === void 0 ? classification.requireEmpty.length > 0 ? await commitEvolvedSchemaWhenRequiredKindsAreEmpty(
|
|
@@ -20165,7 +20175,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
20165
20175
|
merged,
|
|
20166
20176
|
activeRow.version,
|
|
20167
20177
|
classification
|
|
20168
|
-
) : await
|
|
20178
|
+
) : await chunk65E3XWGF_cjs.commitNewSchemaVersion(this.#backend, merged, activeRow.version) : await chunk65E3XWGF_cjs.commitNewSchemaVersionWithPreflight(
|
|
20169
20179
|
this.#backend,
|
|
20170
20180
|
merged,
|
|
20171
20181
|
activeRow.version,
|
|
@@ -20397,7 +20407,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
20397
20407
|
tableName,
|
|
20398
20408
|
declaration
|
|
20399
20409
|
);
|
|
20400
|
-
const now =
|
|
20410
|
+
const now = chunkMCLYU6BN_cjs.nowIso();
|
|
20401
20411
|
await backend.recordIndexMaterialization({
|
|
20402
20412
|
indexName: vectorStatusKey(this.graphId, declaration.name),
|
|
20403
20413
|
graphId: this.graphId,
|
|
@@ -20742,7 +20752,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
20742
20752
|
*/
|
|
20743
20753
|
async removeKinds(names, options) {
|
|
20744
20754
|
const { activeRow, baseline } = await this.#loadCaughtUp("remove");
|
|
20745
|
-
const plan =
|
|
20755
|
+
const plan = chunk65E3XWGF_cjs.planRemovals(baseline, names);
|
|
20746
20756
|
if (plan.removedNodeKinds.length === 0 && plan.removedEdgeKinds.length === 0) {
|
|
20747
20757
|
if (baseline === this.#graph) {
|
|
20748
20758
|
syncStoreReplacementRef(options?.ref, this);
|
|
@@ -20754,18 +20764,18 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
20754
20764
|
schemaMetadataFromRow(activeRow)
|
|
20755
20765
|
);
|
|
20756
20766
|
}
|
|
20757
|
-
const compileTimeGraph =
|
|
20758
|
-
const merged = plan.document === void 0 ? compileTimeGraph :
|
|
20759
|
-
const finalGraph =
|
|
20767
|
+
const compileTimeGraph = chunk65E3XWGF_cjs.stripGraphExtension(this.#graph);
|
|
20768
|
+
const merged = plan.document === void 0 ? compileTimeGraph : chunk65E3XWGF_cjs.mergeGraphExtension(compileTimeGraph, plan.document);
|
|
20769
|
+
const finalGraph = chunk65E3XWGF_cjs.applyDeprecatedKinds(merged, baseline.deprecatedKinds);
|
|
20760
20770
|
const identityCascade = await this.#identityRemovalPreflight(
|
|
20761
20771
|
finalGraph,
|
|
20762
20772
|
plan.removedNodeKinds
|
|
20763
20773
|
);
|
|
20764
|
-
const committedRow = identityCascade === void 0 ? await
|
|
20774
|
+
const committedRow = identityCascade === void 0 ? await chunk65E3XWGF_cjs.commitNewSchemaVersion(
|
|
20765
20775
|
this.#backend,
|
|
20766
20776
|
finalGraph,
|
|
20767
20777
|
activeRow.version
|
|
20768
|
-
) : await
|
|
20778
|
+
) : await chunk65E3XWGF_cjs.commitNewSchemaVersionWithPreflight(
|
|
20769
20779
|
this.#backend,
|
|
20770
20780
|
finalGraph,
|
|
20771
20781
|
activeRow.version,
|
|
@@ -20777,7 +20787,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
20777
20787
|
this.#backend,
|
|
20778
20788
|
this.#backend.ensureKindRemovalsTable
|
|
20779
20789
|
);
|
|
20780
|
-
const attemptedAt =
|
|
20790
|
+
const attemptedAt = chunkMCLYU6BN_cjs.nowIso();
|
|
20781
20791
|
const newSchemaVersion = committedRow.version;
|
|
20782
20792
|
const queue = (kindName, entity) => recordKindRemoval(
|
|
20783
20793
|
buildPendingKindRemoval({
|
|
@@ -20823,7 +20833,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
20823
20833
|
async #identityRemovalPreflight(finalGraph, removedNodeKinds) {
|
|
20824
20834
|
if (removedNodeKinds.length === 0) return void 0;
|
|
20825
20835
|
const repairClosure = finalGraph.identity !== void 0;
|
|
20826
|
-
if (!repairClosure && !await
|
|
20836
|
+
if (!repairClosure && !await chunk65E3XWGF_cjs.identityKindCascadeNeeded(
|
|
20827
20837
|
this.#backend,
|
|
20828
20838
|
this.#sqlSchema(),
|
|
20829
20839
|
this.graphId,
|
|
@@ -20884,8 +20894,8 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
20884
20894
|
schemaMetadataFromRow(activeRow)
|
|
20885
20895
|
);
|
|
20886
20896
|
}
|
|
20887
|
-
const merged =
|
|
20888
|
-
const result = await
|
|
20897
|
+
const merged = chunk65E3XWGF_cjs.applyDeprecatedKinds(baseline, nextSet);
|
|
20898
|
+
const result = await chunk65E3XWGF_cjs.ensureSchema(this.#backend, merged, {
|
|
20889
20899
|
preloaded: { activeRow, storedSchema },
|
|
20890
20900
|
autoMigrate: true
|
|
20891
20901
|
});
|
|
@@ -20893,9 +20903,9 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
20893
20903
|
return this.#cloneWithGraph(merged, options?.ref, metadata);
|
|
20894
20904
|
}
|
|
20895
20905
|
#catchUpToStored(storedSchema) {
|
|
20896
|
-
const compileTimeGraph =
|
|
20897
|
-
const withGraphExtension = storedSchema.extension === void 0 ? compileTimeGraph :
|
|
20898
|
-
return
|
|
20906
|
+
const compileTimeGraph = chunk65E3XWGF_cjs.stripGraphExtension(this.#graph);
|
|
20907
|
+
const withGraphExtension = storedSchema.extension === void 0 ? compileTimeGraph : chunk65E3XWGF_cjs.mergeGraphExtension(compileTimeGraph, storedSchema.extension);
|
|
20908
|
+
return chunk65E3XWGF_cjs.applyDeprecatedKinds(
|
|
20899
20909
|
withGraphExtension,
|
|
20900
20910
|
storedSchema.deprecatedKinds
|
|
20901
20911
|
);
|
|
@@ -20913,7 +20923,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
20913
20923
|
* serializes the actual commit.
|
|
20914
20924
|
*/
|
|
20915
20925
|
async #loadCaughtUp(verb) {
|
|
20916
|
-
const activeRow = await
|
|
20926
|
+
const activeRow = await chunk65E3XWGF_cjs.loadActiveSchemaWithBootstrap(
|
|
20917
20927
|
this.#backend,
|
|
20918
20928
|
this.graphId
|
|
20919
20929
|
);
|
|
@@ -20924,7 +20934,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
20924
20934
|
{ code }
|
|
20925
20935
|
);
|
|
20926
20936
|
}
|
|
20927
|
-
const storedSchema =
|
|
20937
|
+
const storedSchema = chunk65E3XWGF_cjs.parseSerializedSchema(activeRow.schema_doc);
|
|
20928
20938
|
const baseline = this.#catchUpToStored(storedSchema);
|
|
20929
20939
|
return { activeRow, storedSchema, baseline };
|
|
20930
20940
|
}
|
|
@@ -21009,8 +21019,8 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
21009
21019
|
registry: this.#registry,
|
|
21010
21020
|
...identityConfig === void 0 ? {} : {
|
|
21011
21021
|
identity: {
|
|
21012
|
-
lock: (target) =>
|
|
21013
|
-
foldCreated: (target, references) =>
|
|
21022
|
+
lock: (target) => chunkDTVWX77L_cjs.lockIdentityGraph(target, this.graphId),
|
|
21023
|
+
foldCreated: (target, references) => chunkDTVWX77L_cjs.foldIdentityForCreatedNodes(
|
|
21014
21024
|
{
|
|
21015
21025
|
graphId: this.graphId,
|
|
21016
21026
|
registry: this.#registry,
|
|
@@ -21020,7 +21030,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
21020
21030
|
target,
|
|
21021
21031
|
references
|
|
21022
21032
|
),
|
|
21023
|
-
detachDeleted: (target, ref, mode) =>
|
|
21033
|
+
detachDeleted: (target, ref, mode) => chunkDTVWX77L_cjs.detachIdentityForNode(
|
|
21024
21034
|
{
|
|
21025
21035
|
graphId: this.graphId,
|
|
21026
21036
|
sameIdAcrossKinds: identityConfig.sameIdAcrossKinds,
|
|
@@ -21073,7 +21083,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
21073
21083
|
}
|
|
21074
21084
|
const executeRaw = backend.executeRaw;
|
|
21075
21085
|
const compileSql = backend.compileSql;
|
|
21076
|
-
const projected =
|
|
21086
|
+
const projected = chunkPF6F5NLJ_cjs.createGraphBackendProjection(backend);
|
|
21077
21087
|
return chunkXBYVV3MP_cjs.createBackendOverlay(projected, {
|
|
21078
21088
|
execute: (query) => {
|
|
21079
21089
|
const compiled = compileSql === void 0 ? chunkVCRRKBLN_cjs.renderSql(query, backend.dialect) : compileSql(query);
|
|
@@ -21114,7 +21124,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
21114
21124
|
}
|
|
21115
21125
|
#createHookContext() {
|
|
21116
21126
|
return {
|
|
21117
|
-
operationId:
|
|
21127
|
+
operationId: chunkPF6F5NLJ_cjs.generateId(),
|
|
21118
21128
|
graphId: this.graphId,
|
|
21119
21129
|
startedAt: /* @__PURE__ */ new Date()
|
|
21120
21130
|
};
|
|
@@ -21255,8 +21265,8 @@ var AdapterStoreImplementation = class _AdapterStoreImplementation extends Store
|
|
|
21255
21265
|
backend;
|
|
21256
21266
|
constructor(graph, backend, options, schemaMetadata) {
|
|
21257
21267
|
super(graph, backend, options, schemaMetadata, backend);
|
|
21258
|
-
this.backend = options?.history === true ? createHistoryStoreBackendProjection(this[
|
|
21259
|
-
|
|
21268
|
+
this.backend = options?.history === true ? createHistoryStoreBackendProjection(this[chunkQ3G6A4I3_cjs.STORE_RUNTIME].backend) : Object.freeze(
|
|
21269
|
+
chunkPF6F5NLJ_cjs.createGraphBackendProjection(this[chunkQ3G6A4I3_cjs.STORE_RUNTIME].backend)
|
|
21260
21270
|
);
|
|
21261
21271
|
}
|
|
21262
21272
|
/**
|
|
@@ -21449,7 +21459,7 @@ async function createStoreWithSchema(graph, backend, options) {
|
|
|
21449
21459
|
async function assertHistorySchemaOnOpen(backend, graph, options) {
|
|
21450
21460
|
if (options?.history !== true) return;
|
|
21451
21461
|
const schema = options.schema === void 0 ? chunkNFCVHQ5P_cjs.createSqlSchema(backend.tableNames) : chunkNFCVHQ5P_cjs.requireSqlSchema(options.schema, "store schema");
|
|
21452
|
-
await
|
|
21462
|
+
await chunkPF6F5NLJ_cjs.assertCurrentRecordedSchema(
|
|
21453
21463
|
backend,
|
|
21454
21464
|
schema,
|
|
21455
21465
|
graph.identity !== void 0
|
|
@@ -21476,7 +21486,7 @@ var IDENTITY_GATE_CODES = {
|
|
|
21476
21486
|
};
|
|
21477
21487
|
async function ensureSchemaWithIdentityPrecedence(backend, graph, options, gate) {
|
|
21478
21488
|
try {
|
|
21479
|
-
return await
|
|
21489
|
+
return await chunk65E3XWGF_cjs.ensureSchema(backend, graph, options);
|
|
21480
21490
|
} catch (error) {
|
|
21481
21491
|
if (gate === void 0 || !isIdentityOnlyBreakingChange(error)) throw error;
|
|
21482
21492
|
throw identityMigrationRequiredError(graph.id, gate, {
|
|
@@ -21516,20 +21526,20 @@ async function prepareStoreWithSchema(graph, backend, options) {
|
|
|
21516
21526
|
graph: merged,
|
|
21517
21527
|
activeRow,
|
|
21518
21528
|
storedSchema
|
|
21519
|
-
} = await
|
|
21529
|
+
} = await chunk65E3XWGF_cjs.loadAndMergeGraphExtensionDocument(backend, graph);
|
|
21520
21530
|
const identityProfileChanged = activeRow !== void 0 && storedSchema?.identity?.sameIdAcrossKinds !== merged.identity?.sameIdAcrossKinds;
|
|
21521
21531
|
const identityInitialization = activeRow === void 0 && merged.identity !== void 0;
|
|
21522
21532
|
const identityEnablement = identityInitialization || identityProfileChanged && storedSchema?.identity === void 0 && merged.identity !== void 0;
|
|
21523
21533
|
const identitySemanticsChanged = identityProfileChanged || activeRow !== void 0 && storedSchema !== void 0 && merged.identity !== void 0 && identityOntologyChanged(
|
|
21524
21534
|
storedSchema,
|
|
21525
|
-
|
|
21535
|
+
chunk65E3XWGF_cjs.serializeSchema(merged, activeRow.version + 1)
|
|
21526
21536
|
);
|
|
21527
21537
|
const identityGate = identitySemanticsChanged ? identityEnablement ? "enablement" : identityProfileChanged ? "profile" : "ontology" : void 0;
|
|
21528
21538
|
const identityProfile = merged.identity;
|
|
21529
21539
|
if (identityProfile !== void 0) {
|
|
21530
21540
|
const resolvedIdentitySchema = options?.schema === void 0 ? chunkNFCVHQ5P_cjs.createSqlSchema(backend.tableNames) : chunkNFCVHQ5P_cjs.requireSqlSchema(options.schema, "store schema");
|
|
21531
|
-
const identityRegistry =
|
|
21532
|
-
await
|
|
21541
|
+
const identityRegistry = chunk65E3XWGF_cjs.buildKindRegistry(merged);
|
|
21542
|
+
await chunk65E3XWGF_cjs.ensureIdentitySchemaStorage(backend, resolvedIdentitySchema, {
|
|
21533
21543
|
graphId: merged.id,
|
|
21534
21544
|
enablement: identityEnablement,
|
|
21535
21545
|
registry: identityRegistry,
|
|
@@ -21550,7 +21560,7 @@ async function prepareStoreWithSchema(graph, backend, options) {
|
|
|
21550
21560
|
// the relation absent rather than readable-empty, and the next open of a
|
|
21551
21561
|
// graph whose semantics ARE committed heals it here.
|
|
21552
21562
|
...identityGate === void 0 ? {
|
|
21553
|
-
recomputeDerivedRelations: (target) =>
|
|
21563
|
+
recomputeDerivedRelations: (target) => chunkDTVWX77L_cjs.rebuildIdentityClosureForContext({
|
|
21554
21564
|
backend: target,
|
|
21555
21565
|
graphId: merged.id,
|
|
21556
21566
|
registry: identityRegistry,
|
|
@@ -21646,7 +21656,7 @@ async function prepareVerifiedStore(graph, backend, options) {
|
|
|
21646
21656
|
graph: merged,
|
|
21647
21657
|
activeRow,
|
|
21648
21658
|
result
|
|
21649
|
-
} = await
|
|
21659
|
+
} = await chunk65E3XWGF_cjs.loadAndVerifyGraph(backend, graph);
|
|
21650
21660
|
await assertHistorySchemaOnOpen(backend, merged, options);
|
|
21651
21661
|
return {
|
|
21652
21662
|
graph: merged,
|
|
@@ -21704,5 +21714,5 @@ exports.min = min;
|
|
|
21704
21714
|
exports.offsetFragment = offsetFragment;
|
|
21705
21715
|
exports.orderByFragment = orderByFragment;
|
|
21706
21716
|
exports.sum = sum;
|
|
21707
|
-
//# sourceMappingURL=chunk-
|
|
21708
|
-
//# sourceMappingURL=chunk-
|
|
21717
|
+
//# sourceMappingURL=chunk-PNTCATDE.cjs.map
|
|
21718
|
+
//# sourceMappingURL=chunk-PNTCATDE.cjs.map
|