@nicia-ai/typegraph 0.34.0 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backend/postgres/index.cjs +29 -29
- package/dist/backend/postgres/index.d.cts +39 -7
- package/dist/backend/postgres/index.d.ts +39 -7
- package/dist/backend/postgres/index.js +16 -16
- package/dist/backend/postgres/pglite.cjs +21 -21
- package/dist/backend/postgres/pglite.d.cts +4 -4
- package/dist/backend/postgres/pglite.d.ts +4 -4
- package/dist/backend/postgres/pglite.js +16 -16
- package/dist/backend/sqlite/index.cjs +25 -26
- package/dist/backend/sqlite/index.d.cts +8 -8
- package/dist/backend/sqlite/index.d.ts +8 -8
- package/dist/backend/sqlite/index.js +13 -14
- package/dist/backend/sqlite/libsql.cjs +19 -19
- package/dist/backend/sqlite/libsql.d.cts +4 -4
- package/dist/backend/sqlite/libsql.d.ts +4 -4
- package/dist/backend/sqlite/libsql.js +15 -15
- package/dist/backend/sqlite/local.cjs +101 -21
- 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 +95 -16
- package/dist/backend/sqlite/local.js.map +1 -1
- package/dist/{chunk-T6SPUYLX.cjs → chunk-2THZ3TQI.cjs} +116 -10
- package/dist/chunk-2THZ3TQI.cjs.map +1 -0
- package/dist/{chunk-UJLOZYKT.cjs → chunk-456Z2U7Y.cjs} +441 -115
- package/dist/chunk-456Z2U7Y.cjs.map +1 -0
- package/dist/chunk-4BCU6VFZ.cjs +100 -0
- package/dist/chunk-4BCU6VFZ.cjs.map +1 -0
- package/dist/chunk-4BMPGT35.cjs +12 -0
- package/dist/{chunk-HMFK4BXR.cjs.map → chunk-4BMPGT35.cjs.map} +1 -1
- package/dist/chunk-4CAXEB2F.cjs +1366 -0
- package/dist/chunk-4CAXEB2F.cjs.map +1 -0
- package/dist/{chunk-RY2VIWAM.js → chunk-4GX2JJXS.js} +355 -32
- package/dist/chunk-4GX2JJXS.js.map +1 -0
- package/dist/{chunk-GQANNXXT.cjs → chunk-5A6FNS6N.cjs} +75 -20
- package/dist/chunk-5A6FNS6N.cjs.map +1 -0
- package/dist/{chunk-3Z6TW3CT.cjs → chunk-5AQIKK56.cjs} +65 -25
- package/dist/chunk-5AQIKK56.cjs.map +1 -0
- package/dist/{chunk-WLRIWYHQ.js → chunk-5DIPR3L3.js} +2145 -1937
- package/dist/chunk-5DIPR3L3.js.map +1 -0
- package/dist/{chunk-BVTWD66D.js → chunk-5SEGFTZX.js} +3 -3
- package/dist/{chunk-BVTWD66D.js.map → chunk-5SEGFTZX.js.map} +1 -1
- package/dist/{chunk-A7SZZFAG.js → chunk-5VTR2F2K.js} +452 -109
- package/dist/chunk-5VTR2F2K.js.map +1 -0
- package/dist/{chunk-JJRCLAUN.cjs → chunk-5W4L6DLF.cjs} +116 -10
- package/dist/chunk-5W4L6DLF.cjs.map +1 -0
- package/dist/{chunk-6GNSY7AV.js → chunk-6FR2MMS6.js} +7 -7
- package/dist/chunk-6FR2MMS6.js.map +1 -0
- package/dist/{chunk-3BRVBQQD.cjs → chunk-7BQLPXK6.cjs} +2648 -2440
- package/dist/chunk-7BQLPXK6.cjs.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-ZV5N4DBG.js → chunk-BJVEU3ZL.js} +300 -58
- package/dist/chunk-BJVEU3ZL.js.map +1 -0
- package/dist/chunk-BYPOGQWK.js +25 -0
- package/dist/chunk-BYPOGQWK.js.map +1 -0
- package/dist/chunk-CUHM5CWJ.cjs +12 -0
- package/dist/chunk-CUHM5CWJ.cjs.map +1 -0
- package/dist/{chunk-2JXB3NYJ.cjs → chunk-D7ZEOS56.cjs} +25 -32
- 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-JIEJCTDS.cjs → chunk-DIK74MXX.cjs} +37 -4
- package/dist/chunk-DIK74MXX.cjs.map +1 -0
- package/dist/chunk-DN5VP4JC.js +1343 -0
- package/dist/chunk-DN5VP4JC.js.map +1 -0
- package/dist/chunk-EOLERH7Y.cjs +40 -0
- package/dist/chunk-EOLERH7Y.cjs.map +1 -0
- package/dist/{chunk-TGJE22RM.cjs → chunk-FACJJWGF.cjs} +24 -6
- package/dist/chunk-FACJJWGF.cjs.map +1 -0
- package/dist/{chunk-WVC2Q2FD.cjs → chunk-FN35DLCN.cjs} +31 -9
- package/dist/chunk-FN35DLCN.cjs.map +1 -0
- package/dist/{chunk-KUTNI6SI.js → chunk-FPIZFYHE.js} +10 -18
- package/dist/chunk-FPIZFYHE.js.map +1 -0
- package/dist/{chunk-VCGO4V26.js → chunk-FRV5Q5IO.js} +64 -9
- 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-JQGIPGVL.cjs → chunk-H7YNSMA7.cjs} +43 -2
- package/dist/chunk-H7YNSMA7.cjs.map +1 -0
- package/dist/chunk-HW3LW7DH.cjs +1271 -0
- package/dist/chunk-HW3LW7DH.cjs.map +1 -0
- package/dist/{chunk-V3QNTB7Z.js → chunk-IU46OHVW.js} +194 -114
- package/dist/chunk-IU46OHVW.js.map +1 -0
- package/dist/{chunk-HK5SATYM.cjs → chunk-J3LEGNQB.cjs} +16 -109
- package/dist/chunk-J3LEGNQB.cjs.map +1 -0
- package/dist/{chunk-ZP5WHI4C.cjs → chunk-JFMEONLG.cjs} +358 -116
- package/dist/chunk-JFMEONLG.cjs.map +1 -0
- package/dist/{chunk-2MRAX3UE.js → chunk-JFUPDJXD.js} +47 -4
- package/dist/chunk-JFUPDJXD.js.map +1 -0
- package/dist/{chunk-Z5XBMDXU.js → chunk-KBGQIPRQ.js} +42 -3
- package/dist/chunk-KBGQIPRQ.js.map +1 -0
- package/dist/{chunk-K2TGS3EN.js → chunk-M75SUBFG.js} +138 -89
- package/dist/chunk-M75SUBFG.js.map +1 -0
- package/dist/chunk-OHMP6N2J.js +47 -0
- package/dist/chunk-OHMP6N2J.js.map +1 -0
- package/dist/{chunk-4DIBPQNJ.js → chunk-OR5ZA5WP.js} +135 -25
- package/dist/chunk-OR5ZA5WP.js.map +1 -0
- package/dist/{chunk-6HVOHZHS.cjs → chunk-PWGX5DF5.cjs} +213 -168
- package/dist/chunk-PWGX5DF5.cjs.map +1 -0
- package/dist/chunk-PZKNKG5M.js +1252 -0
- package/dist/chunk-PZKNKG5M.js.map +1 -0
- package/dist/{chunk-DEQFL35G.js → chunk-Q5TEXCTB.js} +61 -7
- package/dist/chunk-Q5TEXCTB.js.map +1 -0
- package/dist/{chunk-QV245VMN.js → chunk-RAXU3RMB.js} +100 -6
- package/dist/chunk-RAXU3RMB.js.map +1 -0
- package/dist/{chunk-RHZWOJVA.cjs → chunk-RSSQKPSZ.cjs} +52 -4
- package/dist/chunk-RSSQKPSZ.cjs.map +1 -0
- package/dist/{chunk-G6SOJEDI.cjs → chunk-S55OV6PW.cjs} +15 -15
- package/dist/chunk-S55OV6PW.cjs.map +1 -0
- package/dist/chunk-S5F7ZLP2.js +94 -0
- package/dist/chunk-S5F7ZLP2.js.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-CHXTTSC6.js → chunk-SKCOUWAX.js} +104 -5
- package/dist/chunk-SKCOUWAX.js.map +1 -0
- 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-ZURTTSCM.js → chunk-SXGE7ITL.js} +6 -94
- package/dist/chunk-SXGE7ITL.js.map +1 -0
- package/dist/{chunk-RBV7YCQD.js → chunk-T2WUSPDA.js} +49 -9
- package/dist/chunk-T2WUSPDA.js.map +1 -0
- package/dist/{chunk-KGC4LY5T.cjs → chunk-TCOCYN2P.cjs} +75 -21
- 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-ZY4GXIVN.cjs → chunk-TEDRJXOG.cjs} +5 -5
- package/dist/{chunk-ZY4GXIVN.cjs.map → chunk-TEDRJXOG.cjs.map} +1 -1
- package/dist/{chunk-WL2SG7ZV.cjs → chunk-UMDVATGY.cjs} +6 -6
- package/dist/{chunk-WL2SG7ZV.cjs.map → chunk-UMDVATGY.cjs.map} +1 -1
- package/dist/chunk-UT3S4SEN.js +31 -0
- package/dist/chunk-UT3S4SEN.js.map +1 -0
- package/dist/{chunk-RRKQAKD6.cjs → chunk-UUT7UN2N.cjs} +149 -39
- package/dist/chunk-UUT7UN2N.cjs.map +1 -0
- package/dist/{chunk-SHLY4MCM.js → chunk-UZV3AZKF.js} +21 -3
- package/dist/chunk-UZV3AZKF.js.map +1 -0
- package/dist/{chunk-CYX2JTDG.js → chunk-VHMPG6UL.js} +29 -7
- package/dist/chunk-VHMPG6UL.js.map +1 -0
- package/dist/{chunk-LANHCOXB.js → chunk-VQEXF5D4.js} +485 -83
- package/dist/chunk-VQEXF5D4.js.map +1 -0
- package/dist/{chunk-K34OPSJK.js → chunk-W63OVYY4.js} +3 -3
- package/dist/{chunk-K34OPSJK.js.map → chunk-W63OVYY4.js.map} +1 -1
- package/dist/{chunk-TQOYM4LN.js → chunk-WI7ISNQF.js} +35 -5
- package/dist/chunk-WI7ISNQF.js.map +1 -0
- package/dist/{chunk-UNNPKQUG.cjs → chunk-X4JBT642.cjs} +246 -155
- package/dist/chunk-X4JBT642.cjs.map +1 -0
- package/dist/chunk-ZAMFOJ5P.cjs +1176 -0
- package/dist/chunk-ZAMFOJ5P.cjs.map +1 -0
- package/dist/{chunk-T46GR2VY.js → chunk-ZIGXMKQQ.js} +3 -3
- package/dist/{chunk-T46GR2VY.js.map → chunk-ZIGXMKQQ.js.map} +1 -1
- package/dist/{chunk-5IQIX7LU.cjs → chunk-ZUNQ5BEP.cjs} +518 -172
- package/dist/chunk-ZUNQ5BEP.cjs.map +1 -0
- package/dist/{ddl-BrmPg61z.d.ts → ddl-C2rZ-Aen.d.ts} +4 -4
- package/dist/{ddl-j1-sH6lE.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-DkNnF-7K.d.cts → fulltext-strategy-B57yvC5Q.d.ts} +2562 -2133
- package/dist/{types-D1Sqeyxy.d.ts → fulltext-strategy-CDkSSYhq.d.cts} +2562 -2133
- package/dist/graph-extension/index.cjs +20 -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 +5 -4
- package/dist/graph-merge/index.cjs +255 -164
- 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 +135 -44
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/{index-DGX6D9j1.d.ts → index-BFvdmBPV.d.ts} +301 -93
- package/dist/{index-SEvUHDA6.d.cts → index-BLtQWKRj.d.cts} +301 -93
- package/dist/index.cjs +216 -188
- package/dist/index.d.cts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +33 -33
- package/dist/indexes/index.cjs +19 -20
- package/dist/indexes/index.d.cts +5 -5
- package/dist/indexes/index.d.ts +5 -5
- package/dist/indexes/index.js +10 -11
- package/dist/interchange/index.cjs +48 -26
- package/dist/interchange/index.d.cts +126 -12
- package/dist/interchange/index.d.ts +126 -12
- package/dist/interchange/index.js +15 -13
- package/dist/{manager-ms9cKdc6.d.cts → manager-DwQi8eV0.d.cts} +9 -2
- package/dist/{manager-BZUeN_BU.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-BhpxGMC5.d.cts → postgres-CfEqsRMp.d.cts} +152 -1
- package/dist/{postgres-CWHLwNl1.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 +40 -41
- 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 +11 -12
- package/dist/provenance/index.js.map +1 -1
- package/dist/schema/index.cjs +53 -40
- 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 +28 -15
- package/dist/schema/index.js.map +1 -1
- package/dist/{sqlite-XrDxNaa7.d.cts → sqlite-D7zBinNR.d.cts} +92 -1
- package/dist/{sqlite-CGu5SLsw.d.ts → sqlite-DvQndLky.d.ts} +92 -1
- package/dist/{store-view-D09po4H6.d.cts → store-view-9KDOpZzF.d.cts} +643 -58
- package/dist/{store-view-BlgnhEYf.d.ts → store-view-DplHC3Nt.d.ts} +643 -58
- package/dist/{types-DiE1AO7p.d.cts → types-Bv9DcS_E.d.cts} +2 -2
- package/dist/{types-B1TbZJYS.d.ts → types-CoxuV7EJ.d.ts} +2 -2
- package/dist/{where-DKjuofPr.d.cts → where-7RKFOsXt.d.ts} +2 -2
- package/dist/{where-DrUIIWHb.d.ts → where-DdMIXOtH.d.cts} +2 -2
- package/package.json +14 -13
- package/dist/chunk-2EBMPJBO.js +0 -16
- package/dist/chunk-2EBMPJBO.js.map +0 -1
- package/dist/chunk-2JXB3NYJ.cjs.map +0 -1
- package/dist/chunk-2MRAX3UE.js.map +0 -1
- package/dist/chunk-3BRVBQQD.cjs.map +0 -1
- package/dist/chunk-3EUKJEQ3.js +0 -77
- package/dist/chunk-3EUKJEQ3.js.map +0 -1
- package/dist/chunk-3Z6TW3CT.cjs.map +0 -1
- package/dist/chunk-4DIBPQNJ.js.map +0 -1
- package/dist/chunk-4S2FXGBJ.js +0 -9
- package/dist/chunk-4S2FXGBJ.js.map +0 -1
- package/dist/chunk-5IQIX7LU.cjs.map +0 -1
- package/dist/chunk-6GNSY7AV.js.map +0 -1
- package/dist/chunk-6HVOHZHS.cjs.map +0 -1
- package/dist/chunk-6SCVW4AS.js +0 -20
- package/dist/chunk-6SCVW4AS.js.map +0 -1
- package/dist/chunk-A7SZZFAG.js.map +0 -1
- package/dist/chunk-CHXTTSC6.js.map +0 -1
- package/dist/chunk-CYX2JTDG.js.map +0 -1
- package/dist/chunk-DEQFL35G.js.map +0 -1
- package/dist/chunk-G6SOJEDI.cjs.map +0 -1
- package/dist/chunk-GQANNXXT.cjs.map +0 -1
- package/dist/chunk-GZCNZ7QW.js +0 -24
- package/dist/chunk-GZCNZ7QW.js.map +0 -1
- package/dist/chunk-HK5SATYM.cjs.map +0 -1
- package/dist/chunk-HMFK4BXR.cjs +0 -12
- package/dist/chunk-HTGDWIDE.cjs +0 -89
- package/dist/chunk-HTGDWIDE.cjs.map +0 -1
- package/dist/chunk-JIEJCTDS.cjs.map +0 -1
- package/dist/chunk-JJRCLAUN.cjs.map +0 -1
- package/dist/chunk-JQGIPGVL.cjs.map +0 -1
- package/dist/chunk-K2TGS3EN.js.map +0 -1
- package/dist/chunk-KGC4LY5T.cjs.map +0 -1
- package/dist/chunk-KNHYNQQ3.cjs +0 -663
- package/dist/chunk-KNHYNQQ3.cjs.map +0 -1
- package/dist/chunk-KUTNI6SI.js.map +0 -1
- package/dist/chunk-LANHCOXB.js.map +0 -1
- package/dist/chunk-N6WTUSBV.cjs +0 -23
- package/dist/chunk-N6WTUSBV.cjs.map +0 -1
- package/dist/chunk-NAUA4PW5.cjs +0 -28
- package/dist/chunk-NAUA4PW5.cjs.map +0 -1
- package/dist/chunk-QV245VMN.js.map +0 -1
- package/dist/chunk-RBV7YCQD.js.map +0 -1
- package/dist/chunk-RHZWOJVA.cjs.map +0 -1
- package/dist/chunk-RRKQAKD6.cjs.map +0 -1
- package/dist/chunk-RY2VIWAM.js.map +0 -1
- package/dist/chunk-SHLY4MCM.js.map +0 -1
- package/dist/chunk-T2DWPQNE.js +0 -649
- package/dist/chunk-T2DWPQNE.js.map +0 -1
- package/dist/chunk-T6SPUYLX.cjs.map +0 -1
- package/dist/chunk-TGJE22RM.cjs.map +0 -1
- package/dist/chunk-TOTPVGOG.cjs +0 -774
- package/dist/chunk-TOTPVGOG.cjs.map +0 -1
- package/dist/chunk-TQOYM4LN.js.map +0 -1
- package/dist/chunk-UJLOZYKT.cjs.map +0 -1
- package/dist/chunk-UNNPKQUG.cjs.map +0 -1
- package/dist/chunk-V3QNTB7Z.js.map +0 -1
- package/dist/chunk-VCGO4V26.js.map +0 -1
- package/dist/chunk-WLRIWYHQ.js.map +0 -1
- package/dist/chunk-WVC2Q2FD.cjs.map +0 -1
- package/dist/chunk-XXVEULWX.js +0 -39
- package/dist/chunk-XXVEULWX.js.map +0 -1
- package/dist/chunk-YAZE7QZR.cjs +0 -32
- package/dist/chunk-YAZE7QZR.cjs.map +0 -1
- package/dist/chunk-YC6PWTHY.cjs +0 -44
- package/dist/chunk-YC6PWTHY.cjs.map +0 -1
- package/dist/chunk-Z5HBYM7U.cjs +0 -11
- package/dist/chunk-Z5HBYM7U.cjs.map +0 -1
- package/dist/chunk-Z5XBMDXU.js.map +0 -1
- package/dist/chunk-ZP5WHI4C.cjs.map +0 -1
- package/dist/chunk-ZURTTSCM.js.map +0 -1
- package/dist/chunk-ZV5N4DBG.js.map +0 -1
|
@@ -1,11 +1,188 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
3
|
+
var chunkRSSQKPSZ_cjs = require('./chunk-RSSQKPSZ.cjs');
|
|
4
|
+
var chunk7YSP4V4R_cjs = require('./chunk-7YSP4V4R.cjs');
|
|
5
|
+
var chunkSJDMVITW_cjs = require('./chunk-SJDMVITW.cjs');
|
|
6
|
+
var chunkDIK74MXX_cjs = require('./chunk-DIK74MXX.cjs');
|
|
7
|
+
var chunkTDXIBCGY_cjs = require('./chunk-TDXIBCGY.cjs');
|
|
7
8
|
var drizzleOrm = require('drizzle-orm');
|
|
8
9
|
|
|
10
|
+
// src/backend/types.ts
|
|
11
|
+
function rowPropsToObject(props) {
|
|
12
|
+
return typeof props === "string" ? JSON.parse(props) : props;
|
|
13
|
+
}
|
|
14
|
+
function rowPropsToJsonText(props) {
|
|
15
|
+
return typeof props === "string" ? props : JSON.stringify(props);
|
|
16
|
+
}
|
|
17
|
+
function isLiveNodeRow(row) {
|
|
18
|
+
return row.deleted_at === void 0;
|
|
19
|
+
}
|
|
20
|
+
function isTombstonedNodeRow(row) {
|
|
21
|
+
return row.deleted_at !== void 0;
|
|
22
|
+
}
|
|
23
|
+
function createBackendOverlay(target, overlay) {
|
|
24
|
+
const boundTargetMethods = /* @__PURE__ */ new Map();
|
|
25
|
+
function hasOverlayProperty(property) {
|
|
26
|
+
return Object.hasOwn(overlay, property);
|
|
27
|
+
}
|
|
28
|
+
function targetValue(targetObject, property) {
|
|
29
|
+
const value = Reflect.get(targetObject, property, targetObject);
|
|
30
|
+
if (typeof value !== "function") return value;
|
|
31
|
+
const cached = boundTargetMethods.get(property);
|
|
32
|
+
if (cached !== void 0) return cached;
|
|
33
|
+
const method = value;
|
|
34
|
+
const bound = method.bind(targetObject);
|
|
35
|
+
boundTargetMethods.set(property, bound);
|
|
36
|
+
return bound;
|
|
37
|
+
}
|
|
38
|
+
return new Proxy(target, {
|
|
39
|
+
get(targetObject, property) {
|
|
40
|
+
if (hasOverlayProperty(property)) {
|
|
41
|
+
return Reflect.get(overlay, property, overlay);
|
|
42
|
+
}
|
|
43
|
+
return targetValue(targetObject, property);
|
|
44
|
+
},
|
|
45
|
+
has(targetObject, property) {
|
|
46
|
+
return hasOverlayProperty(property) || Reflect.has(targetObject, property);
|
|
47
|
+
},
|
|
48
|
+
ownKeys(targetObject) {
|
|
49
|
+
return [
|
|
50
|
+
.../* @__PURE__ */ new Set([
|
|
51
|
+
...Reflect.ownKeys(targetObject),
|
|
52
|
+
...Reflect.ownKeys(overlay)
|
|
53
|
+
])
|
|
54
|
+
];
|
|
55
|
+
},
|
|
56
|
+
getOwnPropertyDescriptor(targetObject, property) {
|
|
57
|
+
if (hasOverlayProperty(property)) {
|
|
58
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(overlay, property);
|
|
59
|
+
if (descriptor === void 0) return;
|
|
60
|
+
return { ...descriptor, configurable: true };
|
|
61
|
+
}
|
|
62
|
+
return Reflect.getOwnPropertyDescriptor(targetObject, property);
|
|
63
|
+
},
|
|
64
|
+
set(targetObject, property, value) {
|
|
65
|
+
if (hasOverlayProperty(property)) {
|
|
66
|
+
return Reflect.set(overlay, property, value, overlay);
|
|
67
|
+
}
|
|
68
|
+
return Reflect.set(targetObject, property, value, targetObject);
|
|
69
|
+
},
|
|
70
|
+
defineProperty(targetObject, property, attributes) {
|
|
71
|
+
if (hasOverlayProperty(property)) {
|
|
72
|
+
return Reflect.defineProperty(overlay, property, attributes);
|
|
73
|
+
}
|
|
74
|
+
return Reflect.defineProperty(targetObject, property, attributes);
|
|
75
|
+
},
|
|
76
|
+
deleteProperty(targetObject, property) {
|
|
77
|
+
if (hasOverlayProperty(property)) {
|
|
78
|
+
return Reflect.deleteProperty(overlay, property);
|
|
79
|
+
}
|
|
80
|
+
return Reflect.deleteProperty(targetObject, property);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
function wrapWithManagedClose(backend, teardown) {
|
|
85
|
+
let isClosed = false;
|
|
86
|
+
return createBackendOverlay(backend, {
|
|
87
|
+
async close() {
|
|
88
|
+
if (isClosed) return;
|
|
89
|
+
isClosed = true;
|
|
90
|
+
await backend.close();
|
|
91
|
+
await teardown();
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
async function runOptionallyInTransaction(backend, fn, fallback) {
|
|
96
|
+
if ("transaction" in backend && backend.capabilities.transactions) {
|
|
97
|
+
return backend.transaction((tx) => fn(tx));
|
|
98
|
+
}
|
|
99
|
+
return fn(fallback ?? backend);
|
|
100
|
+
}
|
|
101
|
+
var SQLITE_MAX_BIND_PARAMETERS = 999;
|
|
102
|
+
var MODERN_SQLITE_MAX_BIND_PARAMETERS = 32766;
|
|
103
|
+
var D1_MAX_BIND_PARAMETERS = 100;
|
|
104
|
+
var POSTGRES_MAX_BIND_PARAMETERS = 65535;
|
|
105
|
+
var SQLITE_CAPABILITIES = {
|
|
106
|
+
transactions: true,
|
|
107
|
+
// SQLite supports transactions
|
|
108
|
+
windowFunctions: true,
|
|
109
|
+
// SQLite has supported window functions since 3.25.0
|
|
110
|
+
returning: true,
|
|
111
|
+
// SQLite has supported RETURNING since 3.35.0
|
|
112
|
+
maxBindParameters: SQLITE_MAX_BIND_PARAMETERS
|
|
113
|
+
};
|
|
114
|
+
var POSTGRES_CAPABILITIES = {
|
|
115
|
+
transactions: true,
|
|
116
|
+
// PostgreSQL supports transactions
|
|
117
|
+
windowFunctions: true,
|
|
118
|
+
// PostgreSQL supports ROW_NUMBER() and related windows
|
|
119
|
+
returning: true,
|
|
120
|
+
// PostgreSQL has supported RETURNING since 8.2
|
|
121
|
+
maxBindParameters: POSTGRES_MAX_BIND_PARAMETERS
|
|
122
|
+
};
|
|
123
|
+
var pinnedReadInstant;
|
|
124
|
+
function withPinnedReadInstant(emit) {
|
|
125
|
+
if (pinnedReadInstant !== void 0) return emit();
|
|
126
|
+
pinnedReadInstant = chunkRSSQKPSZ_cjs.nowIso();
|
|
127
|
+
try {
|
|
128
|
+
return emit();
|
|
129
|
+
} finally {
|
|
130
|
+
pinnedReadInstant = void 0;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
function currentReadInstant() {
|
|
134
|
+
return drizzleOrm.sql`${pinnedReadInstant ?? chunkRSSQKPSZ_cjs.nowIso()}`;
|
|
135
|
+
}
|
|
136
|
+
var CURRENT_READ_INSTANT_PLACEHOLDER = "__typegraph_current_read_instant__";
|
|
137
|
+
function currentReadInstantPlaceholder() {
|
|
138
|
+
return drizzleOrm.sql`${drizzleOrm.sql.placeholder(CURRENT_READ_INSTANT_PLACEHOLDER)}`;
|
|
139
|
+
}
|
|
140
|
+
function currentReadInstantFor(mode) {
|
|
141
|
+
return mode === "placeholder" ? currentReadInstantPlaceholder() : currentReadInstant();
|
|
142
|
+
}
|
|
143
|
+
function compileTemporalFilter(options) {
|
|
144
|
+
const { mode, asOf, tableAlias, currentTimestamp, recordedAsOf } = options;
|
|
145
|
+
const prefix = tableAlias ? drizzleOrm.sql.raw(`${tableAlias}.`) : drizzleOrm.sql.raw("");
|
|
146
|
+
const deletedAt = drizzleOrm.sql`${prefix}deleted_at`;
|
|
147
|
+
const validFrom = drizzleOrm.sql`${prefix}valid_from`;
|
|
148
|
+
const validTo = drizzleOrm.sql`${prefix}valid_to`;
|
|
149
|
+
const validFilter = (() => {
|
|
150
|
+
switch (mode) {
|
|
151
|
+
case "current": {
|
|
152
|
+
const now = recordedAsOf === void 0 ? currentTimestamp ?? currentReadInstant() : drizzleOrm.sql`${recordedAsOf}`;
|
|
153
|
+
return drizzleOrm.sql`${deletedAt} IS NULL AND (${validFrom} IS NULL OR ${validFrom} <= ${now}) AND (${validTo} IS NULL OR ${validTo} > ${now})`;
|
|
154
|
+
}
|
|
155
|
+
case "asOf": {
|
|
156
|
+
if (asOf === void 0) {
|
|
157
|
+
throw new Error(
|
|
158
|
+
`asOf timestamp is required for temporal mode "asOf"`
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
const timestamp = asOf;
|
|
162
|
+
return drizzleOrm.sql`${deletedAt} IS NULL AND (${validFrom} IS NULL OR ${validFrom} <= ${timestamp}) AND (${validTo} IS NULL OR ${validTo} > ${timestamp})`;
|
|
163
|
+
}
|
|
164
|
+
case "includeEnded": {
|
|
165
|
+
return drizzleOrm.sql`${deletedAt} IS NULL`;
|
|
166
|
+
}
|
|
167
|
+
case "includeTombstones": {
|
|
168
|
+
return drizzleOrm.sql.raw("1=1");
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
})();
|
|
172
|
+
if (recordedAsOf === void 0) return validFilter;
|
|
173
|
+
const recordedFrom = drizzleOrm.sql`${prefix}recorded_from`;
|
|
174
|
+
const recordedTo = drizzleOrm.sql`${prefix}recorded_to`;
|
|
175
|
+
return drizzleOrm.sql`(${validFilter}) AND ${recordedFrom} <= ${recordedAsOf} AND ${recordedAsOf} < ${recordedTo}`;
|
|
176
|
+
}
|
|
177
|
+
function extractTemporalOptions(ast, tableAlias) {
|
|
178
|
+
return {
|
|
179
|
+
mode: ast.temporalMode.mode,
|
|
180
|
+
asOf: ast.temporalMode.asOf,
|
|
181
|
+
recordedAsOf: ast.recordedAsOf,
|
|
182
|
+
tableAlias
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
|
|
9
186
|
// src/query/subquery-utils.ts
|
|
10
187
|
function normalizeValueType(valueType) {
|
|
11
188
|
if (valueType === void 0 || valueType === "unknown") {
|
|
@@ -82,6 +259,12 @@ function predicate(expr) {
|
|
|
82
259
|
};
|
|
83
260
|
}
|
|
84
261
|
function param(name) {
|
|
262
|
+
if (name === CURRENT_READ_INSTANT_PLACEHOLDER) {
|
|
263
|
+
throw new chunkDIK74MXX_cjs.ConfigurationError(
|
|
264
|
+
`Parameter name "${name}" is reserved for internal use`,
|
|
265
|
+
{ parameterName: name }
|
|
266
|
+
);
|
|
267
|
+
}
|
|
85
268
|
return { __type: "parameter", name };
|
|
86
269
|
}
|
|
87
270
|
function isParameterRef(value) {
|
|
@@ -224,7 +407,7 @@ function createFulltextAccessor(alias, hasSearchableField) {
|
|
|
224
407
|
return {
|
|
225
408
|
matches: (query, k, options) => {
|
|
226
409
|
if (!hasSearchableField()) {
|
|
227
|
-
throw new
|
|
410
|
+
throw new chunkDIK74MXX_cjs.UnsupportedPredicateError(
|
|
228
411
|
`Cannot call .$fulltext.matches() on alias "${alias}" \u2014 its node kind has no fields declared with searchable(). Add at least one: \`title: searchable({ language: "english" })\`.`
|
|
229
412
|
);
|
|
230
413
|
}
|
|
@@ -239,7 +422,7 @@ function createFulltextAccessor(alias, hasSearchableField) {
|
|
|
239
422
|
}
|
|
240
423
|
function fulltextMatch(field, query, limit, options) {
|
|
241
424
|
if (!Number.isFinite(limit) || limit <= 0) {
|
|
242
|
-
throw new
|
|
425
|
+
throw new chunkDIK74MXX_cjs.UnsupportedPredicateError(
|
|
243
426
|
`matches() limit must be a positive finite number, got ${String(limit)}`
|
|
244
427
|
);
|
|
245
428
|
}
|
|
@@ -314,7 +497,10 @@ function vectorSimilarity(field, queryEmbedding, limit, options) {
|
|
|
314
497
|
// here would mis-rank l2/inner_product fields and bypass their ANN index.
|
|
315
498
|
...options?.metric !== void 0 && { metric: options.metric },
|
|
316
499
|
limit,
|
|
317
|
-
...options?.minScore !== void 0 && { minScore: options.minScore }
|
|
500
|
+
...options?.minScore !== void 0 && { minScore: options.minScore },
|
|
501
|
+
...options?.approximate !== void 0 && {
|
|
502
|
+
approximate: options.approximate
|
|
503
|
+
}
|
|
318
504
|
};
|
|
319
505
|
return predicate(expr);
|
|
320
506
|
}
|
|
@@ -356,7 +542,7 @@ function buildFieldBuilderForTypeInfo(field, typeInfo) {
|
|
|
356
542
|
}
|
|
357
543
|
}
|
|
358
544
|
function resolvePointerTypeInfo(typeInfo, pointer) {
|
|
359
|
-
return
|
|
545
|
+
return chunkSJDMVITW_cjs.resolveFieldTypeInfoAtJsonPointer(typeInfo, pointer);
|
|
360
546
|
}
|
|
361
547
|
function objectOp(op, field, pointer, value, options) {
|
|
362
548
|
const expr = {
|
|
@@ -379,8 +565,8 @@ function objectField(field, options) {
|
|
|
379
565
|
return {
|
|
380
566
|
...baseFieldBuilder(field),
|
|
381
567
|
get: (key) => {
|
|
382
|
-
const pointer =
|
|
383
|
-
const nestedPointer =
|
|
568
|
+
const pointer = chunkTDXIBCGY_cjs.jsonPointer([key]);
|
|
569
|
+
const nestedPointer = chunkTDXIBCGY_cjs.joinJsonPointers(basePointer, pointer);
|
|
384
570
|
const resolved = resolvePointerTypeInfo(options?.typeInfo, pointer);
|
|
385
571
|
const nestedRef = fieldRef(field.alias, field.path, {
|
|
386
572
|
jsonPointer: nestedPointer,
|
|
@@ -394,17 +580,17 @@ function objectField(field, options) {
|
|
|
394
580
|
return buildFieldBuilderForTypeInfo(nestedRef, resolved);
|
|
395
581
|
},
|
|
396
582
|
hasKey: (key) => {
|
|
397
|
-
const pointer =
|
|
583
|
+
const pointer = chunkTDXIBCGY_cjs.jsonPointer([key]);
|
|
398
584
|
resolvePointerTypeInfo(options?.typeInfo, pointer);
|
|
399
585
|
return objectOp("hasKey", field, pointer);
|
|
400
586
|
},
|
|
401
587
|
hasPath: (pointer) => {
|
|
402
|
-
const normalized =
|
|
588
|
+
const normalized = chunkTDXIBCGY_cjs.normalizeJsonPointer(pointer);
|
|
403
589
|
resolvePointerTypeInfo(options?.typeInfo, normalized);
|
|
404
590
|
return objectOp("hasPath", field, normalized);
|
|
405
591
|
},
|
|
406
592
|
pathEquals: (pointer, value) => {
|
|
407
|
-
const normalized =
|
|
593
|
+
const normalized = chunkTDXIBCGY_cjs.normalizeJsonPointer(pointer);
|
|
408
594
|
const resolved = resolvePointerTypeInfo(options?.typeInfo, normalized);
|
|
409
595
|
if (resolved && (resolved.valueType === "array" || resolved.valueType === "object")) {
|
|
410
596
|
throw new Error("pathEquals is only supported for scalar JSON values");
|
|
@@ -413,7 +599,7 @@ function objectField(field, options) {
|
|
|
413
599
|
return objectOp("pathEquals", field, normalized, value, predicateOptions);
|
|
414
600
|
},
|
|
415
601
|
pathContains: (pointer, value) => {
|
|
416
|
-
const normalized =
|
|
602
|
+
const normalized = chunkTDXIBCGY_cjs.normalizeJsonPointer(pointer);
|
|
417
603
|
const resolved = resolvePointerTypeInfo(options?.typeInfo, normalized);
|
|
418
604
|
if (resolved && resolved.valueType !== "array") {
|
|
419
605
|
throw new Error("pathContains is only supported for JSON array values");
|
|
@@ -428,7 +614,7 @@ function objectField(field, options) {
|
|
|
428
614
|
);
|
|
429
615
|
},
|
|
430
616
|
pathIsNull: (pointer) => {
|
|
431
|
-
const normalized =
|
|
617
|
+
const normalized = chunkTDXIBCGY_cjs.normalizeJsonPointer(pointer);
|
|
432
618
|
const resolved = resolvePointerTypeInfo(options?.typeInfo, normalized);
|
|
433
619
|
const predicateOptions = resolved?.valueType === void 0 ? void 0 : { valueType: resolved.valueType };
|
|
434
620
|
return objectOp(
|
|
@@ -440,7 +626,7 @@ function objectField(field, options) {
|
|
|
440
626
|
);
|
|
441
627
|
},
|
|
442
628
|
pathIsNotNull: (pointer) => {
|
|
443
|
-
const normalized =
|
|
629
|
+
const normalized = chunkTDXIBCGY_cjs.normalizeJsonPointer(pointer);
|
|
444
630
|
const resolved = resolvePointerTypeInfo(options?.typeInfo, normalized);
|
|
445
631
|
const predicateOptions = resolved?.valueType === void 0 ? void 0 : { valueType: resolved.valueType };
|
|
446
632
|
return objectOp(
|
|
@@ -452,8 +638,8 @@ function objectField(field, options) {
|
|
|
452
638
|
);
|
|
453
639
|
},
|
|
454
640
|
field: (pointer) => {
|
|
455
|
-
const normalized =
|
|
456
|
-
const nestedPointer =
|
|
641
|
+
const normalized = chunkTDXIBCGY_cjs.normalizeJsonPointer(pointer);
|
|
642
|
+
const nestedPointer = chunkTDXIBCGY_cjs.joinJsonPointers(basePointer, normalized);
|
|
457
643
|
const resolved = resolvePointerTypeInfo(options?.typeInfo, normalized);
|
|
458
644
|
const nestedRef = fieldRef(field.alias, field.path, {
|
|
459
645
|
jsonPointer: nestedPointer,
|
|
@@ -509,7 +695,7 @@ function notInSubquery(field, subquery) {
|
|
|
509
695
|
function assertSingleColumnSubquery(subquery) {
|
|
510
696
|
const columnCount = getSubqueryColumnCount(subquery);
|
|
511
697
|
if (columnCount === 1) return;
|
|
512
|
-
throw new
|
|
698
|
+
throw new chunkDIK74MXX_cjs.UnsupportedPredicateError(
|
|
513
699
|
`IN/NOT IN subquery must project exactly 1 column, but got ${columnCount}`,
|
|
514
700
|
{ subqueryColumnCount: columnCount },
|
|
515
701
|
{
|
|
@@ -522,7 +708,7 @@ function assertCompatibleSubqueryValueTypes(field, subquery) {
|
|
|
522
708
|
const subqueryValueType = getSingleSubqueryColumnValueType(subquery);
|
|
523
709
|
const resolvedValueType = fieldValueType ?? subqueryValueType;
|
|
524
710
|
if (isUnsupportedInSubqueryValueType(resolvedValueType)) {
|
|
525
|
-
throw new
|
|
711
|
+
throw new chunkDIK74MXX_cjs.UnsupportedPredicateError(
|
|
526
712
|
`IN/NOT IN subquery does not support ${String(resolvedValueType)} values`,
|
|
527
713
|
{ valueType: resolvedValueType },
|
|
528
714
|
{
|
|
@@ -533,7 +719,7 @@ function assertCompatibleSubqueryValueTypes(field, subquery) {
|
|
|
533
719
|
if (isInSubqueryTypeCompatible(fieldValueType, subqueryValueType)) {
|
|
534
720
|
return;
|
|
535
721
|
}
|
|
536
|
-
throw new
|
|
722
|
+
throw new chunkDIK74MXX_cjs.UnsupportedPredicateError(
|
|
537
723
|
`IN/NOT IN type mismatch: field type "${String(fieldValueType)}" does not match subquery column type "${String(subqueryValueType)}"`,
|
|
538
724
|
{
|
|
539
725
|
fieldValueType,
|
|
@@ -541,112 +727,6 @@ function assertCompatibleSubqueryValueTypes(field, subquery) {
|
|
|
541
727
|
}
|
|
542
728
|
);
|
|
543
729
|
}
|
|
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
|
-
}
|
|
552
|
-
function createBackendOverlay(target, overlay) {
|
|
553
|
-
const boundTargetMethods = /* @__PURE__ */ new Map();
|
|
554
|
-
function hasOverlayProperty(property) {
|
|
555
|
-
return Object.hasOwn(overlay, property);
|
|
556
|
-
}
|
|
557
|
-
function targetValue(targetObject, property) {
|
|
558
|
-
const value = Reflect.get(targetObject, property, targetObject);
|
|
559
|
-
if (typeof value !== "function") return value;
|
|
560
|
-
const cached = boundTargetMethods.get(property);
|
|
561
|
-
if (cached !== void 0) return cached;
|
|
562
|
-
const method = value;
|
|
563
|
-
const bound = method.bind(targetObject);
|
|
564
|
-
boundTargetMethods.set(property, bound);
|
|
565
|
-
return bound;
|
|
566
|
-
}
|
|
567
|
-
return new Proxy(target, {
|
|
568
|
-
get(targetObject, property) {
|
|
569
|
-
if (hasOverlayProperty(property)) {
|
|
570
|
-
return Reflect.get(overlay, property, overlay);
|
|
571
|
-
}
|
|
572
|
-
return targetValue(targetObject, property);
|
|
573
|
-
},
|
|
574
|
-
has(targetObject, property) {
|
|
575
|
-
return hasOverlayProperty(property) || Reflect.has(targetObject, property);
|
|
576
|
-
},
|
|
577
|
-
ownKeys(targetObject) {
|
|
578
|
-
return [
|
|
579
|
-
.../* @__PURE__ */ new Set([
|
|
580
|
-
...Reflect.ownKeys(targetObject),
|
|
581
|
-
...Reflect.ownKeys(overlay)
|
|
582
|
-
])
|
|
583
|
-
];
|
|
584
|
-
},
|
|
585
|
-
getOwnPropertyDescriptor(targetObject, property) {
|
|
586
|
-
if (hasOverlayProperty(property)) {
|
|
587
|
-
const descriptor = Reflect.getOwnPropertyDescriptor(overlay, property);
|
|
588
|
-
if (descriptor === void 0) return;
|
|
589
|
-
return { ...descriptor, configurable: true };
|
|
590
|
-
}
|
|
591
|
-
return Reflect.getOwnPropertyDescriptor(targetObject, property);
|
|
592
|
-
},
|
|
593
|
-
set(targetObject, property, value) {
|
|
594
|
-
if (hasOverlayProperty(property)) {
|
|
595
|
-
return Reflect.set(overlay, property, value, overlay);
|
|
596
|
-
}
|
|
597
|
-
return Reflect.set(targetObject, property, value, targetObject);
|
|
598
|
-
},
|
|
599
|
-
defineProperty(targetObject, property, attributes) {
|
|
600
|
-
if (hasOverlayProperty(property)) {
|
|
601
|
-
return Reflect.defineProperty(overlay, property, attributes);
|
|
602
|
-
}
|
|
603
|
-
return Reflect.defineProperty(targetObject, property, attributes);
|
|
604
|
-
},
|
|
605
|
-
deleteProperty(targetObject, property) {
|
|
606
|
-
if (hasOverlayProperty(property)) {
|
|
607
|
-
return Reflect.deleteProperty(overlay, property);
|
|
608
|
-
}
|
|
609
|
-
return Reflect.deleteProperty(targetObject, property);
|
|
610
|
-
}
|
|
611
|
-
});
|
|
612
|
-
}
|
|
613
|
-
function wrapWithManagedClose(backend, teardown) {
|
|
614
|
-
let isClosed = false;
|
|
615
|
-
return createBackendOverlay(backend, {
|
|
616
|
-
async close() {
|
|
617
|
-
if (isClosed) return;
|
|
618
|
-
isClosed = true;
|
|
619
|
-
await backend.close();
|
|
620
|
-
await teardown();
|
|
621
|
-
}
|
|
622
|
-
});
|
|
623
|
-
}
|
|
624
|
-
async function runOptionallyInTransaction(backend, fn, fallback) {
|
|
625
|
-
if ("transaction" in backend && backend.capabilities.transactions) {
|
|
626
|
-
return backend.transaction((tx) => fn(tx));
|
|
627
|
-
}
|
|
628
|
-
return fn(fallback ?? backend);
|
|
629
|
-
}
|
|
630
|
-
var SQLITE_MAX_BIND_PARAMETERS = 999;
|
|
631
|
-
var POSTGRES_MAX_BIND_PARAMETERS = 65535;
|
|
632
|
-
var SQLITE_CAPABILITIES = {
|
|
633
|
-
transactions: true,
|
|
634
|
-
// SQLite supports transactions
|
|
635
|
-
windowFunctions: true,
|
|
636
|
-
// SQLite has supported window functions since 3.25.0
|
|
637
|
-
returning: true,
|
|
638
|
-
// SQLite has supported RETURNING since 3.35.0
|
|
639
|
-
maxBindParameters: SQLITE_MAX_BIND_PARAMETERS
|
|
640
|
-
};
|
|
641
|
-
var POSTGRES_CAPABILITIES = {
|
|
642
|
-
transactions: true,
|
|
643
|
-
// PostgreSQL supports transactions
|
|
644
|
-
windowFunctions: true,
|
|
645
|
-
// PostgreSQL supports ROW_NUMBER() and related windows
|
|
646
|
-
returning: true,
|
|
647
|
-
// PostgreSQL has supported RETURNING since 8.2
|
|
648
|
-
maxBindParameters: POSTGRES_MAX_BIND_PARAMETERS
|
|
649
|
-
};
|
|
650
730
|
var COMPARISON_OP_SQL = {
|
|
651
731
|
eq: "=",
|
|
652
732
|
neq: "!=",
|
|
@@ -687,7 +767,7 @@ function getFieldPointer(field) {
|
|
|
687
767
|
return field.jsonPointer;
|
|
688
768
|
}
|
|
689
769
|
if (field.path.length > 1 && field.path[0] === "props") {
|
|
690
|
-
return
|
|
770
|
+
return chunkTDXIBCGY_cjs.jsonPointer(field.path.slice(1));
|
|
691
771
|
}
|
|
692
772
|
return void 0;
|
|
693
773
|
}
|
|
@@ -763,7 +843,7 @@ function resolveLiteralValueTypes(literals) {
|
|
|
763
843
|
}
|
|
764
844
|
}
|
|
765
845
|
if (resolved.size > 1) {
|
|
766
|
-
throw new
|
|
846
|
+
throw new chunkDIK74MXX_cjs.UnsupportedPredicateError(
|
|
767
847
|
"Mixed literal value types are not supported in predicates",
|
|
768
848
|
{ valueTypes: [...resolved] }
|
|
769
849
|
);
|
|
@@ -797,9 +877,9 @@ function convertValueForSql(value, dialect) {
|
|
|
797
877
|
}
|
|
798
878
|
function compileStringPattern(op, pattern) {
|
|
799
879
|
const escaped = pattern.replaceAll(
|
|
800
|
-
|
|
801
|
-
`${
|
|
802
|
-
).replaceAll("%", `${
|
|
880
|
+
chunk7YSP4V4R_cjs.LIKE_ESCAPE_CHARACTER,
|
|
881
|
+
`${chunk7YSP4V4R_cjs.LIKE_ESCAPE_CHARACTER}${chunk7YSP4V4R_cjs.LIKE_ESCAPE_CHARACTER}`
|
|
882
|
+
).replaceAll("%", `${chunk7YSP4V4R_cjs.LIKE_ESCAPE_CHARACTER}%`).replaceAll("_", `${chunk7YSP4V4R_cjs.LIKE_ESCAPE_CHARACTER}_`);
|
|
803
883
|
switch (op) {
|
|
804
884
|
case "contains": {
|
|
805
885
|
return `%${escaped}%`;
|
|
@@ -820,8 +900,8 @@ function compileStringPattern(op, pattern) {
|
|
|
820
900
|
}
|
|
821
901
|
}
|
|
822
902
|
function escapeLikePatternParameter(parameter) {
|
|
823
|
-
const doubledEscape = `${
|
|
824
|
-
return drizzleOrm.sql`REPLACE(REPLACE(REPLACE(${parameter}, ${
|
|
903
|
+
const doubledEscape = `${chunk7YSP4V4R_cjs.LIKE_ESCAPE_CHARACTER}${chunk7YSP4V4R_cjs.LIKE_ESCAPE_CHARACTER}`;
|
|
904
|
+
return drizzleOrm.sql`REPLACE(REPLACE(REPLACE(${parameter}, ${chunk7YSP4V4R_cjs.LIKE_ESCAPE_CHARACTER}, ${doubledEscape}), '%', ${`${chunk7YSP4V4R_cjs.LIKE_ESCAPE_CHARACTER}%`}), '_', ${`${chunk7YSP4V4R_cjs.LIKE_ESCAPE_CHARACTER}_`})`;
|
|
825
905
|
}
|
|
826
906
|
function compileParameterizedStringPattern(op, parameter) {
|
|
827
907
|
switch (op) {
|
|
@@ -867,13 +947,13 @@ function compilePredicateExpression(expr, ctx) {
|
|
|
867
947
|
if (expr.op === "ilike" || expr.op === "contains" || expr.op === "startsWith" || expr.op === "endsWith") {
|
|
868
948
|
return dialect.ilike(field, pattern2);
|
|
869
949
|
}
|
|
870
|
-
return drizzleOrm.sql`${field} LIKE ${pattern2} ${
|
|
950
|
+
return drizzleOrm.sql`${field} LIKE ${pattern2} ${chunk7YSP4V4R_cjs.likeEscapeClause}`;
|
|
871
951
|
}
|
|
872
952
|
const pattern = compileStringPattern(expr.op, expr.pattern);
|
|
873
953
|
if (expr.op === "ilike" || expr.op === "contains" || expr.op === "startsWith" || expr.op === "endsWith") {
|
|
874
954
|
return dialect.ilike(field, pattern);
|
|
875
955
|
}
|
|
876
|
-
return drizzleOrm.sql`${field} LIKE ${pattern} ${
|
|
956
|
+
return drizzleOrm.sql`${field} LIKE ${pattern} ${chunk7YSP4V4R_cjs.likeEscapeClause}`;
|
|
877
957
|
}
|
|
878
958
|
case "null_check": {
|
|
879
959
|
const field = compileFieldTextValue(
|
|
@@ -893,7 +973,7 @@ function compilePredicateExpression(expr, ctx) {
|
|
|
893
973
|
if (!upperIsParam) boundsForType.push(expr.upper);
|
|
894
974
|
const valueType = boundsForType.length > 0 ? resolveComparisonValueType(expr.field, boundsForType) : normalizeValueType2(expr.field.valueType);
|
|
895
975
|
if (valueType === "array" || valueType === "object") {
|
|
896
|
-
throw new
|
|
976
|
+
throw new chunkDIK74MXX_cjs.UnsupportedPredicateError(
|
|
897
977
|
"Between comparisons are not supported for JSON arrays or objects"
|
|
898
978
|
);
|
|
899
979
|
}
|
|
@@ -960,7 +1040,7 @@ function compileComparisonPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
960
1040
|
);
|
|
961
1041
|
const opSql2 = COMPARISON_OP_SQL[expr.op];
|
|
962
1042
|
if (!opSql2) {
|
|
963
|
-
throw new
|
|
1043
|
+
throw new chunkDIK74MXX_cjs.UnsupportedPredicateError(
|
|
964
1044
|
`Comparison operation "${expr.op}" is not supported for parameterized predicates`
|
|
965
1045
|
);
|
|
966
1046
|
}
|
|
@@ -968,7 +1048,7 @@ function compileComparisonPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
968
1048
|
}
|
|
969
1049
|
const valueType = resolveComparisonValueType(expr.left, expr.right);
|
|
970
1050
|
if (valueType === "array" || valueType === "object") {
|
|
971
|
-
throw new
|
|
1051
|
+
throw new chunkDIK74MXX_cjs.UnsupportedPredicateError(
|
|
972
1052
|
`Comparison operation "${expr.op}" is not supported for ${valueType} values`
|
|
973
1053
|
);
|
|
974
1054
|
}
|
|
@@ -996,7 +1076,7 @@ function compileComparisonPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
996
1076
|
const convertedRight = convertValueForSql(rightValue.value, dialect);
|
|
997
1077
|
const opSql = COMPARISON_OP_SQL[expr.op];
|
|
998
1078
|
if (!opSql) {
|
|
999
|
-
throw new
|
|
1079
|
+
throw new chunkDIK74MXX_cjs.UnsupportedPredicateError(
|
|
1000
1080
|
`Comparison operation "${expr.op}" is not supported`
|
|
1001
1081
|
);
|
|
1002
1082
|
}
|
|
@@ -1050,7 +1130,7 @@ function compileArrayPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1050
1130
|
}
|
|
1051
1131
|
function compileObjectPredicate(expr, dialect, cteColumnPrefix) {
|
|
1052
1132
|
const basePointer = getFieldPointer(expr.field);
|
|
1053
|
-
const pointer =
|
|
1133
|
+
const pointer = chunkTDXIBCGY_cjs.joinJsonPointers(basePointer, expr.pointer);
|
|
1054
1134
|
const column = compileFieldColumn(expr.field, void 0, cteColumnPrefix);
|
|
1055
1135
|
switch (expr.op) {
|
|
1056
1136
|
case "hasKey":
|
|
@@ -1059,13 +1139,13 @@ function compileObjectPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1059
1139
|
}
|
|
1060
1140
|
case "pathEquals": {
|
|
1061
1141
|
if (!expr.value) {
|
|
1062
|
-
throw new
|
|
1142
|
+
throw new chunkDIK74MXX_cjs.UnsupportedPredicateError(
|
|
1063
1143
|
"pathEquals requires a comparison value"
|
|
1064
1144
|
);
|
|
1065
1145
|
}
|
|
1066
1146
|
const valueType = resolvePredicateValueType(expr.valueType, expr.value);
|
|
1067
1147
|
if (valueType === "array" || valueType === "object") {
|
|
1068
|
-
throw new
|
|
1148
|
+
throw new chunkDIK74MXX_cjs.UnsupportedPredicateError(
|
|
1069
1149
|
"pathEquals is not supported for JSON arrays or objects"
|
|
1070
1150
|
);
|
|
1071
1151
|
}
|
|
@@ -1081,7 +1161,7 @@ function compileObjectPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1081
1161
|
}
|
|
1082
1162
|
case "pathContains": {
|
|
1083
1163
|
if (!expr.value) {
|
|
1084
|
-
throw new
|
|
1164
|
+
throw new chunkDIK74MXX_cjs.UnsupportedPredicateError(
|
|
1085
1165
|
"pathContains requires a comparison value"
|
|
1086
1166
|
);
|
|
1087
1167
|
}
|
|
@@ -1109,7 +1189,7 @@ function compileAggregatePredicate(expr, dialect) {
|
|
|
1109
1189
|
const aggregate = compileAggregateExpr(expr.aggregate, dialect);
|
|
1110
1190
|
const op = COMPARISON_OP_SQL[expr.op];
|
|
1111
1191
|
if (!op) {
|
|
1112
|
-
throw new
|
|
1192
|
+
throw new chunkDIK74MXX_cjs.UnsupportedPredicateError(
|
|
1113
1193
|
`Comparison operation "${expr.op}" is not supported for aggregate predicates`
|
|
1114
1194
|
);
|
|
1115
1195
|
}
|
|
@@ -1144,7 +1224,7 @@ function compileAggregateExpr(expr, dialect) {
|
|
|
1144
1224
|
return drizzleOrm.sql`MAX(${field})`;
|
|
1145
1225
|
}
|
|
1146
1226
|
default: {
|
|
1147
|
-
throw new
|
|
1227
|
+
throw new chunkDIK74MXX_cjs.UnsupportedPredicateError(
|
|
1148
1228
|
`Unknown aggregate function: ${expr.function}`
|
|
1149
1229
|
);
|
|
1150
1230
|
}
|
|
@@ -1152,7 +1232,7 @@ function compileAggregateExpr(expr, dialect) {
|
|
|
1152
1232
|
}
|
|
1153
1233
|
function compileExistsSubquery(expr, ctx) {
|
|
1154
1234
|
if (expr.subquery.graphId === void 0) {
|
|
1155
|
-
throw new
|
|
1235
|
+
throw new chunkDIK74MXX_cjs.UnsupportedPredicateError("EXISTS subquery must have a graphId");
|
|
1156
1236
|
}
|
|
1157
1237
|
const subSql = ctx.compileQuery(expr.subquery, expr.subquery.graphId);
|
|
1158
1238
|
return expr.negated ? drizzleOrm.sql`NOT EXISTS (${subSql})` : drizzleOrm.sql`EXISTS (${subSql})`;
|
|
@@ -1160,7 +1240,7 @@ function compileExistsSubquery(expr, ctx) {
|
|
|
1160
1240
|
function compileInSubquery(expr, ctx) {
|
|
1161
1241
|
const subqueryColumnCount = getSubqueryColumnCount(expr.subquery);
|
|
1162
1242
|
if (subqueryColumnCount !== 1) {
|
|
1163
|
-
throw new
|
|
1243
|
+
throw new chunkDIK74MXX_cjs.UnsupportedPredicateError(
|
|
1164
1244
|
`IN/NOT IN subquery must project exactly 1 column, but got ${subqueryColumnCount}`,
|
|
1165
1245
|
{ subqueryColumnCount }
|
|
1166
1246
|
);
|
|
@@ -1169,13 +1249,13 @@ function compileInSubquery(expr, ctx) {
|
|
|
1169
1249
|
const subqueryValueType = getSingleSubqueryColumnValueType(expr.subquery);
|
|
1170
1250
|
const resolvedValueType = fieldValueType ?? subqueryValueType;
|
|
1171
1251
|
if (isUnsupportedInSubqueryValueType(resolvedValueType)) {
|
|
1172
|
-
throw new
|
|
1252
|
+
throw new chunkDIK74MXX_cjs.UnsupportedPredicateError(
|
|
1173
1253
|
`IN/NOT IN subquery does not support ${String(resolvedValueType)} values`,
|
|
1174
1254
|
{ valueType: resolvedValueType }
|
|
1175
1255
|
);
|
|
1176
1256
|
}
|
|
1177
1257
|
if (!isInSubqueryTypeCompatible(fieldValueType, subqueryValueType)) {
|
|
1178
|
-
throw new
|
|
1258
|
+
throw new chunkDIK74MXX_cjs.UnsupportedPredicateError(
|
|
1179
1259
|
`IN/NOT IN type mismatch: field type "${String(fieldValueType)}" does not match subquery column type "${String(subqueryValueType)}"`,
|
|
1180
1260
|
{
|
|
1181
1261
|
fieldValueType,
|
|
@@ -1185,7 +1265,7 @@ function compileInSubquery(expr, ctx) {
|
|
|
1185
1265
|
}
|
|
1186
1266
|
const valueType = fieldValueType ?? subqueryValueType;
|
|
1187
1267
|
if (expr.subquery.graphId === void 0) {
|
|
1188
|
-
throw new
|
|
1268
|
+
throw new chunkDIK74MXX_cjs.UnsupportedPredicateError(
|
|
1189
1269
|
"IN/NOT IN subquery must have a graphId"
|
|
1190
1270
|
);
|
|
1191
1271
|
}
|
|
@@ -1205,7 +1285,7 @@ function extractStructuralPredicates(predicates, isMatch, rejectionMessage) {
|
|
|
1205
1285
|
function visit(expr, inDisallowedBranch) {
|
|
1206
1286
|
if (isMatch(expr)) {
|
|
1207
1287
|
if (inDisallowedBranch) {
|
|
1208
|
-
throw new
|
|
1288
|
+
throw new chunkDIK74MXX_cjs.UnsupportedPredicateError(rejectionMessage);
|
|
1209
1289
|
}
|
|
1210
1290
|
results.push(expr);
|
|
1211
1291
|
return;
|
|
@@ -1312,7 +1392,7 @@ function getNodeKindsForAlias(ast, alias) {
|
|
|
1312
1392
|
return traversal.nodeKinds;
|
|
1313
1393
|
}
|
|
1314
1394
|
}
|
|
1315
|
-
throw new
|
|
1395
|
+
throw new chunkDIK74MXX_cjs.CompilerInvariantError(`Unknown traversal source alias: ${alias}`);
|
|
1316
1396
|
}
|
|
1317
1397
|
function getHybridTargetAlias(vectorPredicate, fulltextPredicate) {
|
|
1318
1398
|
if (!vectorPredicate || !fulltextPredicate) return void 0;
|
|
@@ -1348,6 +1428,9 @@ function isPresent(value) {
|
|
|
1348
1428
|
return value !== null && value !== void 0;
|
|
1349
1429
|
}
|
|
1350
1430
|
|
|
1431
|
+
exports.CURRENT_READ_INSTANT_PLACEHOLDER = CURRENT_READ_INSTANT_PLACEHOLDER;
|
|
1432
|
+
exports.D1_MAX_BIND_PARAMETERS = D1_MAX_BIND_PARAMETERS;
|
|
1433
|
+
exports.MODERN_SQLITE_MAX_BIND_PARAMETERS = MODERN_SQLITE_MAX_BIND_PARAMETERS;
|
|
1351
1434
|
exports.POSTGRES_CAPABILITIES = POSTGRES_CAPABILITIES;
|
|
1352
1435
|
exports.POSTGRES_MAX_BIND_PARAMETERS = POSTGRES_MAX_BIND_PARAMETERS;
|
|
1353
1436
|
exports.SQLITE_CAPABILITIES = SQLITE_CAPABILITIES;
|
|
@@ -1361,13 +1444,18 @@ exports.compileFieldValue = compileFieldValue;
|
|
|
1361
1444
|
exports.compileKindFilter = compileKindFilter;
|
|
1362
1445
|
exports.compilePredicateClauses = compilePredicateClauses;
|
|
1363
1446
|
exports.compilePredicateExpression = compilePredicateExpression;
|
|
1447
|
+
exports.compileTemporalFilter = compileTemporalFilter;
|
|
1364
1448
|
exports.createBackendOverlay = createBackendOverlay;
|
|
1365
1449
|
exports.createFulltextAccessor = createFulltextAccessor;
|
|
1450
|
+
exports.currentReadInstant = currentReadInstant;
|
|
1451
|
+
exports.currentReadInstantFor = currentReadInstantFor;
|
|
1366
1452
|
exports.dateField = dateField;
|
|
1367
1453
|
exports.exists = exists;
|
|
1368
1454
|
exports.extractFulltextMatchPredicates = extractFulltextMatchPredicates;
|
|
1455
|
+
exports.extractTemporalOptions = extractTemporalOptions;
|
|
1369
1456
|
exports.extractVectorSimilarityPredicates = extractVectorSimilarityPredicates;
|
|
1370
1457
|
exports.fieldRef = fieldRef;
|
|
1458
|
+
exports.getFieldPointer = getFieldPointer;
|
|
1371
1459
|
exports.getHybridTargetAlias = getHybridTargetAlias;
|
|
1372
1460
|
exports.getNodeKindsForAlias = getNodeKindsForAlias;
|
|
1373
1461
|
exports.getPredicatesForAlias = getPredicatesForAlias;
|
|
@@ -1382,9 +1470,12 @@ exports.notInSubquery = notInSubquery;
|
|
|
1382
1470
|
exports.numberField = numberField;
|
|
1383
1471
|
exports.objectField = objectField;
|
|
1384
1472
|
exports.param = param;
|
|
1473
|
+
exports.rowPropsToJsonText = rowPropsToJsonText;
|
|
1474
|
+
exports.rowPropsToObject = rowPropsToObject;
|
|
1385
1475
|
exports.runOptionallyInTransaction = runOptionallyInTransaction;
|
|
1386
1476
|
exports.sqlValueList = sqlValueList;
|
|
1387
1477
|
exports.stringField = stringField;
|
|
1478
|
+
exports.withPinnedReadInstant = withPinnedReadInstant;
|
|
1388
1479
|
exports.wrapWithManagedClose = wrapWithManagedClose;
|
|
1389
|
-
//# sourceMappingURL=chunk-
|
|
1390
|
-
//# sourceMappingURL=chunk-
|
|
1480
|
+
//# sourceMappingURL=chunk-X4JBT642.cjs.map
|
|
1481
|
+
//# sourceMappingURL=chunk-X4JBT642.cjs.map
|