@nicia-ai/typegraph 0.33.0 → 0.35.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 +30 -26
- package/dist/backend/postgres/index.d.cts +39 -7
- package/dist/backend/postgres/index.d.ts +39 -7
- package/dist/backend/postgres/index.js +17 -13
- package/dist/backend/postgres/pglite.cjs +22 -18
- package/dist/backend/postgres/pglite.cjs.map +1 -1
- package/dist/backend/postgres/pglite.d.cts +4 -4
- package/dist/backend/postgres/pglite.d.ts +4 -4
- package/dist/backend/postgres/pglite.js +17 -13
- package/dist/backend/postgres/pglite.js.map +1 -1
- package/dist/backend/sqlite/index.cjs +26 -23
- package/dist/backend/sqlite/index.d.cts +8 -8
- package/dist/backend/sqlite/index.d.ts +8 -8
- package/dist/backend/sqlite/index.js +14 -11
- package/dist/backend/sqlite/libsql.cjs +21 -17
- package/dist/backend/sqlite/libsql.cjs.map +1 -1
- package/dist/backend/sqlite/libsql.d.cts +13 -6
- package/dist/backend/sqlite/libsql.d.ts +13 -6
- package/dist/backend/sqlite/libsql.js +17 -13
- package/dist/backend/sqlite/libsql.js.map +1 -1
- package/dist/backend/sqlite/local.cjs +102 -18
- package/dist/backend/sqlite/local.cjs.map +1 -1
- package/dist/backend/sqlite/local.d.cts +95 -5
- package/dist/backend/sqlite/local.d.ts +95 -5
- package/dist/backend/sqlite/local.js +96 -13
- package/dist/backend/sqlite/local.js.map +1 -1
- package/dist/{chunk-JHOBXD7O.js → chunk-3TWF3SH4.js} +332 -64
- package/dist/chunk-3TWF3SH4.js.map +1 -0
- package/dist/chunk-4JEZZJ6S.cjs +1271 -0
- package/dist/chunk-4JEZZJ6S.cjs.map +1 -0
- package/dist/{chunk-I4W7MKVG.cjs → chunk-4TOD4LBZ.cjs} +249 -294
- package/dist/chunk-4TOD4LBZ.cjs.map +1 -0
- package/dist/chunk-55MZDDZV.js +239 -0
- package/dist/chunk-55MZDDZV.js.map +1 -0
- package/dist/{chunk-LM2IC4ZJ.cjs → chunk-5A6FNS6N.cjs} +75 -19
- package/dist/chunk-5A6FNS6N.cjs.map +1 -0
- package/dist/{chunk-FDN43KXV.cjs → chunk-5AQIKK56.cjs} +65 -24
- package/dist/chunk-5AQIKK56.cjs.map +1 -0
- package/dist/{chunk-IZ4PCL47.js → chunk-5SEGFTZX.js} +4 -66
- package/dist/chunk-5SEGFTZX.js.map +1 -0
- package/dist/{chunk-CWFPJ3RC.js → chunk-6FR2MMS6.js} +7 -7
- package/dist/chunk-6FR2MMS6.js.map +1 -0
- package/dist/chunk-7YSP4V4R.cjs +69 -0
- package/dist/chunk-7YSP4V4R.cjs.map +1 -0
- package/dist/chunk-A42GCBGX.cjs +28 -0
- package/dist/chunk-A42GCBGX.cjs.map +1 -0
- package/dist/chunk-ACSVZPK7.cjs +21 -0
- package/dist/chunk-ACSVZPK7.cjs.map +1 -0
- package/dist/{chunk-OIE2UPVG.cjs → chunk-BLZDPRXT.cjs} +52 -21
- package/dist/chunk-BLZDPRXT.cjs.map +1 -0
- package/dist/chunk-BYPOGQWK.js +25 -0
- package/dist/chunk-BYPOGQWK.js.map +1 -0
- package/dist/{chunk-NG5N7R45.cjs → chunk-CK5BVQOW.cjs} +325 -213
- package/dist/chunk-CK5BVQOW.cjs.map +1 -0
- package/dist/chunk-CTTSDJLY.cjs +261 -0
- package/dist/chunk-CTTSDJLY.cjs.map +1 -0
- package/dist/chunk-CUHM5CWJ.cjs +12 -0
- package/dist/chunk-CUHM5CWJ.cjs.map +1 -0
- package/dist/chunk-CZQ3FO2Q.js +2320 -0
- package/dist/chunk-CZQ3FO2Q.js.map +1 -0
- package/dist/{chunk-CFNT3ITG.cjs → chunk-D7ZEOS56.cjs} +25 -52
- package/dist/chunk-D7ZEOS56.cjs.map +1 -0
- package/dist/chunk-DFVLCOP6.js +10 -0
- package/dist/chunk-DFVLCOP6.js.map +1 -0
- package/dist/chunk-DI74SMXS.cjs +29 -0
- package/dist/chunk-DI74SMXS.cjs.map +1 -0
- package/dist/{chunk-KY5SDVA7.cjs → chunk-EM3CWPND.cjs} +442 -113
- package/dist/chunk-EM3CWPND.cjs.map +1 -0
- package/dist/chunk-EMF62TZG.cjs +1176 -0
- package/dist/chunk-EMF62TZG.cjs.map +1 -0
- package/dist/chunk-EOLERH7Y.cjs +40 -0
- package/dist/chunk-EOLERH7Y.cjs.map +1 -0
- package/dist/{chunk-3QRBXYT5.cjs → chunk-FACJJWGF.cjs} +24 -6
- package/dist/chunk-FACJJWGF.cjs.map +1 -0
- package/dist/{chunk-KTIEB7VH.cjs → chunk-FL472AMI.cjs} +49 -165
- package/dist/chunk-FL472AMI.cjs.map +1 -0
- package/dist/{chunk-4RBAJVEC.cjs → chunk-FN35DLCN.cjs} +31 -9
- package/dist/chunk-FN35DLCN.cjs.map +1 -0
- package/dist/{chunk-C4C4Q7A6.js → chunk-FPIZFYHE.js} +12 -35
- package/dist/chunk-FPIZFYHE.js.map +1 -0
- package/dist/{chunk-XKNAK27R.js → chunk-FRV5Q5IO.js} +64 -8
- package/dist/chunk-FRV5Q5IO.js.map +1 -0
- package/dist/{chunk-K5P5OZXS.js → chunk-G6Q5UM7U.js} +2 -2
- package/dist/{chunk-K5P5OZXS.js.map → chunk-G6Q5UM7U.js.map} +1 -1
- package/dist/chunk-GSQ6NPH6.cjs +100 -0
- package/dist/chunk-GSQ6NPH6.cjs.map +1 -0
- package/dist/chunk-GUR2FNB5.cjs +12 -0
- package/dist/{chunk-6ZR4QC3O.cjs.map → chunk-GUR2FNB5.cjs.map} +1 -1
- package/dist/{chunk-ZFWNO3GE.cjs → chunk-H7YNSMA7.cjs} +107 -2
- package/dist/chunk-H7YNSMA7.cjs.map +1 -0
- package/dist/{chunk-GYVBEZAO.js → chunk-I7ZUZKFD.js} +47 -19
- package/dist/chunk-I7ZUZKFD.js.map +1 -0
- package/dist/chunk-ITE4IXAK.js +25 -0
- package/dist/chunk-ITE4IXAK.js.map +1 -0
- package/dist/{chunk-D3EWZ67S.cjs → chunk-J7WFGBJR.cjs} +3372 -4970
- package/dist/chunk-J7WFGBJR.cjs.map +1 -0
- package/dist/{chunk-PYD3UCDU.js → chunk-JBTOYDMN.js} +202 -251
- package/dist/chunk-JBTOYDMN.js.map +1 -0
- package/dist/{chunk-XVUJY72M.js → chunk-K3PPLHY7.js} +234 -118
- package/dist/chunk-K3PPLHY7.js.map +1 -0
- package/dist/{chunk-454I6GDF.js → chunk-KBGQIPRQ.js} +102 -3
- package/dist/chunk-KBGQIPRQ.js.map +1 -0
- package/dist/chunk-KMI7LYAF.js +1252 -0
- package/dist/chunk-KMI7LYAF.js.map +1 -0
- package/dist/{chunk-JIEJCTDS.cjs → chunk-LGEALRC6.cjs} +21 -4
- package/dist/chunk-LGEALRC6.cjs.map +1 -0
- package/dist/{chunk-TQOYM4LN.js → chunk-MP2JQKSG.js} +21 -5
- package/dist/chunk-MP2JQKSG.js.map +1 -0
- package/dist/{chunk-3642VBVC.cjs → chunk-O7UN7OXA.cjs} +389 -121
- package/dist/chunk-O7UN7OXA.cjs.map +1 -0
- package/dist/chunk-OHMP6N2J.js +47 -0
- package/dist/chunk-OHMP6N2J.js.map +1 -0
- package/dist/{chunk-6NRFUHMS.js → chunk-OR5ZA5WP.js} +135 -24
- package/dist/chunk-OR5ZA5WP.js.map +1 -0
- package/dist/{chunk-PRMKPFN5.js → chunk-Q5TEXCTB.js} +61 -6
- package/dist/chunk-Q5TEXCTB.js.map +1 -0
- package/dist/chunk-QNKSQTKQ.js +1312 -0
- package/dist/chunk-QNKSQTKQ.js.map +1 -0
- package/dist/{chunk-YCV72E6L.js → chunk-QOTI55H7.js} +7 -116
- package/dist/chunk-QOTI55H7.js.map +1 -0
- package/dist/{chunk-QBYTJSAY.js → chunk-QWEUYILR.js} +99 -34
- package/dist/chunk-QWEUYILR.js.map +1 -0
- package/dist/{chunk-OS6KS3HV.js → chunk-RGP33ZJ5.js} +485 -82
- package/dist/chunk-RGP33ZJ5.js.map +1 -0
- package/dist/chunk-RGPG7EOJ.js +94 -0
- package/dist/chunk-RGPG7EOJ.js.map +1 -0
- package/dist/{chunk-WWVV44DY.cjs → chunk-S55OV6PW.cjs} +15 -15
- package/dist/chunk-S55OV6PW.cjs.map +1 -0
- package/dist/{chunk-3E7SNSIA.cjs → chunk-SJDMVITW.cjs} +4 -4
- package/dist/{chunk-3E7SNSIA.cjs.map → chunk-SJDMVITW.cjs.map} +1 -1
- package/dist/{chunk-XLUNB2TZ.js → chunk-SNXVDZAJ.js} +3 -3
- package/dist/{chunk-XLUNB2TZ.js.map → chunk-SNXVDZAJ.js.map} +1 -1
- package/dist/{chunk-CEF2QOTO.js → chunk-T2WUSPDA.js} +49 -8
- package/dist/chunk-T2WUSPDA.js.map +1 -0
- package/dist/{chunk-YW7GHMF4.cjs → chunk-TCOCYN2P.cjs} +75 -20
- package/dist/chunk-TCOCYN2P.cjs.map +1 -0
- package/dist/{chunk-FLRCVI2G.cjs → chunk-TDXIBCGY.cjs} +2 -2
- package/dist/{chunk-FLRCVI2G.cjs.map → chunk-TDXIBCGY.cjs.map} +1 -1
- package/dist/chunk-TEDRJXOG.cjs +32 -0
- package/dist/chunk-TEDRJXOG.cjs.map +1 -0
- package/dist/{chunk-WLP6TKFB.js → chunk-UES55P7G.js} +2809 -4398
- package/dist/chunk-UES55P7G.js.map +1 -0
- package/dist/{chunk-EF3Z645U.cjs → chunk-UMDVATGY.cjs} +6 -72
- package/dist/chunk-UMDVATGY.cjs.map +1 -0
- package/dist/chunk-UR7W5YQK.js +18 -0
- package/dist/chunk-UR7W5YQK.js.map +1 -0
- package/dist/chunk-UT3S4SEN.js +31 -0
- package/dist/chunk-UT3S4SEN.js.map +1 -0
- package/dist/{chunk-3IR2GEMJ.cjs → chunk-UUT7UN2N.cjs} +149 -38
- package/dist/chunk-UUT7UN2N.cjs.map +1 -0
- package/dist/{chunk-PIHXFF73.js → chunk-UZV3AZKF.js} +21 -3
- package/dist/chunk-UZV3AZKF.js.map +1 -0
- package/dist/{chunk-DJYRRDHA.js → chunk-VHMPG6UL.js} +29 -7
- package/dist/chunk-VHMPG6UL.js.map +1 -0
- package/dist/{chunk-MBLXCV2Y.cjs → chunk-VPYHY3LJ.cjs} +111 -43
- package/dist/chunk-VPYHY3LJ.cjs.map +1 -0
- package/dist/{chunk-WYTUF3QO.js → chunk-VSPCZAXF.js} +3 -3
- package/dist/{chunk-WYTUF3QO.js.map → chunk-VSPCZAXF.js.map} +1 -1
- package/dist/chunk-W63OVYY4.js +29 -0
- package/dist/chunk-W63OVYY4.js.map +1 -0
- package/dist/{chunk-UPDMJEW6.js → chunk-WDBCBWC4.js} +356 -30
- package/dist/chunk-WDBCBWC4.js.map +1 -0
- package/dist/chunk-WJT7OU7E.cjs +1334 -0
- package/dist/chunk-WJT7OU7E.cjs.map +1 -0
- package/dist/chunk-XOX22WHL.cjs +2383 -0
- package/dist/chunk-XOX22WHL.cjs.map +1 -0
- package/dist/{ddl-CVnHJcar.d.ts → ddl-C2rZ-Aen.d.ts} +4 -4
- package/dist/{ddl-Dxt_fBHr.d.cts → ddl-CZz7a0E8.d.cts} +4 -4
- package/dist/{extension-types-YGFJPrzK.d.cts → extension-types-ixRpJVUp.d.cts} +24 -1
- package/dist/{extension-types-YGFJPrzK.d.ts → extension-types-ixRpJVUp.d.ts} +24 -1
- package/dist/{types-DGylBhWo.d.ts → fulltext-strategy-B57yvC5Q.d.ts} +2558 -2125
- package/dist/{types-C_UnQOQp.d.cts → fulltext-strategy-CDkSSYhq.d.cts} +2558 -2125
- package/dist/graph-extension/index.cjs +21 -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 +6 -4
- package/dist/graph-merge/index.cjs +408 -169
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +63 -33
- package/dist/graph-merge/index.d.ts +63 -33
- package/dist/graph-merge/index.js +286 -47
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/{index-DGX6D9j1.d.ts → index-6CSUAq-x.d.ts} +234 -93
- package/dist/{index-SEvUHDA6.d.cts → index-Bks_3HHK.d.cts} +234 -93
- package/dist/index.cjs +240 -211
- 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 +35 -27
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.cjs +28 -27
- package/dist/indexes/index.d.cts +5 -5
- package/dist/indexes/index.d.ts +5 -5
- package/dist/indexes/index.js +10 -9
- package/dist/interchange/index.cjs +47 -17
- package/dist/interchange/index.d.cts +126 -12
- package/dist/interchange/index.d.ts +126 -12
- package/dist/interchange/index.js +14 -4
- package/dist/{manager-BYl_zyZR.d.cts → manager-DwQi8eV0.d.cts} +9 -2
- package/dist/{manager-C0_r0ALf.d.ts → manager-ejUCB52T.d.ts} +9 -2
- package/dist/{materialize-indexes-D20xNluI.d.cts → materialize-indexes-B4e9360H.d.cts} +20 -4
- package/dist/{materialize-indexes-CAkIYFV-.d.ts → materialize-indexes-te9TPMMJ.d.ts} +20 -4
- package/dist/{postgres-_9psmVGm.d.cts → postgres-CfEqsRMp.d.cts} +152 -1
- package/dist/{postgres-MzBPkYzq.d.ts → postgres-DQ5R6rzV.d.ts} +152 -1
- package/dist/profiler/index.cjs +11 -11
- package/dist/profiler/index.d.cts +7 -7
- package/dist/profiler/index.d.ts +7 -7
- package/dist/profiler/index.js +4 -4
- package/dist/provenance/index.cjs +590 -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 +588 -0
- package/dist/provenance/index.js.map +1 -0
- package/dist/schema/index.cjs +55 -38
- package/dist/schema/index.cjs.map +1 -1
- package/dist/schema/index.d.cts +57 -57
- package/dist/schema/index.d.ts +57 -57
- package/dist/schema/index.js +30 -13
- package/dist/schema/index.js.map +1 -1
- package/dist/{sqlite-gm44dShb.d.ts → sqlite-D7zBinNR.d.cts} +92 -1
- package/dist/{sqlite-BfksSb45.d.cts → sqlite-DvQndLky.d.ts} +92 -1
- package/dist/{store-view-FfE5_7eo.d.ts → store-view-BSpqvAxK.d.cts} +445 -46
- package/dist/{store-view-9jQ2rPum.d.cts → store-view-CKbHFRnn.d.ts} +445 -46
- package/dist/{types-B6mhrcLv.d.cts → types-Bv9DcS_E.d.cts} +2 -2
- package/dist/{types-CdWxK-nD.d.ts → types-CoxuV7EJ.d.ts} +2 -2
- package/dist/{where-Bpp2ul_z.d.cts → where-7RKFOsXt.d.ts} +2 -2
- package/dist/{where-BsEXraKW.d.ts → where-DdMIXOtH.d.cts} +2 -2
- package/package.json +21 -14
- 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-3EUKJEQ3.js +0 -77
- package/dist/chunk-3EUKJEQ3.js.map +0 -1
- package/dist/chunk-3IR2GEMJ.cjs.map +0 -1
- package/dist/chunk-3QRBXYT5.cjs.map +0 -1
- package/dist/chunk-454I6GDF.js.map +0 -1
- package/dist/chunk-4RBAJVEC.cjs.map +0 -1
- package/dist/chunk-6NRFUHMS.js.map +0 -1
- package/dist/chunk-6ZR4QC3O.cjs +0 -12
- package/dist/chunk-73KASJGO.cjs +0 -52
- package/dist/chunk-73KASJGO.cjs.map +0 -1
- package/dist/chunk-BF3ZDEUE.cjs +0 -773
- 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-CWFPJ3RC.js.map +0 -1
- package/dist/chunk-D3EWZ67S.cjs.map +0 -1
- package/dist/chunk-DJYRRDHA.js.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-HTGDWIDE.cjs +0 -89
- package/dist/chunk-HTGDWIDE.cjs.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-JIEJCTDS.cjs.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-PIHXFF73.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 +0 -610
- package/dist/chunk-SPT5JMME.js.map +0 -1
- package/dist/chunk-SST7XDY6.cjs +0 -624
- package/dist/chunk-SST7XDY6.cjs.map +0 -1
- package/dist/chunk-TQOYM4LN.js.map +0 -1
- package/dist/chunk-UPDMJEW6.js.map +0 -1
- package/dist/chunk-WLP6TKFB.js.map +0 -1
- package/dist/chunk-WWVV44DY.cjs.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,8 +1,186 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { nowIso } from './chunk-I7ZUZKFD.js';
|
|
2
|
+
import { likeEscapeClause, LIKE_ESCAPE_CHARACTER } from './chunk-OHMP6N2J.js';
|
|
3
|
+
import { resolveFieldTypeInfoAtJsonPointer } from './chunk-SNXVDZAJ.js';
|
|
4
|
+
import { ConfigurationError, UnsupportedPredicateError, CompilerInvariantError } from './chunk-MP2JQKSG.js';
|
|
5
|
+
import { normalizeJsonPointer, joinJsonPointers, jsonPointer } from './chunk-G6Q5UM7U.js';
|
|
4
6
|
import { sql } from 'drizzle-orm';
|
|
5
7
|
|
|
8
|
+
// src/backend/types.ts
|
|
9
|
+
function rowPropsToObject(props) {
|
|
10
|
+
return typeof props === "string" ? JSON.parse(props) : props;
|
|
11
|
+
}
|
|
12
|
+
function rowPropsToJsonText(props) {
|
|
13
|
+
return typeof props === "string" ? props : JSON.stringify(props);
|
|
14
|
+
}
|
|
15
|
+
function isLiveNodeRow(row) {
|
|
16
|
+
return row.deleted_at === void 0;
|
|
17
|
+
}
|
|
18
|
+
function isTombstonedNodeRow(row) {
|
|
19
|
+
return row.deleted_at !== void 0;
|
|
20
|
+
}
|
|
21
|
+
function createBackendOverlay(target, overlay) {
|
|
22
|
+
const boundTargetMethods = /* @__PURE__ */ new Map();
|
|
23
|
+
function hasOverlayProperty(property) {
|
|
24
|
+
return Object.hasOwn(overlay, property);
|
|
25
|
+
}
|
|
26
|
+
function targetValue(targetObject, property) {
|
|
27
|
+
const value = Reflect.get(targetObject, property, targetObject);
|
|
28
|
+
if (typeof value !== "function") return value;
|
|
29
|
+
const cached = boundTargetMethods.get(property);
|
|
30
|
+
if (cached !== void 0) return cached;
|
|
31
|
+
const method = value;
|
|
32
|
+
const bound = method.bind(targetObject);
|
|
33
|
+
boundTargetMethods.set(property, bound);
|
|
34
|
+
return bound;
|
|
35
|
+
}
|
|
36
|
+
return new Proxy(target, {
|
|
37
|
+
get(targetObject, property) {
|
|
38
|
+
if (hasOverlayProperty(property)) {
|
|
39
|
+
return Reflect.get(overlay, property, overlay);
|
|
40
|
+
}
|
|
41
|
+
return targetValue(targetObject, property);
|
|
42
|
+
},
|
|
43
|
+
has(targetObject, property) {
|
|
44
|
+
return hasOverlayProperty(property) || Reflect.has(targetObject, property);
|
|
45
|
+
},
|
|
46
|
+
ownKeys(targetObject) {
|
|
47
|
+
return [
|
|
48
|
+
.../* @__PURE__ */ new Set([
|
|
49
|
+
...Reflect.ownKeys(targetObject),
|
|
50
|
+
...Reflect.ownKeys(overlay)
|
|
51
|
+
])
|
|
52
|
+
];
|
|
53
|
+
},
|
|
54
|
+
getOwnPropertyDescriptor(targetObject, property) {
|
|
55
|
+
if (hasOverlayProperty(property)) {
|
|
56
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(overlay, property);
|
|
57
|
+
if (descriptor === void 0) return;
|
|
58
|
+
return { ...descriptor, configurable: true };
|
|
59
|
+
}
|
|
60
|
+
return Reflect.getOwnPropertyDescriptor(targetObject, property);
|
|
61
|
+
},
|
|
62
|
+
set(targetObject, property, value) {
|
|
63
|
+
if (hasOverlayProperty(property)) {
|
|
64
|
+
return Reflect.set(overlay, property, value, overlay);
|
|
65
|
+
}
|
|
66
|
+
return Reflect.set(targetObject, property, value, targetObject);
|
|
67
|
+
},
|
|
68
|
+
defineProperty(targetObject, property, attributes) {
|
|
69
|
+
if (hasOverlayProperty(property)) {
|
|
70
|
+
return Reflect.defineProperty(overlay, property, attributes);
|
|
71
|
+
}
|
|
72
|
+
return Reflect.defineProperty(targetObject, property, attributes);
|
|
73
|
+
},
|
|
74
|
+
deleteProperty(targetObject, property) {
|
|
75
|
+
if (hasOverlayProperty(property)) {
|
|
76
|
+
return Reflect.deleteProperty(overlay, property);
|
|
77
|
+
}
|
|
78
|
+
return Reflect.deleteProperty(targetObject, property);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
function wrapWithManagedClose(backend, teardown) {
|
|
83
|
+
let isClosed = false;
|
|
84
|
+
return createBackendOverlay(backend, {
|
|
85
|
+
async close() {
|
|
86
|
+
if (isClosed) return;
|
|
87
|
+
isClosed = true;
|
|
88
|
+
await backend.close();
|
|
89
|
+
await teardown();
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
async function runOptionallyInTransaction(backend, fn, fallback) {
|
|
94
|
+
if ("transaction" in backend && backend.capabilities.transactions) {
|
|
95
|
+
return backend.transaction((tx) => fn(tx));
|
|
96
|
+
}
|
|
97
|
+
return fn(fallback ?? backend);
|
|
98
|
+
}
|
|
99
|
+
var SQLITE_MAX_BIND_PARAMETERS = 999;
|
|
100
|
+
var MODERN_SQLITE_MAX_BIND_PARAMETERS = 32766;
|
|
101
|
+
var D1_MAX_BIND_PARAMETERS = 100;
|
|
102
|
+
var POSTGRES_MAX_BIND_PARAMETERS = 65535;
|
|
103
|
+
var SQLITE_CAPABILITIES = {
|
|
104
|
+
transactions: true,
|
|
105
|
+
// SQLite supports transactions
|
|
106
|
+
windowFunctions: true,
|
|
107
|
+
// SQLite has supported window functions since 3.25.0
|
|
108
|
+
returning: true,
|
|
109
|
+
// SQLite has supported RETURNING since 3.35.0
|
|
110
|
+
maxBindParameters: SQLITE_MAX_BIND_PARAMETERS
|
|
111
|
+
};
|
|
112
|
+
var POSTGRES_CAPABILITIES = {
|
|
113
|
+
transactions: true,
|
|
114
|
+
// PostgreSQL supports transactions
|
|
115
|
+
windowFunctions: true,
|
|
116
|
+
// PostgreSQL supports ROW_NUMBER() and related windows
|
|
117
|
+
returning: true,
|
|
118
|
+
// PostgreSQL has supported RETURNING since 8.2
|
|
119
|
+
maxBindParameters: POSTGRES_MAX_BIND_PARAMETERS
|
|
120
|
+
};
|
|
121
|
+
var pinnedReadInstant;
|
|
122
|
+
function withPinnedReadInstant(emit) {
|
|
123
|
+
if (pinnedReadInstant !== void 0) return emit();
|
|
124
|
+
pinnedReadInstant = nowIso();
|
|
125
|
+
try {
|
|
126
|
+
return emit();
|
|
127
|
+
} finally {
|
|
128
|
+
pinnedReadInstant = void 0;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
function currentReadInstant() {
|
|
132
|
+
return sql`${pinnedReadInstant ?? nowIso()}`;
|
|
133
|
+
}
|
|
134
|
+
var CURRENT_READ_INSTANT_PLACEHOLDER = "__typegraph_current_read_instant__";
|
|
135
|
+
function currentReadInstantPlaceholder() {
|
|
136
|
+
return sql`${sql.placeholder(CURRENT_READ_INSTANT_PLACEHOLDER)}`;
|
|
137
|
+
}
|
|
138
|
+
function currentReadInstantFor(mode) {
|
|
139
|
+
return mode === "placeholder" ? currentReadInstantPlaceholder() : currentReadInstant();
|
|
140
|
+
}
|
|
141
|
+
function compileTemporalFilter(options) {
|
|
142
|
+
const { mode, asOf, tableAlias, currentTimestamp, recordedAsOf } = options;
|
|
143
|
+
const prefix = tableAlias ? sql.raw(`${tableAlias}.`) : sql.raw("");
|
|
144
|
+
const deletedAt = sql`${prefix}deleted_at`;
|
|
145
|
+
const validFrom = sql`${prefix}valid_from`;
|
|
146
|
+
const validTo = sql`${prefix}valid_to`;
|
|
147
|
+
const validFilter = (() => {
|
|
148
|
+
switch (mode) {
|
|
149
|
+
case "current": {
|
|
150
|
+
const now = recordedAsOf === void 0 ? currentTimestamp ?? currentReadInstant() : sql`${recordedAsOf}`;
|
|
151
|
+
return sql`${deletedAt} IS NULL AND (${validFrom} IS NULL OR ${validFrom} <= ${now}) AND (${validTo} IS NULL OR ${validTo} > ${now})`;
|
|
152
|
+
}
|
|
153
|
+
case "asOf": {
|
|
154
|
+
if (asOf === void 0) {
|
|
155
|
+
throw new Error(
|
|
156
|
+
`asOf timestamp is required for temporal mode "asOf"`
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
const timestamp = asOf;
|
|
160
|
+
return sql`${deletedAt} IS NULL AND (${validFrom} IS NULL OR ${validFrom} <= ${timestamp}) AND (${validTo} IS NULL OR ${validTo} > ${timestamp})`;
|
|
161
|
+
}
|
|
162
|
+
case "includeEnded": {
|
|
163
|
+
return sql`${deletedAt} IS NULL`;
|
|
164
|
+
}
|
|
165
|
+
case "includeTombstones": {
|
|
166
|
+
return sql.raw("1=1");
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
})();
|
|
170
|
+
if (recordedAsOf === void 0) return validFilter;
|
|
171
|
+
const recordedFrom = sql`${prefix}recorded_from`;
|
|
172
|
+
const recordedTo = sql`${prefix}recorded_to`;
|
|
173
|
+
return sql`(${validFilter}) AND ${recordedFrom} <= ${recordedAsOf} AND ${recordedAsOf} < ${recordedTo}`;
|
|
174
|
+
}
|
|
175
|
+
function extractTemporalOptions(ast, tableAlias) {
|
|
176
|
+
return {
|
|
177
|
+
mode: ast.temporalMode.mode,
|
|
178
|
+
asOf: ast.temporalMode.asOf,
|
|
179
|
+
recordedAsOf: ast.recordedAsOf,
|
|
180
|
+
tableAlias
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
|
|
6
184
|
// src/query/subquery-utils.ts
|
|
7
185
|
function normalizeValueType(valueType) {
|
|
8
186
|
if (valueType === void 0 || valueType === "unknown") {
|
|
@@ -79,6 +257,12 @@ function predicate(expr) {
|
|
|
79
257
|
};
|
|
80
258
|
}
|
|
81
259
|
function param(name) {
|
|
260
|
+
if (name === CURRENT_READ_INSTANT_PLACEHOLDER) {
|
|
261
|
+
throw new ConfigurationError(
|
|
262
|
+
`Parameter name "${name}" is reserved for internal use`,
|
|
263
|
+
{ parameterName: name }
|
|
264
|
+
);
|
|
265
|
+
}
|
|
82
266
|
return { __type: "parameter", name };
|
|
83
267
|
}
|
|
84
268
|
function isParameterRef(value) {
|
|
@@ -311,7 +495,10 @@ function vectorSimilarity(field, queryEmbedding, limit, options) {
|
|
|
311
495
|
// here would mis-rank l2/inner_product fields and bypass their ANN index.
|
|
312
496
|
...options?.metric !== void 0 && { metric: options.metric },
|
|
313
497
|
limit,
|
|
314
|
-
...options?.minScore !== void 0 && { minScore: options.minScore }
|
|
498
|
+
...options?.minScore !== void 0 && { minScore: options.minScore },
|
|
499
|
+
...options?.approximate !== void 0 && {
|
|
500
|
+
approximate: options.approximate
|
|
501
|
+
}
|
|
315
502
|
};
|
|
316
503
|
return predicate(expr);
|
|
317
504
|
}
|
|
@@ -538,106 +725,6 @@ function assertCompatibleSubqueryValueTypes(field, subquery) {
|
|
|
538
725
|
}
|
|
539
726
|
);
|
|
540
727
|
}
|
|
541
|
-
|
|
542
|
-
// src/backend/types.ts
|
|
543
|
-
function createBackendOverlay(target, overlay) {
|
|
544
|
-
const boundTargetMethods = /* @__PURE__ */ new Map();
|
|
545
|
-
function hasOverlayProperty(property) {
|
|
546
|
-
return Object.hasOwn(overlay, property);
|
|
547
|
-
}
|
|
548
|
-
function targetValue(targetObject, property) {
|
|
549
|
-
const value = Reflect.get(targetObject, property, targetObject);
|
|
550
|
-
if (typeof value !== "function") return value;
|
|
551
|
-
const cached = boundTargetMethods.get(property);
|
|
552
|
-
if (cached !== void 0) return cached;
|
|
553
|
-
const method = value;
|
|
554
|
-
const bound = method.bind(targetObject);
|
|
555
|
-
boundTargetMethods.set(property, bound);
|
|
556
|
-
return bound;
|
|
557
|
-
}
|
|
558
|
-
return new Proxy(target, {
|
|
559
|
-
get(targetObject, property) {
|
|
560
|
-
if (hasOverlayProperty(property)) {
|
|
561
|
-
return Reflect.get(overlay, property, overlay);
|
|
562
|
-
}
|
|
563
|
-
return targetValue(targetObject, property);
|
|
564
|
-
},
|
|
565
|
-
has(targetObject, property) {
|
|
566
|
-
return hasOverlayProperty(property) || Reflect.has(targetObject, property);
|
|
567
|
-
},
|
|
568
|
-
ownKeys(targetObject) {
|
|
569
|
-
return [
|
|
570
|
-
.../* @__PURE__ */ new Set([
|
|
571
|
-
...Reflect.ownKeys(targetObject),
|
|
572
|
-
...Reflect.ownKeys(overlay)
|
|
573
|
-
])
|
|
574
|
-
];
|
|
575
|
-
},
|
|
576
|
-
getOwnPropertyDescriptor(targetObject, property) {
|
|
577
|
-
if (hasOverlayProperty(property)) {
|
|
578
|
-
const descriptor = Reflect.getOwnPropertyDescriptor(overlay, property);
|
|
579
|
-
if (descriptor === void 0) return;
|
|
580
|
-
return { ...descriptor, configurable: true };
|
|
581
|
-
}
|
|
582
|
-
return Reflect.getOwnPropertyDescriptor(targetObject, property);
|
|
583
|
-
},
|
|
584
|
-
set(targetObject, property, value) {
|
|
585
|
-
if (hasOverlayProperty(property)) {
|
|
586
|
-
return Reflect.set(overlay, property, value, overlay);
|
|
587
|
-
}
|
|
588
|
-
return Reflect.set(targetObject, property, value, targetObject);
|
|
589
|
-
},
|
|
590
|
-
defineProperty(targetObject, property, attributes) {
|
|
591
|
-
if (hasOverlayProperty(property)) {
|
|
592
|
-
return Reflect.defineProperty(overlay, property, attributes);
|
|
593
|
-
}
|
|
594
|
-
return Reflect.defineProperty(targetObject, property, attributes);
|
|
595
|
-
},
|
|
596
|
-
deleteProperty(targetObject, property) {
|
|
597
|
-
if (hasOverlayProperty(property)) {
|
|
598
|
-
return Reflect.deleteProperty(overlay, property);
|
|
599
|
-
}
|
|
600
|
-
return Reflect.deleteProperty(targetObject, property);
|
|
601
|
-
}
|
|
602
|
-
});
|
|
603
|
-
}
|
|
604
|
-
function wrapWithManagedClose(backend, teardown) {
|
|
605
|
-
let isClosed = false;
|
|
606
|
-
return createBackendOverlay(backend, {
|
|
607
|
-
async close() {
|
|
608
|
-
if (isClosed) return;
|
|
609
|
-
isClosed = true;
|
|
610
|
-
await backend.close();
|
|
611
|
-
await teardown();
|
|
612
|
-
}
|
|
613
|
-
});
|
|
614
|
-
}
|
|
615
|
-
async function runOptionallyInTransaction(backend, fn, fallback) {
|
|
616
|
-
if ("transaction" in backend && backend.capabilities.transactions) {
|
|
617
|
-
return backend.transaction((tx) => fn(tx));
|
|
618
|
-
}
|
|
619
|
-
return fn(fallback ?? backend);
|
|
620
|
-
}
|
|
621
|
-
var SQLITE_MAX_BIND_PARAMETERS = 999;
|
|
622
|
-
var POSTGRES_MAX_BIND_PARAMETERS = 65535;
|
|
623
|
-
var SQLITE_CAPABILITIES = {
|
|
624
|
-
transactions: true,
|
|
625
|
-
// SQLite supports transactions
|
|
626
|
-
windowFunctions: true,
|
|
627
|
-
// SQLite has supported window functions since 3.25.0
|
|
628
|
-
returning: true,
|
|
629
|
-
// SQLite has supported RETURNING since 3.35.0
|
|
630
|
-
maxBindParameters: SQLITE_MAX_BIND_PARAMETERS
|
|
631
|
-
};
|
|
632
|
-
var POSTGRES_CAPABILITIES = {
|
|
633
|
-
transactions: true,
|
|
634
|
-
// PostgreSQL supports transactions
|
|
635
|
-
windowFunctions: true,
|
|
636
|
-
// PostgreSQL supports ROW_NUMBER() and related windows
|
|
637
|
-
returning: true,
|
|
638
|
-
// PostgreSQL has supported RETURNING since 8.2
|
|
639
|
-
maxBindParameters: POSTGRES_MAX_BIND_PARAMETERS
|
|
640
|
-
};
|
|
641
728
|
var COMPARISON_OP_SQL = {
|
|
642
729
|
eq: "=",
|
|
643
730
|
neq: "!=",
|
|
@@ -787,7 +874,10 @@ function convertValueForSql(value, dialect) {
|
|
|
787
874
|
return dialect.bindValue(value);
|
|
788
875
|
}
|
|
789
876
|
function compileStringPattern(op, pattern) {
|
|
790
|
-
const escaped = pattern.replaceAll(
|
|
877
|
+
const escaped = pattern.replaceAll(
|
|
878
|
+
LIKE_ESCAPE_CHARACTER,
|
|
879
|
+
`${LIKE_ESCAPE_CHARACTER}${LIKE_ESCAPE_CHARACTER}`
|
|
880
|
+
).replaceAll("%", `${LIKE_ESCAPE_CHARACTER}%`).replaceAll("_", `${LIKE_ESCAPE_CHARACTER}_`);
|
|
791
881
|
switch (op) {
|
|
792
882
|
case "contains": {
|
|
793
883
|
return `%${escaped}%`;
|
|
@@ -808,7 +898,8 @@ function compileStringPattern(op, pattern) {
|
|
|
808
898
|
}
|
|
809
899
|
}
|
|
810
900
|
function escapeLikePatternParameter(parameter) {
|
|
811
|
-
|
|
901
|
+
const doubledEscape = `${LIKE_ESCAPE_CHARACTER}${LIKE_ESCAPE_CHARACTER}`;
|
|
902
|
+
return sql`REPLACE(REPLACE(REPLACE(${parameter}, ${LIKE_ESCAPE_CHARACTER}, ${doubledEscape}), '%', ${`${LIKE_ESCAPE_CHARACTER}%`}), '_', ${`${LIKE_ESCAPE_CHARACTER}_`})`;
|
|
812
903
|
}
|
|
813
904
|
function compileParameterizedStringPattern(op, parameter) {
|
|
814
905
|
switch (op) {
|
|
@@ -854,13 +945,13 @@ function compilePredicateExpression(expr, ctx) {
|
|
|
854
945
|
if (expr.op === "ilike" || expr.op === "contains" || expr.op === "startsWith" || expr.op === "endsWith") {
|
|
855
946
|
return dialect.ilike(field, pattern2);
|
|
856
947
|
}
|
|
857
|
-
return sql`${field} LIKE ${pattern2}`;
|
|
948
|
+
return sql`${field} LIKE ${pattern2} ${likeEscapeClause}`;
|
|
858
949
|
}
|
|
859
950
|
const pattern = compileStringPattern(expr.op, expr.pattern);
|
|
860
951
|
if (expr.op === "ilike" || expr.op === "contains" || expr.op === "startsWith" || expr.op === "endsWith") {
|
|
861
952
|
return dialect.ilike(field, pattern);
|
|
862
953
|
}
|
|
863
|
-
return sql`${field} LIKE ${pattern}`;
|
|
954
|
+
return sql`${field} LIKE ${pattern} ${likeEscapeClause}`;
|
|
864
955
|
}
|
|
865
956
|
case "null_check": {
|
|
866
957
|
const field = compileFieldTextValue(
|
|
@@ -1306,146 +1397,6 @@ function getHybridTargetAlias(vectorPredicate, fulltextPredicate) {
|
|
|
1306
1397
|
return vectorPredicate.field.alias === fulltextPredicate.field.alias ? vectorPredicate.field.alias : void 0;
|
|
1307
1398
|
}
|
|
1308
1399
|
|
|
1309
|
-
// src/backend/drizzle/row-mappers.ts
|
|
1310
|
-
function requireTimestamp(value, field) {
|
|
1311
|
-
if (value === void 0) {
|
|
1312
|
-
throw new DatabaseOperationError(
|
|
1313
|
-
`Expected non-null ${field} timestamp`,
|
|
1314
|
-
{ operation: "select", entity: "row" }
|
|
1315
|
-
);
|
|
1316
|
-
}
|
|
1317
|
-
return value;
|
|
1318
|
-
}
|
|
1319
|
-
function asString(value, field) {
|
|
1320
|
-
if (typeof value !== "string") {
|
|
1321
|
-
throw new DatabaseOperationError(
|
|
1322
|
-
`Expected ${field} to be string, got ${typeof value}`,
|
|
1323
|
-
{ operation: "select", entity: "row" }
|
|
1324
|
-
);
|
|
1325
|
-
}
|
|
1326
|
-
return value;
|
|
1327
|
-
}
|
|
1328
|
-
function asNumber(value, field) {
|
|
1329
|
-
if (typeof value !== "number") {
|
|
1330
|
-
throw new DatabaseOperationError(
|
|
1331
|
-
`Expected ${field} to be number, got ${typeof value}`,
|
|
1332
|
-
{ operation: "select", entity: "row" }
|
|
1333
|
-
);
|
|
1334
|
-
}
|
|
1335
|
-
return value;
|
|
1336
|
-
}
|
|
1337
|
-
function nowIso() {
|
|
1338
|
-
return (/* @__PURE__ */ new Date()).toISOString();
|
|
1339
|
-
}
|
|
1340
|
-
function nullToUndefined(value) {
|
|
1341
|
-
return value ?? void 0;
|
|
1342
|
-
}
|
|
1343
|
-
function formatPostgresTimestamp(value) {
|
|
1344
|
-
if (value === null || value === void 0) return void 0;
|
|
1345
|
-
if (value instanceof Date) return value.toISOString();
|
|
1346
|
-
if (typeof value === "string") {
|
|
1347
|
-
if (value.includes("T")) return value;
|
|
1348
|
-
const date = new Date(value);
|
|
1349
|
-
if (!Number.isNaN(date.getTime())) return date.toISOString();
|
|
1350
|
-
return value;
|
|
1351
|
-
}
|
|
1352
|
-
return void 0;
|
|
1353
|
-
}
|
|
1354
|
-
function coerceNumericScore(value) {
|
|
1355
|
-
if (typeof value === "number") return value;
|
|
1356
|
-
const parsed = Number.parseFloat(value);
|
|
1357
|
-
if (Number.isNaN(parsed)) {
|
|
1358
|
-
throw new TypeError(
|
|
1359
|
-
`Backend returned non-numeric fulltext score: ${JSON.stringify(value)}`
|
|
1360
|
-
);
|
|
1361
|
-
}
|
|
1362
|
-
return parsed;
|
|
1363
|
-
}
|
|
1364
|
-
function normalizeJsonColumn(value) {
|
|
1365
|
-
return typeof value === "string" ? value : JSON.stringify(value ?? {});
|
|
1366
|
-
}
|
|
1367
|
-
var SQLITE_ROW_MAPPER_CONFIG = {
|
|
1368
|
-
formatTimestamp: (value) => {
|
|
1369
|
-
if (value === null || value === void 0) return;
|
|
1370
|
-
if (typeof value !== "string") {
|
|
1371
|
-
throw new DatabaseOperationError(
|
|
1372
|
-
`Expected timestamp to be string, got ${typeof value}`,
|
|
1373
|
-
{ operation: "select", entity: "row" }
|
|
1374
|
-
);
|
|
1375
|
-
}
|
|
1376
|
-
return value;
|
|
1377
|
-
},
|
|
1378
|
-
normalizeJson: (value) => {
|
|
1379
|
-
if (typeof value !== "string") {
|
|
1380
|
-
throw new DatabaseOperationError(
|
|
1381
|
-
`Expected JSON column to be string, got ${typeof value}`,
|
|
1382
|
-
{ operation: "select", entity: "row" }
|
|
1383
|
-
);
|
|
1384
|
-
}
|
|
1385
|
-
return value;
|
|
1386
|
-
}
|
|
1387
|
-
};
|
|
1388
|
-
var POSTGRES_ROW_MAPPER_CONFIG = {
|
|
1389
|
-
formatTimestamp: formatPostgresTimestamp,
|
|
1390
|
-
normalizeJson: normalizeJsonColumn
|
|
1391
|
-
};
|
|
1392
|
-
function createNodeRowMapper(config) {
|
|
1393
|
-
return (row) => ({
|
|
1394
|
-
graph_id: asString(row.graph_id, "graph_id"),
|
|
1395
|
-
kind: asString(row.kind, "kind"),
|
|
1396
|
-
id: asString(row.id, "id"),
|
|
1397
|
-
props: config.normalizeJson(row.props),
|
|
1398
|
-
version: asNumber(row.version, "version"),
|
|
1399
|
-
valid_from: nullToUndefined(config.formatTimestamp(row.valid_from)),
|
|
1400
|
-
valid_to: nullToUndefined(config.formatTimestamp(row.valid_to)),
|
|
1401
|
-
created_at: requireTimestamp(config.formatTimestamp(row.created_at), "created_at"),
|
|
1402
|
-
updated_at: requireTimestamp(config.formatTimestamp(row.updated_at), "updated_at"),
|
|
1403
|
-
deleted_at: nullToUndefined(config.formatTimestamp(row.deleted_at))
|
|
1404
|
-
});
|
|
1405
|
-
}
|
|
1406
|
-
function createEdgeRowMapper(config) {
|
|
1407
|
-
return (row) => ({
|
|
1408
|
-
graph_id: asString(row.graph_id, "graph_id"),
|
|
1409
|
-
id: asString(row.id, "id"),
|
|
1410
|
-
kind: asString(row.kind, "kind"),
|
|
1411
|
-
from_kind: asString(row.from_kind, "from_kind"),
|
|
1412
|
-
from_id: asString(row.from_id, "from_id"),
|
|
1413
|
-
to_kind: asString(row.to_kind, "to_kind"),
|
|
1414
|
-
to_id: asString(row.to_id, "to_id"),
|
|
1415
|
-
props: config.normalizeJson(row.props),
|
|
1416
|
-
valid_from: nullToUndefined(config.formatTimestamp(row.valid_from)),
|
|
1417
|
-
valid_to: nullToUndefined(config.formatTimestamp(row.valid_to)),
|
|
1418
|
-
created_at: requireTimestamp(config.formatTimestamp(row.created_at), "created_at"),
|
|
1419
|
-
updated_at: requireTimestamp(config.formatTimestamp(row.updated_at), "updated_at"),
|
|
1420
|
-
deleted_at: nullToUndefined(config.formatTimestamp(row.deleted_at))
|
|
1421
|
-
});
|
|
1422
|
-
}
|
|
1423
|
-
function createUniqueRowMapper(config) {
|
|
1424
|
-
return (row) => ({
|
|
1425
|
-
graph_id: asString(row.graph_id, "graph_id"),
|
|
1426
|
-
node_kind: asString(row.node_kind, "node_kind"),
|
|
1427
|
-
constraint_name: asString(row.constraint_name, "constraint_name"),
|
|
1428
|
-
key: asString(row.key, "key"),
|
|
1429
|
-
node_id: asString(row.node_id, "node_id"),
|
|
1430
|
-
concrete_kind: asString(row.concrete_kind, "concrete_kind"),
|
|
1431
|
-
deleted_at: nullToUndefined(config.formatTimestamp(row.deleted_at))
|
|
1432
|
-
});
|
|
1433
|
-
}
|
|
1434
|
-
function createSchemaVersionRowMapper(config) {
|
|
1435
|
-
return (row) => {
|
|
1436
|
-
const isActiveValue = row.is_active;
|
|
1437
|
-
const isActive = isActiveValue === true || isActiveValue === 1 || isActiveValue === "1";
|
|
1438
|
-
return {
|
|
1439
|
-
graph_id: asString(row.graph_id, "graph_id"),
|
|
1440
|
-
version: asNumber(row.version, "version"),
|
|
1441
|
-
schema_hash: asString(row.schema_hash, "schema_hash"),
|
|
1442
|
-
schema_doc: config.normalizeJson(row.schema_doc),
|
|
1443
|
-
created_at: requireTimestamp(config.formatTimestamp(row.created_at), "created_at"),
|
|
1444
|
-
is_active: isActive
|
|
1445
|
-
};
|
|
1446
|
-
};
|
|
1447
|
-
}
|
|
1448
|
-
|
|
1449
1400
|
// src/utils/array.ts
|
|
1450
1401
|
function chunk(items, size) {
|
|
1451
1402
|
if (!Number.isSafeInteger(size) || size < 1) {
|
|
@@ -1475,6 +1426,6 @@ function isPresent(value) {
|
|
|
1475
1426
|
return value !== null && value !== void 0;
|
|
1476
1427
|
}
|
|
1477
1428
|
|
|
1478
|
-
export { POSTGRES_CAPABILITIES, POSTGRES_MAX_BIND_PARAMETERS,
|
|
1479
|
-
//# sourceMappingURL=chunk-
|
|
1480
|
-
//# sourceMappingURL=chunk-
|
|
1429
|
+
export { CURRENT_READ_INSTANT_PLACEHOLDER, D1_MAX_BIND_PARAMETERS, MODERN_SQLITE_MAX_BIND_PARAMETERS, POSTGRES_CAPABILITIES, POSTGRES_MAX_BIND_PARAMETERS, SQLITE_CAPABILITIES, SQLITE_MAX_BIND_PARAMETERS, arrayField, baseField, buildFieldBuilderForTypeInfo, buildPredicateIndex, chunk, compileFieldValue, compileKindFilter, compilePredicateClauses, compilePredicateExpression, compileTemporalFilter, createBackendOverlay, createFulltextAccessor, currentReadInstant, currentReadInstantFor, dateField, exists, extractFulltextMatchPredicates, extractTemporalOptions, extractVectorSimilarityPredicates, fieldRef, getFieldPointer, getHybridTargetAlias, getNodeKindsForAlias, getPredicatesForAlias, groupBy, inSubquery, isLiveNodeRow, isParameterRef, isPresent, isTombstonedNodeRow, notExists, notInSubquery, numberField, objectField, param, rowPropsToJsonText, rowPropsToObject, runOptionallyInTransaction, sqlValueList, stringField, withPinnedReadInstant, wrapWithManagedClose };
|
|
1430
|
+
//# sourceMappingURL=chunk-JBTOYDMN.js.map
|
|
1431
|
+
//# sourceMappingURL=chunk-JBTOYDMN.js.map
|