@nicia-ai/typegraph 0.47.0 → 0.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backend/drizzle/indexes.d.cts +1 -1
- package/dist/backend/drizzle/indexes.d.ts +1 -1
- package/dist/backend/index.cjs +27 -19
- package/dist/backend/index.d.cts +37 -55
- package/dist/backend/index.d.ts +37 -55
- package/dist/backend/index.js +4 -4
- package/dist/backend/postgres/index.cjs +7 -7
- package/dist/backend/postgres/index.d.cts +21 -7
- package/dist/backend/postgres/index.d.ts +21 -7
- package/dist/backend/postgres/index.js +6 -6
- package/dist/backend/postgres/pglite-store.cjs +17 -17
- package/dist/backend/postgres/pglite-store.d.cts +8 -8
- package/dist/backend/postgres/pglite-store.d.ts +8 -8
- package/dist/backend/postgres/pglite-store.js +14 -14
- package/dist/backend/postgres/pglite.cjs +8 -8
- package/dist/backend/postgres/pglite.d.cts +3 -3
- package/dist/backend/postgres/pglite.d.ts +3 -3
- package/dist/backend/postgres/pglite.js +7 -7
- package/dist/backend/sqlite/index.cjs +7 -7
- package/dist/backend/sqlite/index.d.cts +20 -7
- package/dist/backend/sqlite/index.d.ts +20 -7
- package/dist/backend/sqlite/index.js +6 -6
- package/dist/backend/sqlite/libsql.cjs +8 -8
- package/dist/backend/sqlite/libsql.d.cts +3 -3
- package/dist/backend/sqlite/libsql.d.ts +3 -3
- package/dist/backend/sqlite/libsql.js +6 -6
- package/dist/backend/sqlite/local-store.cjs +18 -18
- package/dist/backend/sqlite/local-store.d.cts +8 -8
- package/dist/backend/sqlite/local-store.d.ts +8 -8
- package/dist/backend/sqlite/local-store.js +15 -15
- package/dist/backend/sqlite/local.cjs +9 -9
- package/dist/backend/sqlite/local.d.cts +3 -3
- package/dist/backend/sqlite/local.d.ts +3 -3
- package/dist/backend/sqlite/local.js +7 -7
- package/dist/{chunk-5FBRVORR.cjs → chunk-2O4PCIZ6.cjs} +8 -7
- package/dist/chunk-2O4PCIZ6.cjs.map +1 -0
- package/dist/{chunk-6KFLYYOC.cjs → chunk-2QGYQBS2.cjs} +5 -5
- package/dist/{chunk-6KFLYYOC.cjs.map → chunk-2QGYQBS2.cjs.map} +1 -1
- package/dist/{chunk-XYBQI6LE.js → chunk-2TYSSBU5.js} +6 -6
- package/dist/{chunk-XYBQI6LE.js.map → chunk-2TYSSBU5.js.map} +1 -1
- package/dist/{chunk-6JVZSOHQ.cjs → chunk-3FPR224C.cjs} +26 -26
- package/dist/{chunk-6JVZSOHQ.cjs.map → chunk-3FPR224C.cjs.map} +1 -1
- package/dist/{chunk-U5EDAVOJ.cjs → chunk-3G5W2U2L.cjs} +82 -51
- package/dist/chunk-3G5W2U2L.cjs.map +1 -0
- package/dist/{chunk-MFZR4QKM.cjs → chunk-3KOY4FH3.cjs} +181 -4
- package/dist/chunk-3KOY4FH3.cjs.map +1 -0
- package/dist/{chunk-UPAJHMW3.cjs → chunk-3QNZ5SAJ.cjs} +55 -58
- package/dist/chunk-3QNZ5SAJ.cjs.map +1 -0
- package/dist/{chunk-NG2RB5WL.js → chunk-5K2BKEBD.js} +18 -3
- package/dist/chunk-5K2BKEBD.js.map +1 -0
- package/dist/chunk-5PRKMB24.cjs +124 -0
- package/dist/chunk-5PRKMB24.cjs.map +1 -0
- package/dist/chunk-6LN7FIVU.js +107 -0
- package/dist/chunk-6LN7FIVU.js.map +1 -0
- package/dist/{chunk-M35DF33T.js → chunk-7LZJNLA5.js} +29 -16
- package/dist/chunk-7LZJNLA5.js.map +1 -0
- package/dist/{chunk-I4G3SQPF.cjs → chunk-7UOLHNWC.cjs} +7 -7
- package/dist/chunk-7UOLHNWC.cjs.map +1 -0
- package/dist/{chunk-DJZTXBWY.js → chunk-BRRP76WO.js} +71 -30
- package/dist/chunk-BRRP76WO.js.map +1 -0
- package/dist/{chunk-5FT3TLPK.js → chunk-D4QLTJSM.js} +16 -13
- package/dist/chunk-D4QLTJSM.js.map +1 -0
- package/dist/{chunk-XY5OMOJD.js → chunk-DZAICA5J.js} +3 -3
- package/dist/{chunk-XY5OMOJD.js.map → chunk-DZAICA5J.js.map} +1 -1
- package/dist/{chunk-OIFSOPSR.cjs → chunk-EZEEWCFJ.cjs} +38 -156
- package/dist/chunk-EZEEWCFJ.cjs.map +1 -0
- package/dist/{chunk-AMMWA76F.cjs → chunk-FA2AFWLP.cjs} +6 -6
- package/dist/{chunk-AMMWA76F.cjs.map → chunk-FA2AFWLP.cjs.map} +1 -1
- package/dist/{chunk-FNOMT74T.js → chunk-I4GAZH5Z.js} +180 -5
- package/dist/chunk-I4GAZH5Z.js.map +1 -0
- package/dist/{chunk-WGX7JH7E.cjs → chunk-JB6T4GLL.cjs} +106 -134
- package/dist/chunk-JB6T4GLL.cjs.map +1 -0
- package/dist/{chunk-MX4DHSQP.cjs → chunk-JFRT7S3B.cjs} +92 -98
- package/dist/chunk-JFRT7S3B.cjs.map +1 -0
- package/dist/{chunk-5UMTUOM5.js → chunk-JPD2CTC3.js} +5 -4
- package/dist/chunk-JPD2CTC3.js.map +1 -0
- package/dist/{chunk-SE6EGQSD.js → chunk-KF6K7TGH.js} +38 -66
- package/dist/chunk-KF6K7TGH.js.map +1 -0
- package/dist/{chunk-QS3NQZVC.js → chunk-LTXQOEIC.js} +44 -14
- package/dist/chunk-LTXQOEIC.js.map +1 -0
- package/dist/{chunk-ZHNXLS3C.js → chunk-NACVVDWB.js} +208 -8
- package/dist/chunk-NACVVDWB.js.map +1 -0
- package/dist/{chunk-AVGUJWVX.js → chunk-S5TERQVW.js} +15 -132
- package/dist/chunk-S5TERQVW.js.map +1 -0
- package/dist/chunk-SIT26LAZ.cjs +614 -0
- package/dist/chunk-SIT26LAZ.cjs.map +1 -0
- package/dist/{chunk-BR7SHKGM.cjs → chunk-SR725PWF.cjs} +548 -507
- package/dist/chunk-SR725PWF.cjs.map +1 -0
- package/dist/{chunk-425IZOQ5.cjs → chunk-TQHGE7UC.cjs} +20 -2
- package/dist/chunk-TQHGE7UC.cjs.map +1 -0
- package/dist/{chunk-GYUJZARH.cjs → chunk-TUNPBZY3.cjs} +4 -4
- package/dist/{chunk-GYUJZARH.cjs.map → chunk-TUNPBZY3.cjs.map} +1 -1
- package/dist/chunk-UGHG7PGX.js +592 -0
- package/dist/chunk-UGHG7PGX.js.map +1 -0
- package/dist/{chunk-BCQ76AXA.cjs → chunk-UGHQV7MP.cjs} +107 -94
- package/dist/chunk-UGHQV7MP.cjs.map +1 -0
- package/dist/{chunk-KABFHAL7.cjs → chunk-UMGZDVOA.cjs} +213 -12
- package/dist/chunk-UMGZDVOA.cjs.map +1 -0
- package/dist/{chunk-6FWSNSRE.js → chunk-WIC7DRXW.js} +4 -4
- package/dist/chunk-WIC7DRXW.js.map +1 -0
- package/dist/{chunk-LEWHMOUY.js → chunk-YIURNGXI.js} +4 -4
- package/dist/{chunk-LEWHMOUY.js.map → chunk-YIURNGXI.js.map} +1 -1
- package/dist/{chunk-EP4RUYD6.js → chunk-YVF2EM7B.js} +3 -3
- package/dist/{chunk-EP4RUYD6.js.map → chunk-YVF2EM7B.js.map} +1 -1
- package/dist/{chunk-EMIB2RXD.cjs → chunk-YYUHLYM2.cjs} +99 -96
- package/dist/chunk-YYUHLYM2.cjs.map +1 -0
- package/dist/{chunk-KH7XW7VV.js → chunk-Z2JCLZFJ.js} +25 -28
- package/dist/chunk-Z2JCLZFJ.js.map +1 -0
- package/dist/{chunk-NNQ6A3RM.js → chunk-ZFMCDJGB.js} +7 -12
- package/dist/chunk-ZFMCDJGB.js.map +1 -0
- package/dist/core/index.cjs +6 -6
- package/dist/core/index.d.cts +4 -4
- package/dist/core/index.d.ts +4 -4
- package/dist/core/index.js +2 -2
- package/dist/ddl-BL1NZLMY.d.cts +78 -0
- package/dist/ddl-D_oW-EVO.d.ts +78 -0
- package/dist/graph-extension/index.d.cts +4 -4
- package/dist/graph-extension/index.d.ts +4 -4
- package/dist/graph-merge/index.cjs +357 -191
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +68 -15
- package/dist/graph-merge/index.d.ts +68 -15
- package/dist/graph-merge/index.js +197 -32
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/{index-CHTv4XMZ.d.cts → index-COs_z6nV.d.cts} +2 -2
- package/dist/{index-CzoJ3MUw.d.ts → index-D7d1u2gr.d.ts} +2 -2
- package/dist/index.cjs +90 -86
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -12
- package/dist/index.d.ts +12 -12
- package/dist/index.js +13 -13
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.d.cts +4 -4
- package/dist/indexes/index.d.ts +4 -4
- package/dist/ingestion-import-target-XPxZYw89.d.cts +17 -0
- package/dist/ingestion-import-target-dNeL7iAv.d.ts +17 -0
- package/dist/interchange/index.cjs +38 -38
- package/dist/interchange/index.d.cts +15 -12
- package/dist/interchange/index.d.ts +15 -12
- package/dist/interchange/index.js +10 -10
- package/dist/{manager-DlY1vlla.d.cts → manager-CYaff3n3.d.cts} +2 -2
- package/dist/{manager-B6sOQzcQ.d.ts → manager-D9eRT_ns.d.ts} +2 -2
- package/dist/{materialize-indexes-DQL4xcpf.d.ts → materialize-indexes-DJ3ykH59.d.ts} +1 -1
- package/dist/{materialize-indexes-sskhp-c_.d.cts → materialize-indexes-DTtAnvfY.d.cts} +1 -1
- package/dist/{postgres-BXy_nyMs.d.cts → postgres-CcL4bAHS.d.ts} +1 -1
- package/dist/{postgres-B6YOUcaK.d.ts → postgres-DMj39MEu.d.cts} +1 -1
- package/dist/profiler/index.d.cts +9 -9
- package/dist/profiler/index.d.ts +9 -9
- package/dist/provenance/index.cjs +25 -26
- package/dist/provenance/index.cjs.map +1 -1
- package/dist/provenance/index.d.cts +7 -7
- package/dist/provenance/index.d.ts +7 -7
- package/dist/provenance/index.js +9 -10
- package/dist/provenance/index.js.map +1 -1
- package/dist/repair-validity-windows-BFNZvd_H.d.cts +166 -0
- package/dist/repair-validity-windows-DlUSqwCg.d.ts +166 -0
- package/dist/schema/index.cjs +35 -35
- package/dist/schema/index.d.cts +6 -6
- package/dist/schema/index.d.ts +6 -6
- package/dist/schema/index.js +8 -8
- package/dist/{searchable-D9gMiwcS.d.ts → searchable-DHJMh_nj.d.cts} +1 -1
- package/dist/{searchable-0Cn_lY8U.d.cts → searchable-bpE1bBfc.d.ts} +1 -1
- package/dist/{sqlite-DioSxaPe.d.cts → sqlite-D7Oz0SQh.d.ts} +1 -1
- package/dist/{sqlite-ClXuBYAj.d.ts → sqlite-YppHrNFb.d.cts} +1 -1
- package/dist/{store-5j-w5onJ.d.ts → store-DRrFCx5x.d.ts} +122 -27
- package/dist/{store-CFedKGU5.d.cts → store-bphCSo7z.d.cts} +122 -27
- package/dist/{temporal-CjO9FH1l.d.ts → temporal-5GqpYCk2.d.cts} +1 -1
- package/dist/{temporal-Ce1pG0S1.d.cts → temporal-CbnLzTmM.d.ts} +1 -1
- package/dist/{types-DKkMJZjR.d.cts → types-BqFZTQmV.d.cts} +29 -4
- package/dist/{types-DKkMJZjR.d.ts → types-BqFZTQmV.d.ts} +29 -4
- package/dist/{types-BrdOFu48.d.ts → types-Bx74kaTt.d.ts} +1 -1
- package/dist/{types-oj_OGAaZ.d.cts → types-CXAhpW-c.d.cts} +1 -1
- package/dist/{where-D1wKCJ4Q.d.cts → where-DI_Fqz-X.d.cts} +1 -1
- package/dist/{where-C8w2627G.d.ts → where-O-k2wgYm.d.ts} +1 -1
- package/package.json +2 -3
- package/dist/chunk-3HGRTCDU.cjs +0 -269
- package/dist/chunk-3HGRTCDU.cjs.map +0 -1
- package/dist/chunk-425IZOQ5.cjs.map +0 -1
- package/dist/chunk-5FBRVORR.cjs.map +0 -1
- package/dist/chunk-5FT3TLPK.js.map +0 -1
- package/dist/chunk-5UMTUOM5.js.map +0 -1
- package/dist/chunk-6FWSNSRE.js.map +0 -1
- package/dist/chunk-AVGUJWVX.js.map +0 -1
- package/dist/chunk-BCQ76AXA.cjs.map +0 -1
- package/dist/chunk-BR7SHKGM.cjs.map +0 -1
- package/dist/chunk-DJZTXBWY.js.map +0 -1
- package/dist/chunk-EMIB2RXD.cjs.map +0 -1
- package/dist/chunk-FNOMT74T.js.map +0 -1
- package/dist/chunk-I4G3SQPF.cjs.map +0 -1
- package/dist/chunk-JR6SX5RH.cjs +0 -268
- package/dist/chunk-JR6SX5RH.cjs.map +0 -1
- package/dist/chunk-KABFHAL7.cjs.map +0 -1
- package/dist/chunk-KH7XW7VV.js.map +0 -1
- package/dist/chunk-M35DF33T.js.map +0 -1
- package/dist/chunk-MFZR4QKM.cjs.map +0 -1
- package/dist/chunk-MX4DHSQP.cjs.map +0 -1
- package/dist/chunk-NAZ2RA4L.js +0 -254
- package/dist/chunk-NAZ2RA4L.js.map +0 -1
- package/dist/chunk-NG2RB5WL.js.map +0 -1
- package/dist/chunk-NNQ6A3RM.js.map +0 -1
- package/dist/chunk-OIFSOPSR.cjs.map +0 -1
- package/dist/chunk-QS3NQZVC.js.map +0 -1
- package/dist/chunk-SE6EGQSD.js.map +0 -1
- package/dist/chunk-SHSSRCFR.js +0 -246
- package/dist/chunk-SHSSRCFR.js.map +0 -1
- package/dist/chunk-U5EDAVOJ.cjs.map +0 -1
- package/dist/chunk-UPAJHMW3.cjs.map +0 -1
- package/dist/chunk-WGX7JH7E.cjs.map +0 -1
- package/dist/chunk-ZHNXLS3C.js.map +0 -1
- package/dist/ddl-CprnMXJ-.d.ts +0 -38
- package/dist/ddl-DJA7Lci5.d.cts +0 -38
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkSIT26LAZ_cjs = require('./chunk-SIT26LAZ.cjs');
|
|
4
4
|
var chunk3U5ABFDW_cjs = require('./chunk-3U5ABFDW.cjs');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
5
|
+
var chunk5PRKMB24_cjs = require('./chunk-5PRKMB24.cjs');
|
|
6
|
+
var chunk2QGYQBS2_cjs = require('./chunk-2QGYQBS2.cjs');
|
|
7
|
+
var chunkTQHGE7UC_cjs = require('./chunk-TQHGE7UC.cjs');
|
|
8
8
|
var chunkEDN4Y4ZG_cjs = require('./chunk-EDN4Y4ZG.cjs');
|
|
9
9
|
var chunkRT5ZY4XA_cjs = require('./chunk-RT5ZY4XA.cjs');
|
|
10
10
|
var chunkMRDBBHIZ_cjs = require('./chunk-MRDBBHIZ.cjs');
|
|
@@ -16,7 +16,7 @@ var nanoid = require('nanoid');
|
|
|
16
16
|
var pinnedReadInstant;
|
|
17
17
|
function withPinnedReadInstant(emit) {
|
|
18
18
|
if (pinnedReadInstant !== void 0) return emit();
|
|
19
|
-
pinnedReadInstant =
|
|
19
|
+
pinnedReadInstant = chunkTQHGE7UC_cjs.nowIso();
|
|
20
20
|
try {
|
|
21
21
|
return emit();
|
|
22
22
|
} finally {
|
|
@@ -24,7 +24,7 @@ function withPinnedReadInstant(emit) {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
function currentReadInstant() {
|
|
27
|
-
return chunkEDN4Y4ZG_cjs.sql`${pinnedReadInstant ??
|
|
27
|
+
return chunkEDN4Y4ZG_cjs.sql`${pinnedReadInstant ?? chunkTQHGE7UC_cjs.nowIso()}`;
|
|
28
28
|
}
|
|
29
29
|
var CURRENT_READ_INSTANT_PLACEHOLDER = "__typegraph_current_read_instant__";
|
|
30
30
|
function currentReadInstantPlaceholder() {
|
|
@@ -35,7 +35,7 @@ function currentReadInstantFor(mode) {
|
|
|
35
35
|
}
|
|
36
36
|
function compileTemporalFilter(options) {
|
|
37
37
|
const { mode, asOf, tableAlias, currentTimestamp, recordedAsOf } = options;
|
|
38
|
-
const recorded =
|
|
38
|
+
const recorded = chunk2QGYQBS2_cjs.optionalRecordedInstantParts(recordedAsOf, "recordedAsOf");
|
|
39
39
|
const prefix = tableAlias ? chunkEDN4Y4ZG_cjs.sql.raw(`${tableAlias}.`) : chunkEDN4Y4ZG_cjs.sql.raw("");
|
|
40
40
|
const deletedAt = chunkEDN4Y4ZG_cjs.sql`${prefix}deleted_at`;
|
|
41
41
|
const validFrom = chunkEDN4Y4ZG_cjs.sql`${prefix}valid_from`;
|
|
@@ -928,13 +928,13 @@ function failInvalidClock(value, cause) {
|
|
|
928
928
|
}
|
|
929
929
|
function recordedClockRevision(value) {
|
|
930
930
|
const revision = typeof value === "bigint" ? Number(value) : typeof value === "string" && /^\d+$/.test(value) ? Number(value) : value;
|
|
931
|
-
if (typeof revision !== "number" || !Number.isSafeInteger(revision) || revision < RECORDED_MIN_REVISION || revision >=
|
|
931
|
+
if (typeof revision !== "number" || !Number.isSafeInteger(revision) || revision < RECORDED_MIN_REVISION || revision >= chunk2QGYQBS2_cjs.RECORDED_MAX_REVISION) {
|
|
932
932
|
return failInvalidClock(value);
|
|
933
933
|
}
|
|
934
934
|
return revision;
|
|
935
935
|
}
|
|
936
936
|
function recordedClockWallTime(value) {
|
|
937
|
-
return
|
|
937
|
+
return chunkTQHGE7UC_cjs.canonicalizeDatabaseTimestamp(value) ?? failInvalidClock(value);
|
|
938
938
|
}
|
|
939
939
|
function recordedClockParts(row) {
|
|
940
940
|
const revision = recordedClockRevision(row.revision);
|
|
@@ -942,7 +942,7 @@ function recordedClockParts(row) {
|
|
|
942
942
|
return { revision, recordedAt: recordedClockWallTime(row.recorded_at) };
|
|
943
943
|
}
|
|
944
944
|
function nextRecordedCommitParts(previous) {
|
|
945
|
-
const wallTime =
|
|
945
|
+
const wallTime = chunkTQHGE7UC_cjs.nowIso();
|
|
946
946
|
if (previous === void 0) {
|
|
947
947
|
return { revision: 1, recordedAt: wallTime };
|
|
948
948
|
}
|
|
@@ -960,7 +960,7 @@ function nonDecreasingWallTime(current, previous) {
|
|
|
960
960
|
}
|
|
961
961
|
async function readRecordedClock(target, schema, graphId) {
|
|
962
962
|
const parts = await readRecordedClockParts(target, schema, graphId);
|
|
963
|
-
return parts === void 0 ? void 0 :
|
|
963
|
+
return parts === void 0 ? void 0 : chunk2QGYQBS2_cjs.createRecordedInstant(parts.revision, parts.recordedAt);
|
|
964
964
|
}
|
|
965
965
|
async function readRecordedClockParts(target, schema, graphId) {
|
|
966
966
|
const rows = await target.execute(
|
|
@@ -1070,18 +1070,18 @@ async function lockRecordedClock(target, schema, graphId, ownsWriteLock) {
|
|
|
1070
1070
|
}
|
|
1071
1071
|
async function allocateRecordedCommit(target, schema, graphId, ownsWriteLock, previousRevision) {
|
|
1072
1072
|
await lockRecordedClock(target, schema, graphId, ownsWriteLock);
|
|
1073
|
-
const previous = previousRevision === void 0 ? await readRecordedClockParts(target, schema, graphId) :
|
|
1073
|
+
const previous = previousRevision === void 0 ? await readRecordedClockParts(target, schema, graphId) : chunk2QGYQBS2_cjs.parseRecordedInstant(previousRevision, "previous recorded revision");
|
|
1074
1074
|
const { revision, recordedAt } = nextRecordedCommitParts(previous);
|
|
1075
|
-
if (revision >=
|
|
1075
|
+
if (revision >= chunk2QGYQBS2_cjs.RECORDED_MAX_REVISION) {
|
|
1076
1076
|
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
1077
|
-
`Recorded commit clock reached the open revision sentinel ${
|
|
1077
|
+
`Recorded commit clock reached the open revision sentinel ${chunk2QGYQBS2_cjs.RECORDED_MAX_REVISION}`,
|
|
1078
1078
|
{ graphId, revision },
|
|
1079
1079
|
{
|
|
1080
1080
|
suggestion: "Start a new graph before exhausting the per-graph recorded revision space."
|
|
1081
1081
|
}
|
|
1082
1082
|
);
|
|
1083
1083
|
}
|
|
1084
|
-
const instant =
|
|
1084
|
+
const instant = chunk2QGYQBS2_cjs.createRecordedInstant(revision, recordedAt);
|
|
1085
1085
|
await writeRecordedClock(target, schema, graphId, { revision, recordedAt });
|
|
1086
1086
|
if (previousRevision !== void 0) {
|
|
1087
1087
|
await assertRecordedClockAdvanced(target, schema, graphId, revision);
|
|
@@ -1099,128 +1099,6 @@ async function advanceRevisionClock(target, schema, graphId, ownsWriteLock, prev
|
|
|
1099
1099
|
return commit.instant;
|
|
1100
1100
|
}
|
|
1101
1101
|
|
|
1102
|
-
// src/backend/graph-backend-projection.ts
|
|
1103
|
-
var GRAPH_BACKEND_PROJECTION_KEYS = [
|
|
1104
|
-
"dialect",
|
|
1105
|
-
"capabilities",
|
|
1106
|
-
"tableNames",
|
|
1107
|
-
"fulltextStrategy",
|
|
1108
|
-
"vectorStrategy",
|
|
1109
|
-
"insertNode",
|
|
1110
|
-
"insertNodeNoReturn",
|
|
1111
|
-
"insertNodesBatch",
|
|
1112
|
-
"insertNodesBatchReturning",
|
|
1113
|
-
"updateNode",
|
|
1114
|
-
"updateNodeSet",
|
|
1115
|
-
"deleteNode",
|
|
1116
|
-
"hardDeleteNode",
|
|
1117
|
-
"getNode",
|
|
1118
|
-
"getNodes",
|
|
1119
|
-
"insertEdge",
|
|
1120
|
-
"insertEdgeNoReturn",
|
|
1121
|
-
"insertEdgesBatch",
|
|
1122
|
-
"insertEdgesBatchReturning",
|
|
1123
|
-
"updateEdge",
|
|
1124
|
-
"deleteEdge",
|
|
1125
|
-
"hardDeleteEdge",
|
|
1126
|
-
"deleteEdgesBatch",
|
|
1127
|
-
"hardDeleteEdgesBatch",
|
|
1128
|
-
"getEdge",
|
|
1129
|
-
"getEdges",
|
|
1130
|
-
"countEdgesFrom",
|
|
1131
|
-
"edgeExistsBetween",
|
|
1132
|
-
"findEdgesConnectedTo",
|
|
1133
|
-
"findNodesByKind",
|
|
1134
|
-
"countNodesByKind",
|
|
1135
|
-
"findEdgesByKind",
|
|
1136
|
-
"findEdgesByEndpointSet",
|
|
1137
|
-
"findEdgesByHeterogeneousEndpointSet",
|
|
1138
|
-
"countEdgesByKind",
|
|
1139
|
-
"insertUnique",
|
|
1140
|
-
"insertUniqueBatch",
|
|
1141
|
-
"deleteUnique",
|
|
1142
|
-
"hardDeleteUniquesByNodeIds",
|
|
1143
|
-
"checkUnique",
|
|
1144
|
-
"checkUniqueBatch",
|
|
1145
|
-
"getActiveSchema",
|
|
1146
|
-
"getSchemaVersion",
|
|
1147
|
-
"commitSchemaVersion",
|
|
1148
|
-
"commitSchemaVersionIfKindsEmpty",
|
|
1149
|
-
"lockSchemaVersionForWrite",
|
|
1150
|
-
"commitSchemaVersionWithPreflight",
|
|
1151
|
-
"setActiveVersion",
|
|
1152
|
-
"schemaWriteTransaction",
|
|
1153
|
-
"upsertEmbedding",
|
|
1154
|
-
"upsertEmbeddingBatch",
|
|
1155
|
-
"deleteEmbedding",
|
|
1156
|
-
"deleteEmbeddingBatch",
|
|
1157
|
-
"vectorSearch",
|
|
1158
|
-
"createVectorIndex",
|
|
1159
|
-
"dropVectorIndex",
|
|
1160
|
-
"hybridSearch",
|
|
1161
|
-
"upsertFulltext",
|
|
1162
|
-
"deleteFulltext",
|
|
1163
|
-
"upsertFulltextBatch",
|
|
1164
|
-
"deleteFulltextBatch",
|
|
1165
|
-
"fulltextSearch",
|
|
1166
|
-
"ensureIndexMaterializationsTable",
|
|
1167
|
-
"ensureTrigramExtension",
|
|
1168
|
-
"ensureRevisionOriginsTable",
|
|
1169
|
-
"getIndexMaterialization",
|
|
1170
|
-
"getIndexMaterializations",
|
|
1171
|
-
"recordIndexMaterialization",
|
|
1172
|
-
"claimIndexMaterialization",
|
|
1173
|
-
"releaseIndexMaterializationClaim",
|
|
1174
|
-
"ensureContributionMaterializationsTable",
|
|
1175
|
-
"getContributionMaterialization",
|
|
1176
|
-
"recordContributionMaterialization",
|
|
1177
|
-
"assertRuntimeContributionsInitialized",
|
|
1178
|
-
"ensureKindRemovalsTable",
|
|
1179
|
-
"getPendingKindRemovals",
|
|
1180
|
-
"getAllKindRemovals",
|
|
1181
|
-
"recordKindRemoval",
|
|
1182
|
-
"ensureReconciliationMarkersTable",
|
|
1183
|
-
"ensureRuntimeContributions",
|
|
1184
|
-
"ensureVectorSlotContribution",
|
|
1185
|
-
"ensureVectorSlotContributions",
|
|
1186
|
-
"assertVectorSlotInitialized",
|
|
1187
|
-
"assertVectorSlotsInitialized",
|
|
1188
|
-
"deleteVectorSlotContribution",
|
|
1189
|
-
"verifyContributions",
|
|
1190
|
-
"repairContributions",
|
|
1191
|
-
"probeContributions",
|
|
1192
|
-
"rebuildContribution",
|
|
1193
|
-
"ensureFulltextTable",
|
|
1194
|
-
"ensureIdentityTables",
|
|
1195
|
-
"identityTableDdl",
|
|
1196
|
-
"getReconciliationMarker",
|
|
1197
|
-
"setReconciliationMarker",
|
|
1198
|
-
"clearGraph",
|
|
1199
|
-
"bootstrapTables",
|
|
1200
|
-
"refreshStatistics",
|
|
1201
|
-
"trustedImport",
|
|
1202
|
-
"execute",
|
|
1203
|
-
"executeStatement",
|
|
1204
|
-
"executeTemporaryStatement",
|
|
1205
|
-
"executeRaw",
|
|
1206
|
-
"compileSql",
|
|
1207
|
-
"executeDdl",
|
|
1208
|
-
"transaction",
|
|
1209
|
-
"close"
|
|
1210
|
-
];
|
|
1211
|
-
function projectBackendMembers(backend, keys) {
|
|
1212
|
-
const entries = keys.flatMap((key) => {
|
|
1213
|
-
if (!Reflect.has(backend, key)) return [];
|
|
1214
|
-
return [[key, Reflect.get(backend, key)]];
|
|
1215
|
-
});
|
|
1216
|
-
const projection = Object.fromEntries(entries);
|
|
1217
|
-
chunk3HGRTCDU_cjs.inheritSerializedTransactionResource(projection, backend);
|
|
1218
|
-
return projection;
|
|
1219
|
-
}
|
|
1220
|
-
function createGraphBackendProjection(backend) {
|
|
1221
|
-
return projectBackendMembers(backend, GRAPH_BACKEND_PROJECTION_KEYS);
|
|
1222
|
-
}
|
|
1223
|
-
|
|
1224
1102
|
// src/store/insert-dispatch.ts
|
|
1225
1103
|
function nodeInsertDispatch(backend) {
|
|
1226
1104
|
return {
|
|
@@ -1290,7 +1168,7 @@ function identitySqlCoordinate(coordinate, currentInstant) {
|
|
|
1290
1168
|
return {
|
|
1291
1169
|
validMode: coordinate?.valid.mode ?? "current",
|
|
1292
1170
|
validAsOf: coordinate?.valid.asOf,
|
|
1293
|
-
recorded:
|
|
1171
|
+
recorded: chunk2QGYQBS2_cjs.optionalRecordedInstantParts(
|
|
1294
1172
|
coordinate?.recorded?.asOf,
|
|
1295
1173
|
"recorded.asOf"
|
|
1296
1174
|
),
|
|
@@ -2267,14 +2145,14 @@ function recordedCommonCells() {
|
|
|
2267
2145
|
graph_id: (row) => chunkEDN4Y4ZG_cjs.sql`${row.graph_id}`,
|
|
2268
2146
|
id: (row) => chunkEDN4Y4ZG_cjs.sql`${row.id}`,
|
|
2269
2147
|
kind: (row) => chunkEDN4Y4ZG_cjs.sql`${row.kind}`,
|
|
2270
|
-
props: (row) => chunkEDN4Y4ZG_cjs.sql`${
|
|
2148
|
+
props: (row) => chunkEDN4Y4ZG_cjs.sql`${chunk5PRKMB24_cjs.rowPropsToJsonText(row.props)}`,
|
|
2271
2149
|
valid_from: (row) => chunkEDN4Y4ZG_cjs.sql`${sqlNull(row.valid_from)}`,
|
|
2272
2150
|
valid_to: (row) => chunkEDN4Y4ZG_cjs.sql`${sqlNull(row.valid_to)}`,
|
|
2273
2151
|
created_at: (row) => chunkEDN4Y4ZG_cjs.sql`${row.created_at}`,
|
|
2274
2152
|
updated_at: (row) => chunkEDN4Y4ZG_cjs.sql`${row.updated_at}`,
|
|
2275
2153
|
deleted_at: (row) => chunkEDN4Y4ZG_cjs.sql`${sqlNull(row.deleted_at)}`,
|
|
2276
2154
|
recorded_from: (_row, recordedRevision) => chunkEDN4Y4ZG_cjs.sql`${recordedRevision}`,
|
|
2277
|
-
recorded_to: () => chunkEDN4Y4ZG_cjs.sql`${
|
|
2155
|
+
recorded_to: () => chunkEDN4Y4ZG_cjs.sql`${chunk2QGYQBS2_cjs.RECORDED_MAX_REVISION}`,
|
|
2278
2156
|
op: (_row, _recordedCommit, operation) => chunkEDN4Y4ZG_cjs.sql`${operation}`,
|
|
2279
2157
|
schema_version: () => chunkEDN4Y4ZG_cjs.sql`NULL`,
|
|
2280
2158
|
tx_id: () => chunkEDN4Y4ZG_cjs.sql`NULL`,
|
|
@@ -2309,7 +2187,7 @@ var recordedIdentityAssertionCells = {
|
|
|
2309
2187
|
ended_by_kind: (row) => chunkEDN4Y4ZG_cjs.sql`${row.ended_by_kind ?? chunkEDN4Y4ZG_cjs.sql.raw("NULL")}`,
|
|
2310
2188
|
ended_by_id: (row) => chunkEDN4Y4ZG_cjs.sql`${row.ended_by_id ?? chunkEDN4Y4ZG_cjs.sql.raw("NULL")}`,
|
|
2311
2189
|
recorded_from: (_row, recordedRevision) => chunkEDN4Y4ZG_cjs.sql`${recordedRevision}`,
|
|
2312
|
-
recorded_to: () => chunkEDN4Y4ZG_cjs.sql`${
|
|
2190
|
+
recorded_to: () => chunkEDN4Y4ZG_cjs.sql`${chunk2QGYQBS2_cjs.RECORDED_MAX_REVISION}`,
|
|
2313
2191
|
op: (_row, _recordedRevision, operation) => chunkEDN4Y4ZG_cjs.sql`${operation}`
|
|
2314
2192
|
};
|
|
2315
2193
|
function recordedValuesTuple(columns, cells, row, recordedRevision, operation) {
|
|
@@ -2402,7 +2280,7 @@ async function closeOpenReturning(target, table, graphId, ids, recordedRevision,
|
|
|
2402
2280
|
SET recorded_to = ${recordedRevision}
|
|
2403
2281
|
WHERE graph_id = ${graphId}
|
|
2404
2282
|
${kindFilter}
|
|
2405
|
-
AND recorded_to = ${
|
|
2283
|
+
AND recorded_to = ${chunk2QGYQBS2_cjs.RECORDED_MAX_REVISION}
|
|
2406
2284
|
AND id IN (${sqlValueList(ids)})
|
|
2407
2285
|
RETURNING id, deleted_at
|
|
2408
2286
|
`)
|
|
@@ -2447,7 +2325,7 @@ function recordedInsertsFor(afterById, closed) {
|
|
|
2447
2325
|
async function flushNodes(target, schema, graphId, entities, recordedRevision) {
|
|
2448
2326
|
const chunkSize = recordedNodeChunkSize(target);
|
|
2449
2327
|
for (const [kind, group] of groupNodesByKind(entities)) {
|
|
2450
|
-
for (const entityChunk of
|
|
2328
|
+
for (const entityChunk of chunkSIT26LAZ_cjs.chunk(group, chunkSize)) {
|
|
2451
2329
|
const ids = entityChunk.map((entity) => entity.id);
|
|
2452
2330
|
const closed = await closeOpenReturning(
|
|
2453
2331
|
target,
|
|
@@ -2472,7 +2350,7 @@ async function flushNodes(target, schema, graphId, entities, recordedRevision) {
|
|
|
2472
2350
|
}
|
|
2473
2351
|
async function flushEdges(target, schema, graphId, entities, recordedRevision) {
|
|
2474
2352
|
const chunkSize = recordedEdgeChunkSize(target);
|
|
2475
|
-
for (const entityChunk of
|
|
2353
|
+
for (const entityChunk of chunkSIT26LAZ_cjs.chunk(entities, chunkSize)) {
|
|
2476
2354
|
const ids = entityChunk.map((entity) => entity.id);
|
|
2477
2355
|
const closed = await closeOpenReturning(
|
|
2478
2356
|
target,
|
|
@@ -2508,7 +2386,7 @@ async function getIdentityAssertionRowsByIds(target, schema, graphId, ids) {
|
|
|
2508
2386
|
async function flushIdentityAssertions(target, schema, graphId, entities, recordedRevision) {
|
|
2509
2387
|
if (entities.length === 0) return;
|
|
2510
2388
|
const chunkSize = recordedIdentityAssertionChunkSize(target);
|
|
2511
|
-
for (const entityChunk of
|
|
2389
|
+
for (const entityChunk of chunkSIT26LAZ_cjs.chunk(entities, chunkSize)) {
|
|
2512
2390
|
const ids = entityChunk.map((entity) => entity.id);
|
|
2513
2391
|
const closed = await closeOpenReturning(
|
|
2514
2392
|
target,
|
|
@@ -2537,7 +2415,7 @@ async function closeOpenByKind(target, table, graphId, kind, recordedRevision) {
|
|
|
2537
2415
|
SET recorded_to = ${recordedRevision}
|
|
2538
2416
|
WHERE graph_id = ${graphId}
|
|
2539
2417
|
AND kind = ${kind}
|
|
2540
|
-
AND recorded_to = ${
|
|
2418
|
+
AND recorded_to = ${chunk2QGYQBS2_cjs.RECORDED_MAX_REVISION}
|
|
2541
2419
|
`
|
|
2542
2420
|
);
|
|
2543
2421
|
}
|
|
@@ -2549,7 +2427,7 @@ async function closeOpenEdgesByNodeKind(target, schema, graphId, nodeKind, recor
|
|
|
2549
2427
|
SET recorded_to = ${recordedRevision}
|
|
2550
2428
|
WHERE graph_id = ${graphId}
|
|
2551
2429
|
AND (from_kind = ${nodeKind} OR to_kind = ${nodeKind})
|
|
2552
|
-
AND recorded_to = ${
|
|
2430
|
+
AND recorded_to = ${chunk2QGYQBS2_cjs.RECORDED_MAX_REVISION}
|
|
2553
2431
|
`
|
|
2554
2432
|
);
|
|
2555
2433
|
}
|
|
@@ -2813,7 +2691,7 @@ function createRecordedCaptureSession() {
|
|
|
2813
2691
|
if (touched.size === 0 && forcedGraphRevisions.size === 0)
|
|
2814
2692
|
return /* @__PURE__ */ new Map();
|
|
2815
2693
|
const recordedByGraph = /* @__PURE__ */ new Map();
|
|
2816
|
-
const byGraph =
|
|
2694
|
+
const byGraph = chunkSIT26LAZ_cjs.groupBy(touched.values(), (entity) => entity.graphId);
|
|
2817
2695
|
for (const graphId of forcedGraphRevisions) {
|
|
2818
2696
|
if (!byGraph.has(graphId)) byGraph.set(graphId, []);
|
|
2819
2697
|
}
|
|
@@ -2898,7 +2776,7 @@ function createRecordedTransactionBackend(target, session, schema) {
|
|
|
2898
2776
|
await lockRecordedGraphWrite(target, graphId, graphLocks);
|
|
2899
2777
|
}
|
|
2900
2778
|
}
|
|
2901
|
-
const overlay =
|
|
2779
|
+
const overlay = chunkSIT26LAZ_cjs.deriveBackend(target, {
|
|
2902
2780
|
...rawWriteGuards(target, "tx.backend"),
|
|
2903
2781
|
async insertNode(params) {
|
|
2904
2782
|
session.assertOpen();
|
|
@@ -3078,7 +2956,7 @@ function createRecordedTransactionScope(target, schema, ownsWriteLock = false) {
|
|
|
3078
2956
|
return {
|
|
3079
2957
|
backend: createRecordedTransactionBackend(target, session, resolvedSchema),
|
|
3080
2958
|
async flush() {
|
|
3081
|
-
return
|
|
2959
|
+
return chunkSIT26LAZ_cjs.withRecordedRelationsPrecondition(
|
|
3082
2960
|
session.flush(target, resolvedSchema, ownsWriteLock),
|
|
3083
2961
|
{ dialect: target.dialect, surface: "capture-flush" }
|
|
3084
2962
|
);
|
|
@@ -3098,8 +2976,8 @@ async function runCapturedAutocommit(backend, schema, fn, options) {
|
|
|
3098
2976
|
function createRecordedBackend(backend, schema) {
|
|
3099
2977
|
assertCapturableBackend(backend);
|
|
3100
2978
|
const capture = (fn) => runCapturedAutocommit(backend, schema, fn);
|
|
3101
|
-
const projectedBackend =
|
|
3102
|
-
return
|
|
2979
|
+
const projectedBackend = chunkSIT26LAZ_cjs.projectGraphBackend(backend);
|
|
2980
|
+
return chunkSIT26LAZ_cjs.deriveBackend(projectedBackend, {
|
|
3103
2981
|
...rawWriteGuards(backend, "backend"),
|
|
3104
2982
|
async insertNode(params) {
|
|
3105
2983
|
return capture((target) => target.insertNode(params));
|
|
@@ -3234,6 +3112,11 @@ function compareCodePoints(left, right) {
|
|
|
3234
3112
|
return leftExhausted ? -1 : 1;
|
|
3235
3113
|
}
|
|
3236
3114
|
|
|
3115
|
+
// src/utils/tuple-key.ts
|
|
3116
|
+
function encodeTupleKey(values) {
|
|
3117
|
+
return JSON.stringify(values);
|
|
3118
|
+
}
|
|
3119
|
+
|
|
3237
3120
|
exports.CURRENT_READ_INSTANT_PLACEHOLDER = CURRENT_READ_INSTANT_PLACEHOLDER;
|
|
3238
3121
|
exports.IDENTITY_ASSERTION_COLUMNS = IDENTITY_ASSERTION_COLUMNS;
|
|
3239
3122
|
exports.IDENTITY_PEER_CLASS_COLUMNS = IDENTITY_PEER_CLASS_COLUMNS;
|
|
@@ -3254,13 +3137,13 @@ exports.compilePredicateClauses = compilePredicateClauses;
|
|
|
3254
3137
|
exports.compilePredicateExpression = compilePredicateExpression;
|
|
3255
3138
|
exports.compileTemporalFilter = compileTemporalFilter;
|
|
3256
3139
|
exports.createFulltextAccessor = createFulltextAccessor;
|
|
3257
|
-
exports.createGraphBackendProjection = createGraphBackendProjection;
|
|
3258
3140
|
exports.createRecordedBackend = createRecordedBackend;
|
|
3259
3141
|
exports.createRecordedTransactionScope = createRecordedTransactionScope;
|
|
3260
3142
|
exports.currentReadInstant = currentReadInstant;
|
|
3261
3143
|
exports.currentReadInstantFor = currentReadInstantFor;
|
|
3262
3144
|
exports.dateField = dateField;
|
|
3263
3145
|
exports.edgeInsertDispatch = edgeInsertDispatch;
|
|
3146
|
+
exports.encodeTupleKey = encodeTupleKey;
|
|
3264
3147
|
exports.ensureRevisionOrigin = ensureRevisionOrigin;
|
|
3265
3148
|
exports.exists = exists;
|
|
3266
3149
|
exports.extractFulltextMatchPredicates = extractFulltextMatchPredicates;
|
|
@@ -3290,7 +3173,6 @@ exports.notInSubquery = notInSubquery;
|
|
|
3290
3173
|
exports.numberField = numberField;
|
|
3291
3174
|
exports.objectField = objectField;
|
|
3292
3175
|
exports.param = param;
|
|
3293
|
-
exports.projectBackendMembers = projectBackendMembers;
|
|
3294
3176
|
exports.readRecordedClock = readRecordedClock;
|
|
3295
3177
|
exports.readRevisionOrigin = readRevisionOrigin;
|
|
3296
3178
|
exports.recordedBindParamBudget = recordedBindParamBudget;
|
|
@@ -3307,5 +3189,5 @@ exports.uncapturedGraphWriteLock = uncapturedGraphWriteLock;
|
|
|
3307
3189
|
exports.withPinnedReadInstant = withPinnedReadInstant;
|
|
3308
3190
|
exports.withRecordedFlushObserver = withRecordedFlushObserver;
|
|
3309
3191
|
exports.withRecordedIdentityMutationTarget = withRecordedIdentityMutationTarget;
|
|
3310
|
-
//# sourceMappingURL=chunk-
|
|
3311
|
-
//# sourceMappingURL=chunk-
|
|
3192
|
+
//# sourceMappingURL=chunk-EZEEWCFJ.cjs.map
|
|
3193
|
+
//# sourceMappingURL=chunk-EZEEWCFJ.cjs.map
|