@nicia-ai/typegraph 0.41.0 → 0.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backend/drizzle/indexes.cjs +9 -9
- package/dist/backend/drizzle/indexes.d.cts +1 -2
- package/dist/backend/drizzle/indexes.d.ts +1 -2
- package/dist/backend/drizzle/indexes.js +5 -5
- package/dist/backend/index.cjs +50 -50
- package/dist/backend/index.d.cts +3 -4
- package/dist/backend/index.d.ts +3 -4
- package/dist/backend/index.js +11 -11
- package/dist/backend/postgres/index.cjs +26 -26
- package/dist/backend/postgres/index.d.cts +5 -6
- package/dist/backend/postgres/index.d.ts +5 -6
- package/dist/backend/postgres/index.js +13 -13
- package/dist/backend/postgres/pglite-store.cjs +34 -34
- package/dist/backend/postgres/pglite-store.d.cts +7 -8
- package/dist/backend/postgres/pglite-store.d.ts +7 -8
- package/dist/backend/postgres/pglite-store.js +30 -30
- package/dist/backend/postgres/pglite.cjs +15 -15
- package/dist/backend/postgres/pglite.d.cts +2 -3
- package/dist/backend/postgres/pglite.d.ts +2 -3
- package/dist/backend/postgres/pglite.js +14 -14
- package/dist/backend/sqlite/index.cjs +23 -23
- package/dist/backend/sqlite/index.d.cts +5 -6
- package/dist/backend/sqlite/index.d.ts +5 -6
- package/dist/backend/sqlite/index.js +11 -11
- package/dist/backend/sqlite/libsql.cjs +17 -17
- package/dist/backend/sqlite/libsql.d.cts +2 -3
- package/dist/backend/sqlite/libsql.d.ts +2 -3
- package/dist/backend/sqlite/libsql.js +13 -13
- package/dist/backend/sqlite/local-store.cjs +35 -35
- package/dist/backend/sqlite/local-store.d.cts +7 -8
- package/dist/backend/sqlite/local-store.d.ts +7 -8
- package/dist/backend/sqlite/local-store.js +31 -31
- package/dist/backend/sqlite/local.cjs +16 -16
- package/dist/backend/sqlite/local.d.cts +2 -3
- package/dist/backend/sqlite/local.d.ts +2 -3
- package/dist/backend/sqlite/local.js +14 -14
- package/dist/{chunk-LOKG3KQV.cjs → chunk-277UZV7X.cjs} +1113 -1089
- package/dist/chunk-277UZV7X.cjs.map +1 -0
- package/dist/{chunk-2I3DNNBU.js → chunk-2G6ZEGYO.js} +4 -4
- package/dist/{chunk-2I3DNNBU.js.map → chunk-2G6ZEGYO.js.map} +1 -1
- package/dist/{chunk-76HE7DJP.js → chunk-2HKIID5K.js} +5 -5
- package/dist/{chunk-76HE7DJP.js.map → chunk-2HKIID5K.js.map} +1 -1
- package/dist/{chunk-QOHTVDHU.js → chunk-2OOY4OYT.js} +4 -4
- package/dist/{chunk-QOHTVDHU.js.map → chunk-2OOY4OYT.js.map} +1 -1
- package/dist/{chunk-UCHW2MGP.cjs → chunk-2SO5I5AI.cjs} +196 -196
- package/dist/{chunk-UCHW2MGP.cjs.map → chunk-2SO5I5AI.cjs.map} +1 -1
- package/dist/{chunk-LFFVD5ZR.cjs → chunk-33PAKPED.cjs} +41 -41
- package/dist/{chunk-LFFVD5ZR.cjs.map → chunk-33PAKPED.cjs.map} +1 -1
- package/dist/{chunk-QCKD3RCI.cjs → chunk-3RPQDGUE.cjs} +5 -5
- package/dist/{chunk-QCKD3RCI.cjs.map → chunk-3RPQDGUE.cjs.map} +1 -1
- package/dist/{chunk-PH4IJ3V5.js → chunk-3V6D5DEC.js} +3 -3
- package/dist/{chunk-PH4IJ3V5.js.map → chunk-3V6D5DEC.js.map} +1 -1
- package/dist/{chunk-Y5UC3IXF.js → chunk-42XYPKZU.js} +3 -3
- package/dist/{chunk-Y5UC3IXF.js.map → chunk-42XYPKZU.js.map} +1 -1
- package/dist/{chunk-XZA3Y4YH.js → chunk-4WYFRACU.js} +3 -3
- package/dist/{chunk-XZA3Y4YH.js.map → chunk-4WYFRACU.js.map} +1 -1
- package/dist/{chunk-AQVDAKXH.js → chunk-4XRP2N6B.js} +3 -3
- package/dist/{chunk-AQVDAKXH.js.map → chunk-4XRP2N6B.js.map} +1 -1
- package/dist/{chunk-PWXGB77L.cjs → chunk-5AERZSHC.cjs} +4 -4
- package/dist/{chunk-PWXGB77L.cjs.map → chunk-5AERZSHC.cjs.map} +1 -1
- package/dist/{chunk-K6CD6W5J.js → chunk-5C75HQYQ.js} +5 -5
- package/dist/{chunk-K6CD6W5J.js.map → chunk-5C75HQYQ.js.map} +1 -1
- package/dist/{chunk-2J5NMMVR.cjs → chunk-5GV4JQNA.cjs} +43 -43
- package/dist/{chunk-2J5NMMVR.cjs.map → chunk-5GV4JQNA.cjs.map} +1 -1
- package/dist/{chunk-KHNKYSGP.cjs → chunk-5P6IPIT6.cjs} +41 -41
- package/dist/{chunk-KHNKYSGP.cjs.map → chunk-5P6IPIT6.cjs.map} +1 -1
- package/dist/{chunk-53BSOG3O.js → chunk-6NB73BXV.js} +11 -11
- package/dist/{chunk-53BSOG3O.js.map → chunk-6NB73BXV.js.map} +1 -1
- package/dist/{chunk-SE422RES.cjs → chunk-6TJ6PKPS.cjs} +27 -27
- package/dist/{chunk-SE422RES.cjs.map → chunk-6TJ6PKPS.cjs.map} +1 -1
- package/dist/{chunk-QXKVUJLI.cjs → chunk-7TOT7RKY.cjs} +120 -120
- package/dist/{chunk-QXKVUJLI.cjs.map → chunk-7TOT7RKY.cjs.map} +1 -1
- package/dist/{chunk-7WLEQIHA.cjs → chunk-7Y6BV3TK.cjs} +100 -100
- package/dist/{chunk-7WLEQIHA.cjs.map → chunk-7Y6BV3TK.cjs.map} +1 -1
- package/dist/{chunk-HP6LWBLB.cjs → chunk-AO2WPYFZ.cjs} +4 -4
- package/dist/{chunk-HP6LWBLB.cjs.map → chunk-AO2WPYFZ.cjs.map} +1 -1
- package/dist/{chunk-7UTUKH4E.cjs → chunk-AQR6BHB3.cjs} +10 -10
- package/dist/{chunk-7UTUKH4E.cjs.map → chunk-AQR6BHB3.cjs.map} +1 -1
- package/dist/{chunk-X4PVHAZ6.cjs → chunk-ARN3ZODS.cjs} +6 -6
- package/dist/{chunk-X4PVHAZ6.cjs.map → chunk-ARN3ZODS.cjs.map} +1 -1
- package/dist/{chunk-EFZ4S22A.js → chunk-BGXKXGDI.js} +12 -12
- package/dist/{chunk-EFZ4S22A.js.map → chunk-BGXKXGDI.js.map} +1 -1
- package/dist/{chunk-YYLMXERH.js → chunk-CDYRPI5U.js} +4 -4
- package/dist/{chunk-YYLMXERH.js.map → chunk-CDYRPI5U.js.map} +1 -1
- package/dist/{chunk-3LKL3S6X.js → chunk-CI5NPLXX.js} +3 -3
- package/dist/{chunk-3LKL3S6X.js.map → chunk-CI5NPLXX.js.map} +1 -1
- package/dist/{chunk-UUIBACKJ.js → chunk-CUPJL6TS.js} +3 -3
- package/dist/{chunk-UUIBACKJ.js.map → chunk-CUPJL6TS.js.map} +1 -1
- package/dist/{chunk-JZYMOHHM.cjs → chunk-CVK4T34X.cjs} +22 -22
- package/dist/{chunk-JZYMOHHM.cjs.map → chunk-CVK4T34X.cjs.map} +1 -1
- package/dist/{chunk-L3DDZUZP.js → chunk-CVNGKTHO.js} +4 -4
- package/dist/{chunk-L3DDZUZP.js.map → chunk-CVNGKTHO.js.map} +1 -1
- package/dist/{chunk-RW24SAHI.cjs → chunk-DMZEVJGL.cjs} +13 -13
- package/dist/{chunk-RW24SAHI.cjs.map → chunk-DMZEVJGL.cjs.map} +1 -1
- package/dist/{chunk-MQBF3XGY.js → chunk-DP7KC6CL.js} +47 -23
- package/dist/chunk-DP7KC6CL.js.map +1 -0
- package/dist/{chunk-QYDUCWD2.cjs → chunk-ECU53PMN.cjs} +4 -4
- package/dist/{chunk-QYDUCWD2.cjs.map → chunk-ECU53PMN.cjs.map} +1 -1
- package/dist/{chunk-SCTZRFW5.js → chunk-EQOQOT55.js} +5 -5
- package/dist/{chunk-SCTZRFW5.js.map → chunk-EQOQOT55.js.map} +1 -1
- package/dist/{chunk-JHK6NPFV.js → chunk-EVFL2ZY5.js} +9 -9
- package/dist/{chunk-JHK6NPFV.js.map → chunk-EVFL2ZY5.js.map} +1 -1
- package/dist/{chunk-SAMJLDGG.cjs → chunk-F2KVJ6FF.cjs} +112 -112
- package/dist/{chunk-SAMJLDGG.cjs.map → chunk-F2KVJ6FF.cjs.map} +1 -1
- package/dist/{chunk-NMQ6C6TS.cjs → chunk-F7TDKSVB.cjs} +4 -4
- package/dist/{chunk-NMQ6C6TS.cjs.map → chunk-F7TDKSVB.cjs.map} +1 -1
- package/dist/{chunk-HQRZEYYB.cjs → chunk-FFQGI67R.cjs} +44 -44
- package/dist/{chunk-HQRZEYYB.cjs.map → chunk-FFQGI67R.cjs.map} +1 -1
- package/dist/{chunk-YIRLBUNN.js → chunk-FMPZPOUD.js} +3 -3
- package/dist/{chunk-YIRLBUNN.js.map → chunk-FMPZPOUD.js.map} +1 -1
- package/dist/{chunk-LL5D5T5W.cjs → chunk-FSCJOTHF.cjs} +10 -10
- package/dist/{chunk-LL5D5T5W.cjs.map → chunk-FSCJOTHF.cjs.map} +1 -1
- package/dist/{chunk-2X73QTIC.cjs → chunk-FY4VY5EV.cjs} +20 -20
- package/dist/{chunk-2X73QTIC.cjs.map → chunk-FY4VY5EV.cjs.map} +1 -1
- package/dist/{chunk-3SHAUJRB.js → chunk-GT7NEXSU.js} +3 -3
- package/dist/{chunk-3SHAUJRB.js.map → chunk-GT7NEXSU.js.map} +1 -1
- package/dist/{chunk-W66YCXWT.js → chunk-HHBKGPEI.js} +11 -10
- package/dist/chunk-HHBKGPEI.js.map +1 -0
- package/dist/{chunk-CKFBZ4LV.cjs → chunk-I73ATSAH.cjs} +4 -4
- package/dist/{chunk-CKFBZ4LV.cjs.map → chunk-I73ATSAH.cjs.map} +1 -1
- package/dist/{chunk-ELA3V6UN.js → chunk-JOYPNY33.js} +9 -9
- package/dist/{chunk-ELA3V6UN.js.map → chunk-JOYPNY33.js.map} +1 -1
- package/dist/{chunk-YIX3BEBR.cjs → chunk-K2HHCWZO.cjs} +108 -108
- package/dist/{chunk-YIX3BEBR.cjs.map → chunk-K2HHCWZO.cjs.map} +1 -1
- package/dist/{chunk-SAFZ6JTI.cjs → chunk-KTBTSHU6.cjs} +19 -2
- package/dist/chunk-KTBTSHU6.cjs.map +1 -0
- package/dist/{chunk-KOI7UEI5.js → chunk-LDCWO5B6.js} +3 -3
- package/dist/{chunk-KOI7UEI5.js.map → chunk-LDCWO5B6.js.map} +1 -1
- package/dist/{chunk-I5CRUPKO.js → chunk-LQLVJWUH.js} +7 -7
- package/dist/{chunk-I5CRUPKO.js.map → chunk-LQLVJWUH.js.map} +1 -1
- package/dist/{chunk-ZE7E46IZ.js → chunk-LTVBD56M.js} +6 -6
- package/dist/{chunk-ZE7E46IZ.js.map → chunk-LTVBD56M.js.map} +1 -1
- package/dist/{chunk-6N7QBIWN.js → chunk-M4GYQF2H.js} +3 -3
- package/dist/{chunk-6N7QBIWN.js.map → chunk-M4GYQF2H.js.map} +1 -1
- package/dist/{chunk-XRU7V7FF.cjs → chunk-O2GZM7UK.cjs} +7 -7
- package/dist/{chunk-XRU7V7FF.cjs.map → chunk-O2GZM7UK.cjs.map} +1 -1
- package/dist/{chunk-ZE6NVENI.js → chunk-O3USVVWS.js} +3 -3
- package/dist/{chunk-ZE6NVENI.js.map → chunk-O3USVVWS.js.map} +1 -1
- package/dist/{chunk-UDS5DZNY.cjs → chunk-O7XVCLXW.cjs} +68 -67
- package/dist/chunk-O7XVCLXW.cjs.map +1 -0
- package/dist/{chunk-KLR77R5A.cjs → chunk-OM6RIOA5.cjs} +13 -13
- package/dist/{chunk-KLR77R5A.cjs.map → chunk-OM6RIOA5.cjs.map} +1 -1
- package/dist/{chunk-LLHMAHG4.cjs → chunk-OMQ2NBOR.cjs} +27 -27
- package/dist/{chunk-LLHMAHG4.cjs.map → chunk-OMQ2NBOR.cjs.map} +1 -1
- package/dist/{chunk-DPNA466P.js → chunk-OYJSYDIH.js} +19 -3
- package/dist/chunk-OYJSYDIH.js.map +1 -0
- package/dist/{chunk-V3S74J44.js → chunk-RAWG2FEU.js} +134 -22
- package/dist/chunk-RAWG2FEU.js.map +1 -0
- package/dist/{chunk-M2RPZS7J.cjs → chunk-RTUCOEIO.cjs} +12 -12
- package/dist/{chunk-M2RPZS7J.cjs.map → chunk-RTUCOEIO.cjs.map} +1 -1
- package/dist/{chunk-TAUGGLNQ.js → chunk-RXOAXO3R.js} +3 -3
- package/dist/{chunk-TAUGGLNQ.js.map → chunk-RXOAXO3R.js.map} +1 -1
- package/dist/{chunk-LLE25NRD.cjs → chunk-TRC646QQ.cjs} +7 -7
- package/dist/{chunk-LLE25NRD.cjs.map → chunk-TRC646QQ.cjs.map} +1 -1
- package/dist/chunk-U3YRCZ5L.cjs +12 -0
- package/dist/{chunk-IMQKXL4E.cjs.map → chunk-U3YRCZ5L.cjs.map} +1 -1
- package/dist/{chunk-ZVME6OSV.js → chunk-UJRWOV5B.js} +5 -5
- package/dist/{chunk-ZVME6OSV.js.map → chunk-UJRWOV5B.js.map} +1 -1
- package/dist/{chunk-HAQVISUF.cjs → chunk-UTTW2Q3M.cjs} +133 -133
- package/dist/{chunk-HAQVISUF.cjs.map → chunk-UTTW2Q3M.cjs.map} +1 -1
- package/dist/{chunk-L5ET7FYQ.js → chunk-UZLEQFTV.js} +3 -3
- package/dist/{chunk-L5ET7FYQ.js.map → chunk-UZLEQFTV.js.map} +1 -1
- package/dist/{chunk-JP5EICR6.cjs → chunk-V2GZBPY2.cjs} +179 -65
- package/dist/chunk-V2GZBPY2.cjs.map +1 -0
- package/dist/{chunk-BUZWMDNL.js → chunk-VC26BUNP.js} +5 -5
- package/dist/{chunk-BUZWMDNL.js.map → chunk-VC26BUNP.js.map} +1 -1
- package/dist/chunk-VGMNGWBR.cjs +12 -0
- package/dist/{chunk-5YBDB7UG.cjs.map → chunk-VGMNGWBR.cjs.map} +1 -1
- package/dist/{chunk-XMEYZYGE.js → chunk-WYQILW5V.js} +8 -8
- package/dist/{chunk-XMEYZYGE.js.map → chunk-WYQILW5V.js.map} +1 -1
- package/dist/{chunk-YX3H63VV.cjs → chunk-X2XOQZT3.cjs} +9 -9
- package/dist/{chunk-YX3H63VV.cjs.map → chunk-X2XOQZT3.cjs.map} +1 -1
- package/dist/{chunk-N2V3HJFV.cjs → chunk-XDMPDUKL.cjs} +9 -9
- package/dist/{chunk-N2V3HJFV.cjs.map → chunk-XDMPDUKL.cjs.map} +1 -1
- package/dist/{chunk-5J4VNCUD.js → chunk-Z3WIL6S3.js} +5 -5
- package/dist/{chunk-5J4VNCUD.js.map → chunk-Z3WIL6S3.js.map} +1 -1
- package/dist/{chunk-MNURF4RF.cjs → chunk-ZBV4LQD2.cjs} +4 -4
- package/dist/{chunk-MNURF4RF.cjs.map → chunk-ZBV4LQD2.cjs.map} +1 -1
- package/dist/{chunk-YGX4PMG6.js → chunk-ZGOUVMVS.js} +5 -5
- package/dist/{chunk-YGX4PMG6.js.map → chunk-ZGOUVMVS.js.map} +1 -1
- package/dist/{chunk-QZYGZVUI.js → chunk-ZIRC2U6G.js} +11 -11
- package/dist/{chunk-QZYGZVUI.js.map → chunk-ZIRC2U6G.js.map} +1 -1
- package/dist/{chunk-6QP4QXBR.js → chunk-ZOHCFYXE.js} +3 -3
- package/dist/{chunk-6QP4QXBR.js.map → chunk-ZOHCFYXE.js.map} +1 -1
- package/dist/{chunk-VWEFXG73.js → chunk-ZP2KPDNN.js} +3 -3
- package/dist/{chunk-VWEFXG73.js.map → chunk-ZP2KPDNN.js.map} +1 -1
- package/dist/{chunk-NT6ILURI.cjs → chunk-ZPCKPLMX.cjs} +8 -8
- package/dist/{chunk-NT6ILURI.cjs.map → chunk-ZPCKPLMX.cjs.map} +1 -1
- package/dist/core/index.cjs +28 -28
- package/dist/core/index.d.cts +5 -6
- package/dist/core/index.d.ts +5 -6
- package/dist/core/index.js +8 -8
- package/dist/{ddl-BCXFRLWg.d.cts → ddl-3unqC-kg.d.cts} +3 -3
- package/dist/{ddl-ByLmGgn9.d.ts → ddl-Bc4Dl8fu.d.ts} +3 -3
- package/dist/{define-graph-BSviZubs.d.ts → define-graph-Byslw2OO.d.cts} +1 -2
- package/dist/{define-graph-XyJheaFm.d.cts → define-graph-DBFnc7u_.d.ts} +1 -2
- package/dist/graph-extension/index.cjs +20 -20
- 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 -5
- package/dist/graph-merge/index.cjs +105 -105
- package/dist/graph-merge/index.d.cts +8 -9
- package/dist/graph-merge/index.d.ts +8 -9
- package/dist/graph-merge/index.js +25 -25
- package/dist/{index-BD_3TCgh.d.ts → index-DHXw7QAl.d.cts} +19 -4
- package/dist/{index-BihFPsPu.d.cts → index-DQzVJBHa.d.ts} +19 -4
- package/dist/index.cjs +206 -202
- package/dist/index.d.cts +13 -15
- package/dist/index.d.ts +13 -15
- package/dist/index.js +35 -35
- package/dist/indexes/index.cjs +13 -13
- package/dist/indexes/index.d.cts +4 -5
- package/dist/indexes/index.d.ts +4 -5
- package/dist/indexes/index.js +6 -6
- package/dist/interchange/index.cjs +40 -40
- package/dist/interchange/index.d.cts +9 -10
- package/dist/interchange/index.d.ts +9 -10
- package/dist/interchange/index.js +14 -14
- package/dist/{manager-C7iC5bk_.d.ts → manager-Dl0-er1G.d.ts} +21 -156
- package/dist/{manager-Dm6MCYO7.d.cts → manager-U9_zopqr.d.cts} +21 -156
- package/dist/materialize-indexes-BM3u0aXE.d.ts +258 -0
- package/dist/materialize-indexes-DzMCetZe.d.cts +258 -0
- package/dist/{postgres-DZxwzCQ8.d.cts → postgres-C5-WMKFA.d.ts} +1 -1
- package/dist/{postgres-Cb6ceh4-.d.ts → postgres-DpJqtbSX.d.cts} +1 -1
- package/dist/profiler/index.d.cts +9 -10
- package/dist/profiler/index.d.ts +9 -10
- package/dist/provenance/index.cjs +39 -39
- package/dist/provenance/index.d.cts +7 -8
- package/dist/provenance/index.d.ts +7 -8
- package/dist/provenance/index.js +9 -9
- package/dist/schema/index.cjs +48 -39
- package/dist/schema/index.d.cts +7 -8
- package/dist/schema/index.d.ts +7 -8
- package/dist/schema/index.js +15 -14
- package/dist/{searchable-aUaKh3_r.d.cts → searchable-B4mUXZT6.d.cts} +2 -2
- package/dist/{searchable-Cet4Oztt.d.ts → searchable-C7jmPNLT.d.ts} +2 -2
- package/dist/{sqlite-Cb3Ilj9_.d.ts → sqlite-Ch5tSYQY.d.ts} +1 -1
- package/dist/{sqlite-Dxklpizv.d.cts → sqlite-Da7jiYu9.d.cts} +1 -1
- package/dist/{store-view-PCT7vTKH.d.cts → store-view-6C2vTWqf.d.ts} +8 -7
- package/dist/{store-view-BDjGFjpN.d.ts → store-view-CNcOG8bQ.d.cts} +8 -7
- package/dist/{temporal-CyFsSPe8.d.ts → temporal-BtrTYTiB.d.ts} +1 -1
- package/dist/{temporal-Dn_JADWY.d.cts → temporal-CMpigMCW.d.cts} +1 -1
- package/dist/{types-CFZiEEPh.d.ts → types-D2rU5Taq.d.ts} +1 -2
- package/dist/{types-D-vOo_pM.d.ts → types-Dh-EgT-w.d.cts} +569 -2
- package/dist/{types-ho4DJJb_.d.cts → types-Dh-EgT-w.d.ts} +569 -2
- package/dist/{types-CsaG00wS.d.cts → types-G4sVM-76.d.cts} +1 -2
- package/dist/{where-DLYaXa4L.d.ts → where-B8Y21kig.d.ts} +1 -2
- package/dist/{where-udes1WRA.d.cts → where-DbZ9XDOI.d.cts} +1 -2
- package/package.json +1 -1
- package/dist/chunk-5YBDB7UG.cjs +0 -12
- package/dist/chunk-DPNA466P.js.map +0 -1
- package/dist/chunk-IMQKXL4E.cjs +0 -12
- package/dist/chunk-JP5EICR6.cjs.map +0 -1
- package/dist/chunk-LOKG3KQV.cjs.map +0 -1
- package/dist/chunk-MQBF3XGY.js.map +0 -1
- package/dist/chunk-SAFZ6JTI.cjs.map +0 -1
- package/dist/chunk-UDS5DZNY.cjs.map +0 -1
- package/dist/chunk-V3S74J44.js.map +0 -1
- package/dist/chunk-W66YCXWT.js.map +0 -1
- package/dist/extension-types-BLEVH4SG.d.cts +0 -571
- package/dist/extension-types-BLEVH4SG.d.ts +0 -571
- package/dist/materialize-indexes-D4iei4Kp.d.ts +0 -90
- package/dist/materialize-indexes-ExQ6OrAh.d.cts +0 -90
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkZDH3DX3C_cjs = require('./chunk-ZDH3DX3C.cjs');
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
4
|
+
var chunkCVK4T34X_cjs = require('./chunk-CVK4T34X.cjs');
|
|
5
|
+
var chunkECU53PMN_cjs = require('./chunk-ECU53PMN.cjs');
|
|
6
|
+
var chunkFSCJOTHF_cjs = require('./chunk-FSCJOTHF.cjs');
|
|
7
|
+
var chunkAO2WPYFZ_cjs = require('./chunk-AO2WPYFZ.cjs');
|
|
8
|
+
var chunkZBV4LQD2_cjs = require('./chunk-ZBV4LQD2.cjs');
|
|
9
|
+
var chunkX2XOQZT3_cjs = require('./chunk-X2XOQZT3.cjs');
|
|
10
10
|
var chunkSJDMVITW_cjs = require('./chunk-SJDMVITW.cjs');
|
|
11
11
|
var chunk764JHTLT_cjs = require('./chunk-764JHTLT.cjs');
|
|
12
12
|
var chunkHAHNRASW_cjs = require('./chunk-HAHNRASW.cjs');
|
|
13
|
-
var
|
|
13
|
+
var chunkKTBTSHU6_cjs = require('./chunk-KTBTSHU6.cjs');
|
|
14
14
|
var chunkTDXIBCGY_cjs = require('./chunk-TDXIBCGY.cjs');
|
|
15
15
|
var nanoid = require('nanoid');
|
|
16
16
|
|
|
17
17
|
// src/store/types.ts
|
|
18
18
|
var AUTO_REFRESH_STATISTICS_ROW_THRESHOLD = 1e3;
|
|
19
|
-
var TRANSACTION_RUNTIME =
|
|
19
|
+
var TRANSACTION_RUNTIME = chunkX2XOQZT3_cjs.typeGraphGlobalSymbol(
|
|
20
20
|
"transaction-runtime-v1"
|
|
21
21
|
);
|
|
22
22
|
|
|
23
23
|
// src/store/runtime-port.ts
|
|
24
|
-
var STORE_RUNTIME =
|
|
24
|
+
var STORE_RUNTIME = chunkX2XOQZT3_cjs.typeGraphGlobalSymbol("store-runtime-v1");
|
|
25
25
|
function storeRuntime(store) {
|
|
26
26
|
const runtime = store[STORE_RUNTIME];
|
|
27
27
|
if (runtime === void 0) {
|
|
@@ -57,7 +57,7 @@ function transactionNodeOperationHookRunner(transaction) {
|
|
|
57
57
|
var pinnedReadInstant;
|
|
58
58
|
function withPinnedReadInstant(emit) {
|
|
59
59
|
if (pinnedReadInstant !== void 0) return emit();
|
|
60
|
-
pinnedReadInstant =
|
|
60
|
+
pinnedReadInstant = chunkZBV4LQD2_cjs.nowIso();
|
|
61
61
|
try {
|
|
62
62
|
return emit();
|
|
63
63
|
} finally {
|
|
@@ -65,26 +65,26 @@ function withPinnedReadInstant(emit) {
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
function currentReadInstant() {
|
|
68
|
-
return
|
|
68
|
+
return chunkX2XOQZT3_cjs.sql`${pinnedReadInstant ?? chunkZBV4LQD2_cjs.nowIso()}`;
|
|
69
69
|
}
|
|
70
70
|
var CURRENT_READ_INSTANT_PLACEHOLDER = "__typegraph_current_read_instant__";
|
|
71
71
|
function currentReadInstantPlaceholder() {
|
|
72
|
-
return
|
|
72
|
+
return chunkX2XOQZT3_cjs.sql`${chunkX2XOQZT3_cjs.sql.placeholder(CURRENT_READ_INSTANT_PLACEHOLDER)}`;
|
|
73
73
|
}
|
|
74
74
|
function currentReadInstantFor(mode) {
|
|
75
75
|
return mode === "placeholder" ? currentReadInstantPlaceholder() : currentReadInstant();
|
|
76
76
|
}
|
|
77
77
|
function compileTemporalFilter(options) {
|
|
78
78
|
const { mode, asOf, tableAlias, currentTimestamp, recordedAsOf } = options;
|
|
79
|
-
const prefix = tableAlias ?
|
|
80
|
-
const deletedAt =
|
|
81
|
-
const validFrom =
|
|
82
|
-
const validTo =
|
|
79
|
+
const prefix = tableAlias ? chunkX2XOQZT3_cjs.sql.raw(`${tableAlias}.`) : chunkX2XOQZT3_cjs.sql.raw("");
|
|
80
|
+
const deletedAt = chunkX2XOQZT3_cjs.sql`${prefix}deleted_at`;
|
|
81
|
+
const validFrom = chunkX2XOQZT3_cjs.sql`${prefix}valid_from`;
|
|
82
|
+
const validTo = chunkX2XOQZT3_cjs.sql`${prefix}valid_to`;
|
|
83
83
|
const validFilter = (() => {
|
|
84
84
|
switch (mode) {
|
|
85
85
|
case "current": {
|
|
86
|
-
const now = recordedAsOf === void 0 ? currentTimestamp ?? currentReadInstant() :
|
|
87
|
-
return
|
|
86
|
+
const now = recordedAsOf === void 0 ? currentTimestamp ?? currentReadInstant() : chunkX2XOQZT3_cjs.sql`${chunkFSCJOTHF_cjs.parseRecordedInstant(recordedAsOf, "recordedAsOf").recordedAt}`;
|
|
87
|
+
return chunkX2XOQZT3_cjs.sql`${deletedAt} IS NULL AND (${validFrom} IS NULL OR ${validFrom} <= ${now}) AND (${validTo} IS NULL OR ${validTo} > ${now})`;
|
|
88
88
|
}
|
|
89
89
|
case "asOf": {
|
|
90
90
|
if (asOf === void 0) {
|
|
@@ -93,24 +93,24 @@ function compileTemporalFilter(options) {
|
|
|
93
93
|
);
|
|
94
94
|
}
|
|
95
95
|
const timestamp = asOf;
|
|
96
|
-
return
|
|
96
|
+
return chunkX2XOQZT3_cjs.sql`${deletedAt} IS NULL AND (${validFrom} IS NULL OR ${validFrom} <= ${timestamp}) AND (${validTo} IS NULL OR ${validTo} > ${timestamp})`;
|
|
97
97
|
}
|
|
98
98
|
case "includeEnded": {
|
|
99
|
-
return
|
|
99
|
+
return chunkX2XOQZT3_cjs.sql`${deletedAt} IS NULL`;
|
|
100
100
|
}
|
|
101
101
|
case "includeTombstones": {
|
|
102
|
-
return
|
|
102
|
+
return chunkX2XOQZT3_cjs.sql.raw("1=1");
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
})();
|
|
106
106
|
if (recordedAsOf === void 0) return validFilter;
|
|
107
|
-
const recordedFrom =
|
|
108
|
-
const recordedTo =
|
|
109
|
-
const recordedRevision =
|
|
107
|
+
const recordedFrom = chunkX2XOQZT3_cjs.sql`${prefix}recorded_from`;
|
|
108
|
+
const recordedTo = chunkX2XOQZT3_cjs.sql`${prefix}recorded_to`;
|
|
109
|
+
const recordedRevision = chunkFSCJOTHF_cjs.parseRecordedInstant(
|
|
110
110
|
recordedAsOf,
|
|
111
111
|
"recordedAsOf"
|
|
112
112
|
).revision;
|
|
113
|
-
return
|
|
113
|
+
return chunkX2XOQZT3_cjs.sql`(${validFilter}) AND ${recordedFrom} <= ${recordedRevision} AND ${recordedRevision} < ${recordedTo}`;
|
|
114
114
|
}
|
|
115
115
|
function extractTemporalOptions(ast, tableAlias) {
|
|
116
116
|
return {
|
|
@@ -198,7 +198,7 @@ function predicate(expr) {
|
|
|
198
198
|
}
|
|
199
199
|
function param(name) {
|
|
200
200
|
if (name === CURRENT_READ_INSTANT_PLACEHOLDER) {
|
|
201
|
-
throw new
|
|
201
|
+
throw new chunkKTBTSHU6_cjs.ConfigurationError(
|
|
202
202
|
`Parameter name "${name}" is reserved for internal use`,
|
|
203
203
|
{ parameterName: name }
|
|
204
204
|
);
|
|
@@ -345,7 +345,7 @@ function createFulltextAccessor(alias, hasSearchableField) {
|
|
|
345
345
|
return {
|
|
346
346
|
matches: (query, k, options) => {
|
|
347
347
|
if (!hasSearchableField()) {
|
|
348
|
-
throw new
|
|
348
|
+
throw new chunkKTBTSHU6_cjs.UnsupportedPredicateError(
|
|
349
349
|
`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" })\`.`
|
|
350
350
|
);
|
|
351
351
|
}
|
|
@@ -360,7 +360,7 @@ function createFulltextAccessor(alias, hasSearchableField) {
|
|
|
360
360
|
}
|
|
361
361
|
function fulltextMatch(field, query, limit, options) {
|
|
362
362
|
if (!Number.isFinite(limit) || limit <= 0) {
|
|
363
|
-
throw new
|
|
363
|
+
throw new chunkKTBTSHU6_cjs.UnsupportedPredicateError(
|
|
364
364
|
`matches() limit must be a positive finite number, got ${String(limit)}`
|
|
365
365
|
);
|
|
366
366
|
}
|
|
@@ -633,7 +633,7 @@ function notInSubquery(field, subquery) {
|
|
|
633
633
|
function assertSingleColumnSubquery(subquery) {
|
|
634
634
|
const columnCount = getSubqueryColumnCount(subquery);
|
|
635
635
|
if (columnCount === 1) return;
|
|
636
|
-
throw new
|
|
636
|
+
throw new chunkKTBTSHU6_cjs.UnsupportedPredicateError(
|
|
637
637
|
`IN/NOT IN subquery must project exactly 1 column, but got ${columnCount}`,
|
|
638
638
|
{ subqueryColumnCount: columnCount },
|
|
639
639
|
{
|
|
@@ -646,7 +646,7 @@ function assertCompatibleSubqueryValueTypes(field, subquery) {
|
|
|
646
646
|
const subqueryValueType = getSingleSubqueryColumnValueType(subquery);
|
|
647
647
|
const resolvedValueType = fieldValueType ?? subqueryValueType;
|
|
648
648
|
if (isUnsupportedInSubqueryValueType(resolvedValueType)) {
|
|
649
|
-
throw new
|
|
649
|
+
throw new chunkKTBTSHU6_cjs.UnsupportedPredicateError(
|
|
650
650
|
`IN/NOT IN subquery does not support ${String(resolvedValueType)} values`,
|
|
651
651
|
{ valueType: resolvedValueType },
|
|
652
652
|
{
|
|
@@ -657,7 +657,7 @@ function assertCompatibleSubqueryValueTypes(field, subquery) {
|
|
|
657
657
|
if (isInSubqueryTypeCompatible(fieldValueType, subqueryValueType)) {
|
|
658
658
|
return;
|
|
659
659
|
}
|
|
660
|
-
throw new
|
|
660
|
+
throw new chunkKTBTSHU6_cjs.UnsupportedPredicateError(
|
|
661
661
|
`IN/NOT IN type mismatch: field type "${String(fieldValueType)}" does not match subquery column type "${String(subqueryValueType)}"`,
|
|
662
662
|
{
|
|
663
663
|
fieldValueType,
|
|
@@ -676,7 +676,7 @@ var RECORDED_ISOLATION_REQUIRES_POSTGRES_CHECK = {
|
|
|
676
676
|
};
|
|
677
677
|
function requireRecordedSchema(target) {
|
|
678
678
|
if (target.tableNames === void 0) {
|
|
679
|
-
throw new
|
|
679
|
+
throw new chunkKTBTSHU6_cjs.ConfigurationError(
|
|
680
680
|
"Recorded-time capture requires the backend to expose tableNames.",
|
|
681
681
|
{ dialect: target.dialect },
|
|
682
682
|
{
|
|
@@ -684,11 +684,11 @@ function requireRecordedSchema(target) {
|
|
|
684
684
|
}
|
|
685
685
|
);
|
|
686
686
|
}
|
|
687
|
-
return
|
|
687
|
+
return chunkCVK4T34X_cjs.createSqlSchema(target.tableNames);
|
|
688
688
|
}
|
|
689
689
|
function requireCaptureStatements(target) {
|
|
690
690
|
if (target.executeStatement === void 0) {
|
|
691
|
-
throw new
|
|
691
|
+
throw new chunkKTBTSHU6_cjs.ConfigurationError(
|
|
692
692
|
"Recorded-time capture requires backend.executeStatement support on the transaction backend.",
|
|
693
693
|
{ dialect: target.dialect },
|
|
694
694
|
{
|
|
@@ -699,10 +699,10 @@ function requireCaptureStatements(target) {
|
|
|
699
699
|
}
|
|
700
700
|
async function executeStatement(target, query) {
|
|
701
701
|
requireCaptureStatements(target);
|
|
702
|
-
await target.executeStatement(
|
|
702
|
+
await target.executeStatement(chunkX2XOQZT3_cjs.asCompiledStatementSql(query));
|
|
703
703
|
}
|
|
704
704
|
function unsupportedPostgresIsolationError(isolationLevel) {
|
|
705
|
-
return new
|
|
705
|
+
return new chunkKTBTSHU6_cjs.ConfigurationError(
|
|
706
706
|
"Recorded-time capture on PostgreSQL requires read_committed isolation.",
|
|
707
707
|
{ isolationLevel: isolationLevel ?? "unknown" },
|
|
708
708
|
{
|
|
@@ -728,7 +728,7 @@ async function assertRecordedCaptureTransactionIsolation(target, options) {
|
|
|
728
728
|
if (!RECORDED_ISOLATION_REQUIRES_POSTGRES_CHECK[target.dialect]) return;
|
|
729
729
|
if (options?.accessMode === "read_only") return;
|
|
730
730
|
const rows = await target.execute(
|
|
731
|
-
|
|
731
|
+
chunkX2XOQZT3_cjs.asCompiledRowsSql(chunkX2XOQZT3_cjs.sql`
|
|
732
732
|
SELECT current_setting('transaction_isolation') AS transaction_isolation
|
|
733
733
|
`)
|
|
734
734
|
);
|
|
@@ -739,7 +739,7 @@ async function assertRecordedCaptureTransactionIsolation(target, options) {
|
|
|
739
739
|
throw unsupportedPostgresIsolationError(isolationLevel);
|
|
740
740
|
}
|
|
741
741
|
function recordedCaptureRequiresCallbackTransactionError(details = {}) {
|
|
742
|
-
return new
|
|
742
|
+
return new chunkKTBTSHU6_cjs.ConfigurationError(
|
|
743
743
|
"withTransaction() has no recorded-time capture flush point when history is enabled.",
|
|
744
744
|
{
|
|
745
745
|
...details,
|
|
@@ -751,7 +751,7 @@ function recordedCaptureRequiresCallbackTransactionError(details = {}) {
|
|
|
751
751
|
);
|
|
752
752
|
}
|
|
753
753
|
function historyUnsafeRawWriteError(surface) {
|
|
754
|
-
return new
|
|
754
|
+
return new chunkKTBTSHU6_cjs.ConfigurationError(
|
|
755
755
|
`${surface} is not available when history capture is enabled because raw SQL writes bypass recorded-time capture.`,
|
|
756
756
|
{
|
|
757
757
|
code: "RECORDED_CAPTURE_RAW_SQL_DISABLED"
|
|
@@ -762,7 +762,7 @@ function historyUnsafeRawWriteError(surface) {
|
|
|
762
762
|
);
|
|
763
763
|
}
|
|
764
764
|
function revisionTrackingUnsafeRawWriteError(surface) {
|
|
765
|
-
return new
|
|
765
|
+
return new chunkKTBTSHU6_cjs.ConfigurationError(
|
|
766
766
|
`${surface} is not available when revision tracking is enabled because raw SQL writes bypass the revision anchor.`,
|
|
767
767
|
{
|
|
768
768
|
code: "REVISION_TRACKING_RAW_SQL_DISABLED"
|
|
@@ -798,7 +798,7 @@ function rawWriteGuards(target, prefix) {
|
|
|
798
798
|
}
|
|
799
799
|
function assertCapturableBackend(backend) {
|
|
800
800
|
if (!backend.capabilities.transactions) {
|
|
801
|
-
throw new
|
|
801
|
+
throw new chunkKTBTSHU6_cjs.ConfigurationError(
|
|
802
802
|
"history: true requires a backend with transaction support.",
|
|
803
803
|
{ dialect: backend.dialect },
|
|
804
804
|
{
|
|
@@ -807,7 +807,7 @@ function assertCapturableBackend(backend) {
|
|
|
807
807
|
);
|
|
808
808
|
}
|
|
809
809
|
if (backend.executeStatement === void 0) {
|
|
810
|
-
throw new
|
|
810
|
+
throw new chunkKTBTSHU6_cjs.ConfigurationError(
|
|
811
811
|
"history: true requires a backend that supports executeStatement.",
|
|
812
812
|
{ dialect: backend.dialect },
|
|
813
813
|
{
|
|
@@ -816,7 +816,7 @@ function assertCapturableBackend(backend) {
|
|
|
816
816
|
);
|
|
817
817
|
}
|
|
818
818
|
if (backend.capabilities.returning === false) {
|
|
819
|
-
throw new
|
|
819
|
+
throw new chunkKTBTSHU6_cjs.ConfigurationError(
|
|
820
820
|
"history: true requires a backend that supports UPDATE \u2026 RETURNING.",
|
|
821
821
|
{ dialect: backend.dialect },
|
|
822
822
|
{
|
|
@@ -825,7 +825,7 @@ function assertCapturableBackend(backend) {
|
|
|
825
825
|
);
|
|
826
826
|
}
|
|
827
827
|
if (backend.tableNames === void 0) {
|
|
828
|
-
throw new
|
|
828
|
+
throw new chunkKTBTSHU6_cjs.ConfigurationError(
|
|
829
829
|
"history: true requires a backend that exposes tableNames.",
|
|
830
830
|
{ dialect: backend.dialect },
|
|
831
831
|
{
|
|
@@ -836,7 +836,7 @@ function assertCapturableBackend(backend) {
|
|
|
836
836
|
}
|
|
837
837
|
function assertRevisionTrackableBackend(backend) {
|
|
838
838
|
if (!backend.capabilities.transactions) {
|
|
839
|
-
throw new
|
|
839
|
+
throw new chunkKTBTSHU6_cjs.ConfigurationError(
|
|
840
840
|
"revisionTracking: true requires a backend with transaction support.",
|
|
841
841
|
{ dialect: backend.dialect },
|
|
842
842
|
{
|
|
@@ -845,7 +845,7 @@ function assertRevisionTrackableBackend(backend) {
|
|
|
845
845
|
);
|
|
846
846
|
}
|
|
847
847
|
if (backend.executeStatement === void 0) {
|
|
848
|
-
throw new
|
|
848
|
+
throw new chunkKTBTSHU6_cjs.ConfigurationError(
|
|
849
849
|
"revisionTracking: true requires a backend that supports executeStatement.",
|
|
850
850
|
{ dialect: backend.dialect },
|
|
851
851
|
{
|
|
@@ -854,7 +854,7 @@ function assertRevisionTrackableBackend(backend) {
|
|
|
854
854
|
);
|
|
855
855
|
}
|
|
856
856
|
if (backend.tableNames === void 0) {
|
|
857
|
-
throw new
|
|
857
|
+
throw new chunkKTBTSHU6_cjs.ConfigurationError(
|
|
858
858
|
"revisionTracking: true requires a backend that exposes tableNames.",
|
|
859
859
|
{ dialect: backend.dialect },
|
|
860
860
|
{
|
|
@@ -863,7 +863,7 @@ function assertRevisionTrackableBackend(backend) {
|
|
|
863
863
|
);
|
|
864
864
|
}
|
|
865
865
|
if (backend.ensureRevisionOriginsTable === void 0) {
|
|
866
|
-
throw new
|
|
866
|
+
throw new chunkKTBTSHU6_cjs.ConfigurationError(
|
|
867
867
|
"revisionTracking: true requires a backend that can bootstrap revision origins.",
|
|
868
868
|
{ dialect: backend.dialect },
|
|
869
869
|
{
|
|
@@ -883,7 +883,7 @@ var USES_RECORDED_GRAPH_ADVISORY_LOCK = {
|
|
|
883
883
|
sqlite: false
|
|
884
884
|
};
|
|
885
885
|
function graphAdvisoryLockSql(namespace, graphId) {
|
|
886
|
-
return
|
|
886
|
+
return chunkX2XOQZT3_cjs.sql`
|
|
887
887
|
SELECT pg_advisory_xact_lock(
|
|
888
888
|
hashtext(${namespace}),
|
|
889
889
|
hashtext(${graphId})
|
|
@@ -915,7 +915,7 @@ function registerRecordedGraphLockMemo(backend, memo) {
|
|
|
915
915
|
}
|
|
916
916
|
async function acquireRecordedGraphWriteLock(target, graphId) {
|
|
917
917
|
await target.execute(
|
|
918
|
-
|
|
918
|
+
chunkX2XOQZT3_cjs.asCompiledRowsSql(recordedGraphWriteAdvisoryLockSql(graphId))
|
|
919
919
|
);
|
|
920
920
|
}
|
|
921
921
|
async function lockRecordedGraphWrite(target, graphId, memo) {
|
|
@@ -941,7 +941,7 @@ async function lockRecordedGraphWrite(target, graphId, memo) {
|
|
|
941
941
|
return graphWriteLockEvidence();
|
|
942
942
|
}
|
|
943
943
|
function failInvalidClock(value, cause) {
|
|
944
|
-
throw new
|
|
944
|
+
throw new chunkKTBTSHU6_cjs.ConfigurationError(
|
|
945
945
|
"Recorded clock row contained an invalid revision or wall time",
|
|
946
946
|
{ value },
|
|
947
947
|
{
|
|
@@ -952,13 +952,13 @@ function failInvalidClock(value, cause) {
|
|
|
952
952
|
}
|
|
953
953
|
function recordedClockRevision(value) {
|
|
954
954
|
const revision = typeof value === "bigint" ? Number(value) : typeof value === "string" && /^\d+$/.test(value) ? Number(value) : value;
|
|
955
|
-
if (typeof revision !== "number" || !Number.isSafeInteger(revision) || revision < RECORDED_MIN_REVISION || revision >=
|
|
955
|
+
if (typeof revision !== "number" || !Number.isSafeInteger(revision) || revision < RECORDED_MIN_REVISION || revision >= chunkFSCJOTHF_cjs.RECORDED_MAX_REVISION) {
|
|
956
956
|
return failInvalidClock(value);
|
|
957
957
|
}
|
|
958
958
|
return revision;
|
|
959
959
|
}
|
|
960
960
|
function recordedClockWallTime(value) {
|
|
961
|
-
return
|
|
961
|
+
return chunkZBV4LQD2_cjs.canonicalizeDatabaseTimestamp(value) ?? failInvalidClock(value);
|
|
962
962
|
}
|
|
963
963
|
function recordedClockParts(row) {
|
|
964
964
|
const revision = recordedClockRevision(row.revision);
|
|
@@ -966,7 +966,7 @@ function recordedClockParts(row) {
|
|
|
966
966
|
return { revision, recordedAt: recordedClockWallTime(row.recorded_at) };
|
|
967
967
|
}
|
|
968
968
|
function nextRecordedCommitParts(previous) {
|
|
969
|
-
const wallTime =
|
|
969
|
+
const wallTime = chunkZBV4LQD2_cjs.nowIso();
|
|
970
970
|
if (previous === void 0) {
|
|
971
971
|
return { revision: 1, recordedAt: wallTime };
|
|
972
972
|
}
|
|
@@ -984,11 +984,11 @@ function nonDecreasingWallTime(current, previous) {
|
|
|
984
984
|
}
|
|
985
985
|
async function readRecordedClock(target, schema, graphId) {
|
|
986
986
|
const parts = await readRecordedClockParts(target, schema, graphId);
|
|
987
|
-
return parts === void 0 ? void 0 :
|
|
987
|
+
return parts === void 0 ? void 0 : chunkFSCJOTHF_cjs.createRecordedInstant(parts.revision, parts.recordedAt);
|
|
988
988
|
}
|
|
989
989
|
async function readRecordedClockParts(target, schema, graphId) {
|
|
990
990
|
const rows = await target.execute(
|
|
991
|
-
|
|
991
|
+
chunkX2XOQZT3_cjs.asCompiledRowsSql(chunkX2XOQZT3_cjs.sql`
|
|
992
992
|
SELECT revision, recorded_at
|
|
993
993
|
FROM ${schema.recordedClockTable}
|
|
994
994
|
WHERE graph_id = ${graphId}
|
|
@@ -999,7 +999,7 @@ async function readRecordedClockParts(target, schema, graphId) {
|
|
|
999
999
|
}
|
|
1000
1000
|
async function readRevisionOrigin(target, schema, graphId) {
|
|
1001
1001
|
const rows = await target.execute(
|
|
1002
|
-
|
|
1002
|
+
chunkX2XOQZT3_cjs.asCompiledRowsSql(chunkX2XOQZT3_cjs.sql`
|
|
1003
1003
|
SELECT origin
|
|
1004
1004
|
FROM ${schema.revisionOriginsTable}
|
|
1005
1005
|
WHERE graph_id = ${graphId}
|
|
@@ -1008,7 +1008,7 @@ async function readRevisionOrigin(target, schema, graphId) {
|
|
|
1008
1008
|
const first = rows[0];
|
|
1009
1009
|
if (first === void 0) return void 0;
|
|
1010
1010
|
if (typeof first.origin !== "string" || first.origin.length === 0) {
|
|
1011
|
-
throw new
|
|
1011
|
+
throw new chunkKTBTSHU6_cjs.ConfigurationError(
|
|
1012
1012
|
"Revision origin row contained an invalid origin",
|
|
1013
1013
|
{ graphId, origin: first.origin }
|
|
1014
1014
|
);
|
|
@@ -1018,7 +1018,7 @@ async function readRevisionOrigin(target, schema, graphId) {
|
|
|
1018
1018
|
async function ensureRevisionOrigin(target, schema, graphId) {
|
|
1019
1019
|
const ensureTable = target.ensureRevisionOriginsTable;
|
|
1020
1020
|
if (ensureTable === void 0) {
|
|
1021
|
-
throw new
|
|
1021
|
+
throw new chunkKTBTSHU6_cjs.ConfigurationError(
|
|
1022
1022
|
"Revision tracking requires a backend that can bootstrap revision origins.",
|
|
1023
1023
|
{ dialect: target.dialect },
|
|
1024
1024
|
{
|
|
@@ -1031,7 +1031,7 @@ async function ensureRevisionOrigin(target, schema, graphId) {
|
|
|
1031
1031
|
if (existing !== void 0) return existing;
|
|
1032
1032
|
await executeStatement(
|
|
1033
1033
|
target,
|
|
1034
|
-
|
|
1034
|
+
chunkX2XOQZT3_cjs.sql`
|
|
1035
1035
|
INSERT INTO ${schema.revisionOriginsTable} (graph_id, origin)
|
|
1036
1036
|
VALUES (${graphId}, ${generateId()})
|
|
1037
1037
|
ON CONFLICT (graph_id) DO NOTHING
|
|
@@ -1039,7 +1039,7 @@ async function ensureRevisionOrigin(target, schema, graphId) {
|
|
|
1039
1039
|
);
|
|
1040
1040
|
const origin = await readRevisionOrigin(target, schema, graphId);
|
|
1041
1041
|
if (origin !== void 0) return origin;
|
|
1042
|
-
throw new
|
|
1042
|
+
throw new chunkKTBTSHU6_cjs.ConfigurationError(
|
|
1043
1043
|
"Revision origin was not persisted after initialization.",
|
|
1044
1044
|
{ graphId, dialect: target.dialect }
|
|
1045
1045
|
);
|
|
@@ -1047,7 +1047,7 @@ async function ensureRevisionOrigin(target, schema, graphId) {
|
|
|
1047
1047
|
async function writeRecordedClock(target, schema, graphId, parts) {
|
|
1048
1048
|
await executeStatement(
|
|
1049
1049
|
target,
|
|
1050
|
-
|
|
1050
|
+
chunkX2XOQZT3_cjs.sql`
|
|
1051
1051
|
INSERT INTO ${schema.recordedClockTable} (graph_id, revision, recorded_at)
|
|
1052
1052
|
VALUES (${graphId}, ${parts.revision}, ${parts.recordedAt})
|
|
1053
1053
|
ON CONFLICT (graph_id) DO UPDATE
|
|
@@ -1059,7 +1059,7 @@ async function lockRecordedClock(target, schema, graphId, ownsWriteLock) {
|
|
|
1059
1059
|
switch (target.dialect) {
|
|
1060
1060
|
case "postgres": {
|
|
1061
1061
|
await target.execute(
|
|
1062
|
-
|
|
1062
|
+
chunkX2XOQZT3_cjs.asCompiledRowsSql(recordedClockAdvisoryLockSql(graphId))
|
|
1063
1063
|
);
|
|
1064
1064
|
return;
|
|
1065
1065
|
}
|
|
@@ -1067,7 +1067,7 @@ async function lockRecordedClock(target, schema, graphId, ownsWriteLock) {
|
|
|
1067
1067
|
if (ownsWriteLock) return;
|
|
1068
1068
|
await executeStatement(
|
|
1069
1069
|
target,
|
|
1070
|
-
|
|
1070
|
+
chunkX2XOQZT3_cjs.sql`
|
|
1071
1071
|
INSERT INTO ${schema.recordedClockTable} (graph_id, revision, recorded_at)
|
|
1072
1072
|
VALUES (${graphId}, ${RECORDED_MIN_REVISION}, ${RECORDED_MIN_TIME})
|
|
1073
1073
|
ON CONFLICT (graph_id) DO UPDATE SET revision = revision
|
|
@@ -1082,18 +1082,18 @@ async function lockRecordedClock(target, schema, graphId, ownsWriteLock) {
|
|
|
1082
1082
|
}
|
|
1083
1083
|
async function allocateRecordedCommit(target, schema, graphId, ownsWriteLock, previousRevision) {
|
|
1084
1084
|
await lockRecordedClock(target, schema, graphId, ownsWriteLock);
|
|
1085
|
-
const previous = previousRevision === void 0 ? await readRecordedClockParts(target, schema, graphId) :
|
|
1085
|
+
const previous = previousRevision === void 0 ? await readRecordedClockParts(target, schema, graphId) : chunkFSCJOTHF_cjs.parseRecordedInstant(previousRevision, "previous recorded revision");
|
|
1086
1086
|
const { revision, recordedAt } = nextRecordedCommitParts(previous);
|
|
1087
|
-
if (revision >=
|
|
1088
|
-
throw new
|
|
1089
|
-
`Recorded commit clock reached the open revision sentinel ${
|
|
1087
|
+
if (revision >= chunkFSCJOTHF_cjs.RECORDED_MAX_REVISION) {
|
|
1088
|
+
throw new chunkKTBTSHU6_cjs.ConfigurationError(
|
|
1089
|
+
`Recorded commit clock reached the open revision sentinel ${chunkFSCJOTHF_cjs.RECORDED_MAX_REVISION}`,
|
|
1090
1090
|
{ graphId, revision },
|
|
1091
1091
|
{
|
|
1092
1092
|
suggestion: "Start a new graph before exhausting the per-graph recorded revision space."
|
|
1093
1093
|
}
|
|
1094
1094
|
);
|
|
1095
1095
|
}
|
|
1096
|
-
const instant =
|
|
1096
|
+
const instant = chunkFSCJOTHF_cjs.createRecordedInstant(revision, recordedAt);
|
|
1097
1097
|
await writeRecordedClock(target, schema, graphId, { revision, recordedAt });
|
|
1098
1098
|
return { instant, revision, recordedAt };
|
|
1099
1099
|
}
|
|
@@ -1270,28 +1270,28 @@ function compileFieldColumn(field, cteAlias, cteColumnPrefix) {
|
|
|
1270
1270
|
if (cteColumnPrefix !== void 0) {
|
|
1271
1271
|
const qualifier2 = cteColumnPrefix === "" ? "" : `${cteColumnPrefix}.`;
|
|
1272
1272
|
if (field.path.length === 1 && field.path[0] === "id") {
|
|
1273
|
-
return
|
|
1273
|
+
return chunkX2XOQZT3_cjs.sql.raw(`${qualifier2}id`);
|
|
1274
1274
|
}
|
|
1275
1275
|
if (field.path.length === 1 && field.path[0] === "kind") {
|
|
1276
|
-
return
|
|
1276
|
+
return chunkX2XOQZT3_cjs.sql.raw(`${qualifier2}kind`);
|
|
1277
1277
|
}
|
|
1278
1278
|
if (field.path.length > 0 && field.path[0] === "props") {
|
|
1279
|
-
return
|
|
1279
|
+
return chunkX2XOQZT3_cjs.sql.raw(`${qualifier2}props`);
|
|
1280
1280
|
}
|
|
1281
|
-
return
|
|
1281
|
+
return chunkX2XOQZT3_cjs.sql.raw(`${qualifier2}${field.path.join("_")}`);
|
|
1282
1282
|
}
|
|
1283
1283
|
const prefix = field.alias;
|
|
1284
1284
|
const qualifier = cteAlias ? `${cteAlias}.` : "";
|
|
1285
1285
|
if (field.path.length === 1 && field.path[0] === "id") {
|
|
1286
|
-
return
|
|
1286
|
+
return chunkX2XOQZT3_cjs.sql.raw(`${qualifier}${prefix}_id`);
|
|
1287
1287
|
}
|
|
1288
1288
|
if (field.path.length === 1 && field.path[0] === "kind") {
|
|
1289
|
-
return
|
|
1289
|
+
return chunkX2XOQZT3_cjs.sql.raw(`${qualifier}${prefix}_kind`);
|
|
1290
1290
|
}
|
|
1291
1291
|
if (field.path.length > 0 && field.path[0] === "props") {
|
|
1292
|
-
return
|
|
1292
|
+
return chunkX2XOQZT3_cjs.sql.raw(`${qualifier}${prefix}_props`);
|
|
1293
1293
|
}
|
|
1294
|
-
return
|
|
1294
|
+
return chunkX2XOQZT3_cjs.sql.raw(`${qualifier}${prefix}_${field.path.join("_")}`);
|
|
1295
1295
|
}
|
|
1296
1296
|
function getFieldPointer(field) {
|
|
1297
1297
|
if (field.jsonPointer !== void 0) {
|
|
@@ -1374,7 +1374,7 @@ function resolveLiteralValueTypes(literals) {
|
|
|
1374
1374
|
}
|
|
1375
1375
|
}
|
|
1376
1376
|
if (resolved.size > 1) {
|
|
1377
|
-
throw new
|
|
1377
|
+
throw new chunkKTBTSHU6_cjs.UnsupportedPredicateError(
|
|
1378
1378
|
"Mixed literal value types are not supported in predicates",
|
|
1379
1379
|
{ valueTypes: [...resolved] }
|
|
1380
1380
|
);
|
|
@@ -1408,9 +1408,9 @@ function convertValueForSql(value, dialect) {
|
|
|
1408
1408
|
}
|
|
1409
1409
|
function compileStringPattern(op, pattern) {
|
|
1410
1410
|
const escaped = pattern.replaceAll(
|
|
1411
|
-
|
|
1412
|
-
`${
|
|
1413
|
-
).replaceAll("%", `${
|
|
1411
|
+
chunkX2XOQZT3_cjs.LIKE_ESCAPE_CHARACTER,
|
|
1412
|
+
`${chunkX2XOQZT3_cjs.LIKE_ESCAPE_CHARACTER}${chunkX2XOQZT3_cjs.LIKE_ESCAPE_CHARACTER}`
|
|
1413
|
+
).replaceAll("%", `${chunkX2XOQZT3_cjs.LIKE_ESCAPE_CHARACTER}%`).replaceAll("_", `${chunkX2XOQZT3_cjs.LIKE_ESCAPE_CHARACTER}_`);
|
|
1414
1414
|
switch (op) {
|
|
1415
1415
|
case "contains": {
|
|
1416
1416
|
return `%${escaped}%`;
|
|
@@ -1431,22 +1431,22 @@ function compileStringPattern(op, pattern) {
|
|
|
1431
1431
|
}
|
|
1432
1432
|
}
|
|
1433
1433
|
function escapeLikePatternParameter(parameter) {
|
|
1434
|
-
const doubledEscape = `${
|
|
1435
|
-
return
|
|
1434
|
+
const doubledEscape = `${chunkX2XOQZT3_cjs.LIKE_ESCAPE_CHARACTER}${chunkX2XOQZT3_cjs.LIKE_ESCAPE_CHARACTER}`;
|
|
1435
|
+
return chunkX2XOQZT3_cjs.sql`REPLACE(REPLACE(REPLACE(${parameter}, ${chunkX2XOQZT3_cjs.LIKE_ESCAPE_CHARACTER}, ${doubledEscape}), '%', ${`${chunkX2XOQZT3_cjs.LIKE_ESCAPE_CHARACTER}%`}), '_', ${`${chunkX2XOQZT3_cjs.LIKE_ESCAPE_CHARACTER}_`})`;
|
|
1436
1436
|
}
|
|
1437
1437
|
function compileParameterizedStringPattern(op, parameter) {
|
|
1438
1438
|
switch (op) {
|
|
1439
1439
|
case "contains": {
|
|
1440
1440
|
const escaped = escapeLikePatternParameter(parameter);
|
|
1441
|
-
return
|
|
1441
|
+
return chunkX2XOQZT3_cjs.sql`'%' || ${escaped} || '%'`;
|
|
1442
1442
|
}
|
|
1443
1443
|
case "startsWith": {
|
|
1444
1444
|
const escaped = escapeLikePatternParameter(parameter);
|
|
1445
|
-
return
|
|
1445
|
+
return chunkX2XOQZT3_cjs.sql`${escaped} || '%'`;
|
|
1446
1446
|
}
|
|
1447
1447
|
case "endsWith": {
|
|
1448
1448
|
const escaped = escapeLikePatternParameter(parameter);
|
|
1449
|
-
return
|
|
1449
|
+
return chunkX2XOQZT3_cjs.sql`'%' || ${escaped}`;
|
|
1450
1450
|
}
|
|
1451
1451
|
case "like":
|
|
1452
1452
|
case "ilike": {
|
|
@@ -1473,18 +1473,18 @@ function compilePredicateExpression(expr, ctx) {
|
|
|
1473
1473
|
cteColumnPrefix
|
|
1474
1474
|
);
|
|
1475
1475
|
if (isParameterRef(expr.pattern)) {
|
|
1476
|
-
const placeholder =
|
|
1476
|
+
const placeholder = chunkX2XOQZT3_cjs.sql`${chunkX2XOQZT3_cjs.sql.placeholder(expr.pattern.name)}`;
|
|
1477
1477
|
const pattern2 = compileParameterizedStringPattern(expr.op, placeholder);
|
|
1478
1478
|
if (expr.op === "ilike" || expr.op === "contains" || expr.op === "startsWith" || expr.op === "endsWith") {
|
|
1479
1479
|
return dialect.ilike(field, pattern2);
|
|
1480
1480
|
}
|
|
1481
|
-
return
|
|
1481
|
+
return chunkX2XOQZT3_cjs.sql`${field} LIKE ${pattern2} ${chunkX2XOQZT3_cjs.likeEscapeClause}`;
|
|
1482
1482
|
}
|
|
1483
1483
|
const pattern = compileStringPattern(expr.op, expr.pattern);
|
|
1484
1484
|
if (expr.op === "ilike" || expr.op === "contains" || expr.op === "startsWith" || expr.op === "endsWith") {
|
|
1485
1485
|
return dialect.ilike(field, pattern);
|
|
1486
1486
|
}
|
|
1487
|
-
return
|
|
1487
|
+
return chunkX2XOQZT3_cjs.sql`${field} LIKE ${pattern} ${chunkX2XOQZT3_cjs.likeEscapeClause}`;
|
|
1488
1488
|
}
|
|
1489
1489
|
case "null_check": {
|
|
1490
1490
|
const field = compileFieldTextValue(
|
|
@@ -1494,7 +1494,7 @@ function compilePredicateExpression(expr, ctx) {
|
|
|
1494
1494
|
void 0,
|
|
1495
1495
|
cteColumnPrefix
|
|
1496
1496
|
);
|
|
1497
|
-
return expr.op === "isNull" ?
|
|
1497
|
+
return expr.op === "isNull" ? chunkX2XOQZT3_cjs.sql`${field} IS NULL` : chunkX2XOQZT3_cjs.sql`${field} IS NOT NULL`;
|
|
1498
1498
|
}
|
|
1499
1499
|
case "between": {
|
|
1500
1500
|
const lowerIsParam = isParameterRef(expr.lower);
|
|
@@ -1504,7 +1504,7 @@ function compilePredicateExpression(expr, ctx) {
|
|
|
1504
1504
|
if (!upperIsParam) boundsForType.push(expr.upper);
|
|
1505
1505
|
const valueType = boundsForType.length > 0 ? resolveComparisonValueType(expr.field, boundsForType) : normalizeValueType2(expr.field.valueType);
|
|
1506
1506
|
if (valueType === "array" || valueType === "object") {
|
|
1507
|
-
throw new
|
|
1507
|
+
throw new chunkKTBTSHU6_cjs.UnsupportedPredicateError(
|
|
1508
1508
|
"Between comparisons are not supported for JSON arrays or objects"
|
|
1509
1509
|
);
|
|
1510
1510
|
}
|
|
@@ -1516,25 +1516,25 @@ function compilePredicateExpression(expr, ctx) {
|
|
|
1516
1516
|
void 0,
|
|
1517
1517
|
cteColumnPrefix
|
|
1518
1518
|
);
|
|
1519
|
-
const lower = lowerIsParam ?
|
|
1520
|
-
const upper = upperIsParam ?
|
|
1521
|
-
return
|
|
1519
|
+
const lower = lowerIsParam ? chunkX2XOQZT3_cjs.sql.placeholder(expr.lower.name) : convertValueForSql(expr.lower.value, dialect);
|
|
1520
|
+
const upper = upperIsParam ? chunkX2XOQZT3_cjs.sql.placeholder(expr.upper.name) : convertValueForSql(expr.upper.value, dialect);
|
|
1521
|
+
return chunkX2XOQZT3_cjs.sql`${field} BETWEEN ${lower} AND ${upper}`;
|
|
1522
1522
|
}
|
|
1523
1523
|
case "and": {
|
|
1524
1524
|
const parts = expr.predicates.map(
|
|
1525
1525
|
(p) => compilePredicateExpression(p, ctx)
|
|
1526
1526
|
);
|
|
1527
|
-
return
|
|
1527
|
+
return chunkX2XOQZT3_cjs.sql`(${chunkX2XOQZT3_cjs.sql.join(parts, chunkX2XOQZT3_cjs.sql` AND `)})`;
|
|
1528
1528
|
}
|
|
1529
1529
|
case "or": {
|
|
1530
1530
|
const parts = expr.predicates.map(
|
|
1531
1531
|
(p) => compilePredicateExpression(p, ctx)
|
|
1532
1532
|
);
|
|
1533
|
-
return
|
|
1533
|
+
return chunkX2XOQZT3_cjs.sql`(${chunkX2XOQZT3_cjs.sql.join(parts, chunkX2XOQZT3_cjs.sql` OR `)})`;
|
|
1534
1534
|
}
|
|
1535
1535
|
case "not": {
|
|
1536
1536
|
const inner = compilePredicateExpression(expr.predicate, ctx);
|
|
1537
|
-
return
|
|
1537
|
+
return chunkX2XOQZT3_cjs.sql`NOT (${inner})`;
|
|
1538
1538
|
}
|
|
1539
1539
|
case "array_op": {
|
|
1540
1540
|
return compileArrayPredicate(expr, dialect, cteColumnPrefix);
|
|
@@ -1557,7 +1557,7 @@ function compilePredicateExpression(expr, ctx) {
|
|
|
1557
1557
|
}
|
|
1558
1558
|
}
|
|
1559
1559
|
}
|
|
1560
|
-
var STRUCTURAL_PREDICATE_NOOP =
|
|
1560
|
+
var STRUCTURAL_PREDICATE_NOOP = chunkX2XOQZT3_cjs.sql.raw("1=1");
|
|
1561
1561
|
function compileComparisonPredicate(expr, dialect, cteColumnPrefix) {
|
|
1562
1562
|
if (isParameterRef(expr.right)) {
|
|
1563
1563
|
const parameterValueType = normalizeValueType2(expr.right.valueType) ?? normalizeValueType2(expr.left.valueType);
|
|
@@ -1571,15 +1571,15 @@ function compileComparisonPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1571
1571
|
);
|
|
1572
1572
|
const opSql2 = COMPARISON_OP_SQL[expr.op];
|
|
1573
1573
|
if (!opSql2) {
|
|
1574
|
-
throw new
|
|
1574
|
+
throw new chunkKTBTSHU6_cjs.UnsupportedPredicateError(
|
|
1575
1575
|
`Comparison operation "${expr.op}" is not supported for parameterized predicates`
|
|
1576
1576
|
);
|
|
1577
1577
|
}
|
|
1578
|
-
return
|
|
1578
|
+
return chunkX2XOQZT3_cjs.sql`${left2} ${chunkX2XOQZT3_cjs.sql.raw(opSql2)} ${chunkX2XOQZT3_cjs.sql.placeholder(expr.right.name)}`;
|
|
1579
1579
|
}
|
|
1580
1580
|
const valueType = resolveComparisonValueType(expr.left, expr.right);
|
|
1581
1581
|
if (valueType === "array" || valueType === "object") {
|
|
1582
|
-
throw new
|
|
1582
|
+
throw new chunkKTBTSHU6_cjs.UnsupportedPredicateError(
|
|
1583
1583
|
`Comparison operation "${expr.op}" is not supported for ${valueType} values`
|
|
1584
1584
|
);
|
|
1585
1585
|
}
|
|
@@ -1594,7 +1594,7 @@ function compileComparisonPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1594
1594
|
if (expr.op === "in" || expr.op === "notIn") {
|
|
1595
1595
|
const values = Array.isArray(expr.right) ? expr.right : [expr.right];
|
|
1596
1596
|
if (values.length === 0) {
|
|
1597
|
-
return expr.op === "in" ?
|
|
1597
|
+
return expr.op === "in" ? chunkX2XOQZT3_cjs.sql.raw("1=0") : chunkX2XOQZT3_cjs.sql.raw("1=1");
|
|
1598
1598
|
}
|
|
1599
1599
|
const convertedValues = values.map(
|
|
1600
1600
|
(value) => convertValueForSql(value.value, dialect)
|
|
@@ -1606,11 +1606,11 @@ function compileComparisonPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1606
1606
|
const convertedRight = convertValueForSql(rightValue.value, dialect);
|
|
1607
1607
|
const opSql = COMPARISON_OP_SQL[expr.op];
|
|
1608
1608
|
if (!opSql) {
|
|
1609
|
-
throw new
|
|
1609
|
+
throw new chunkKTBTSHU6_cjs.UnsupportedPredicateError(
|
|
1610
1610
|
`Comparison operation "${expr.op}" is not supported`
|
|
1611
1611
|
);
|
|
1612
1612
|
}
|
|
1613
|
-
return
|
|
1613
|
+
return chunkX2XOQZT3_cjs.sql`${left} ${chunkX2XOQZT3_cjs.sql.raw(opSql)} ${convertedRight}`;
|
|
1614
1614
|
}
|
|
1615
1615
|
function compileArrayPredicate(expr, dialect, cteColumnPrefix) {
|
|
1616
1616
|
const field = compileFieldJsonValue(
|
|
@@ -1623,30 +1623,30 @@ function compileArrayPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1623
1623
|
const values = expr.values?.map((v) => convertValueForSql(v.value, dialect)) ?? [];
|
|
1624
1624
|
switch (expr.op) {
|
|
1625
1625
|
case "isEmpty": {
|
|
1626
|
-
return
|
|
1626
|
+
return chunkX2XOQZT3_cjs.sql`(${field} IS NULL OR ${dialect.jsonArrayLength(field)} = 0)`;
|
|
1627
1627
|
}
|
|
1628
1628
|
case "isNotEmpty": {
|
|
1629
|
-
return
|
|
1629
|
+
return chunkX2XOQZT3_cjs.sql`(${field} IS NOT NULL AND ${dialect.jsonArrayLength(field)} > 0)`;
|
|
1630
1630
|
}
|
|
1631
1631
|
case "lengthEq": {
|
|
1632
|
-
return
|
|
1632
|
+
return chunkX2XOQZT3_cjs.sql`${dialect.jsonArrayLength(field)} = ${expr.length}`;
|
|
1633
1633
|
}
|
|
1634
1634
|
case "lengthGt": {
|
|
1635
|
-
return
|
|
1635
|
+
return chunkX2XOQZT3_cjs.sql`${dialect.jsonArrayLength(field)} > ${expr.length}`;
|
|
1636
1636
|
}
|
|
1637
1637
|
case "lengthGte": {
|
|
1638
|
-
return
|
|
1638
|
+
return chunkX2XOQZT3_cjs.sql`${dialect.jsonArrayLength(field)} >= ${expr.length}`;
|
|
1639
1639
|
}
|
|
1640
1640
|
case "lengthLt": {
|
|
1641
|
-
return
|
|
1641
|
+
return chunkX2XOQZT3_cjs.sql`${dialect.jsonArrayLength(field)} < ${expr.length}`;
|
|
1642
1642
|
}
|
|
1643
1643
|
case "lengthLte": {
|
|
1644
|
-
return
|
|
1644
|
+
return chunkX2XOQZT3_cjs.sql`${dialect.jsonArrayLength(field)} <= ${expr.length}`;
|
|
1645
1645
|
}
|
|
1646
1646
|
case "contains": {
|
|
1647
1647
|
const value = values[0];
|
|
1648
1648
|
if (value === void 0) {
|
|
1649
|
-
return
|
|
1649
|
+
return chunkX2XOQZT3_cjs.sql.raw("1=0");
|
|
1650
1650
|
}
|
|
1651
1651
|
return dialect.jsonArrayContains(field, value);
|
|
1652
1652
|
}
|
|
@@ -1669,13 +1669,13 @@ function compileObjectPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1669
1669
|
}
|
|
1670
1670
|
case "pathEquals": {
|
|
1671
1671
|
if (!expr.value) {
|
|
1672
|
-
throw new
|
|
1672
|
+
throw new chunkKTBTSHU6_cjs.UnsupportedPredicateError(
|
|
1673
1673
|
"pathEquals requires a comparison value"
|
|
1674
1674
|
);
|
|
1675
1675
|
}
|
|
1676
1676
|
const valueType = resolvePredicateValueType(expr.valueType, expr.value);
|
|
1677
1677
|
if (valueType === "array" || valueType === "object") {
|
|
1678
|
-
throw new
|
|
1678
|
+
throw new chunkKTBTSHU6_cjs.UnsupportedPredicateError(
|
|
1679
1679
|
"pathEquals is not supported for JSON arrays or objects"
|
|
1680
1680
|
);
|
|
1681
1681
|
}
|
|
@@ -1687,11 +1687,11 @@ function compileObjectPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1687
1687
|
pointer,
|
|
1688
1688
|
cteColumnPrefix
|
|
1689
1689
|
);
|
|
1690
|
-
return
|
|
1690
|
+
return chunkX2XOQZT3_cjs.sql`${left} = ${convertValueForSql(expr.value.value, dialect)}`;
|
|
1691
1691
|
}
|
|
1692
1692
|
case "pathContains": {
|
|
1693
1693
|
if (!expr.value) {
|
|
1694
|
-
throw new
|
|
1694
|
+
throw new chunkKTBTSHU6_cjs.UnsupportedPredicateError(
|
|
1695
1695
|
"pathContains requires a comparison value"
|
|
1696
1696
|
);
|
|
1697
1697
|
}
|
|
@@ -1719,12 +1719,12 @@ function compileAggregatePredicate(expr, dialect) {
|
|
|
1719
1719
|
const aggregate = compileAggregateExpr(expr.aggregate, dialect);
|
|
1720
1720
|
const op = COMPARISON_OP_SQL[expr.op];
|
|
1721
1721
|
if (!op) {
|
|
1722
|
-
throw new
|
|
1722
|
+
throw new chunkKTBTSHU6_cjs.UnsupportedPredicateError(
|
|
1723
1723
|
`Comparison operation "${expr.op}" is not supported for aggregate predicates`
|
|
1724
1724
|
);
|
|
1725
1725
|
}
|
|
1726
1726
|
const convertedValue = convertValueForSql(expr.value.value, dialect);
|
|
1727
|
-
return
|
|
1727
|
+
return chunkX2XOQZT3_cjs.sql`${aggregate} ${chunkX2XOQZT3_cjs.sql.raw(op)} ${convertedValue}`;
|
|
1728
1728
|
}
|
|
1729
1729
|
function compileAggregateExpr(expr, dialect) {
|
|
1730
1730
|
const cteAlias = `cte_${expr.field.alias}`;
|
|
@@ -1736,25 +1736,25 @@ function compileAggregateExpr(expr, dialect) {
|
|
|
1736
1736
|
);
|
|
1737
1737
|
switch (expr.function) {
|
|
1738
1738
|
case "count": {
|
|
1739
|
-
return
|
|
1739
|
+
return chunkX2XOQZT3_cjs.sql`COUNT(${field})`;
|
|
1740
1740
|
}
|
|
1741
1741
|
case "countDistinct": {
|
|
1742
|
-
return
|
|
1742
|
+
return chunkX2XOQZT3_cjs.sql`COUNT(DISTINCT ${field})`;
|
|
1743
1743
|
}
|
|
1744
1744
|
case "sum": {
|
|
1745
|
-
return
|
|
1745
|
+
return chunkX2XOQZT3_cjs.sql`SUM(${field})`;
|
|
1746
1746
|
}
|
|
1747
1747
|
case "avg": {
|
|
1748
|
-
return
|
|
1748
|
+
return chunkX2XOQZT3_cjs.sql`AVG(${field})`;
|
|
1749
1749
|
}
|
|
1750
1750
|
case "min": {
|
|
1751
|
-
return
|
|
1751
|
+
return chunkX2XOQZT3_cjs.sql`MIN(${field})`;
|
|
1752
1752
|
}
|
|
1753
1753
|
case "max": {
|
|
1754
|
-
return
|
|
1754
|
+
return chunkX2XOQZT3_cjs.sql`MAX(${field})`;
|
|
1755
1755
|
}
|
|
1756
1756
|
default: {
|
|
1757
|
-
throw new
|
|
1757
|
+
throw new chunkKTBTSHU6_cjs.UnsupportedPredicateError(
|
|
1758
1758
|
`Unknown aggregate function: ${expr.function}`
|
|
1759
1759
|
);
|
|
1760
1760
|
}
|
|
@@ -1762,15 +1762,15 @@ function compileAggregateExpr(expr, dialect) {
|
|
|
1762
1762
|
}
|
|
1763
1763
|
function compileExistsSubquery(expr, ctx) {
|
|
1764
1764
|
if (expr.subquery.graphId === void 0) {
|
|
1765
|
-
throw new
|
|
1765
|
+
throw new chunkKTBTSHU6_cjs.UnsupportedPredicateError("EXISTS subquery must have a graphId");
|
|
1766
1766
|
}
|
|
1767
1767
|
const subSql = ctx.compileQuery(expr.subquery, expr.subquery.graphId);
|
|
1768
|
-
return expr.negated ?
|
|
1768
|
+
return expr.negated ? chunkX2XOQZT3_cjs.sql`NOT EXISTS (${subSql})` : chunkX2XOQZT3_cjs.sql`EXISTS (${subSql})`;
|
|
1769
1769
|
}
|
|
1770
1770
|
function compileInSubquery(expr, ctx) {
|
|
1771
1771
|
const subqueryColumnCount = getSubqueryColumnCount(expr.subquery);
|
|
1772
1772
|
if (subqueryColumnCount !== 1) {
|
|
1773
|
-
throw new
|
|
1773
|
+
throw new chunkKTBTSHU6_cjs.UnsupportedPredicateError(
|
|
1774
1774
|
`IN/NOT IN subquery must project exactly 1 column, but got ${subqueryColumnCount}`,
|
|
1775
1775
|
{ subqueryColumnCount }
|
|
1776
1776
|
);
|
|
@@ -1779,13 +1779,13 @@ function compileInSubquery(expr, ctx) {
|
|
|
1779
1779
|
const subqueryValueType = getSingleSubqueryColumnValueType(expr.subquery);
|
|
1780
1780
|
const resolvedValueType = fieldValueType ?? subqueryValueType;
|
|
1781
1781
|
if (isUnsupportedInSubqueryValueType(resolvedValueType)) {
|
|
1782
|
-
throw new
|
|
1782
|
+
throw new chunkKTBTSHU6_cjs.UnsupportedPredicateError(
|
|
1783
1783
|
`IN/NOT IN subquery does not support ${String(resolvedValueType)} values`,
|
|
1784
1784
|
{ valueType: resolvedValueType }
|
|
1785
1785
|
);
|
|
1786
1786
|
}
|
|
1787
1787
|
if (!isInSubqueryTypeCompatible(fieldValueType, subqueryValueType)) {
|
|
1788
|
-
throw new
|
|
1788
|
+
throw new chunkKTBTSHU6_cjs.UnsupportedPredicateError(
|
|
1789
1789
|
`IN/NOT IN type mismatch: field type "${String(fieldValueType)}" does not match subquery column type "${String(subqueryValueType)}"`,
|
|
1790
1790
|
{
|
|
1791
1791
|
fieldValueType,
|
|
@@ -1795,7 +1795,7 @@ function compileInSubquery(expr, ctx) {
|
|
|
1795
1795
|
}
|
|
1796
1796
|
const valueType = fieldValueType ?? subqueryValueType;
|
|
1797
1797
|
if (expr.subquery.graphId === void 0) {
|
|
1798
|
-
throw new
|
|
1798
|
+
throw new chunkKTBTSHU6_cjs.UnsupportedPredicateError(
|
|
1799
1799
|
"IN/NOT IN subquery must have a graphId"
|
|
1800
1800
|
);
|
|
1801
1801
|
}
|
|
@@ -1808,14 +1808,14 @@ function compileInSubquery(expr, ctx) {
|
|
|
1808
1808
|
ctx.cteColumnPrefix
|
|
1809
1809
|
);
|
|
1810
1810
|
const subSql = ctx.compileQuery(expr.subquery, expr.subquery.graphId);
|
|
1811
|
-
return expr.negated ?
|
|
1811
|
+
return expr.negated ? chunkX2XOQZT3_cjs.sql`${fieldSql} NOT IN (${subSql})` : chunkX2XOQZT3_cjs.sql`${fieldSql} IN (${subSql})`;
|
|
1812
1812
|
}
|
|
1813
1813
|
function extractStructuralPredicates(predicates, isMatch, rejectionMessage) {
|
|
1814
1814
|
const results = [];
|
|
1815
1815
|
function visit(expr, inDisallowedBranch) {
|
|
1816
1816
|
if (isMatch(expr)) {
|
|
1817
1817
|
if (inDisallowedBranch) {
|
|
1818
|
-
throw new
|
|
1818
|
+
throw new chunkKTBTSHU6_cjs.UnsupportedPredicateError(rejectionMessage);
|
|
1819
1819
|
}
|
|
1820
1820
|
results.push(expr);
|
|
1821
1821
|
return;
|
|
@@ -1869,9 +1869,9 @@ function extractFulltextMatchPredicates(predicates) {
|
|
|
1869
1869
|
// src/query/compiler/predicate-utils.ts
|
|
1870
1870
|
var EMPTY_PREDICATES = [];
|
|
1871
1871
|
function sqlValueList(values) {
|
|
1872
|
-
return
|
|
1873
|
-
values.map((value) =>
|
|
1874
|
-
|
|
1872
|
+
return chunkX2XOQZT3_cjs.sql.join(
|
|
1873
|
+
values.map((value) => chunkX2XOQZT3_cjs.sql`${value}`),
|
|
1874
|
+
chunkX2XOQZT3_cjs.sql`, `
|
|
1875
1875
|
);
|
|
1876
1876
|
}
|
|
1877
1877
|
function buildPredicateIndexKey(alias, targetType) {
|
|
@@ -1908,12 +1908,12 @@ function compilePredicateClauses(predicates, predicateContext) {
|
|
|
1908
1908
|
}
|
|
1909
1909
|
function compileKindFilter(column, kinds) {
|
|
1910
1910
|
if (kinds.length === 0) {
|
|
1911
|
-
return
|
|
1911
|
+
return chunkX2XOQZT3_cjs.sql`1 = 0`;
|
|
1912
1912
|
}
|
|
1913
1913
|
if (kinds.length === 1) {
|
|
1914
|
-
return
|
|
1914
|
+
return chunkX2XOQZT3_cjs.sql`${column} = ${kinds[0]}`;
|
|
1915
1915
|
}
|
|
1916
|
-
return
|
|
1916
|
+
return chunkX2XOQZT3_cjs.sql`${column} IN (${sqlValueList(kinds)})`;
|
|
1917
1917
|
}
|
|
1918
1918
|
function getNodeKindsForAlias(ast, alias) {
|
|
1919
1919
|
if (alias === ast.start.alias) {
|
|
@@ -1924,7 +1924,7 @@ function getNodeKindsForAlias(ast, alias) {
|
|
|
1924
1924
|
return traversal.nodeKinds;
|
|
1925
1925
|
}
|
|
1926
1926
|
}
|
|
1927
|
-
throw new
|
|
1927
|
+
throw new chunkKTBTSHU6_cjs.CompilerInvariantError(`Unknown traversal source alias: ${alias}`);
|
|
1928
1928
|
}
|
|
1929
1929
|
function getHybridTargetAlias(vectorPredicate, fulltextPredicate) {
|
|
1930
1930
|
if (!vectorPredicate || !fulltextPredicate) return void 0;
|
|
@@ -2009,13 +2009,13 @@ var RECORDED_EDGE_COLUMNS = [
|
|
|
2009
2009
|
"tx_id",
|
|
2010
2010
|
"meta"
|
|
2011
2011
|
];
|
|
2012
|
-
var RECORDED_NODE_COLUMN_LIST =
|
|
2013
|
-
var RECORDED_EDGE_COLUMN_LIST =
|
|
2012
|
+
var RECORDED_NODE_COLUMN_LIST = chunkX2XOQZT3_cjs.sql.raw(RECORDED_NODE_COLUMNS.join(", "));
|
|
2013
|
+
var RECORDED_EDGE_COLUMN_LIST = chunkX2XOQZT3_cjs.sql.raw(RECORDED_EDGE_COLUMNS.join(", "));
|
|
2014
2014
|
var RECORDED_BIND_PARAM_BUDGET = 900;
|
|
2015
2015
|
function recordedBindParamBudget(target) {
|
|
2016
2016
|
const budget = target.capabilities.maxBindParameters ?? RECORDED_BIND_PARAM_BUDGET;
|
|
2017
2017
|
if (!Number.isSafeInteger(budget) || budget < 1) {
|
|
2018
|
-
throw new
|
|
2018
|
+
throw new chunkKTBTSHU6_cjs.ConfigurationError(
|
|
2019
2019
|
`backend capabilities.maxBindParameters must be a positive integer, got: ${String(budget)}`,
|
|
2020
2020
|
{
|
|
2021
2021
|
code: "INVALID_BACKEND_CAPABILITY",
|
|
@@ -2031,44 +2031,44 @@ function recordedChunkSize(target, columnCount) {
|
|
|
2031
2031
|
return Math.max(1, Math.floor(budget / columnCount));
|
|
2032
2032
|
}
|
|
2033
2033
|
function sqlNull(value) {
|
|
2034
|
-
return value === void 0 ?
|
|
2034
|
+
return value === void 0 ? chunkX2XOQZT3_cjs.sql.raw("NULL") : chunkX2XOQZT3_cjs.sql`${value}`;
|
|
2035
2035
|
}
|
|
2036
2036
|
function recordedCommonCells() {
|
|
2037
2037
|
return {
|
|
2038
|
-
history_id: () =>
|
|
2039
|
-
graph_id: (row) =>
|
|
2040
|
-
id: (row) =>
|
|
2041
|
-
kind: (row) =>
|
|
2042
|
-
props: (row) =>
|
|
2043
|
-
valid_from: (row) =>
|
|
2044
|
-
valid_to: (row) =>
|
|
2045
|
-
created_at: (row) =>
|
|
2046
|
-
updated_at: (row) =>
|
|
2047
|
-
deleted_at: (row) =>
|
|
2048
|
-
recorded_from: (_row, recordedRevision) =>
|
|
2049
|
-
recorded_to: () =>
|
|
2050
|
-
op: (_row, _recordedCommit, operation) =>
|
|
2051
|
-
schema_version: () =>
|
|
2052
|
-
tx_id: () =>
|
|
2053
|
-
meta: () =>
|
|
2038
|
+
history_id: () => chunkX2XOQZT3_cjs.sql`${generateId()}`,
|
|
2039
|
+
graph_id: (row) => chunkX2XOQZT3_cjs.sql`${row.graph_id}`,
|
|
2040
|
+
id: (row) => chunkX2XOQZT3_cjs.sql`${row.id}`,
|
|
2041
|
+
kind: (row) => chunkX2XOQZT3_cjs.sql`${row.kind}`,
|
|
2042
|
+
props: (row) => chunkX2XOQZT3_cjs.sql`${chunkECU53PMN_cjs.rowPropsToJsonText(row.props)}`,
|
|
2043
|
+
valid_from: (row) => chunkX2XOQZT3_cjs.sql`${sqlNull(row.valid_from)}`,
|
|
2044
|
+
valid_to: (row) => chunkX2XOQZT3_cjs.sql`${sqlNull(row.valid_to)}`,
|
|
2045
|
+
created_at: (row) => chunkX2XOQZT3_cjs.sql`${row.created_at}`,
|
|
2046
|
+
updated_at: (row) => chunkX2XOQZT3_cjs.sql`${row.updated_at}`,
|
|
2047
|
+
deleted_at: (row) => chunkX2XOQZT3_cjs.sql`${sqlNull(row.deleted_at)}`,
|
|
2048
|
+
recorded_from: (_row, recordedRevision) => chunkX2XOQZT3_cjs.sql`${recordedRevision}`,
|
|
2049
|
+
recorded_to: () => chunkX2XOQZT3_cjs.sql`${chunkFSCJOTHF_cjs.RECORDED_MAX_REVISION}`,
|
|
2050
|
+
op: (_row, _recordedCommit, operation) => chunkX2XOQZT3_cjs.sql`${operation}`,
|
|
2051
|
+
schema_version: () => chunkX2XOQZT3_cjs.sql`NULL`,
|
|
2052
|
+
tx_id: () => chunkX2XOQZT3_cjs.sql`NULL`,
|
|
2053
|
+
meta: () => chunkX2XOQZT3_cjs.sql`${RECORDED_HISTORY_META}`
|
|
2054
2054
|
};
|
|
2055
2055
|
}
|
|
2056
2056
|
var recordedNodeCells = {
|
|
2057
2057
|
...recordedCommonCells(),
|
|
2058
|
-
version: (row) =>
|
|
2058
|
+
version: (row) => chunkX2XOQZT3_cjs.sql`${row.version}`
|
|
2059
2059
|
};
|
|
2060
2060
|
var recordedEdgeCells = {
|
|
2061
2061
|
...recordedCommonCells(),
|
|
2062
|
-
from_kind: (row) =>
|
|
2063
|
-
from_id: (row) =>
|
|
2064
|
-
to_kind: (row) =>
|
|
2065
|
-
to_id: (row) =>
|
|
2062
|
+
from_kind: (row) => chunkX2XOQZT3_cjs.sql`${row.from_kind}`,
|
|
2063
|
+
from_id: (row) => chunkX2XOQZT3_cjs.sql`${row.from_id}`,
|
|
2064
|
+
to_kind: (row) => chunkX2XOQZT3_cjs.sql`${row.to_kind}`,
|
|
2065
|
+
to_id: (row) => chunkX2XOQZT3_cjs.sql`${row.to_id}`
|
|
2066
2066
|
};
|
|
2067
2067
|
function recordedValuesTuple(columns, cells, row, recordedRevision, operation) {
|
|
2068
2068
|
const tuple = columns.map(
|
|
2069
2069
|
(column) => cells[column](row, recordedRevision, operation)
|
|
2070
2070
|
);
|
|
2071
|
-
return
|
|
2071
|
+
return chunkX2XOQZT3_cjs.sql`(${chunkX2XOQZT3_cjs.sql.join(tuple, chunkX2XOQZT3_cjs.sql`, `)})`;
|
|
2072
2072
|
}
|
|
2073
2073
|
async function insertRecordedRows(target, table, columnList, columns, cells, inserts, recordedRevision) {
|
|
2074
2074
|
if (inserts.length === 0) return;
|
|
@@ -2083,9 +2083,9 @@ async function insertRecordedRows(target, table, columnList, columns, cells, ins
|
|
|
2083
2083
|
);
|
|
2084
2084
|
await executeStatement(
|
|
2085
2085
|
target,
|
|
2086
|
-
|
|
2086
|
+
chunkX2XOQZT3_cjs.sql`
|
|
2087
2087
|
INSERT INTO ${table} (${columnList})
|
|
2088
|
-
VALUES ${
|
|
2088
|
+
VALUES ${chunkX2XOQZT3_cjs.sql.join(values, chunkX2XOQZT3_cjs.sql`, `)}
|
|
2089
2089
|
`
|
|
2090
2090
|
);
|
|
2091
2091
|
}
|
|
@@ -2130,14 +2130,14 @@ function entityKey(entity) {
|
|
|
2130
2130
|
}
|
|
2131
2131
|
}
|
|
2132
2132
|
async function closeOpenReturning(target, table, graphId, ids, recordedRevision, kind) {
|
|
2133
|
-
const kindFilter = kind === void 0 ?
|
|
2133
|
+
const kindFilter = kind === void 0 ? chunkX2XOQZT3_cjs.sql`` : chunkX2XOQZT3_cjs.sql`AND kind = ${kind}`;
|
|
2134
2134
|
const rows = await target.execute(
|
|
2135
|
-
|
|
2135
|
+
chunkX2XOQZT3_cjs.asCompiledRowsSql(chunkX2XOQZT3_cjs.sql`
|
|
2136
2136
|
UPDATE ${table}
|
|
2137
2137
|
SET recorded_to = ${recordedRevision}
|
|
2138
2138
|
WHERE graph_id = ${graphId}
|
|
2139
2139
|
${kindFilter}
|
|
2140
|
-
AND recorded_to = ${
|
|
2140
|
+
AND recorded_to = ${chunkFSCJOTHF_cjs.RECORDED_MAX_REVISION}
|
|
2141
2141
|
AND id IN (${sqlValueList(ids)})
|
|
2142
2142
|
RETURNING id, deleted_at
|
|
2143
2143
|
`)
|
|
@@ -2231,24 +2231,24 @@ async function flushEdges(target, schema, graphId, entities, recordedRevision) {
|
|
|
2231
2231
|
async function closeOpenByKind(target, table, graphId, kind, recordedRevision) {
|
|
2232
2232
|
await executeStatement(
|
|
2233
2233
|
target,
|
|
2234
|
-
|
|
2234
|
+
chunkX2XOQZT3_cjs.sql`
|
|
2235
2235
|
UPDATE ${table}
|
|
2236
2236
|
SET recorded_to = ${recordedRevision}
|
|
2237
2237
|
WHERE graph_id = ${graphId}
|
|
2238
2238
|
AND kind = ${kind}
|
|
2239
|
-
AND recorded_to = ${
|
|
2239
|
+
AND recorded_to = ${chunkFSCJOTHF_cjs.RECORDED_MAX_REVISION}
|
|
2240
2240
|
`
|
|
2241
2241
|
);
|
|
2242
2242
|
}
|
|
2243
2243
|
async function closeOpenEdgesByNodeKind(target, schema, graphId, nodeKind, recordedRevision) {
|
|
2244
2244
|
await executeStatement(
|
|
2245
2245
|
target,
|
|
2246
|
-
|
|
2246
|
+
chunkX2XOQZT3_cjs.sql`
|
|
2247
2247
|
UPDATE ${schema.recordedEdgesTable}
|
|
2248
2248
|
SET recorded_to = ${recordedRevision}
|
|
2249
2249
|
WHERE graph_id = ${graphId}
|
|
2250
2250
|
AND (from_kind = ${nodeKind} OR to_kind = ${nodeKind})
|
|
2251
|
-
AND recorded_to = ${
|
|
2251
|
+
AND recorded_to = ${chunkFSCJOTHF_cjs.RECORDED_MAX_REVISION}
|
|
2252
2252
|
`
|
|
2253
2253
|
);
|
|
2254
2254
|
}
|
|
@@ -2286,7 +2286,7 @@ async function closeRecordedHardDeletedKind(target, schema, graphId, removal, ow
|
|
|
2286
2286
|
}
|
|
2287
2287
|
async function queryConnectedEdgeIds(target, schema, params) {
|
|
2288
2288
|
const rows = await target.execute(
|
|
2289
|
-
|
|
2289
|
+
chunkX2XOQZT3_cjs.asCompiledRowsSql(chunkX2XOQZT3_cjs.sql`
|
|
2290
2290
|
SELECT id
|
|
2291
2291
|
FROM ${schema.edgesTable}
|
|
2292
2292
|
WHERE graph_id = ${params.graphId}
|
|
@@ -2307,9 +2307,9 @@ function normalizedColumnType(value) {
|
|
|
2307
2307
|
}
|
|
2308
2308
|
async function readColumnTypes(backend, table) {
|
|
2309
2309
|
const rows = backend.dialect === "sqlite" ? await backend.execute(
|
|
2310
|
-
|
|
2310
|
+
chunkX2XOQZT3_cjs.asCompiledRowsSql(chunkX2XOQZT3_cjs.sql`PRAGMA table_info(${chunkX2XOQZT3_cjs.sql.identifier(table)})`)
|
|
2311
2311
|
) : await backend.execute(
|
|
2312
|
-
|
|
2312
|
+
chunkX2XOQZT3_cjs.asCompiledRowsSql(chunkX2XOQZT3_cjs.sql`
|
|
2313
2313
|
SELECT column_name AS name, data_type AS type
|
|
2314
2314
|
FROM information_schema.columns
|
|
2315
2315
|
WHERE table_schema = current_schema()
|
|
@@ -2384,7 +2384,7 @@ async function assertCurrentRecordedSchema(backend, schema) {
|
|
|
2384
2384
|
return [{ ...requirement, actual: actual ?? "missing" }];
|
|
2385
2385
|
});
|
|
2386
2386
|
if (incompatible.length === 0) return;
|
|
2387
|
-
throw new
|
|
2387
|
+
throw new chunkKTBTSHU6_cjs.ConfigurationError(
|
|
2388
2388
|
"Recorded-time schema is incompatible with history capture.",
|
|
2389
2389
|
{
|
|
2390
2390
|
code: "RECORDED_SCHEMA_INCOMPATIBLE",
|
|
@@ -2432,7 +2432,7 @@ function edgeRowIdentityKey(row) {
|
|
|
2432
2432
|
return edgeIdentityKey(row.graph_id, row.id);
|
|
2433
2433
|
}
|
|
2434
2434
|
function recordedCaptureSealedError(details) {
|
|
2435
|
-
return new
|
|
2435
|
+
return new chunkKTBTSHU6_cjs.ConfigurationError(
|
|
2436
2436
|
"Recorded-time capture session is sealed: a graph write happened after the transaction's capture was flushed.",
|
|
2437
2437
|
details,
|
|
2438
2438
|
{
|
|
@@ -2465,7 +2465,7 @@ function createRecordedCaptureSession() {
|
|
|
2465
2465
|
},
|
|
2466
2466
|
async flush(target, schema, ownsWriteLock) {
|
|
2467
2467
|
if (sealed) {
|
|
2468
|
-
throw new
|
|
2468
|
+
throw new chunkKTBTSHU6_cjs.ConfigurationError(
|
|
2469
2469
|
"Recorded-time capture session was already flushed.",
|
|
2470
2470
|
{},
|
|
2471
2471
|
{
|
|
@@ -2526,7 +2526,7 @@ function createRecordedTransactionBackend(target, session, schema) {
|
|
|
2526
2526
|
await lockRecordedGraphWrite(target, graphId, graphLocks);
|
|
2527
2527
|
}
|
|
2528
2528
|
}
|
|
2529
|
-
const overlay =
|
|
2529
|
+
const overlay = chunkECU53PMN_cjs.createBackendOverlay(target, {
|
|
2530
2530
|
...rawWriteGuards(target, "tx.backend"),
|
|
2531
2531
|
async insertNode(params) {
|
|
2532
2532
|
session.assertOpen();
|
|
@@ -2692,7 +2692,7 @@ function createRecordedTransactionScope(target, schema, ownsWriteLock = false) {
|
|
|
2692
2692
|
return {
|
|
2693
2693
|
backend: createRecordedTransactionBackend(target, session, resolvedSchema),
|
|
2694
2694
|
async flush() {
|
|
2695
|
-
return
|
|
2695
|
+
return chunkAO2WPYFZ_cjs.withRecordedRelationsPrecondition(
|
|
2696
2696
|
session.flush(target, resolvedSchema, ownsWriteLock),
|
|
2697
2697
|
{ dialect: target.dialect, surface: "capture-flush" }
|
|
2698
2698
|
);
|
|
@@ -2713,7 +2713,7 @@ function createRecordedBackend(backend, schema) {
|
|
|
2713
2713
|
assertCapturableBackend(backend);
|
|
2714
2714
|
const capture = (fn) => runCapturedAutocommit(backend, schema, fn);
|
|
2715
2715
|
const projectedBackend = createGraphBackendProjection(backend);
|
|
2716
|
-
return
|
|
2716
|
+
return chunkECU53PMN_cjs.createBackendOverlay(projectedBackend, {
|
|
2717
2717
|
...rawWriteGuards(backend, "backend"),
|
|
2718
2718
|
async insertNode(params) {
|
|
2719
2719
|
return capture((target) => target.insertNode(params));
|
|
@@ -3132,7 +3132,7 @@ function checkCardinality(edgeKind, fromKind, fromId, cardinality, existingEdgeC
|
|
|
3132
3132
|
}
|
|
3133
3133
|
case "one": {
|
|
3134
3134
|
if (existingEdgeCount > 0) {
|
|
3135
|
-
return new
|
|
3135
|
+
return new chunkKTBTSHU6_cjs.CardinalityError({
|
|
3136
3136
|
edgeKind,
|
|
3137
3137
|
fromKind,
|
|
3138
3138
|
fromId,
|
|
@@ -3147,7 +3147,7 @@ function checkCardinality(edgeKind, fromKind, fromId, cardinality, existingEdgeC
|
|
|
3147
3147
|
}
|
|
3148
3148
|
case "oneActive": {
|
|
3149
3149
|
if (hasActiveEdge) {
|
|
3150
|
-
return new
|
|
3150
|
+
return new chunkKTBTSHU6_cjs.CardinalityError({
|
|
3151
3151
|
edgeKind,
|
|
3152
3152
|
fromKind,
|
|
3153
3153
|
fromId,
|
|
@@ -3161,7 +3161,7 @@ function checkCardinality(edgeKind, fromKind, fromId, cardinality, existingEdgeC
|
|
|
3161
3161
|
}
|
|
3162
3162
|
function checkUniqueEdge(edgeKind, fromKind, fromId, _toKind, _toId, existingCount) {
|
|
3163
3163
|
if (existingCount > 0) {
|
|
3164
|
-
return new
|
|
3164
|
+
return new chunkKTBTSHU6_cjs.CardinalityError({
|
|
3165
3165
|
edgeKind,
|
|
3166
3166
|
fromKind,
|
|
3167
3167
|
fromId,
|
|
@@ -3174,7 +3174,7 @@ function checkUniqueEdge(edgeKind, fromKind, fromId, _toKind, _toId, existingCou
|
|
|
3174
3174
|
function validateEdgeEndpoints(edgeKind, fromKind, toKind, registration, registry) {
|
|
3175
3175
|
const validFromKinds = registration.from.map((node) => node.kind);
|
|
3176
3176
|
if (!registry.isAssignableToAny(fromKind, validFromKinds)) {
|
|
3177
|
-
return new
|
|
3177
|
+
return new chunkKTBTSHU6_cjs.EndpointError({
|
|
3178
3178
|
edgeKind,
|
|
3179
3179
|
endpoint: "from",
|
|
3180
3180
|
actualKind: fromKind,
|
|
@@ -3183,7 +3183,7 @@ function validateEdgeEndpoints(edgeKind, fromKind, toKind, registration, registr
|
|
|
3183
3183
|
}
|
|
3184
3184
|
const validToKinds = registration.to.map((node) => node.kind);
|
|
3185
3185
|
if (!registry.isAssignableToAny(toKind, validToKinds)) {
|
|
3186
|
-
return new
|
|
3186
|
+
return new chunkKTBTSHU6_cjs.EndpointError({
|
|
3187
3187
|
edgeKind,
|
|
3188
3188
|
endpoint: "to",
|
|
3189
3189
|
actualKind: toKind,
|
|
@@ -3195,7 +3195,7 @@ function validateEdgeEndpoints(edgeKind, fromKind, toKind, registration, registr
|
|
|
3195
3195
|
function checkDisjointness(nodeId, nodeKind, existingKinds, registry) {
|
|
3196
3196
|
for (const existingKind of existingKinds) {
|
|
3197
3197
|
if (registry.areDisjoint(nodeKind, existingKind)) {
|
|
3198
|
-
return new
|
|
3198
|
+
return new chunkKTBTSHU6_cjs.DisjointError({
|
|
3199
3199
|
nodeId,
|
|
3200
3200
|
attemptedKind: nodeKind,
|
|
3201
3201
|
conflictingKind: existingKind
|
|
@@ -3232,7 +3232,7 @@ async function checkUniquenessConstraints(ctx, kind, id, props, constraints) {
|
|
|
3232
3232
|
key
|
|
3233
3233
|
});
|
|
3234
3234
|
if (existing && existing.node_id !== id) {
|
|
3235
|
-
throw new
|
|
3235
|
+
throw new chunkKTBTSHU6_cjs.UniquenessError({
|
|
3236
3236
|
constraintName: constraint.name,
|
|
3237
3237
|
kind: kindToCheck,
|
|
3238
3238
|
existingId: existing.node_id,
|
|
@@ -3338,7 +3338,7 @@ async function updateUniquenessEntries(ctx, kind, id, oldProps, newProps, constr
|
|
|
3338
3338
|
key: newKey
|
|
3339
3339
|
});
|
|
3340
3340
|
if (existing && existing.node_id !== id) {
|
|
3341
|
-
throw new
|
|
3341
|
+
throw new chunkKTBTSHU6_cjs.UniquenessError({
|
|
3342
3342
|
constraintName: constraint.name,
|
|
3343
3343
|
kind: kindToCheck,
|
|
3344
3344
|
existingId: existing.node_id,
|
|
@@ -3395,7 +3395,7 @@ async function enforceNodeDeleteBehavior(ctx, args, backend, policy) {
|
|
|
3395
3395
|
if (connectedEdges.length === 0) return;
|
|
3396
3396
|
switch (behavior) {
|
|
3397
3397
|
case "restrict": {
|
|
3398
|
-
throw new
|
|
3398
|
+
throw new chunkKTBTSHU6_cjs.RestrictedDeleteError({
|
|
3399
3399
|
nodeKind: args.kind,
|
|
3400
3400
|
nodeId: args.id,
|
|
3401
3401
|
edgeCount: connectedEdges.length,
|
|
@@ -3468,7 +3468,7 @@ async function applyNodeInsertSideEffectsBatch(ctx, items, backend) {
|
|
|
3468
3468
|
);
|
|
3469
3469
|
}
|
|
3470
3470
|
function parseRowProps(row) {
|
|
3471
|
-
return
|
|
3471
|
+
return chunkECU53PMN_cjs.rowPropsToObject(row.props);
|
|
3472
3472
|
}
|
|
3473
3473
|
async function applyNodeUpdate(ctx, args, backend) {
|
|
3474
3474
|
const { kind, id } = args.existing;
|
|
@@ -3682,5 +3682,5 @@ exports.uncapturedGraphWriteLock = uncapturedGraphWriteLock;
|
|
|
3682
3682
|
exports.validateEdgeEndpoints = validateEdgeEndpoints;
|
|
3683
3683
|
exports.withPinnedReadInstant = withPinnedReadInstant;
|
|
3684
3684
|
exports.withRecordedFlushObserver = withRecordedFlushObserver;
|
|
3685
|
-
//# sourceMappingURL=chunk-
|
|
3686
|
-
//# sourceMappingURL=chunk-
|
|
3685
|
+
//# sourceMappingURL=chunk-2SO5I5AI.cjs.map
|
|
3686
|
+
//# sourceMappingURL=chunk-2SO5I5AI.cjs.map
|