@nicia-ai/typegraph 0.36.0 → 0.37.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/postgres/index.cjs +24 -24
- package/dist/backend/postgres/index.d.cts +6 -6
- package/dist/backend/postgres/index.d.ts +6 -6
- package/dist/backend/postgres/index.js +11 -11
- package/dist/backend/postgres/pglite.cjs +16 -16
- package/dist/backend/postgres/pglite.d.cts +3 -3
- package/dist/backend/postgres/pglite.d.ts +3 -3
- package/dist/backend/postgres/pglite.js +11 -11
- package/dist/backend/sqlite/index.cjs +22 -21
- package/dist/backend/sqlite/index.d.cts +11 -9
- package/dist/backend/sqlite/index.d.ts +11 -9
- package/dist/backend/sqlite/index.js +10 -9
- package/dist/backend/sqlite/libsql.cjs +15 -14
- package/dist/backend/sqlite/libsql.cjs.map +1 -1
- package/dist/backend/sqlite/libsql.d.cts +3 -3
- package/dist/backend/sqlite/libsql.d.ts +3 -3
- package/dist/backend/sqlite/libsql.js +11 -10
- package/dist/backend/sqlite/libsql.js.map +1 -1
- package/dist/backend/sqlite/local.cjs +30 -23
- package/dist/backend/sqlite/local.cjs.map +1 -1
- package/dist/backend/sqlite/local.d.cts +3 -3
- package/dist/backend/sqlite/local.d.ts +3 -3
- package/dist/backend/sqlite/local.js +18 -11
- package/dist/backend/sqlite/local.js.map +1 -1
- package/dist/{chunk-TCOCYN2P.cjs → chunk-27SSDCEP.cjs} +14 -14
- package/dist/{chunk-TCOCYN2P.cjs.map → chunk-27SSDCEP.cjs.map} +1 -1
- package/dist/{chunk-5AQIKK56.cjs → chunk-2N6EOBTH.cjs} +16 -16
- package/dist/{chunk-5AQIKK56.cjs.map → chunk-2N6EOBTH.cjs.map} +1 -1
- package/dist/{chunk-FN35DLCN.cjs → chunk-3C2RYI6L.cjs} +13 -107
- package/dist/chunk-3C2RYI6L.cjs.map +1 -0
- package/dist/{chunk-HW3LW7DH.cjs → chunk-3DS7Z4T4.cjs} +39 -39
- package/dist/{chunk-HW3LW7DH.cjs.map → chunk-3DS7Z4T4.cjs.map} +1 -1
- package/dist/{chunk-RSSQKPSZ.cjs → chunk-3GH67G4Z.cjs} +5 -5
- package/dist/{chunk-RSSQKPSZ.cjs.map → chunk-3GH67G4Z.cjs.map} +1 -1
- package/dist/{chunk-M75SUBFG.js → chunk-3RWZPJKV.js} +24 -9
- package/dist/chunk-3RWZPJKV.js.map +1 -0
- package/dist/{chunk-SKCOUWAX.js → chunk-3SLPDKHQ.js} +4 -4
- package/dist/chunk-3SLPDKHQ.js.map +1 -0
- package/dist/{chunk-5A6FNS6N.cjs → chunk-3XXGYU62.cjs} +11 -11
- package/dist/{chunk-5A6FNS6N.cjs.map → chunk-3XXGYU62.cjs.map} +1 -1
- package/dist/{chunk-IU46OHVW.js → chunk-44TA22QT.js} +58 -11
- package/dist/chunk-44TA22QT.js.map +1 -0
- package/dist/{chunk-7BQLPXK6.cjs → chunk-5AVRFNP4.cjs} +2955 -898
- package/dist/chunk-5AVRFNP4.cjs.map +1 -0
- package/dist/{chunk-2THZ3TQI.cjs → chunk-5KEQ74YU.cjs} +14 -14
- package/dist/chunk-5KEQ74YU.cjs.map +1 -0
- package/dist/{chunk-Q5TEXCTB.js → chunk-5KPNWT6X.js} +3 -3
- package/dist/{chunk-Q5TEXCTB.js.map → chunk-5KPNWT6X.js.map} +1 -1
- package/dist/{chunk-WI7ISNQF.js → chunk-5PNMDJ7J.js} +94 -5
- package/dist/chunk-5PNMDJ7J.js.map +1 -0
- package/dist/{chunk-AW4A3P5A.cjs → chunk-5VQM6VWP.cjs} +2 -2
- package/dist/{chunk-AW4A3P5A.cjs.map → chunk-5VQM6VWP.cjs.map} +1 -1
- package/dist/{chunk-A3W7QG7K.js → chunk-5WWVZMVX.js} +2 -2
- package/dist/{chunk-A3W7QG7K.js.map → chunk-5WWVZMVX.js.map} +1 -1
- package/dist/{chunk-FACJJWGF.cjs → chunk-6EEO3OVU.cjs} +7 -7
- package/dist/{chunk-FACJJWGF.cjs.map → chunk-6EEO3OVU.cjs.map} +1 -1
- package/dist/{chunk-DIK74MXX.cjs → chunk-BVRDGYXQ.cjs} +97 -4
- package/dist/chunk-BVRDGYXQ.cjs.map +1 -0
- package/dist/{chunk-4BCU6VFZ.cjs → chunk-DEFQM7JU.cjs} +7 -7
- package/dist/{chunk-4BCU6VFZ.cjs.map → chunk-DEFQM7JU.cjs.map} +1 -1
- package/dist/{chunk-456Z2U7Y.cjs → chunk-DIQ3AV5W.cjs} +574 -268
- package/dist/chunk-DIQ3AV5W.cjs.map +1 -0
- package/dist/{chunk-JFMEONLG.cjs → chunk-EJYMTO3K.cjs} +332 -188
- package/dist/chunk-EJYMTO3K.cjs.map +1 -0
- package/dist/{chunk-FPIZFYHE.js → chunk-EXU3RASM.js} +74 -15
- package/dist/chunk-EXU3RASM.js.map +1 -0
- package/dist/{chunk-5DIPR3L3.js → chunk-GA4TT3DH.js} +2338 -281
- package/dist/chunk-GA4TT3DH.js.map +1 -0
- package/dist/{chunk-H7YNSMA7.cjs → chunk-HAHNRASW.cjs} +20 -2
- package/dist/chunk-HAHNRASW.cjs.map +1 -0
- package/dist/{chunk-J3LEGNQB.cjs → chunk-IP3CGGPA.cjs} +8 -8
- package/dist/{chunk-J3LEGNQB.cjs.map → chunk-IP3CGGPA.cjs.map} +1 -1
- package/dist/{chunk-X4JBT642.cjs → chunk-IPSVVTWT.cjs} +94 -35
- package/dist/chunk-IPSVVTWT.cjs.map +1 -0
- package/dist/{chunk-VQEXF5D4.js → chunk-IXGYRP2P.js} +184 -92
- package/dist/chunk-IXGYRP2P.js.map +1 -0
- package/dist/{chunk-4GX2JJXS.js → chunk-K3Q3LJY3.js} +520 -221
- package/dist/chunk-K3Q3LJY3.js.map +1 -0
- package/dist/{chunk-OR5ZA5WP.js → chunk-K5UBVGJN.js} +4 -4
- package/dist/{chunk-OR5ZA5WP.js.map → chunk-K5UBVGJN.js.map} +1 -1
- package/dist/{chunk-UZV3AZKF.js → chunk-KQJ54OG5.js} +3 -3
- package/dist/{chunk-UZV3AZKF.js.map → chunk-KQJ54OG5.js.map} +1 -1
- package/dist/{chunk-SXGE7ITL.js → chunk-L7HQ2OSI.js} +4 -4
- package/dist/{chunk-SXGE7ITL.js.map → chunk-L7HQ2OSI.js.map} +1 -1
- package/dist/{chunk-RAXU3RMB.js → chunk-M6VES7V6.js} +4 -4
- package/dist/{chunk-RAXU3RMB.js.map → chunk-M6VES7V6.js.map} +1 -1
- package/dist/{chunk-PWGX5DF5.cjs → chunk-NUIG3BCV.cjs} +100 -85
- package/dist/chunk-NUIG3BCV.cjs.map +1 -0
- package/dist/{chunk-ZAMFOJ5P.cjs → chunk-NXQFATMF.cjs} +269 -177
- package/dist/chunk-NXQFATMF.cjs.map +1 -0
- package/dist/{chunk-KBGQIPRQ.js → chunk-PC2UBAUB.js} +20 -3
- package/dist/chunk-PC2UBAUB.js.map +1 -0
- package/dist/chunk-QARBLBXT.cjs +219 -0
- package/dist/chunk-QARBLBXT.cjs.map +1 -0
- package/dist/{chunk-6FR2MMS6.js → chunk-QERAIDRJ.js} +45 -4
- package/dist/chunk-QERAIDRJ.js.map +1 -0
- package/dist/chunk-QSXTWU4U.cjs +12 -0
- package/dist/{chunk-4BMPGT35.cjs.map → chunk-QSXTWU4U.cjs.map} +1 -1
- package/dist/{chunk-DN5VP4JC.js → chunk-RCVLFTCT.js} +9 -10
- package/dist/chunk-RCVLFTCT.js.map +1 -0
- package/dist/{chunk-ZIGXMKQQ.js → chunk-RRSNR3TP.js} +3 -3
- package/dist/{chunk-ZIGXMKQQ.js.map → chunk-RRSNR3TP.js.map} +1 -1
- package/dist/{chunk-4CAXEB2F.cjs → chunk-TGOMW4MB.cjs} +91 -92
- package/dist/chunk-TGOMW4MB.cjs.map +1 -0
- package/dist/{chunk-PZKNKG5M.js → chunk-TKT2XHED.js} +8 -8
- package/dist/{chunk-PZKNKG5M.js.map → chunk-TKT2XHED.js.map} +1 -1
- package/dist/{chunk-S5F7ZLP2.js → chunk-TPF25IG6.js} +3 -3
- package/dist/{chunk-S5F7ZLP2.js.map → chunk-TPF25IG6.js.map} +1 -1
- package/dist/{chunk-5SEGFTZX.js → chunk-UGZUAYAR.js} +3 -3
- package/dist/{chunk-5SEGFTZX.js.map → chunk-UGZUAYAR.js.map} +1 -1
- package/dist/{chunk-BJVEU3ZL.js → chunk-UV3WP5WZ.js} +265 -121
- package/dist/chunk-UV3WP5WZ.js.map +1 -0
- package/dist/{chunk-VHMPG6UL.js → chunk-UXLSNRYL.js} +11 -105
- package/dist/chunk-UXLSNRYL.js.map +1 -0
- package/dist/{chunk-FRV5Q5IO.js → chunk-UYQMBBWJ.js} +3 -3
- package/dist/{chunk-FRV5Q5IO.js.map → chunk-UYQMBBWJ.js.map} +1 -1
- package/dist/{chunk-UUT7UN2N.cjs → chunk-VGDDG3XJ.cjs} +7 -7
- package/dist/{chunk-UUT7UN2N.cjs.map → chunk-VGDDG3XJ.cjs.map} +1 -1
- package/dist/{chunk-5VTR2F2K.js → chunk-VKGKDOKR.js} +12 -10
- package/dist/chunk-VKGKDOKR.js.map +1 -0
- package/dist/{chunk-5W4L6DLF.cjs → chunk-VL2V6PEN.cjs} +11 -11
- package/dist/{chunk-5W4L6DLF.cjs.map → chunk-VL2V6PEN.cjs.map} +1 -1
- package/dist/{chunk-ZUNQ5BEP.cjs → chunk-WOJMKB3N.cjs} +82 -80
- package/dist/chunk-WOJMKB3N.cjs.map +1 -0
- package/dist/{chunk-UMDVATGY.cjs → chunk-WWFHO375.cjs} +6 -6
- package/dist/{chunk-UMDVATGY.cjs.map → chunk-WWFHO375.cjs.map} +1 -1
- package/dist/{chunk-JFUPDJXD.js → chunk-XGPUQ56G.js} +3 -3
- package/dist/{chunk-JFUPDJXD.js.map → chunk-XGPUQ56G.js.map} +1 -1
- package/dist/{chunk-D7ZEOS56.cjs → chunk-XGU7DZDA.cjs} +74 -14
- package/dist/chunk-XGU7DZDA.cjs.map +1 -0
- package/dist/{chunk-S55OV6PW.cjs → chunk-XPCZADMT.cjs} +54 -11
- package/dist/chunk-XPCZADMT.cjs.map +1 -0
- package/dist/{chunk-T2WUSPDA.js → chunk-XWV4JT34.js} +3 -3
- package/dist/{chunk-T2WUSPDA.js.map → chunk-XWV4JT34.js.map} +1 -1
- package/dist/chunk-YTSN73ND.js +212 -0
- package/dist/chunk-YTSN73ND.js.map +1 -0
- package/dist/{ddl-CZz7a0E8.d.cts → ddl-BD-ZfKeX.d.cts} +3 -3
- package/dist/{ddl-C2rZ-Aen.d.ts → ddl-CS0KUVwB.d.ts} +3 -3
- package/dist/{extension-types-ixRpJVUp.d.ts → extension-types-BM2ACfYO.d.cts} +6 -1
- package/dist/{extension-types-ixRpJVUp.d.cts → extension-types-BM2ACfYO.d.ts} +6 -1
- package/dist/{fulltext-strategy-CDkSSYhq.d.cts → fulltext-strategy-C27vXaeB.d.cts} +127 -8
- package/dist/{fulltext-strategy-B57yvC5Q.d.ts → fulltext-strategy-DebsMrqg.d.ts} +127 -8
- package/dist/graph-extension/index.cjs +19 -19
- package/dist/graph-extension/index.d.cts +4 -4
- package/dist/graph-extension/index.d.ts +4 -4
- package/dist/graph-extension/index.js +4 -4
- package/dist/graph-merge/index.cjs +88 -88
- package/dist/graph-merge/index.d.cts +6 -6
- package/dist/graph-merge/index.d.ts +6 -6
- package/dist/graph-merge/index.js +19 -19
- package/dist/{index-BLtQWKRj.d.cts → index-BPM59vsg.d.cts} +52 -7
- package/dist/{index-BFvdmBPV.d.ts → index-BeacbPoe.d.ts} +52 -7
- package/dist/index.cjs +224 -187
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +53 -40
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.cjs +30 -21
- package/dist/indexes/index.d.cts +5 -5
- package/dist/indexes/index.d.ts +5 -5
- package/dist/indexes/index.js +8 -7
- package/dist/interchange/index.cjs +207 -30
- package/dist/interchange/index.cjs.map +1 -1
- package/dist/interchange/index.d.cts +25 -8
- package/dist/interchange/index.d.ts +25 -8
- package/dist/interchange/index.js +190 -11
- package/dist/interchange/index.js.map +1 -1
- package/dist/{manager-DwQi8eV0.d.cts → manager-D00_NXvT.d.ts} +11 -2
- package/dist/{manager-ejUCB52T.d.ts → manager-nU1vTJLy.d.cts} +11 -2
- package/dist/{materialize-indexes-B4e9360H.d.cts → materialize-indexes-CuR3gAZb.d.cts} +8 -2
- package/dist/{materialize-indexes-te9TPMMJ.d.ts → materialize-indexes-zK2J_flP.d.ts} +8 -2
- package/dist/{postgres-CfEqsRMp.d.cts → postgres-IaBA4RgE.d.ts} +1 -1
- package/dist/{postgres-DQ5R6rzV.d.ts → postgres-YrYmPlaU.d.cts} +1 -1
- package/dist/profiler/index.cjs +3 -3
- package/dist/profiler/index.d.cts +7 -7
- package/dist/profiler/index.d.ts +7 -7
- package/dist/profiler/index.js +2 -2
- package/dist/provenance/index.cjs +32 -33
- package/dist/provenance/index.cjs.map +1 -1
- package/dist/provenance/index.d.cts +5 -5
- package/dist/provenance/index.d.ts +5 -5
- package/dist/provenance/index.js +5 -6
- package/dist/provenance/index.js.map +1 -1
- package/dist/schema/index.cjs +35 -35
- package/dist/schema/index.d.cts +7 -7
- package/dist/schema/index.d.ts +7 -7
- package/dist/schema/index.js +11 -11
- package/dist/{sqlite-DvQndLky.d.ts → sqlite-BUOHPx7p.d.ts} +1 -1
- package/dist/{sqlite-D7zBinNR.d.cts → sqlite-Pp8O19WE.d.cts} +1 -1
- package/dist/{store-view-DplHC3Nt.d.ts → store-view-ANL6mTph.d.ts} +213 -27
- package/dist/{store-view-9KDOpZzF.d.cts → store-view-X96Rd00T.d.cts} +213 -27
- package/dist/{types-Bv9DcS_E.d.cts → types-r-Zyq2Hz.d.cts} +2 -2
- package/dist/{types-CoxuV7EJ.d.ts → types-wsvuBgPK.d.ts} +2 -2
- package/dist/where-CJOpJj3a.d.ts +36 -0
- package/dist/where-K3uBP33l.d.cts +36 -0
- package/package.json +1 -1
- package/dist/chunk-2THZ3TQI.cjs.map +0 -1
- package/dist/chunk-456Z2U7Y.cjs.map +0 -1
- package/dist/chunk-4BMPGT35.cjs +0 -12
- package/dist/chunk-4CAXEB2F.cjs.map +0 -1
- package/dist/chunk-4GX2JJXS.js.map +0 -1
- package/dist/chunk-5DIPR3L3.js.map +0 -1
- package/dist/chunk-5VTR2F2K.js.map +0 -1
- package/dist/chunk-6FR2MMS6.js.map +0 -1
- package/dist/chunk-7BQLPXK6.cjs.map +0 -1
- package/dist/chunk-BJVEU3ZL.js.map +0 -1
- package/dist/chunk-D7ZEOS56.cjs.map +0 -1
- package/dist/chunk-DIK74MXX.cjs.map +0 -1
- package/dist/chunk-DN5VP4JC.js.map +0 -1
- package/dist/chunk-EOLERH7Y.cjs +0 -40
- package/dist/chunk-EOLERH7Y.cjs.map +0 -1
- package/dist/chunk-FN35DLCN.cjs.map +0 -1
- package/dist/chunk-FPIZFYHE.js.map +0 -1
- package/dist/chunk-H7YNSMA7.cjs.map +0 -1
- package/dist/chunk-IU46OHVW.js.map +0 -1
- package/dist/chunk-JFMEONLG.cjs.map +0 -1
- package/dist/chunk-KBGQIPRQ.js.map +0 -1
- package/dist/chunk-M75SUBFG.js.map +0 -1
- package/dist/chunk-PWGX5DF5.cjs.map +0 -1
- package/dist/chunk-S55OV6PW.cjs.map +0 -1
- package/dist/chunk-SKCOUWAX.js.map +0 -1
- package/dist/chunk-UT3S4SEN.js +0 -31
- package/dist/chunk-UT3S4SEN.js.map +0 -1
- package/dist/chunk-VHMPG6UL.js.map +0 -1
- package/dist/chunk-VQEXF5D4.js.map +0 -1
- package/dist/chunk-WI7ISNQF.js.map +0 -1
- package/dist/chunk-X4JBT642.cjs.map +0 -1
- package/dist/chunk-ZAMFOJ5P.cjs.map +0 -1
- package/dist/chunk-ZUNQ5BEP.cjs.map +0 -1
- package/dist/where-7RKFOsXt.d.ts +0 -11
- package/dist/where-DdMIXOtH.d.cts +0 -11
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var chunkRSSQKPSZ_cjs = require('./chunk-RSSQKPSZ.cjs');
|
|
3
|
+
var chunkIPSVVTWT_cjs = require('./chunk-IPSVVTWT.cjs');
|
|
4
|
+
var chunk3GH67G4Z_cjs = require('./chunk-3GH67G4Z.cjs');
|
|
6
5
|
var chunk7YSP4V4R_cjs = require('./chunk-7YSP4V4R.cjs');
|
|
7
|
-
var
|
|
8
|
-
var
|
|
6
|
+
var chunkHAHNRASW_cjs = require('./chunk-HAHNRASW.cjs');
|
|
7
|
+
var chunkBVRDGYXQ_cjs = require('./chunk-BVRDGYXQ.cjs');
|
|
9
8
|
var drizzleOrm = require('drizzle-orm');
|
|
10
9
|
var nanoid = require('nanoid');
|
|
11
10
|
|
|
12
11
|
// src/core/temporal.ts
|
|
13
12
|
var RECORDED_MAX = "9999-12-31T23:59:59.999Z";
|
|
14
13
|
function assertValidRecordedInstant(value, path) {
|
|
15
|
-
|
|
14
|
+
chunk3GH67G4Z_cjs.validateCanonicalIsoDate(value, path);
|
|
16
15
|
if (value >= RECORDED_MAX) {
|
|
17
|
-
throw new
|
|
16
|
+
throw new chunkBVRDGYXQ_cjs.ValidationError(
|
|
18
17
|
`${path} must be before the recorded-time open sentinel ${RECORDED_MAX}.`,
|
|
19
18
|
{
|
|
20
19
|
issues: [
|
|
@@ -36,7 +35,7 @@ function asRecordedInstant(value) {
|
|
|
36
35
|
}
|
|
37
36
|
function resolveReadCoordinate(mode, asOf, suggestion) {
|
|
38
37
|
if (mode !== "asOf" && asOf !== void 0) {
|
|
39
|
-
throw new
|
|
38
|
+
throw new chunkBVRDGYXQ_cjs.ValidationError(
|
|
40
39
|
`Temporal mode "${mode}" does not take an asOf timestamp.`,
|
|
41
40
|
{
|
|
42
41
|
issues: [
|
|
@@ -67,7 +66,7 @@ function withRecordedCoordinate(coordinate, recordedAsOf) {
|
|
|
67
66
|
}
|
|
68
67
|
function assertValidAsOf(mode, asOf, options) {
|
|
69
68
|
if (mode === "asOf" && asOf === void 0) {
|
|
70
|
-
throw new
|
|
69
|
+
throw new chunkBVRDGYXQ_cjs.ValidationError(
|
|
71
70
|
'Temporal mode "asOf" requires a timestamp',
|
|
72
71
|
{
|
|
73
72
|
issues: [
|
|
@@ -80,7 +79,7 @@ function assertValidAsOf(mode, asOf, options) {
|
|
|
80
79
|
);
|
|
81
80
|
}
|
|
82
81
|
if (asOf !== void 0) {
|
|
83
|
-
|
|
82
|
+
chunk3GH67G4Z_cjs.validateCanonicalIsoDate(asOf, "asOf");
|
|
84
83
|
}
|
|
85
84
|
}
|
|
86
85
|
function describeCoordinate(coordinate) {
|
|
@@ -145,15 +144,15 @@ function resolveTableNames(names) {
|
|
|
145
144
|
var VALID_IDENTIFIER_PATTERN = /^[a-z_][a-z0-9_$]*$/i;
|
|
146
145
|
function validateTableName(name, label) {
|
|
147
146
|
if (!name || name.length === 0) {
|
|
148
|
-
throw new
|
|
147
|
+
throw new chunkBVRDGYXQ_cjs.ConfigurationError(`${label} table name cannot be empty`);
|
|
149
148
|
}
|
|
150
149
|
if (name.length > chunk7YSP4V4R_cjs.MAX_PG_IDENTIFIER_LENGTH) {
|
|
151
|
-
throw new
|
|
150
|
+
throw new chunkBVRDGYXQ_cjs.ConfigurationError(
|
|
152
151
|
`${label} table name exceeds maximum length of ${chunk7YSP4V4R_cjs.MAX_PG_IDENTIFIER_LENGTH} characters`
|
|
153
152
|
);
|
|
154
153
|
}
|
|
155
154
|
if (!VALID_IDENTIFIER_PATTERN.test(name)) {
|
|
156
|
-
throw new
|
|
155
|
+
throw new chunkBVRDGYXQ_cjs.ConfigurationError(
|
|
157
156
|
`${label} table name "${name}" is not a valid SQL identifier. Table names must start with a letter or underscore and contain only letters, digits, underscores, or dollar signs.`
|
|
158
157
|
);
|
|
159
158
|
}
|
|
@@ -169,7 +168,7 @@ function isSqlSchema(schema) {
|
|
|
169
168
|
}
|
|
170
169
|
function requireSqlSchema(schema, surface = "SqlSchema") {
|
|
171
170
|
if (isSqlSchema(schema)) return schema;
|
|
172
|
-
throw new
|
|
171
|
+
throw new chunkBVRDGYXQ_cjs.ConfigurationError(
|
|
173
172
|
`${surface} must be created with createSqlSchema(...).`,
|
|
174
173
|
{ code: "INVALID_SQL_SCHEMA", surface },
|
|
175
174
|
{
|
|
@@ -215,7 +214,7 @@ function recordedRelation(options) {
|
|
|
215
214
|
function requireExternalRecordedReadSource(source) {
|
|
216
215
|
if (source === void 0) return void 0;
|
|
217
216
|
if (isExternalRecordedReadSource(source)) return source;
|
|
218
|
-
throw new
|
|
217
|
+
throw new chunkBVRDGYXQ_cjs.ConfigurationError(
|
|
219
218
|
"recordedRead must be created with recordedRelation({ schema }).",
|
|
220
219
|
{ code: "INVALID_RECORDED_READ_SOURCE" },
|
|
221
220
|
{
|
|
@@ -239,7 +238,7 @@ function createRecordedReadBinding(schema) {
|
|
|
239
238
|
function requireRecordedReadBinding(binding, surface) {
|
|
240
239
|
if (isRecordedReadBinding(binding)) return binding;
|
|
241
240
|
if (binding !== void 0) {
|
|
242
|
-
throw new
|
|
241
|
+
throw new chunkBVRDGYXQ_cjs.ConfigurationError(
|
|
243
242
|
"Recorded-time reads require a recorded read relation created by TypeGraph.",
|
|
244
243
|
{ code: "INVALID_RECORDED_READ_BINDING", surface },
|
|
245
244
|
{
|
|
@@ -247,7 +246,7 @@ function requireRecordedReadBinding(binding, surface) {
|
|
|
247
246
|
}
|
|
248
247
|
);
|
|
249
248
|
}
|
|
250
|
-
throw new
|
|
249
|
+
throw new chunkBVRDGYXQ_cjs.ConfigurationError(
|
|
251
250
|
"Recorded-time reads require a recorded read relation.",
|
|
252
251
|
{ code: "RECORDED_READ_REQUIRES_BINDING", surface },
|
|
253
252
|
{
|
|
@@ -297,7 +296,7 @@ function generateId() {
|
|
|
297
296
|
}
|
|
298
297
|
function requireRecordedSchema(target) {
|
|
299
298
|
if (target.tableNames === void 0) {
|
|
300
|
-
throw new
|
|
299
|
+
throw new chunkBVRDGYXQ_cjs.ConfigurationError(
|
|
301
300
|
"Recorded-time capture requires the backend to expose tableNames.",
|
|
302
301
|
{ dialect: target.dialect },
|
|
303
302
|
{
|
|
@@ -309,7 +308,7 @@ function requireRecordedSchema(target) {
|
|
|
309
308
|
}
|
|
310
309
|
function requireCaptureStatements(target) {
|
|
311
310
|
if (target.executeStatement === void 0) {
|
|
312
|
-
throw new
|
|
311
|
+
throw new chunkBVRDGYXQ_cjs.ConfigurationError(
|
|
313
312
|
"Recorded-time capture requires backend.executeStatement support on the transaction backend.",
|
|
314
313
|
{ dialect: target.dialect },
|
|
315
314
|
{
|
|
@@ -320,10 +319,10 @@ function requireCaptureStatements(target) {
|
|
|
320
319
|
}
|
|
321
320
|
async function executeStatement(target, query) {
|
|
322
321
|
requireCaptureStatements(target);
|
|
323
|
-
await target.executeStatement(
|
|
322
|
+
await target.executeStatement(chunkIPSVVTWT_cjs.asCompiledStatementSql(query));
|
|
324
323
|
}
|
|
325
324
|
function unsupportedPostgresIsolationError(isolationLevel) {
|
|
326
|
-
return new
|
|
325
|
+
return new chunkBVRDGYXQ_cjs.ConfigurationError(
|
|
327
326
|
"Recorded-time capture on PostgreSQL requires read_committed isolation.",
|
|
328
327
|
{ isolationLevel: isolationLevel ?? "unknown" },
|
|
329
328
|
{
|
|
@@ -336,6 +335,7 @@ function isSupportedRecordedIsolationLevel(isolationLevel) {
|
|
|
336
335
|
}
|
|
337
336
|
function assertRequestedRecordedIsolation(backend, options) {
|
|
338
337
|
if (backend.dialect !== "postgres") return;
|
|
338
|
+
if (options?.accessMode === "read_only") return;
|
|
339
339
|
const isolationLevel = options?.isolationLevel;
|
|
340
340
|
if (isSupportedRecordedIsolationLevel(isolationLevel)) return;
|
|
341
341
|
throw unsupportedPostgresIsolationError(isolationLevel);
|
|
@@ -344,10 +344,11 @@ function normalizeIsolationLevel(value) {
|
|
|
344
344
|
if (typeof value !== "string") return void 0;
|
|
345
345
|
return value.replaceAll(" ", "_").toLowerCase();
|
|
346
346
|
}
|
|
347
|
-
async function assertRecordedCaptureTransactionIsolation(target) {
|
|
347
|
+
async function assertRecordedCaptureTransactionIsolation(target, options) {
|
|
348
348
|
if (target.dialect !== "postgres") return;
|
|
349
|
+
if (options?.accessMode === "read_only") return;
|
|
349
350
|
const rows = await target.execute(
|
|
350
|
-
|
|
351
|
+
chunkIPSVVTWT_cjs.asCompiledRowsSql(drizzleOrm.sql`
|
|
351
352
|
SELECT current_setting('transaction_isolation') AS transaction_isolation
|
|
352
353
|
`)
|
|
353
354
|
);
|
|
@@ -358,7 +359,7 @@ async function assertRecordedCaptureTransactionIsolation(target) {
|
|
|
358
359
|
throw unsupportedPostgresIsolationError(isolationLevel);
|
|
359
360
|
}
|
|
360
361
|
function recordedCaptureRequiresCallbackTransactionError(details = {}) {
|
|
361
|
-
return new
|
|
362
|
+
return new chunkBVRDGYXQ_cjs.ConfigurationError(
|
|
362
363
|
"withTransaction() has no recorded-time capture flush point when history is enabled.",
|
|
363
364
|
{
|
|
364
365
|
...details,
|
|
@@ -370,7 +371,7 @@ function recordedCaptureRequiresCallbackTransactionError(details = {}) {
|
|
|
370
371
|
);
|
|
371
372
|
}
|
|
372
373
|
function historyUnsafeRawWriteError(surface) {
|
|
373
|
-
return new
|
|
374
|
+
return new chunkBVRDGYXQ_cjs.ConfigurationError(
|
|
374
375
|
`${surface} is not available when history capture is enabled because raw SQL writes bypass recorded-time capture.`,
|
|
375
376
|
{
|
|
376
377
|
code: "RECORDED_CAPTURE_RAW_SQL_DISABLED"
|
|
@@ -381,7 +382,7 @@ function historyUnsafeRawWriteError(surface) {
|
|
|
381
382
|
);
|
|
382
383
|
}
|
|
383
384
|
function revisionTrackingUnsafeRawWriteError(surface) {
|
|
384
|
-
return new
|
|
385
|
+
return new chunkBVRDGYXQ_cjs.ConfigurationError(
|
|
385
386
|
`${surface} is not available when revision tracking is enabled because raw SQL writes bypass the revision anchor.`,
|
|
386
387
|
{
|
|
387
388
|
code: "REVISION_TRACKING_RAW_SQL_DISABLED"
|
|
@@ -462,7 +463,7 @@ function rawWriteGuards(target, prefix) {
|
|
|
462
463
|
}
|
|
463
464
|
function assertCapturableBackend(backend) {
|
|
464
465
|
if (!backend.capabilities.transactions) {
|
|
465
|
-
throw new
|
|
466
|
+
throw new chunkBVRDGYXQ_cjs.ConfigurationError(
|
|
466
467
|
"history: true requires a backend with transaction support.",
|
|
467
468
|
{ dialect: backend.dialect },
|
|
468
469
|
{
|
|
@@ -471,7 +472,7 @@ function assertCapturableBackend(backend) {
|
|
|
471
472
|
);
|
|
472
473
|
}
|
|
473
474
|
if (backend.executeStatement === void 0) {
|
|
474
|
-
throw new
|
|
475
|
+
throw new chunkBVRDGYXQ_cjs.ConfigurationError(
|
|
475
476
|
"history: true requires a backend that supports executeStatement.",
|
|
476
477
|
{ dialect: backend.dialect },
|
|
477
478
|
{
|
|
@@ -480,7 +481,7 @@ function assertCapturableBackend(backend) {
|
|
|
480
481
|
);
|
|
481
482
|
}
|
|
482
483
|
if (backend.capabilities.returning === false) {
|
|
483
|
-
throw new
|
|
484
|
+
throw new chunkBVRDGYXQ_cjs.ConfigurationError(
|
|
484
485
|
"history: true requires a backend that supports UPDATE \u2026 RETURNING.",
|
|
485
486
|
{ dialect: backend.dialect },
|
|
486
487
|
{
|
|
@@ -489,7 +490,7 @@ function assertCapturableBackend(backend) {
|
|
|
489
490
|
);
|
|
490
491
|
}
|
|
491
492
|
if (backend.tableNames === void 0) {
|
|
492
|
-
throw new
|
|
493
|
+
throw new chunkBVRDGYXQ_cjs.ConfigurationError(
|
|
493
494
|
"history: true requires a backend that exposes tableNames.",
|
|
494
495
|
{ dialect: backend.dialect },
|
|
495
496
|
{
|
|
@@ -500,7 +501,7 @@ function assertCapturableBackend(backend) {
|
|
|
500
501
|
}
|
|
501
502
|
function assertRevisionTrackableBackend(backend) {
|
|
502
503
|
if (!backend.capabilities.transactions) {
|
|
503
|
-
throw new
|
|
504
|
+
throw new chunkBVRDGYXQ_cjs.ConfigurationError(
|
|
504
505
|
"revisionTracking: true requires a backend with transaction support.",
|
|
505
506
|
{ dialect: backend.dialect },
|
|
506
507
|
{
|
|
@@ -509,7 +510,7 @@ function assertRevisionTrackableBackend(backend) {
|
|
|
509
510
|
);
|
|
510
511
|
}
|
|
511
512
|
if (backend.executeStatement === void 0) {
|
|
512
|
-
throw new
|
|
513
|
+
throw new chunkBVRDGYXQ_cjs.ConfigurationError(
|
|
513
514
|
"revisionTracking: true requires a backend that supports executeStatement.",
|
|
514
515
|
{ dialect: backend.dialect },
|
|
515
516
|
{
|
|
@@ -518,7 +519,7 @@ function assertRevisionTrackableBackend(backend) {
|
|
|
518
519
|
);
|
|
519
520
|
}
|
|
520
521
|
if (backend.tableNames === void 0) {
|
|
521
|
-
throw new
|
|
522
|
+
throw new chunkBVRDGYXQ_cjs.ConfigurationError(
|
|
522
523
|
"revisionTracking: true requires a backend that exposes tableNames.",
|
|
523
524
|
{ dialect: backend.dialect },
|
|
524
525
|
{
|
|
@@ -527,7 +528,7 @@ function assertRevisionTrackableBackend(backend) {
|
|
|
527
528
|
);
|
|
528
529
|
}
|
|
529
530
|
if (backend.ensureRevisionOriginsTable === void 0) {
|
|
530
|
-
throw new
|
|
531
|
+
throw new chunkBVRDGYXQ_cjs.ConfigurationError(
|
|
531
532
|
"revisionTracking: true requires a backend that can bootstrap revision origins.",
|
|
532
533
|
{ dialect: backend.dialect },
|
|
533
534
|
{
|
|
@@ -575,7 +576,7 @@ function registerRecordedGraphLockMemo(backend, memo) {
|
|
|
575
576
|
}
|
|
576
577
|
async function acquireRecordedGraphWriteLock(target, graphId) {
|
|
577
578
|
await target.execute(
|
|
578
|
-
|
|
579
|
+
chunkIPSVVTWT_cjs.asCompiledRowsSql(recordedGraphWriteAdvisoryLockSql(graphId))
|
|
579
580
|
);
|
|
580
581
|
}
|
|
581
582
|
async function lockRecordedGraphWrite(target, graphId, memo) {
|
|
@@ -599,7 +600,7 @@ async function lockRecordedGraphWrite(target, graphId, memo) {
|
|
|
599
600
|
return graphWriteLockEvidence();
|
|
600
601
|
}
|
|
601
602
|
function failInvalidClockTimestamp(value) {
|
|
602
|
-
throw new
|
|
603
|
+
throw new chunkBVRDGYXQ_cjs.ConfigurationError(
|
|
603
604
|
"Recorded clock row contained an invalid timestamp",
|
|
604
605
|
{ value }
|
|
605
606
|
);
|
|
@@ -638,12 +639,12 @@ function toCanonicalIso(value) {
|
|
|
638
639
|
return failInvalidClockTimestamp(value);
|
|
639
640
|
}
|
|
640
641
|
function nextRecordedCommitTime(previous) {
|
|
641
|
-
const wallTime = Date.parse(
|
|
642
|
+
const wallTime = Date.parse(chunk3GH67G4Z_cjs.nowIso());
|
|
642
643
|
return previous === void 0 ? wallTime : Math.max(wallTime, Date.parse(previous) + 1);
|
|
643
644
|
}
|
|
644
645
|
async function readRecordedClock(target, schema, graphId) {
|
|
645
646
|
const rows = await target.execute(
|
|
646
|
-
|
|
647
|
+
chunkIPSVVTWT_cjs.asCompiledRowsSql(drizzleOrm.sql`
|
|
647
648
|
SELECT recorded_at
|
|
648
649
|
FROM ${schema.recordedClockTable}
|
|
649
650
|
WHERE graph_id = ${graphId}
|
|
@@ -654,7 +655,7 @@ async function readRecordedClock(target, schema, graphId) {
|
|
|
654
655
|
}
|
|
655
656
|
async function readRevisionOrigin(target, schema, graphId) {
|
|
656
657
|
const rows = await target.execute(
|
|
657
|
-
|
|
658
|
+
chunkIPSVVTWT_cjs.asCompiledRowsSql(drizzleOrm.sql`
|
|
658
659
|
SELECT origin
|
|
659
660
|
FROM ${schema.revisionOriginsTable}
|
|
660
661
|
WHERE graph_id = ${graphId}
|
|
@@ -663,7 +664,7 @@ async function readRevisionOrigin(target, schema, graphId) {
|
|
|
663
664
|
const first = rows[0];
|
|
664
665
|
if (first === void 0) return void 0;
|
|
665
666
|
if (typeof first.origin !== "string" || first.origin.length === 0) {
|
|
666
|
-
throw new
|
|
667
|
+
throw new chunkBVRDGYXQ_cjs.ConfigurationError(
|
|
667
668
|
"Revision origin row contained an invalid origin",
|
|
668
669
|
{ graphId, origin: first.origin }
|
|
669
670
|
);
|
|
@@ -673,7 +674,7 @@ async function readRevisionOrigin(target, schema, graphId) {
|
|
|
673
674
|
async function ensureRevisionOrigin(target, schema, graphId) {
|
|
674
675
|
const ensureTable = target.ensureRevisionOriginsTable;
|
|
675
676
|
if (ensureTable === void 0) {
|
|
676
|
-
throw new
|
|
677
|
+
throw new chunkBVRDGYXQ_cjs.ConfigurationError(
|
|
677
678
|
"Revision tracking requires a backend that can bootstrap revision origins.",
|
|
678
679
|
{ dialect: target.dialect },
|
|
679
680
|
{
|
|
@@ -694,7 +695,7 @@ async function ensureRevisionOrigin(target, schema, graphId) {
|
|
|
694
695
|
);
|
|
695
696
|
const origin = await readRevisionOrigin(target, schema, graphId);
|
|
696
697
|
if (origin !== void 0) return origin;
|
|
697
|
-
throw new
|
|
698
|
+
throw new chunkBVRDGYXQ_cjs.ConfigurationError(
|
|
698
699
|
"Revision origin was not persisted after initialization.",
|
|
699
700
|
{ graphId, dialect: target.dialect }
|
|
700
701
|
);
|
|
@@ -712,7 +713,7 @@ async function writeRecordedClock(target, schema, graphId, recordedAt) {
|
|
|
712
713
|
async function lockRecordedClock(target, schema, graphId, ownsWriteLock) {
|
|
713
714
|
if (target.dialect === "postgres") {
|
|
714
715
|
await target.execute(
|
|
715
|
-
|
|
716
|
+
chunkIPSVVTWT_cjs.asCompiledRowsSql(recordedClockAdvisoryLockSql(graphId))
|
|
716
717
|
);
|
|
717
718
|
return;
|
|
718
719
|
}
|
|
@@ -731,7 +732,7 @@ async function allocateRecordedCommit(target, schema, graphId, ownsWriteLock, pr
|
|
|
731
732
|
const previous = previousRevision ?? await readRecordedClock(target, schema, graphId);
|
|
732
733
|
const recordedCommitTime = nextRecordedCommitTime(previous);
|
|
733
734
|
if (!Number.isFinite(recordedCommitTime) || recordedCommitTime >= RECORDED_MAX_TIME) {
|
|
734
|
-
throw new
|
|
735
|
+
throw new chunkBVRDGYXQ_cjs.ConfigurationError(
|
|
735
736
|
`Recorded commit clock reached the open sentinel ${RECORDED_MAX}`,
|
|
736
737
|
{ graphId, recordedCommitTime },
|
|
737
738
|
{
|
|
@@ -880,7 +881,7 @@ var RECORDED_BIND_PARAM_BUDGET = 900;
|
|
|
880
881
|
function recordedBindParamBudget(target) {
|
|
881
882
|
const budget = target.capabilities.maxBindParameters ?? RECORDED_BIND_PARAM_BUDGET;
|
|
882
883
|
if (!Number.isSafeInteger(budget) || budget < 1) {
|
|
883
|
-
throw new
|
|
884
|
+
throw new chunkBVRDGYXQ_cjs.ConfigurationError(
|
|
884
885
|
`backend capabilities.maxBindParameters must be a positive integer, got: ${String(budget)}`,
|
|
885
886
|
{
|
|
886
887
|
code: "INVALID_BACKEND_CAPABILITY",
|
|
@@ -901,7 +902,7 @@ function recordedCommonCells() {
|
|
|
901
902
|
graph_id: (row) => drizzleOrm.sql`${row.graph_id}`,
|
|
902
903
|
id: (row) => drizzleOrm.sql`${row.id}`,
|
|
903
904
|
kind: (row) => drizzleOrm.sql`${row.kind}`,
|
|
904
|
-
props: (row) => drizzleOrm.sql`${
|
|
905
|
+
props: (row) => drizzleOrm.sql`${chunkIPSVVTWT_cjs.rowPropsToJsonText(row.props)}`,
|
|
905
906
|
valid_from: (row) => drizzleOrm.sql`${chunk7YSP4V4R_cjs.sqlNull(row.valid_from)}`,
|
|
906
907
|
valid_to: (row) => drizzleOrm.sql`${chunk7YSP4V4R_cjs.sqlNull(row.valid_to)}`,
|
|
907
908
|
created_at: (row) => drizzleOrm.sql`${row.created_at}`,
|
|
@@ -994,20 +995,20 @@ function entityKey(entity) {
|
|
|
994
995
|
async function closeOpenReturning(target, table, graphId, ids, recordedCommit, kind) {
|
|
995
996
|
const kindFilter = kind === void 0 ? drizzleOrm.sql`` : drizzleOrm.sql`AND kind = ${kind}`;
|
|
996
997
|
const rows = await target.execute(
|
|
997
|
-
|
|
998
|
+
chunkIPSVVTWT_cjs.asCompiledRowsSql(drizzleOrm.sql`
|
|
998
999
|
UPDATE ${table}
|
|
999
1000
|
SET recorded_to = ${recordedCommit}
|
|
1000
1001
|
WHERE graph_id = ${graphId}
|
|
1001
1002
|
${kindFilter}
|
|
1002
1003
|
AND recorded_to = ${RECORDED_MAX}
|
|
1003
|
-
AND id IN (${
|
|
1004
|
+
AND id IN (${chunkIPSVVTWT_cjs.sqlValueList(ids)})
|
|
1004
1005
|
RETURNING id, deleted_at
|
|
1005
1006
|
`)
|
|
1006
1007
|
);
|
|
1007
|
-
return new Map(rows.map((row) => [row.id,
|
|
1008
|
+
return new Map(rows.map((row) => [row.id, chunkIPSVVTWT_cjs.isPresent(row.deleted_at)]));
|
|
1008
1009
|
}
|
|
1009
1010
|
function recordedOp(hadOpenRow, priorRowWasTombstone, after) {
|
|
1010
|
-
if (
|
|
1011
|
+
if (chunkIPSVVTWT_cjs.isPresent(after.deleted_at)) return "delete";
|
|
1011
1012
|
if (!hadOpenRow || priorRowWasTombstone) return "create";
|
|
1012
1013
|
return "update";
|
|
1013
1014
|
}
|
|
@@ -1044,7 +1045,7 @@ function recordedInsertsFor(afterById, closed) {
|
|
|
1044
1045
|
async function flushNodes(target, schema, graphId, entities, recordedCommit) {
|
|
1045
1046
|
const chunkSize = recordedNodeChunkSize(target);
|
|
1046
1047
|
for (const [kind, group] of groupNodesByKind(entities)) {
|
|
1047
|
-
for (const entityChunk of
|
|
1048
|
+
for (const entityChunk of chunkIPSVVTWT_cjs.chunk(group, chunkSize)) {
|
|
1048
1049
|
const ids = entityChunk.map((entity) => entity.id);
|
|
1049
1050
|
const closed = await closeOpenReturning(
|
|
1050
1051
|
target,
|
|
@@ -1069,7 +1070,7 @@ async function flushNodes(target, schema, graphId, entities, recordedCommit) {
|
|
|
1069
1070
|
}
|
|
1070
1071
|
async function flushEdges(target, schema, graphId, entities, recordedCommit) {
|
|
1071
1072
|
const chunkSize = recordedEdgeChunkSize(target);
|
|
1072
|
-
for (const entityChunk of
|
|
1073
|
+
for (const entityChunk of chunkIPSVVTWT_cjs.chunk(entities, chunkSize)) {
|
|
1073
1074
|
const ids = entityChunk.map((entity) => entity.id);
|
|
1074
1075
|
const closed = await closeOpenReturning(
|
|
1075
1076
|
target,
|
|
@@ -1148,7 +1149,7 @@ async function closeRecordedHardDeletedKind(target, schema, graphId, removal, ow
|
|
|
1148
1149
|
}
|
|
1149
1150
|
async function queryConnectedEdgeIds(target, schema, params) {
|
|
1150
1151
|
const rows = await target.execute(
|
|
1151
|
-
|
|
1152
|
+
chunkIPSVVTWT_cjs.asCompiledRowsSql(drizzleOrm.sql`
|
|
1152
1153
|
SELECT id
|
|
1153
1154
|
FROM ${schema.edgesTable}
|
|
1154
1155
|
WHERE graph_id = ${params.graphId}
|
|
@@ -1196,7 +1197,7 @@ function edgeRowIdentityKey(row) {
|
|
|
1196
1197
|
return edgeIdentityKey(row.graph_id, row.id);
|
|
1197
1198
|
}
|
|
1198
1199
|
function recordedCaptureSealedError(details) {
|
|
1199
|
-
return new
|
|
1200
|
+
return new chunkBVRDGYXQ_cjs.ConfigurationError(
|
|
1200
1201
|
"Recorded-time capture session is sealed: a graph write happened after the transaction's capture was flushed.",
|
|
1201
1202
|
details,
|
|
1202
1203
|
{
|
|
@@ -1229,7 +1230,7 @@ function createRecordedCaptureSession() {
|
|
|
1229
1230
|
},
|
|
1230
1231
|
async flush(target, schema, ownsWriteLock) {
|
|
1231
1232
|
if (sealed) {
|
|
1232
|
-
throw new
|
|
1233
|
+
throw new chunkBVRDGYXQ_cjs.ConfigurationError(
|
|
1233
1234
|
"Recorded-time capture session was already flushed.",
|
|
1234
1235
|
{},
|
|
1235
1236
|
{
|
|
@@ -1240,7 +1241,7 @@ function createRecordedCaptureSession() {
|
|
|
1240
1241
|
sealed = true;
|
|
1241
1242
|
if (touched.size === 0) return /* @__PURE__ */ new Map();
|
|
1242
1243
|
const recordedByGraph = /* @__PURE__ */ new Map();
|
|
1243
|
-
const byGraph =
|
|
1244
|
+
const byGraph = chunkIPSVVTWT_cjs.groupBy(touched.values(), (entity) => entity.graphId);
|
|
1244
1245
|
for (const [graphId, entities] of byGraph) {
|
|
1245
1246
|
const recordedCommit = await allocateRecordedCommit(
|
|
1246
1247
|
target,
|
|
@@ -1278,7 +1279,7 @@ function createRecordedTransactionBackend(target, session, schema) {
|
|
|
1278
1279
|
await lockRecordedGraphWrite(target, graphId, graphLocks);
|
|
1279
1280
|
}
|
|
1280
1281
|
}
|
|
1281
|
-
const overlay =
|
|
1282
|
+
const overlay = chunkIPSVVTWT_cjs.createBackendOverlay(target, {
|
|
1282
1283
|
...rawWriteGuards(target, "tx.backend"),
|
|
1283
1284
|
async insertNode(params) {
|
|
1284
1285
|
session.assertOpen();
|
|
@@ -1444,7 +1445,7 @@ function createRecordedTransactionScope(target, schema, ownsWriteLock = false) {
|
|
|
1444
1445
|
return {
|
|
1445
1446
|
backend: createRecordedTransactionBackend(target, session, resolvedSchema),
|
|
1446
1447
|
async flush() {
|
|
1447
|
-
return
|
|
1448
|
+
return chunk3GH67G4Z_cjs.withRecordedRelationsPrecondition(
|
|
1448
1449
|
session.flush(target, resolvedSchema, ownsWriteLock),
|
|
1449
1450
|
{ dialect: target.dialect, surface: "capture-flush" }
|
|
1450
1451
|
);
|
|
@@ -1464,7 +1465,7 @@ async function runCapturedAutocommit(backend, schema, fn, options) {
|
|
|
1464
1465
|
function createRecordedBackend(backend, schema) {
|
|
1465
1466
|
assertCapturableBackend(backend);
|
|
1466
1467
|
const capture = (fn) => runCapturedAutocommit(backend, schema, fn);
|
|
1467
|
-
return
|
|
1468
|
+
return chunkIPSVVTWT_cjs.createBackendOverlay(backend, {
|
|
1468
1469
|
...rawWriteGuards(backend, "backend"),
|
|
1469
1470
|
async insertNode(params) {
|
|
1470
1471
|
return capture((target) => target.insertNode(params));
|
|
@@ -1547,8 +1548,9 @@ function createRecordedBackend(backend, schema) {
|
|
|
1547
1548
|
const backendOptions = stripRecordedFlushObserver(options);
|
|
1548
1549
|
assertRequestedRecordedIsolation(backend, backendOptions);
|
|
1549
1550
|
return backend.transaction(async (target) => {
|
|
1550
|
-
await assertRecordedCaptureTransactionIsolation(target);
|
|
1551
|
-
const
|
|
1551
|
+
await assertRecordedCaptureTransactionIsolation(target, backendOptions);
|
|
1552
|
+
const readOnly = backendOptions?.accessMode === "read_only";
|
|
1553
|
+
const scope = createRecordedTransactionScope(target, schema, !readOnly);
|
|
1552
1554
|
const result = await fn(scope.backend, createHistoryUnsafeSqlRef());
|
|
1553
1555
|
const instants = await scope.flush();
|
|
1554
1556
|
observer?.(instants);
|
|
@@ -1570,7 +1572,7 @@ var embeddingFieldsCache = /* @__PURE__ */ new WeakMap();
|
|
|
1570
1572
|
function getEmbeddingFields(schema) {
|
|
1571
1573
|
const cached = embeddingFieldsCache.get(schema);
|
|
1572
1574
|
if (cached) return cached;
|
|
1573
|
-
const fields =
|
|
1575
|
+
const fields = chunkHAHNRASW_cjs.resolveEmbeddingFields(schema);
|
|
1574
1576
|
embeddingFieldsCache.set(schema, fields);
|
|
1575
1577
|
return fields;
|
|
1576
1578
|
}
|
|
@@ -1699,10 +1701,10 @@ function isValidEmbeddingValue(value) {
|
|
|
1699
1701
|
// src/store/fulltext-sync.ts
|
|
1700
1702
|
var FIELD_SEPARATOR = "\n";
|
|
1701
1703
|
function resolveCombinedLanguage(fields) {
|
|
1702
|
-
return fields[0]?.metadata.language ??
|
|
1704
|
+
return fields[0]?.metadata.language ?? chunkHAHNRASW_cjs.DEFAULT_SEARCHABLE_LANGUAGE;
|
|
1703
1705
|
}
|
|
1704
1706
|
function computeFulltextContent(schema, props) {
|
|
1705
|
-
const searchableFields =
|
|
1707
|
+
const searchableFields = chunkHAHNRASW_cjs.getSearchableFields(schema);
|
|
1706
1708
|
if (searchableFields.length === 0) return void 0;
|
|
1707
1709
|
const parts = [];
|
|
1708
1710
|
for (const field of searchableFields) {
|
|
@@ -1733,7 +1735,7 @@ async function syncFulltext(ctx, schema, props) {
|
|
|
1733
1735
|
});
|
|
1734
1736
|
return;
|
|
1735
1737
|
}
|
|
1736
|
-
if (
|
|
1738
|
+
if (chunkHAHNRASW_cjs.getSearchableFields(schema).length === 0) return;
|
|
1737
1739
|
await backend.deleteFulltext({
|
|
1738
1740
|
graphId: ctx.graphId,
|
|
1739
1741
|
nodeKind: ctx.nodeKind,
|
|
@@ -1747,7 +1749,7 @@ async function syncFulltextBatchForKind(args, schema, items) {
|
|
|
1747
1749
|
}
|
|
1748
1750
|
const rows = [];
|
|
1749
1751
|
const emptyContentIds = [];
|
|
1750
|
-
const hasSearchableFields =
|
|
1752
|
+
const hasSearchableFields = chunkHAHNRASW_cjs.getSearchableFields(schema).length > 0;
|
|
1751
1753
|
for (const item of items) {
|
|
1752
1754
|
const computed = computeFulltextContent(schema, item.props);
|
|
1753
1755
|
if (computed !== void 0) {
|
|
@@ -1794,7 +1796,7 @@ async function deleteNodeFulltext(ctx, schema) {
|
|
|
1794
1796
|
if (!backend.deleteFulltext) {
|
|
1795
1797
|
return;
|
|
1796
1798
|
}
|
|
1797
|
-
if (
|
|
1799
|
+
if (chunkHAHNRASW_cjs.getSearchableFields(schema).length === 0) {
|
|
1798
1800
|
return;
|
|
1799
1801
|
}
|
|
1800
1802
|
await backend.deleteFulltext({
|
|
@@ -1856,7 +1858,7 @@ function evaluatePredicate(predicate, props) {
|
|
|
1856
1858
|
if (pred.op === "isNull") {
|
|
1857
1859
|
return value === null || value === void 0;
|
|
1858
1860
|
}
|
|
1859
|
-
return
|
|
1861
|
+
return chunkIPSVVTWT_cjs.isPresent(value);
|
|
1860
1862
|
}
|
|
1861
1863
|
function getKindsForUniquenessCheck(baseKind, scope, registry) {
|
|
1862
1864
|
if (scope === "kind") {
|
|
@@ -1885,7 +1887,7 @@ function checkCardinality(edgeKind, fromKind, fromId, cardinality, existingEdgeC
|
|
|
1885
1887
|
}
|
|
1886
1888
|
case "one": {
|
|
1887
1889
|
if (existingEdgeCount > 0) {
|
|
1888
|
-
return new
|
|
1890
|
+
return new chunkBVRDGYXQ_cjs.CardinalityError({
|
|
1889
1891
|
edgeKind,
|
|
1890
1892
|
fromKind,
|
|
1891
1893
|
fromId,
|
|
@@ -1900,7 +1902,7 @@ function checkCardinality(edgeKind, fromKind, fromId, cardinality, existingEdgeC
|
|
|
1900
1902
|
}
|
|
1901
1903
|
case "oneActive": {
|
|
1902
1904
|
if (hasActiveEdge) {
|
|
1903
|
-
return new
|
|
1905
|
+
return new chunkBVRDGYXQ_cjs.CardinalityError({
|
|
1904
1906
|
edgeKind,
|
|
1905
1907
|
fromKind,
|
|
1906
1908
|
fromId,
|
|
@@ -1914,7 +1916,7 @@ function checkCardinality(edgeKind, fromKind, fromId, cardinality, existingEdgeC
|
|
|
1914
1916
|
}
|
|
1915
1917
|
function checkUniqueEdge(edgeKind, fromKind, fromId, _toKind, _toId, existingCount) {
|
|
1916
1918
|
if (existingCount > 0) {
|
|
1917
|
-
return new
|
|
1919
|
+
return new chunkBVRDGYXQ_cjs.CardinalityError({
|
|
1918
1920
|
edgeKind,
|
|
1919
1921
|
fromKind,
|
|
1920
1922
|
fromId,
|
|
@@ -1927,7 +1929,7 @@ function checkUniqueEdge(edgeKind, fromKind, fromId, _toKind, _toId, existingCou
|
|
|
1927
1929
|
function validateEdgeEndpoints(edgeKind, fromKind, toKind, registration, registry) {
|
|
1928
1930
|
const validFromKinds = registration.from.map((node) => node.kind);
|
|
1929
1931
|
if (!registry.isAssignableToAny(fromKind, validFromKinds)) {
|
|
1930
|
-
return new
|
|
1932
|
+
return new chunkBVRDGYXQ_cjs.EndpointError({
|
|
1931
1933
|
edgeKind,
|
|
1932
1934
|
endpoint: "from",
|
|
1933
1935
|
actualKind: fromKind,
|
|
@@ -1936,7 +1938,7 @@ function validateEdgeEndpoints(edgeKind, fromKind, toKind, registration, registr
|
|
|
1936
1938
|
}
|
|
1937
1939
|
const validToKinds = registration.to.map((node) => node.kind);
|
|
1938
1940
|
if (!registry.isAssignableToAny(toKind, validToKinds)) {
|
|
1939
|
-
return new
|
|
1941
|
+
return new chunkBVRDGYXQ_cjs.EndpointError({
|
|
1940
1942
|
edgeKind,
|
|
1941
1943
|
endpoint: "to",
|
|
1942
1944
|
actualKind: toKind,
|
|
@@ -1948,7 +1950,7 @@ function validateEdgeEndpoints(edgeKind, fromKind, toKind, registration, registr
|
|
|
1948
1950
|
function checkDisjointness(nodeId, nodeKind, existingKinds, registry) {
|
|
1949
1951
|
for (const existingKind of existingKinds) {
|
|
1950
1952
|
if (registry.areDisjoint(nodeKind, existingKind)) {
|
|
1951
|
-
return new
|
|
1953
|
+
return new chunkBVRDGYXQ_cjs.DisjointError({
|
|
1952
1954
|
nodeId,
|
|
1953
1955
|
attemptedKind: nodeKind,
|
|
1954
1956
|
conflictingKind: existingKind
|
|
@@ -1985,7 +1987,7 @@ async function checkUniquenessConstraints(ctx, kind, id, props, constraints) {
|
|
|
1985
1987
|
key
|
|
1986
1988
|
});
|
|
1987
1989
|
if (existing && existing.node_id !== id) {
|
|
1988
|
-
throw new
|
|
1990
|
+
throw new chunkBVRDGYXQ_cjs.UniquenessError({
|
|
1989
1991
|
constraintName: constraint.name,
|
|
1990
1992
|
kind: kindToCheck,
|
|
1991
1993
|
existingId: existing.node_id,
|
|
@@ -2091,7 +2093,7 @@ async function updateUniquenessEntries(ctx, kind, id, oldProps, newProps, constr
|
|
|
2091
2093
|
key: newKey
|
|
2092
2094
|
});
|
|
2093
2095
|
if (existing && existing.node_id !== id) {
|
|
2094
|
-
throw new
|
|
2096
|
+
throw new chunkBVRDGYXQ_cjs.UniquenessError({
|
|
2095
2097
|
constraintName: constraint.name,
|
|
2096
2098
|
kind: kindToCheck,
|
|
2097
2099
|
existingId: existing.node_id,
|
|
@@ -2148,7 +2150,7 @@ async function enforceNodeDeleteBehavior(ctx, args, backend, policy) {
|
|
|
2148
2150
|
if (connectedEdges.length === 0) return;
|
|
2149
2151
|
switch (behavior) {
|
|
2150
2152
|
case "restrict": {
|
|
2151
|
-
throw new
|
|
2153
|
+
throw new chunkBVRDGYXQ_cjs.RestrictedDeleteError({
|
|
2152
2154
|
nodeKind: args.kind,
|
|
2153
2155
|
nodeId: args.id,
|
|
2154
2156
|
edgeCount: connectedEdges.length,
|
|
@@ -2221,7 +2223,7 @@ async function applyNodeInsertSideEffectsBatch(ctx, items, backend) {
|
|
|
2221
2223
|
);
|
|
2222
2224
|
}
|
|
2223
2225
|
function parseRowProps(row) {
|
|
2224
|
-
return
|
|
2226
|
+
return chunkIPSVVTWT_cjs.rowPropsToObject(row.props);
|
|
2225
2227
|
}
|
|
2226
2228
|
async function applyNodeUpdate(ctx, args, backend) {
|
|
2227
2229
|
const { kind, id } = args.existing;
|
|
@@ -2412,5 +2414,5 @@ exports.validateEdgeEndpoints = validateEdgeEndpoints;
|
|
|
2412
2414
|
exports.vectorSlotKey = vectorSlotKey;
|
|
2413
2415
|
exports.withRecordedCoordinate = withRecordedCoordinate;
|
|
2414
2416
|
exports.withRecordedFlushObserver = withRecordedFlushObserver;
|
|
2415
|
-
//# sourceMappingURL=chunk-
|
|
2416
|
-
//# sourceMappingURL=chunk-
|
|
2417
|
+
//# sourceMappingURL=chunk-WOJMKB3N.cjs.map
|
|
2418
|
+
//# sourceMappingURL=chunk-WOJMKB3N.cjs.map
|