@nicia-ai/typegraph 0.33.0 → 0.34.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/README.md +20 -0
- package/dist/backend/postgres/index.cjs +26 -22
- package/dist/backend/postgres/index.d.cts +5 -5
- package/dist/backend/postgres/index.d.ts +5 -5
- package/dist/backend/postgres/index.js +13 -9
- package/dist/backend/postgres/pglite.cjs +17 -13
- package/dist/backend/postgres/pglite.cjs.map +1 -1
- package/dist/backend/postgres/pglite.d.cts +2 -2
- package/dist/backend/postgres/pglite.d.ts +2 -2
- package/dist/backend/postgres/pglite.js +13 -9
- package/dist/backend/postgres/pglite.js.map +1 -1
- package/dist/backend/sqlite/index.cjs +24 -20
- package/dist/backend/sqlite/index.d.cts +6 -6
- package/dist/backend/sqlite/index.d.ts +6 -6
- package/dist/backend/sqlite/index.js +12 -8
- package/dist/backend/sqlite/libsql.cjs +18 -14
- package/dist/backend/sqlite/libsql.cjs.map +1 -1
- package/dist/backend/sqlite/libsql.d.cts +11 -4
- package/dist/backend/sqlite/libsql.d.ts +11 -4
- package/dist/backend/sqlite/libsql.js +14 -10
- package/dist/backend/sqlite/libsql.js.map +1 -1
- package/dist/backend/sqlite/local.cjs +18 -14
- package/dist/backend/sqlite/local.cjs.map +1 -1
- package/dist/backend/sqlite/local.d.cts +2 -2
- package/dist/backend/sqlite/local.d.ts +2 -2
- package/dist/backend/sqlite/local.js +13 -9
- package/dist/backend/sqlite/local.js.map +1 -1
- package/dist/chunk-2EBMPJBO.js +16 -0
- package/dist/chunk-2EBMPJBO.js.map +1 -0
- package/dist/{chunk-CFNT3ITG.cjs → chunk-2JXB3NYJ.cjs} +15 -35
- package/dist/chunk-2JXB3NYJ.cjs.map +1 -0
- package/dist/{chunk-GYVBEZAO.js → chunk-2MRAX3UE.js} +3 -18
- package/dist/chunk-2MRAX3UE.js.map +1 -0
- package/dist/{chunk-D3EWZ67S.cjs → chunk-3BRVBQQD.cjs} +999 -2675
- package/dist/chunk-3BRVBQQD.cjs.map +1 -0
- package/dist/{chunk-FDN43KXV.cjs → chunk-3Z6TW3CT.cjs} +20 -19
- package/dist/chunk-3Z6TW3CT.cjs.map +1 -0
- package/dist/{chunk-6NRFUHMS.js → chunk-4DIBPQNJ.js} +5 -4
- package/dist/chunk-4DIBPQNJ.js.map +1 -0
- package/dist/chunk-4S2FXGBJ.js +9 -0
- package/dist/chunk-4S2FXGBJ.js.map +1 -0
- package/dist/chunk-5IQIX7LU.cjs +2070 -0
- package/dist/chunk-5IQIX7LU.cjs.map +1 -0
- package/dist/{chunk-CWFPJ3RC.js → chunk-6GNSY7AV.js} +3 -3
- package/dist/{chunk-CWFPJ3RC.js.map → chunk-6GNSY7AV.js.map} +1 -1
- package/dist/{chunk-NG5N7R45.cjs → chunk-6HVOHZHS.cjs} +184 -117
- package/dist/chunk-6HVOHZHS.cjs.map +1 -0
- package/dist/chunk-6SCVW4AS.js +20 -0
- package/dist/chunk-6SCVW4AS.js.map +1 -0
- package/dist/chunk-A7SZZFAG.js +2010 -0
- package/dist/chunk-A7SZZFAG.js.map +1 -0
- package/dist/chunk-ACSVZPK7.cjs +21 -0
- package/dist/chunk-ACSVZPK7.cjs.map +1 -0
- package/dist/{chunk-IZ4PCL47.js → chunk-BVTWD66D.js} +4 -66
- package/dist/chunk-BVTWD66D.js.map +1 -0
- package/dist/{chunk-QBYTJSAY.js → chunk-CHXTTSC6.js} +5 -39
- package/dist/chunk-CHXTTSC6.js.map +1 -0
- package/dist/{chunk-DJYRRDHA.js → chunk-CYX2JTDG.js} +3 -3
- package/dist/{chunk-DJYRRDHA.js.map → chunk-CYX2JTDG.js.map} +1 -1
- package/dist/{chunk-PRMKPFN5.js → chunk-DEQFL35G.js} +4 -3
- package/dist/chunk-DEQFL35G.js.map +1 -0
- package/dist/chunk-DI74SMXS.cjs +29 -0
- package/dist/chunk-DI74SMXS.cjs.map +1 -0
- package/dist/{chunk-WWVV44DY.cjs → chunk-G6SOJEDI.cjs} +11 -11
- package/dist/{chunk-WWVV44DY.cjs.map → chunk-G6SOJEDI.cjs.map} +1 -1
- package/dist/{chunk-LM2IC4ZJ.cjs → chunk-GQANNXXT.cjs} +15 -14
- package/dist/chunk-GQANNXXT.cjs.map +1 -0
- package/dist/chunk-GZCNZ7QW.js +24 -0
- package/dist/chunk-GZCNZ7QW.js.map +1 -0
- package/dist/{chunk-KTIEB7VH.cjs → chunk-HK5SATYM.cjs} +35 -58
- package/dist/chunk-HK5SATYM.cjs.map +1 -0
- package/dist/chunk-HMFK4BXR.cjs +12 -0
- package/dist/{chunk-6ZR4QC3O.cjs.map → chunk-HMFK4BXR.cjs.map} +1 -1
- package/dist/chunk-ITE4IXAK.js +25 -0
- package/dist/chunk-ITE4IXAK.js.map +1 -0
- package/dist/chunk-JJRCLAUN.cjs +155 -0
- package/dist/chunk-JJRCLAUN.cjs.map +1 -0
- package/dist/{chunk-ZFWNO3GE.cjs → chunk-JQGIPGVL.cjs} +66 -2
- package/dist/chunk-JQGIPGVL.cjs.map +1 -0
- package/dist/{chunk-XVUJY72M.js → chunk-K2TGS3EN.js} +105 -38
- package/dist/chunk-K2TGS3EN.js.map +1 -0
- package/dist/chunk-K34OPSJK.js +29 -0
- package/dist/chunk-K34OPSJK.js.map +1 -0
- package/dist/{chunk-YW7GHMF4.cjs → chunk-KGC4LY5T.cjs} +18 -17
- package/dist/chunk-KGC4LY5T.cjs.map +1 -0
- package/dist/{chunk-SST7XDY6.cjs → chunk-KNHYNQQ3.cjs} +111 -72
- package/dist/chunk-KNHYNQQ3.cjs.map +1 -0
- package/dist/{chunk-C4C4Q7A6.js → chunk-KUTNI6SI.js} +6 -21
- package/dist/chunk-KUTNI6SI.js.map +1 -0
- package/dist/{chunk-OS6KS3HV.js → chunk-LANHCOXB.js} +8 -7
- package/dist/chunk-LANHCOXB.js.map +1 -0
- package/dist/chunk-N6WTUSBV.cjs +23 -0
- package/dist/chunk-N6WTUSBV.cjs.map +1 -0
- package/dist/{chunk-73KASJGO.cjs → chunk-NAUA4PW5.cjs} +4 -28
- package/dist/chunk-NAUA4PW5.cjs.map +1 -0
- package/dist/chunk-QV245VMN.js +145 -0
- package/dist/chunk-QV245VMN.js.map +1 -0
- package/dist/{chunk-CEF2QOTO.js → chunk-RBV7YCQD.js} +4 -3
- package/dist/chunk-RBV7YCQD.js.map +1 -0
- package/dist/{chunk-OIE2UPVG.cjs → chunk-RHZWOJVA.cjs} +2 -19
- package/dist/chunk-RHZWOJVA.cjs.map +1 -0
- package/dist/{chunk-3IR2GEMJ.cjs → chunk-RRKQAKD6.cjs} +10 -9
- package/dist/chunk-RRKQAKD6.cjs.map +1 -0
- package/dist/{chunk-UPDMJEW6.js → chunk-RY2VIWAM.js} +11 -8
- package/dist/chunk-RY2VIWAM.js.map +1 -0
- package/dist/{chunk-PIHXFF73.js → chunk-SHLY4MCM.js} +3 -3
- package/dist/{chunk-PIHXFF73.js.map → chunk-SHLY4MCM.js.map} +1 -1
- package/dist/{chunk-SPT5JMME.js → chunk-T2DWPQNE.js} +103 -64
- package/dist/chunk-T2DWPQNE.js.map +1 -0
- package/dist/{chunk-WYTUF3QO.js → chunk-T46GR2VY.js} +3 -3
- package/dist/{chunk-WYTUF3QO.js.map → chunk-T46GR2VY.js.map} +1 -1
- package/dist/{chunk-MBLXCV2Y.cjs → chunk-T6SPUYLX.cjs} +5 -43
- package/dist/chunk-T6SPUYLX.cjs.map +1 -0
- package/dist/{chunk-3QRBXYT5.cjs → chunk-TGJE22RM.cjs} +6 -6
- package/dist/{chunk-3QRBXYT5.cjs.map → chunk-TGJE22RM.cjs.map} +1 -1
- package/dist/{chunk-BF3ZDEUE.cjs → chunk-TOTPVGOG.cjs} +70 -69
- package/dist/chunk-TOTPVGOG.cjs.map +1 -0
- package/dist/{chunk-KY5SDVA7.cjs → chunk-UJLOZYKT.cjs} +90 -87
- package/dist/chunk-UJLOZYKT.cjs.map +1 -0
- package/dist/{chunk-I4W7MKVG.cjs → chunk-UNNPKQUG.cjs} +19 -155
- package/dist/chunk-UNNPKQUG.cjs.map +1 -0
- package/dist/chunk-UR7W5YQK.js +18 -0
- package/dist/chunk-UR7W5YQK.js.map +1 -0
- package/dist/{chunk-PYD3UCDU.js → chunk-V3QNTB7Z.js} +19 -148
- package/dist/chunk-V3QNTB7Z.js.map +1 -0
- package/dist/{chunk-XKNAK27R.js → chunk-VCGO4V26.js} +4 -3
- package/dist/chunk-VCGO4V26.js.map +1 -0
- package/dist/{chunk-EF3Z645U.cjs → chunk-WL2SG7ZV.cjs} +6 -72
- package/dist/chunk-WL2SG7ZV.cjs.map +1 -0
- package/dist/{chunk-WLP6TKFB.js → chunk-WLRIWYHQ.js} +640 -2307
- package/dist/chunk-WLRIWYHQ.js.map +1 -0
- package/dist/{chunk-4RBAJVEC.cjs → chunk-WVC2Q2FD.cjs} +5 -5
- package/dist/{chunk-4RBAJVEC.cjs.map → chunk-WVC2Q2FD.cjs.map} +1 -1
- package/dist/chunk-XXVEULWX.js +39 -0
- package/dist/chunk-XXVEULWX.js.map +1 -0
- package/dist/chunk-YAZE7QZR.cjs +32 -0
- package/dist/chunk-YAZE7QZR.cjs.map +1 -0
- package/dist/chunk-YC6PWTHY.cjs +44 -0
- package/dist/chunk-YC6PWTHY.cjs.map +1 -0
- package/dist/chunk-Z5HBYM7U.cjs +11 -0
- package/dist/chunk-Z5HBYM7U.cjs.map +1 -0
- package/dist/{chunk-454I6GDF.js → chunk-Z5XBMDXU.js} +63 -3
- package/dist/chunk-Z5XBMDXU.js.map +1 -0
- package/dist/{chunk-3642VBVC.cjs → chunk-ZP5WHI4C.cjs} +106 -80
- package/dist/chunk-ZP5WHI4C.cjs.map +1 -0
- package/dist/{chunk-YCV72E6L.js → chunk-ZURTTSCM.js} +4 -25
- package/dist/chunk-ZURTTSCM.js.map +1 -0
- package/dist/{chunk-JHOBXD7O.js → chunk-ZV5N4DBG.js} +46 -20
- package/dist/chunk-ZV5N4DBG.js.map +1 -0
- package/dist/chunk-ZY4GXIVN.cjs +32 -0
- package/dist/chunk-ZY4GXIVN.cjs.map +1 -0
- package/dist/{ddl-CVnHJcar.d.ts → ddl-BrmPg61z.d.ts} +3 -3
- package/dist/{ddl-Dxt_fBHr.d.cts → ddl-j1-sH6lE.d.cts} +3 -3
- package/dist/graph-extension/index.cjs +18 -17
- package/dist/graph-extension/index.js +3 -2
- package/dist/graph-merge/index.cjs +294 -146
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +3 -3
- package/dist/graph-merge/index.d.ts +3 -3
- package/dist/graph-merge/index.js +172 -24
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/index.cjs +181 -172
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +30 -22
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.cjs +27 -25
- package/dist/indexes/index.d.cts +4 -4
- package/dist/indexes/index.d.ts +4 -4
- package/dist/indexes/index.js +9 -7
- package/dist/interchange/index.cjs +25 -16
- package/dist/interchange/index.d.cts +3 -3
- package/dist/interchange/index.d.ts +3 -3
- package/dist/interchange/index.js +12 -3
- package/dist/{manager-C0_r0ALf.d.ts → manager-BZUeN_BU.d.ts} +1 -1
- package/dist/{manager-BYl_zyZR.d.cts → manager-ms9cKdc6.d.cts} +1 -1
- package/dist/{postgres-MzBPkYzq.d.ts → postgres-BhpxGMC5.d.cts} +1 -1
- package/dist/{postgres-_9psmVGm.d.cts → postgres-CWHLwNl1.d.ts} +1 -1
- package/dist/profiler/index.cjs +3 -3
- package/dist/profiler/index.d.cts +5 -5
- package/dist/profiler/index.d.ts +5 -5
- package/dist/profiler/index.js +2 -2
- package/dist/provenance/index.cjs +591 -0
- package/dist/provenance/index.cjs.map +1 -0
- package/dist/provenance/index.d.cts +73 -0
- package/dist/provenance/index.d.ts +73 -0
- package/dist/provenance/index.js +589 -0
- package/dist/provenance/index.js.map +1 -0
- package/dist/schema/index.cjs +36 -32
- package/dist/schema/index.cjs.map +1 -1
- package/dist/schema/index.d.cts +4 -4
- package/dist/schema/index.d.ts +4 -4
- package/dist/schema/index.js +13 -9
- package/dist/schema/index.js.map +1 -1
- package/dist/{sqlite-gm44dShb.d.ts → sqlite-CGu5SLsw.d.ts} +1 -1
- package/dist/{sqlite-BfksSb45.d.cts → sqlite-XrDxNaa7.d.cts} +1 -1
- package/dist/{store-view-FfE5_7eo.d.ts → store-view-BlgnhEYf.d.ts} +33 -5
- package/dist/{store-view-9jQ2rPum.d.cts → store-view-D09po4H6.d.cts} +33 -5
- package/dist/{types-CdWxK-nD.d.ts → types-B1TbZJYS.d.ts} +1 -1
- package/dist/{types-DGylBhWo.d.ts → types-D1Sqeyxy.d.ts} +7 -3
- package/dist/{types-B6mhrcLv.d.cts → types-DiE1AO7p.d.cts} +1 -1
- package/dist/{types-C_UnQOQp.d.cts → types-DkNnF-7K.d.cts} +7 -3
- package/dist/{where-Bpp2ul_z.d.cts → where-DKjuofPr.d.cts} +1 -1
- package/dist/{where-BsEXraKW.d.ts → where-DrUIIWHb.d.ts} +1 -1
- package/package.json +8 -2
- package/dist/chunk-2YMGNYXY.js +0 -40
- package/dist/chunk-2YMGNYXY.js.map +0 -1
- package/dist/chunk-3642VBVC.cjs.map +0 -1
- package/dist/chunk-3IR2GEMJ.cjs.map +0 -1
- package/dist/chunk-454I6GDF.js.map +0 -1
- package/dist/chunk-6NRFUHMS.js.map +0 -1
- package/dist/chunk-6ZR4QC3O.cjs +0 -12
- package/dist/chunk-73KASJGO.cjs.map +0 -1
- package/dist/chunk-BF3ZDEUE.cjs.map +0 -1
- package/dist/chunk-C4C4Q7A6.js.map +0 -1
- package/dist/chunk-CEF2QOTO.js.map +0 -1
- package/dist/chunk-CFNT3ITG.cjs.map +0 -1
- package/dist/chunk-D3EWZ67S.cjs.map +0 -1
- package/dist/chunk-EF3Z645U.cjs.map +0 -1
- package/dist/chunk-FDN43KXV.cjs.map +0 -1
- package/dist/chunk-GYVBEZAO.js.map +0 -1
- package/dist/chunk-I4W7MKVG.cjs.map +0 -1
- package/dist/chunk-IZ4PCL47.js.map +0 -1
- package/dist/chunk-JHOBXD7O.js.map +0 -1
- package/dist/chunk-KTIEB7VH.cjs.map +0 -1
- package/dist/chunk-KY5SDVA7.cjs.map +0 -1
- package/dist/chunk-LM2IC4ZJ.cjs.map +0 -1
- package/dist/chunk-MBLXCV2Y.cjs.map +0 -1
- package/dist/chunk-NG5N7R45.cjs.map +0 -1
- package/dist/chunk-OIE2UPVG.cjs.map +0 -1
- package/dist/chunk-OS6KS3HV.js.map +0 -1
- package/dist/chunk-PRMKPFN5.js.map +0 -1
- package/dist/chunk-PYD3UCDU.js.map +0 -1
- package/dist/chunk-QBYTJSAY.js.map +0 -1
- package/dist/chunk-SPT5JMME.js.map +0 -1
- package/dist/chunk-SST7XDY6.cjs.map +0 -1
- package/dist/chunk-UPDMJEW6.js.map +0 -1
- package/dist/chunk-WLP6TKFB.js.map +0 -1
- package/dist/chunk-XKNAK27R.js.map +0 -1
- package/dist/chunk-XVUJY72M.js.map +0 -1
- package/dist/chunk-YCV72E6L.js.map +0 -1
- package/dist/chunk-YW7GHMF4.cjs.map +0 -1
- package/dist/chunk-ZFWNO3GE.cjs.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var chunkYAZE7QZR_cjs = require('./chunk-YAZE7QZR.cjs');
|
|
3
4
|
var chunk3E7SNSIA_cjs = require('./chunk-3E7SNSIA.cjs');
|
|
4
5
|
var chunkJIEJCTDS_cjs = require('./chunk-JIEJCTDS.cjs');
|
|
5
6
|
var chunkFLRCVI2G_cjs = require('./chunk-FLRCVI2G.cjs');
|
|
@@ -542,6 +543,12 @@ function assertCompatibleSubqueryValueTypes(field, subquery) {
|
|
|
542
543
|
}
|
|
543
544
|
|
|
544
545
|
// src/backend/types.ts
|
|
546
|
+
function isLiveNodeRow(row) {
|
|
547
|
+
return row.deleted_at === void 0;
|
|
548
|
+
}
|
|
549
|
+
function isTombstonedNodeRow(row) {
|
|
550
|
+
return row.deleted_at !== void 0;
|
|
551
|
+
}
|
|
545
552
|
function createBackendOverlay(target, overlay) {
|
|
546
553
|
const boundTargetMethods = /* @__PURE__ */ new Map();
|
|
547
554
|
function hasOverlayProperty(property) {
|
|
@@ -789,7 +796,10 @@ function convertValueForSql(value, dialect) {
|
|
|
789
796
|
return dialect.bindValue(value);
|
|
790
797
|
}
|
|
791
798
|
function compileStringPattern(op, pattern) {
|
|
792
|
-
const escaped = pattern.replaceAll(
|
|
799
|
+
const escaped = pattern.replaceAll(
|
|
800
|
+
chunkYAZE7QZR_cjs.LIKE_ESCAPE_CHARACTER,
|
|
801
|
+
`${chunkYAZE7QZR_cjs.LIKE_ESCAPE_CHARACTER}${chunkYAZE7QZR_cjs.LIKE_ESCAPE_CHARACTER}`
|
|
802
|
+
).replaceAll("%", `${chunkYAZE7QZR_cjs.LIKE_ESCAPE_CHARACTER}%`).replaceAll("_", `${chunkYAZE7QZR_cjs.LIKE_ESCAPE_CHARACTER}_`);
|
|
793
803
|
switch (op) {
|
|
794
804
|
case "contains": {
|
|
795
805
|
return `%${escaped}%`;
|
|
@@ -810,7 +820,8 @@ function compileStringPattern(op, pattern) {
|
|
|
810
820
|
}
|
|
811
821
|
}
|
|
812
822
|
function escapeLikePatternParameter(parameter) {
|
|
813
|
-
|
|
823
|
+
const doubledEscape = `${chunkYAZE7QZR_cjs.LIKE_ESCAPE_CHARACTER}${chunkYAZE7QZR_cjs.LIKE_ESCAPE_CHARACTER}`;
|
|
824
|
+
return drizzleOrm.sql`REPLACE(REPLACE(REPLACE(${parameter}, ${chunkYAZE7QZR_cjs.LIKE_ESCAPE_CHARACTER}, ${doubledEscape}), '%', ${`${chunkYAZE7QZR_cjs.LIKE_ESCAPE_CHARACTER}%`}), '_', ${`${chunkYAZE7QZR_cjs.LIKE_ESCAPE_CHARACTER}_`})`;
|
|
814
825
|
}
|
|
815
826
|
function compileParameterizedStringPattern(op, parameter) {
|
|
816
827
|
switch (op) {
|
|
@@ -856,13 +867,13 @@ function compilePredicateExpression(expr, ctx) {
|
|
|
856
867
|
if (expr.op === "ilike" || expr.op === "contains" || expr.op === "startsWith" || expr.op === "endsWith") {
|
|
857
868
|
return dialect.ilike(field, pattern2);
|
|
858
869
|
}
|
|
859
|
-
return drizzleOrm.sql`${field} LIKE ${pattern2}`;
|
|
870
|
+
return drizzleOrm.sql`${field} LIKE ${pattern2} ${chunkYAZE7QZR_cjs.likeEscapeClause}`;
|
|
860
871
|
}
|
|
861
872
|
const pattern = compileStringPattern(expr.op, expr.pattern);
|
|
862
873
|
if (expr.op === "ilike" || expr.op === "contains" || expr.op === "startsWith" || expr.op === "endsWith") {
|
|
863
874
|
return dialect.ilike(field, pattern);
|
|
864
875
|
}
|
|
865
|
-
return drizzleOrm.sql`${field} LIKE ${pattern}`;
|
|
876
|
+
return drizzleOrm.sql`${field} LIKE ${pattern} ${chunkYAZE7QZR_cjs.likeEscapeClause}`;
|
|
866
877
|
}
|
|
867
878
|
case "null_check": {
|
|
868
879
|
const field = compileFieldTextValue(
|
|
@@ -1308,146 +1319,6 @@ function getHybridTargetAlias(vectorPredicate, fulltextPredicate) {
|
|
|
1308
1319
|
return vectorPredicate.field.alias === fulltextPredicate.field.alias ? vectorPredicate.field.alias : void 0;
|
|
1309
1320
|
}
|
|
1310
1321
|
|
|
1311
|
-
// src/backend/drizzle/row-mappers.ts
|
|
1312
|
-
function requireTimestamp(value, field) {
|
|
1313
|
-
if (value === void 0) {
|
|
1314
|
-
throw new chunkJIEJCTDS_cjs.DatabaseOperationError(
|
|
1315
|
-
`Expected non-null ${field} timestamp`,
|
|
1316
|
-
{ operation: "select", entity: "row" }
|
|
1317
|
-
);
|
|
1318
|
-
}
|
|
1319
|
-
return value;
|
|
1320
|
-
}
|
|
1321
|
-
function asString(value, field) {
|
|
1322
|
-
if (typeof value !== "string") {
|
|
1323
|
-
throw new chunkJIEJCTDS_cjs.DatabaseOperationError(
|
|
1324
|
-
`Expected ${field} to be string, got ${typeof value}`,
|
|
1325
|
-
{ operation: "select", entity: "row" }
|
|
1326
|
-
);
|
|
1327
|
-
}
|
|
1328
|
-
return value;
|
|
1329
|
-
}
|
|
1330
|
-
function asNumber(value, field) {
|
|
1331
|
-
if (typeof value !== "number") {
|
|
1332
|
-
throw new chunkJIEJCTDS_cjs.DatabaseOperationError(
|
|
1333
|
-
`Expected ${field} to be number, got ${typeof value}`,
|
|
1334
|
-
{ operation: "select", entity: "row" }
|
|
1335
|
-
);
|
|
1336
|
-
}
|
|
1337
|
-
return value;
|
|
1338
|
-
}
|
|
1339
|
-
function nowIso() {
|
|
1340
|
-
return (/* @__PURE__ */ new Date()).toISOString();
|
|
1341
|
-
}
|
|
1342
|
-
function nullToUndefined(value) {
|
|
1343
|
-
return value ?? void 0;
|
|
1344
|
-
}
|
|
1345
|
-
function formatPostgresTimestamp(value) {
|
|
1346
|
-
if (value === null || value === void 0) return void 0;
|
|
1347
|
-
if (value instanceof Date) return value.toISOString();
|
|
1348
|
-
if (typeof value === "string") {
|
|
1349
|
-
if (value.includes("T")) return value;
|
|
1350
|
-
const date = new Date(value);
|
|
1351
|
-
if (!Number.isNaN(date.getTime())) return date.toISOString();
|
|
1352
|
-
return value;
|
|
1353
|
-
}
|
|
1354
|
-
return void 0;
|
|
1355
|
-
}
|
|
1356
|
-
function coerceNumericScore(value) {
|
|
1357
|
-
if (typeof value === "number") return value;
|
|
1358
|
-
const parsed = Number.parseFloat(value);
|
|
1359
|
-
if (Number.isNaN(parsed)) {
|
|
1360
|
-
throw new TypeError(
|
|
1361
|
-
`Backend returned non-numeric fulltext score: ${JSON.stringify(value)}`
|
|
1362
|
-
);
|
|
1363
|
-
}
|
|
1364
|
-
return parsed;
|
|
1365
|
-
}
|
|
1366
|
-
function normalizeJsonColumn(value) {
|
|
1367
|
-
return typeof value === "string" ? value : JSON.stringify(value ?? {});
|
|
1368
|
-
}
|
|
1369
|
-
var SQLITE_ROW_MAPPER_CONFIG = {
|
|
1370
|
-
formatTimestamp: (value) => {
|
|
1371
|
-
if (value === null || value === void 0) return;
|
|
1372
|
-
if (typeof value !== "string") {
|
|
1373
|
-
throw new chunkJIEJCTDS_cjs.DatabaseOperationError(
|
|
1374
|
-
`Expected timestamp to be string, got ${typeof value}`,
|
|
1375
|
-
{ operation: "select", entity: "row" }
|
|
1376
|
-
);
|
|
1377
|
-
}
|
|
1378
|
-
return value;
|
|
1379
|
-
},
|
|
1380
|
-
normalizeJson: (value) => {
|
|
1381
|
-
if (typeof value !== "string") {
|
|
1382
|
-
throw new chunkJIEJCTDS_cjs.DatabaseOperationError(
|
|
1383
|
-
`Expected JSON column to be string, got ${typeof value}`,
|
|
1384
|
-
{ operation: "select", entity: "row" }
|
|
1385
|
-
);
|
|
1386
|
-
}
|
|
1387
|
-
return value;
|
|
1388
|
-
}
|
|
1389
|
-
};
|
|
1390
|
-
var POSTGRES_ROW_MAPPER_CONFIG = {
|
|
1391
|
-
formatTimestamp: formatPostgresTimestamp,
|
|
1392
|
-
normalizeJson: normalizeJsonColumn
|
|
1393
|
-
};
|
|
1394
|
-
function createNodeRowMapper(config) {
|
|
1395
|
-
return (row) => ({
|
|
1396
|
-
graph_id: asString(row.graph_id, "graph_id"),
|
|
1397
|
-
kind: asString(row.kind, "kind"),
|
|
1398
|
-
id: asString(row.id, "id"),
|
|
1399
|
-
props: config.normalizeJson(row.props),
|
|
1400
|
-
version: asNumber(row.version, "version"),
|
|
1401
|
-
valid_from: nullToUndefined(config.formatTimestamp(row.valid_from)),
|
|
1402
|
-
valid_to: nullToUndefined(config.formatTimestamp(row.valid_to)),
|
|
1403
|
-
created_at: requireTimestamp(config.formatTimestamp(row.created_at), "created_at"),
|
|
1404
|
-
updated_at: requireTimestamp(config.formatTimestamp(row.updated_at), "updated_at"),
|
|
1405
|
-
deleted_at: nullToUndefined(config.formatTimestamp(row.deleted_at))
|
|
1406
|
-
});
|
|
1407
|
-
}
|
|
1408
|
-
function createEdgeRowMapper(config) {
|
|
1409
|
-
return (row) => ({
|
|
1410
|
-
graph_id: asString(row.graph_id, "graph_id"),
|
|
1411
|
-
id: asString(row.id, "id"),
|
|
1412
|
-
kind: asString(row.kind, "kind"),
|
|
1413
|
-
from_kind: asString(row.from_kind, "from_kind"),
|
|
1414
|
-
from_id: asString(row.from_id, "from_id"),
|
|
1415
|
-
to_kind: asString(row.to_kind, "to_kind"),
|
|
1416
|
-
to_id: asString(row.to_id, "to_id"),
|
|
1417
|
-
props: config.normalizeJson(row.props),
|
|
1418
|
-
valid_from: nullToUndefined(config.formatTimestamp(row.valid_from)),
|
|
1419
|
-
valid_to: nullToUndefined(config.formatTimestamp(row.valid_to)),
|
|
1420
|
-
created_at: requireTimestamp(config.formatTimestamp(row.created_at), "created_at"),
|
|
1421
|
-
updated_at: requireTimestamp(config.formatTimestamp(row.updated_at), "updated_at"),
|
|
1422
|
-
deleted_at: nullToUndefined(config.formatTimestamp(row.deleted_at))
|
|
1423
|
-
});
|
|
1424
|
-
}
|
|
1425
|
-
function createUniqueRowMapper(config) {
|
|
1426
|
-
return (row) => ({
|
|
1427
|
-
graph_id: asString(row.graph_id, "graph_id"),
|
|
1428
|
-
node_kind: asString(row.node_kind, "node_kind"),
|
|
1429
|
-
constraint_name: asString(row.constraint_name, "constraint_name"),
|
|
1430
|
-
key: asString(row.key, "key"),
|
|
1431
|
-
node_id: asString(row.node_id, "node_id"),
|
|
1432
|
-
concrete_kind: asString(row.concrete_kind, "concrete_kind"),
|
|
1433
|
-
deleted_at: nullToUndefined(config.formatTimestamp(row.deleted_at))
|
|
1434
|
-
});
|
|
1435
|
-
}
|
|
1436
|
-
function createSchemaVersionRowMapper(config) {
|
|
1437
|
-
return (row) => {
|
|
1438
|
-
const isActiveValue = row.is_active;
|
|
1439
|
-
const isActive = isActiveValue === true || isActiveValue === 1 || isActiveValue === "1";
|
|
1440
|
-
return {
|
|
1441
|
-
graph_id: asString(row.graph_id, "graph_id"),
|
|
1442
|
-
version: asNumber(row.version, "version"),
|
|
1443
|
-
schema_hash: asString(row.schema_hash, "schema_hash"),
|
|
1444
|
-
schema_doc: config.normalizeJson(row.schema_doc),
|
|
1445
|
-
created_at: requireTimestamp(config.formatTimestamp(row.created_at), "created_at"),
|
|
1446
|
-
is_active: isActive
|
|
1447
|
-
};
|
|
1448
|
-
};
|
|
1449
|
-
}
|
|
1450
|
-
|
|
1451
1322
|
// src/utils/array.ts
|
|
1452
1323
|
function chunk(items, size) {
|
|
1453
1324
|
if (!Number.isSafeInteger(size) || size < 1) {
|
|
@@ -1479,42 +1350,35 @@ function isPresent(value) {
|
|
|
1479
1350
|
|
|
1480
1351
|
exports.POSTGRES_CAPABILITIES = POSTGRES_CAPABILITIES;
|
|
1481
1352
|
exports.POSTGRES_MAX_BIND_PARAMETERS = POSTGRES_MAX_BIND_PARAMETERS;
|
|
1482
|
-
exports.POSTGRES_ROW_MAPPER_CONFIG = POSTGRES_ROW_MAPPER_CONFIG;
|
|
1483
1353
|
exports.SQLITE_CAPABILITIES = SQLITE_CAPABILITIES;
|
|
1484
1354
|
exports.SQLITE_MAX_BIND_PARAMETERS = SQLITE_MAX_BIND_PARAMETERS;
|
|
1485
|
-
exports.SQLITE_ROW_MAPPER_CONFIG = SQLITE_ROW_MAPPER_CONFIG;
|
|
1486
1355
|
exports.arrayField = arrayField;
|
|
1487
1356
|
exports.baseField = baseField;
|
|
1488
1357
|
exports.buildFieldBuilderForTypeInfo = buildFieldBuilderForTypeInfo;
|
|
1489
1358
|
exports.buildPredicateIndex = buildPredicateIndex;
|
|
1490
1359
|
exports.chunk = chunk;
|
|
1491
|
-
exports.coerceNumericScore = coerceNumericScore;
|
|
1492
1360
|
exports.compileFieldValue = compileFieldValue;
|
|
1493
1361
|
exports.compileKindFilter = compileKindFilter;
|
|
1494
1362
|
exports.compilePredicateClauses = compilePredicateClauses;
|
|
1495
1363
|
exports.compilePredicateExpression = compilePredicateExpression;
|
|
1496
1364
|
exports.createBackendOverlay = createBackendOverlay;
|
|
1497
|
-
exports.createEdgeRowMapper = createEdgeRowMapper;
|
|
1498
1365
|
exports.createFulltextAccessor = createFulltextAccessor;
|
|
1499
|
-
exports.createNodeRowMapper = createNodeRowMapper;
|
|
1500
|
-
exports.createSchemaVersionRowMapper = createSchemaVersionRowMapper;
|
|
1501
|
-
exports.createUniqueRowMapper = createUniqueRowMapper;
|
|
1502
1366
|
exports.dateField = dateField;
|
|
1503
1367
|
exports.exists = exists;
|
|
1504
1368
|
exports.extractFulltextMatchPredicates = extractFulltextMatchPredicates;
|
|
1505
1369
|
exports.extractVectorSimilarityPredicates = extractVectorSimilarityPredicates;
|
|
1506
1370
|
exports.fieldRef = fieldRef;
|
|
1507
|
-
exports.formatPostgresTimestamp = formatPostgresTimestamp;
|
|
1508
1371
|
exports.getHybridTargetAlias = getHybridTargetAlias;
|
|
1509
1372
|
exports.getNodeKindsForAlias = getNodeKindsForAlias;
|
|
1510
1373
|
exports.getPredicatesForAlias = getPredicatesForAlias;
|
|
1511
1374
|
exports.groupBy = groupBy;
|
|
1512
1375
|
exports.inSubquery = inSubquery;
|
|
1376
|
+
exports.isLiveNodeRow = isLiveNodeRow;
|
|
1513
1377
|
exports.isParameterRef = isParameterRef;
|
|
1514
1378
|
exports.isPresent = isPresent;
|
|
1379
|
+
exports.isTombstonedNodeRow = isTombstonedNodeRow;
|
|
1515
1380
|
exports.notExists = notExists;
|
|
1516
1381
|
exports.notInSubquery = notInSubquery;
|
|
1517
|
-
exports.nowIso = nowIso;
|
|
1518
1382
|
exports.numberField = numberField;
|
|
1519
1383
|
exports.objectField = objectField;
|
|
1520
1384
|
exports.param = param;
|
|
@@ -1522,5 +1386,5 @@ exports.runOptionallyInTransaction = runOptionallyInTransaction;
|
|
|
1522
1386
|
exports.sqlValueList = sqlValueList;
|
|
1523
1387
|
exports.stringField = stringField;
|
|
1524
1388
|
exports.wrapWithManagedClose = wrapWithManagedClose;
|
|
1525
|
-
//# sourceMappingURL=chunk-
|
|
1526
|
-
//# sourceMappingURL=chunk-
|
|
1389
|
+
//# sourceMappingURL=chunk-UNNPKQUG.cjs.map
|
|
1390
|
+
//# sourceMappingURL=chunk-UNNPKQUG.cjs.map
|