@nicia-ai/typegraph 0.43.0 → 0.45.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 -1
- package/dist/backend/drizzle/indexes.d.ts +1 -1
- package/dist/backend/drizzle/indexes.js +5 -5
- package/dist/backend/index.cjs +50 -50
- package/dist/backend/index.d.cts +3 -3
- package/dist/backend/index.d.ts +3 -3
- package/dist/backend/index.js +11 -11
- package/dist/backend/postgres/index.cjs +26 -26
- package/dist/backend/postgres/index.d.cts +6 -5
- package/dist/backend/postgres/index.d.ts +6 -5
- package/dist/backend/postgres/index.js +13 -13
- package/dist/backend/postgres/pglite-store.cjs +32 -33
- package/dist/backend/postgres/pglite-store.cjs.map +1 -1
- package/dist/backend/postgres/pglite-store.d.cts +7 -7
- package/dist/backend/postgres/pglite-store.d.ts +7 -7
- package/dist/backend/postgres/pglite-store.js +28 -29
- package/dist/backend/postgres/pglite-store.js.map +1 -1
- package/dist/backend/postgres/pglite.cjs +15 -15
- package/dist/backend/postgres/pglite.d.cts +3 -2
- package/dist/backend/postgres/pglite.d.ts +3 -2
- package/dist/backend/postgres/pglite.js +14 -14
- package/dist/backend/sqlite/index.cjs +23 -23
- package/dist/backend/sqlite/index.d.cts +7 -6
- package/dist/backend/sqlite/index.d.ts +7 -6
- package/dist/backend/sqlite/index.js +11 -11
- package/dist/backend/sqlite/libsql.cjs +17 -17
- package/dist/backend/sqlite/libsql.cjs.map +1 -1
- package/dist/backend/sqlite/libsql.d.cts +3 -2
- package/dist/backend/sqlite/libsql.d.ts +3 -2
- package/dist/backend/sqlite/libsql.js +13 -13
- package/dist/backend/sqlite/libsql.js.map +1 -1
- package/dist/backend/sqlite/local-store.cjs +33 -34
- package/dist/backend/sqlite/local-store.cjs.map +1 -1
- package/dist/backend/sqlite/local-store.d.cts +8 -7
- package/dist/backend/sqlite/local-store.d.ts +8 -7
- package/dist/backend/sqlite/local-store.js +29 -30
- package/dist/backend/sqlite/local-store.js.map +1 -1
- package/dist/backend/sqlite/local.cjs +16 -16
- package/dist/backend/sqlite/local.d.cts +3 -2
- package/dist/backend/sqlite/local.d.ts +3 -2
- package/dist/backend/sqlite/local.js +14 -14
- package/dist/{chunk-2OOY4OYT.js → chunk-2L54C2C2.js} +4 -4
- package/dist/{chunk-2OOY4OYT.js.map → chunk-2L54C2C2.js.map} +1 -1
- package/dist/{chunk-4WYFRACU.js → chunk-42PYUGLS.js} +58 -4
- package/dist/chunk-42PYUGLS.js.map +1 -0
- package/dist/{chunk-EQOQOT55.js → chunk-4GUBTVPV.js} +4 -5
- package/dist/chunk-4GUBTVPV.js.map +1 -0
- package/dist/{chunk-ZIRC2U6G.js → chunk-4GUTQPVO.js} +102 -16
- package/dist/chunk-4GUTQPVO.js.map +1 -0
- package/dist/{chunk-OYJSYDIH.js → chunk-4MB3AQAQ.js} +13 -3
- package/dist/chunk-4MB3AQAQ.js.map +1 -0
- package/dist/{chunk-5Q3P6OIC.cjs → chunk-4MEWSUVM.cjs} +12 -12
- package/dist/chunk-4MEWSUVM.cjs.map +1 -0
- package/dist/{chunk-VC26BUNP.js → chunk-4QIKLIGG.js} +17 -5
- package/dist/chunk-4QIKLIGG.js.map +1 -0
- package/dist/chunk-4SZ6XPTG.cjs +12 -0
- package/dist/{chunk-VGMNGWBR.cjs.map → chunk-4SZ6XPTG.cjs.map} +1 -1
- package/dist/{chunk-UZLEQFTV.js → chunk-55ITBQJI.js} +4 -4
- package/dist/chunk-55ITBQJI.js.map +1 -0
- package/dist/{chunk-JOYPNY33.js → chunk-5EKPX6QU.js} +9 -9
- package/dist/{chunk-JOYPNY33.js.map → chunk-5EKPX6QU.js.map} +1 -1
- package/dist/{chunk-TRC646QQ.cjs → chunk-5GAONX5G.cjs} +7 -7
- package/dist/{chunk-TRC646QQ.cjs.map → chunk-5GAONX5G.cjs.map} +1 -1
- package/dist/{chunk-M4GYQF2H.js → chunk-6DCB664D.js} +7 -4
- package/dist/chunk-6DCB664D.js.map +1 -0
- package/dist/{chunk-64LERBFM.cjs → chunk-6RYPD3NJ.cjs} +75 -65
- package/dist/chunk-6RYPD3NJ.cjs.map +1 -0
- package/dist/{chunk-5AERZSHC.cjs → chunk-7PF2L3H6.cjs} +4 -4
- package/dist/{chunk-5AERZSHC.cjs.map → chunk-7PF2L3H6.cjs.map} +1 -1
- package/dist/chunk-B3F2D3SP.cjs +12 -0
- package/dist/{chunk-U3YRCZ5L.cjs.map → chunk-B3F2D3SP.cjs.map} +1 -1
- package/dist/{chunk-Z3WIL6S3.js → chunk-BGYJW37L.js} +5 -5
- package/dist/{chunk-Z3WIL6S3.js.map → chunk-BGYJW37L.js.map} +1 -1
- package/dist/{chunk-DMZEVJGL.cjs → chunk-BNS75YNF.cjs} +12 -13
- package/dist/chunk-BNS75YNF.cjs.map +1 -0
- package/dist/{chunk-KTBTSHU6.cjs → chunk-C4F7VJ5D.cjs} +13 -3
- package/dist/chunk-C4F7VJ5D.cjs.map +1 -0
- package/dist/{chunk-L2BYRYHC.js → chunk-CBKG6HEP.js} +43 -33
- package/dist/chunk-CBKG6HEP.js.map +1 -0
- package/dist/{chunk-CVK4T34X.cjs → chunk-CPEL3YIR.cjs} +22 -22
- package/dist/{chunk-CVK4T34X.cjs.map → chunk-CPEL3YIR.cjs.map} +1 -1
- package/dist/{chunk-O2GZM7UK.cjs → chunk-D54WH24V.cjs} +62 -7
- package/dist/chunk-D54WH24V.cjs.map +1 -0
- package/dist/{chunk-33PAKPED.cjs → chunk-D56XG4EI.cjs} +53 -41
- package/dist/chunk-D56XG4EI.cjs.map +1 -0
- package/dist/{chunk-O3USVVWS.js → chunk-DK2S42XB.js} +3 -3
- package/dist/{chunk-O3USVVWS.js.map → chunk-DK2S42XB.js.map} +1 -1
- package/dist/{chunk-HHBKGPEI.js → chunk-DXEEHSGN.js} +517 -26
- package/dist/chunk-DXEEHSGN.js.map +1 -0
- package/dist/{chunk-UJRWOV5B.js → chunk-EFEOOCJ3.js} +5 -5
- package/dist/{chunk-UJRWOV5B.js.map → chunk-EFEOOCJ3.js.map} +1 -1
- package/dist/{chunk-ECU53PMN.cjs → chunk-EKFUG4G7.cjs} +5 -5
- package/dist/chunk-EKFUG4G7.cjs.map +1 -0
- package/dist/{chunk-FSCJOTHF.cjs → chunk-EQ7JKLZO.cjs} +10 -10
- package/dist/{chunk-FSCJOTHF.cjs.map → chunk-EQ7JKLZO.cjs.map} +1 -1
- package/dist/{chunk-AQR6BHB3.cjs → chunk-F4NHQHEZ.cjs} +10 -10
- package/dist/{chunk-AQR6BHB3.cjs.map → chunk-F4NHQHEZ.cjs.map} +1 -1
- package/dist/{chunk-2G6ZEGYO.js → chunk-FL5UQRES.js} +4 -4
- package/dist/{chunk-2G6ZEGYO.js.map → chunk-FL5UQRES.js.map} +1 -1
- package/dist/{chunk-ZP2KPDNN.js → chunk-FLEQ2HBK.js} +3 -3
- package/dist/{chunk-ZP2KPDNN.js.map → chunk-FLEQ2HBK.js.map} +1 -1
- package/dist/{chunk-RAWG2FEU.js → chunk-FQ7ZPOTZ.js} +264 -18
- package/dist/chunk-FQ7ZPOTZ.js.map +1 -0
- package/dist/{chunk-O7XVCLXW.cjs → chunk-H7VE3FL4.cjs} +577 -82
- package/dist/chunk-H7VE3FL4.cjs.map +1 -0
- package/dist/{chunk-JNXZQBN3.js → chunk-ID4WXTKL.js} +1039 -482
- package/dist/chunk-ID4WXTKL.js.map +1 -0
- package/dist/{chunk-ZGOUVMVS.js → chunk-ISLPNELU.js} +17 -5
- package/dist/chunk-ISLPNELU.js.map +1 -0
- package/dist/{chunk-I73ATSAH.cjs → chunk-IX64T5OL.cjs} +4 -4
- package/dist/{chunk-I73ATSAH.cjs.map → chunk-IX64T5OL.cjs.map} +1 -1
- package/dist/{chunk-XDMPDUKL.cjs → chunk-J2ICGNHO.cjs} +8 -9
- package/dist/chunk-J2ICGNHO.cjs.map +1 -0
- package/dist/{chunk-KDRF3NR2.cjs → chunk-J7LXTUTP.cjs} +295 -201
- package/dist/chunk-J7LXTUTP.cjs.map +1 -0
- package/dist/{chunk-AO2WPYFZ.cjs → chunk-JQXSZHF2.cjs} +14 -4
- package/dist/chunk-JQXSZHF2.cjs.map +1 -0
- package/dist/{chunk-UTTW2Q3M.cjs → chunk-JXUTCSXX.cjs} +197 -133
- package/dist/chunk-JXUTCSXX.cjs.map +1 -0
- package/dist/{chunk-GT7NEXSU.js → chunk-KCO5EFJU.js} +3 -3
- package/dist/{chunk-GT7NEXSU.js.map → chunk-KCO5EFJU.js.map} +1 -1
- package/dist/{chunk-ARN3ZODS.cjs → chunk-KKYELPZ2.cjs} +6 -6
- package/dist/{chunk-ARN3ZODS.cjs.map → chunk-KKYELPZ2.cjs.map} +1 -1
- package/dist/{chunk-7Y6BV3TK.cjs → chunk-KMXWZLQX.cjs} +100 -100
- package/dist/{chunk-7Y6BV3TK.cjs.map → chunk-KMXWZLQX.cjs.map} +1 -1
- package/dist/{chunk-CDYRPI5U.js → chunk-MIJKEVV7.js} +4 -4
- package/dist/{chunk-CDYRPI5U.js.map → chunk-MIJKEVV7.js.map} +1 -1
- package/dist/{chunk-FFQGI67R.cjs → chunk-NAAMUYMS.cjs} +56 -44
- package/dist/chunk-NAAMUYMS.cjs.map +1 -0
- package/dist/{chunk-6TJ6PKPS.cjs → chunk-OOA273IJ.cjs} +27 -27
- package/dist/{chunk-6TJ6PKPS.cjs.map → chunk-OOA273IJ.cjs.map} +1 -1
- package/dist/{chunk-F2KVJ6FF.cjs → chunk-P7GTYOLB.cjs} +203 -117
- package/dist/chunk-P7GTYOLB.cjs.map +1 -0
- package/dist/{chunk-42XYPKZU.js → chunk-PVUI6KGR.js} +67 -3
- package/dist/chunk-PVUI6KGR.js.map +1 -0
- package/dist/{chunk-L5AUCL5P.js → chunk-Q6EDCUXV.js} +274 -14
- package/dist/chunk-Q6EDCUXV.js.map +1 -0
- package/dist/{chunk-ZPCKPLMX.cjs → chunk-QB6VMOJ2.cjs} +8 -8
- package/dist/{chunk-ZPCKPLMX.cjs.map → chunk-QB6VMOJ2.cjs.map} +1 -1
- package/dist/{chunk-3RPQDGUE.cjs → chunk-QC4MCOFV.cjs} +5 -5
- package/dist/{chunk-3RPQDGUE.cjs.map → chunk-QC4MCOFV.cjs.map} +1 -1
- package/dist/{chunk-4XRP2N6B.js → chunk-QLUXRWKL.js} +3 -3
- package/dist/{chunk-4XRP2N6B.js.map → chunk-QLUXRWKL.js.map} +1 -1
- package/dist/{chunk-OM6RIOA5.cjs → chunk-QR24DJDF.cjs} +13 -13
- package/dist/{chunk-OM6RIOA5.cjs.map → chunk-QR24DJDF.cjs.map} +1 -1
- package/dist/{chunk-YPVQYM3L.js → chunk-QRNYDV5Z.js} +138 -31
- package/dist/chunk-QRNYDV5Z.js.map +1 -0
- package/dist/{chunk-ZOHCFYXE.js → chunk-QT6V3YRH.js} +3 -3
- package/dist/{chunk-ZOHCFYXE.js.map → chunk-QT6V3YRH.js.map} +1 -1
- package/dist/{chunk-5C75HQYQ.js → chunk-RFRM3Q5K.js} +17 -5
- package/dist/chunk-RFRM3Q5K.js.map +1 -0
- package/dist/{chunk-NXIZL7ZZ.js → chunk-RUQS6M7G.js} +6 -6
- package/dist/chunk-RUQS6M7G.js.map +1 -0
- package/dist/{chunk-CI5NPLXX.js → chunk-S3ZRKJHY.js} +3 -3
- package/dist/{chunk-CI5NPLXX.js.map → chunk-S3ZRKJHY.js.map} +1 -1
- package/dist/{chunk-3V6D5DEC.js → chunk-S4KQ5LV4.js} +3 -3
- package/dist/{chunk-3V6D5DEC.js.map → chunk-S4KQ5LV4.js.map} +1 -1
- package/dist/{chunk-CTWZPYJW.js → chunk-TKORQCG4.js} +108 -15
- package/dist/chunk-TKORQCG4.js.map +1 -0
- package/dist/{chunk-2HKIID5K.js → chunk-TKP5T34P.js} +4 -5
- package/dist/chunk-TKP5T34P.js.map +1 -0
- package/dist/{chunk-X2XOQZT3.cjs → chunk-U5W4LKZV.cjs} +13 -9
- package/dist/chunk-U5W4LKZV.cjs.map +1 -0
- package/dist/{chunk-BLBG2VZ5.cjs → chunk-UCQ3BFSY.cjs} +372 -110
- package/dist/chunk-UCQ3BFSY.cjs.map +1 -0
- package/dist/{chunk-CUPJL6TS.js → chunk-V34A6R5V.js} +13 -4
- package/dist/chunk-V34A6R5V.js.map +1 -0
- package/dist/{chunk-LQLVJWUH.js → chunk-VTN3C3CH.js} +7 -7
- package/dist/chunk-VTN3C3CH.js.map +1 -0
- package/dist/{chunk-FY4VY5EV.cjs → chunk-VVQM4CZD.cjs} +20 -20
- package/dist/chunk-VVQM4CZD.cjs.map +1 -0
- package/dist/{chunk-LDCWO5B6.js → chunk-WDAVPX46.js} +3 -3
- package/dist/{chunk-LDCWO5B6.js.map → chunk-WDAVPX46.js.map} +1 -1
- package/dist/{chunk-5GV4JQNA.cjs → chunk-WDBXJOU5.cjs} +55 -43
- package/dist/chunk-WDBXJOU5.cjs.map +1 -0
- package/dist/{chunk-FMPZPOUD.js → chunk-WUFASQUO.js} +3 -3
- package/dist/{chunk-FMPZPOUD.js.map → chunk-WUFASQUO.js.map} +1 -1
- package/dist/{chunk-5ZPRE4CV.cjs → chunk-YDWLUT5V.cjs} +237 -130
- package/dist/chunk-YDWLUT5V.cjs.map +1 -0
- package/dist/{chunk-CVNGKTHO.js → chunk-YMTXMPV6.js} +4 -4
- package/dist/{chunk-CVNGKTHO.js.map → chunk-YMTXMPV6.js.map} +1 -1
- package/dist/{chunk-NDQLPKBX.cjs → chunk-YOALGKRE.cjs} +2092 -1535
- package/dist/chunk-YOALGKRE.cjs.map +1 -0
- package/dist/{chunk-OMQ2NBOR.cjs → chunk-Z3WO6MND.cjs} +27 -27
- package/dist/{chunk-OMQ2NBOR.cjs.map → chunk-Z3WO6MND.cjs.map} +1 -1
- package/dist/{chunk-V2GZBPY2.cjs → chunk-ZI6VQSZA.cjs} +310 -61
- package/dist/chunk-ZI6VQSZA.cjs.map +1 -0
- package/dist/{chunk-ZBV4LQD2.cjs → chunk-ZTAJL4DT.cjs} +4 -4
- package/dist/{chunk-ZBV4LQD2.cjs.map → chunk-ZTAJL4DT.cjs.map} +1 -1
- package/dist/core/index.cjs +27 -28
- package/dist/core/index.d.cts +5 -5
- package/dist/core/index.d.ts +5 -5
- package/dist/core/index.js +7 -8
- package/dist/{ddl-3unqC-kg.d.cts → ddl-BG4J805L.d.cts} +3 -3
- package/dist/{ddl-Bc4Dl8fu.d.ts → ddl-CgiS9QLj.d.ts} +3 -3
- package/dist/{define-graph-DBFnc7u_.d.ts → define-graph-BGrJahvp.d.ts} +1 -1
- package/dist/{define-graph-Byslw2OO.d.cts → define-graph-alREY2wj.d.cts} +1 -1
- package/dist/graph-extension/index.cjs +19 -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 +4 -5
- package/dist/graph-merge/index.cjs +103 -104
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +9 -8
- package/dist/graph-merge/index.d.ts +9 -8
- package/dist/graph-merge/index.js +23 -24
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/{index-DHXw7QAl.d.cts → index-BBxZCUdu.d.ts} +37 -7
- package/dist/{index-DQzVJBHa.d.ts → index-C3y_98iN.d.cts} +37 -7
- package/dist/index.cjs +209 -202
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/index.js +33 -34
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.cjs +13 -13
- package/dist/indexes/index.d.cts +4 -4
- package/dist/indexes/index.d.ts +4 -4
- package/dist/indexes/index.js +6 -6
- package/dist/interchange/index.cjs +50 -41
- package/dist/interchange/index.cjs.map +1 -1
- package/dist/interchange/index.d.cts +11 -11
- package/dist/interchange/index.d.ts +11 -11
- package/dist/interchange/index.js +24 -15
- package/dist/interchange/index.js.map +1 -1
- package/dist/{manager-U9_zopqr.d.cts → manager-KS7CGQQT.d.cts} +44 -6
- package/dist/{manager-Dl0-er1G.d.ts → manager-YoLEfcc1.d.ts} +44 -6
- package/dist/{materialize-indexes-BM3u0aXE.d.ts → materialize-indexes-Bhhyb1B3.d.ts} +1 -1
- package/dist/{materialize-indexes-DzMCetZe.d.cts → materialize-indexes-OHRWypW6.d.cts} +1 -1
- package/dist/{postgres-DpJqtbSX.d.cts → postgres-DpkW3R5Y.d.cts} +1 -1
- package/dist/{postgres-C5-WMKFA.d.ts → postgres-DwqyIniy.d.ts} +1 -1
- package/dist/profiler/index.d.cts +10 -9
- package/dist/profiler/index.d.ts +10 -9
- package/dist/provenance/index.cjs +38 -38
- package/dist/provenance/index.cjs.map +1 -1
- package/dist/provenance/index.d.cts +7 -7
- package/dist/provenance/index.d.ts +7 -7
- package/dist/provenance/index.js +8 -8
- package/dist/provenance/index.js.map +1 -1
- package/dist/schema/index.cjs +40 -41
- package/dist/schema/index.d.cts +7 -7
- package/dist/schema/index.d.ts +7 -7
- package/dist/schema/index.js +13 -14
- package/dist/{searchable-B4mUXZT6.d.cts → searchable-CIZL8Hyw.d.cts} +2 -2
- package/dist/{searchable-C7jmPNLT.d.ts → searchable-DLWEfC4a.d.ts} +2 -2
- package/dist/{sqlite-Ch5tSYQY.d.ts → sqlite-DY0WODUK.d.cts} +1 -1
- package/dist/{sqlite-Da7jiYu9.d.cts → sqlite-L-VIRzqA.d.ts} +1 -1
- package/dist/{store-view-DdwBNjZQ.d.ts → store-view-66p92IPi.d.ts} +1974 -1751
- package/dist/{store-view-D1F6KqsE.d.cts → store-view-A85FFRnk.d.cts} +1974 -1751
- package/dist/{temporal-CMpigMCW.d.cts → temporal-BNbjXqer.d.cts} +1 -1
- package/dist/{temporal-BtrTYTiB.d.ts → temporal-Bob6Nfbp.d.ts} +1 -1
- package/dist/{types-Dh-EgT-w.d.cts → types-Ch9a0Dx6.d.cts} +483 -20
- package/dist/{types-Dh-EgT-w.d.ts → types-Ch9a0Dx6.d.ts} +483 -20
- package/dist/{types-D2rU5Taq.d.ts → types-ClCzT-dT.d.ts} +1 -1
- package/dist/{types-G4sVM-76.d.cts → types-DeORZhxn.d.cts} +1 -1
- package/dist/{where-DbZ9XDOI.d.cts → where-DPw52ksb.d.cts} +1 -1
- package/dist/{where-B8Y21kig.d.ts → where-kWUZPvEA.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-2HKIID5K.js.map +0 -1
- package/dist/chunk-33PAKPED.cjs.map +0 -1
- package/dist/chunk-42XYPKZU.js.map +0 -1
- package/dist/chunk-4WYFRACU.js.map +0 -1
- package/dist/chunk-5C75HQYQ.js.map +0 -1
- package/dist/chunk-5GV4JQNA.cjs.map +0 -1
- package/dist/chunk-5Q3P6OIC.cjs.map +0 -1
- package/dist/chunk-5ZPRE4CV.cjs.map +0 -1
- package/dist/chunk-64LERBFM.cjs.map +0 -1
- package/dist/chunk-AO2WPYFZ.cjs.map +0 -1
- package/dist/chunk-BLBG2VZ5.cjs.map +0 -1
- package/dist/chunk-CTWZPYJW.js.map +0 -1
- package/dist/chunk-CUPJL6TS.js.map +0 -1
- package/dist/chunk-DMZEVJGL.cjs.map +0 -1
- package/dist/chunk-ECU53PMN.cjs.map +0 -1
- package/dist/chunk-EQOQOT55.js.map +0 -1
- package/dist/chunk-F2KVJ6FF.cjs.map +0 -1
- package/dist/chunk-F7TDKSVB.cjs +0 -61
- package/dist/chunk-F7TDKSVB.cjs.map +0 -1
- package/dist/chunk-FFQGI67R.cjs.map +0 -1
- package/dist/chunk-FY4VY5EV.cjs.map +0 -1
- package/dist/chunk-HHBKGPEI.js.map +0 -1
- package/dist/chunk-JNXZQBN3.js.map +0 -1
- package/dist/chunk-KDRF3NR2.cjs.map +0 -1
- package/dist/chunk-KTBTSHU6.cjs.map +0 -1
- package/dist/chunk-L2BYRYHC.js.map +0 -1
- package/dist/chunk-L5AUCL5P.js.map +0 -1
- package/dist/chunk-LQLVJWUH.js.map +0 -1
- package/dist/chunk-M4GYQF2H.js.map +0 -1
- package/dist/chunk-NDQLPKBX.cjs.map +0 -1
- package/dist/chunk-NXIZL7ZZ.js.map +0 -1
- package/dist/chunk-O2GZM7UK.cjs.map +0 -1
- package/dist/chunk-O7XVCLXW.cjs.map +0 -1
- package/dist/chunk-OYJSYDIH.js.map +0 -1
- package/dist/chunk-RAWG2FEU.js.map +0 -1
- package/dist/chunk-RXOAXO3R.js +0 -59
- package/dist/chunk-RXOAXO3R.js.map +0 -1
- package/dist/chunk-U3YRCZ5L.cjs +0 -12
- package/dist/chunk-UTTW2Q3M.cjs.map +0 -1
- package/dist/chunk-UZLEQFTV.js.map +0 -1
- package/dist/chunk-V2GZBPY2.cjs.map +0 -1
- package/dist/chunk-VC26BUNP.js.map +0 -1
- package/dist/chunk-VGMNGWBR.cjs +0 -12
- package/dist/chunk-X2XOQZT3.cjs.map +0 -1
- package/dist/chunk-XDMPDUKL.cjs.map +0 -1
- package/dist/chunk-YPVQYM3L.js.map +0 -1
- package/dist/chunk-ZGOUVMVS.js.map +0 -1
- package/dist/chunk-ZIRC2U6G.js.map +0 -1
|
@@ -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 chunkCPEL3YIR_cjs = require('./chunk-CPEL3YIR.cjs');
|
|
5
|
+
var chunkEKFUG4G7_cjs = require('./chunk-EKFUG4G7.cjs');
|
|
6
|
+
var chunkEQ7JKLZO_cjs = require('./chunk-EQ7JKLZO.cjs');
|
|
7
|
+
var chunkJQXSZHF2_cjs = require('./chunk-JQXSZHF2.cjs');
|
|
8
|
+
var chunkZTAJL4DT_cjs = require('./chunk-ZTAJL4DT.cjs');
|
|
9
|
+
var chunkU5W4LKZV_cjs = require('./chunk-U5W4LKZV.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 chunkC4F7VJ5D_cjs = require('./chunk-C4F7VJ5D.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 = chunkU5W4LKZV_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 = chunkU5W4LKZV_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 = chunkZTAJL4DT_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 chunkU5W4LKZV_cjs.sql`${pinnedReadInstant ?? chunkZTAJL4DT_cjs.nowIso()}`;
|
|
69
69
|
}
|
|
70
70
|
var CURRENT_READ_INSTANT_PLACEHOLDER = "__typegraph_current_read_instant__";
|
|
71
71
|
function currentReadInstantPlaceholder() {
|
|
72
|
-
return
|
|
72
|
+
return chunkU5W4LKZV_cjs.sql`${chunkU5W4LKZV_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 ? chunkU5W4LKZV_cjs.sql.raw(`${tableAlias}.`) : chunkU5W4LKZV_cjs.sql.raw("");
|
|
80
|
+
const deletedAt = chunkU5W4LKZV_cjs.sql`${prefix}deleted_at`;
|
|
81
|
+
const validFrom = chunkU5W4LKZV_cjs.sql`${prefix}valid_from`;
|
|
82
|
+
const validTo = chunkU5W4LKZV_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() : chunkU5W4LKZV_cjs.sql`${chunkEQ7JKLZO_cjs.parseRecordedInstant(recordedAsOf, "recordedAsOf").recordedAt}`;
|
|
87
|
+
return chunkU5W4LKZV_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 chunkU5W4LKZV_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 chunkU5W4LKZV_cjs.sql`${deletedAt} IS NULL`;
|
|
100
100
|
}
|
|
101
101
|
case "includeTombstones": {
|
|
102
|
-
return
|
|
102
|
+
return chunkU5W4LKZV_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 = chunkU5W4LKZV_cjs.sql`${prefix}recorded_from`;
|
|
108
|
+
const recordedTo = chunkU5W4LKZV_cjs.sql`${prefix}recorded_to`;
|
|
109
|
+
const recordedRevision = chunkEQ7JKLZO_cjs.parseRecordedInstant(
|
|
110
110
|
recordedAsOf,
|
|
111
111
|
"recordedAsOf"
|
|
112
112
|
).revision;
|
|
113
|
-
return
|
|
113
|
+
return chunkU5W4LKZV_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 chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
202
202
|
`Parameter name "${name}" is reserved for internal use`,
|
|
203
203
|
{ parameterName: name }
|
|
204
204
|
);
|
|
@@ -272,7 +272,26 @@ function comparison(op, field, value) {
|
|
|
272
272
|
return predicate(expr);
|
|
273
273
|
}
|
|
274
274
|
function inComparison(op, field, values) {
|
|
275
|
-
|
|
275
|
+
if (isParameterRef(values)) {
|
|
276
|
+
return predicate({
|
|
277
|
+
__type: "comparison",
|
|
278
|
+
op,
|
|
279
|
+
left: field,
|
|
280
|
+
right: values
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
const literals = values.map((value) => {
|
|
284
|
+
if (isParameterRef(value)) {
|
|
285
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
286
|
+
`param("${value.name}") is not supported as an element of the ${op}() list`,
|
|
287
|
+
{ parameterName: value.name },
|
|
288
|
+
{
|
|
289
|
+
suggestion: `Bind the whole list instead: .${op}(param("${value.name}")) and execute({ ${value.name}: [...] }).`
|
|
290
|
+
}
|
|
291
|
+
);
|
|
292
|
+
}
|
|
293
|
+
return literal(coerceLiteralValue(value));
|
|
294
|
+
});
|
|
276
295
|
const expr = {
|
|
277
296
|
__type: "comparison",
|
|
278
297
|
op,
|
|
@@ -345,7 +364,7 @@ function createFulltextAccessor(alias, hasSearchableField) {
|
|
|
345
364
|
return {
|
|
346
365
|
matches: (query, k, options) => {
|
|
347
366
|
if (!hasSearchableField()) {
|
|
348
|
-
throw new
|
|
367
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
349
368
|
`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
369
|
);
|
|
351
370
|
}
|
|
@@ -360,7 +379,7 @@ function createFulltextAccessor(alias, hasSearchableField) {
|
|
|
360
379
|
}
|
|
361
380
|
function fulltextMatch(field, query, limit, options) {
|
|
362
381
|
if (!Number.isFinite(limit) || limit <= 0) {
|
|
363
|
-
throw new
|
|
382
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
364
383
|
`matches() limit must be a positive finite number, got ${String(limit)}`
|
|
365
384
|
);
|
|
366
385
|
}
|
|
@@ -633,7 +652,7 @@ function notInSubquery(field, subquery) {
|
|
|
633
652
|
function assertSingleColumnSubquery(subquery) {
|
|
634
653
|
const columnCount = getSubqueryColumnCount(subquery);
|
|
635
654
|
if (columnCount === 1) return;
|
|
636
|
-
throw new
|
|
655
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
637
656
|
`IN/NOT IN subquery must project exactly 1 column, but got ${columnCount}`,
|
|
638
657
|
{ subqueryColumnCount: columnCount },
|
|
639
658
|
{
|
|
@@ -646,7 +665,7 @@ function assertCompatibleSubqueryValueTypes(field, subquery) {
|
|
|
646
665
|
const subqueryValueType = getSingleSubqueryColumnValueType(subquery);
|
|
647
666
|
const resolvedValueType = fieldValueType ?? subqueryValueType;
|
|
648
667
|
if (isUnsupportedInSubqueryValueType(resolvedValueType)) {
|
|
649
|
-
throw new
|
|
668
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
650
669
|
`IN/NOT IN subquery does not support ${String(resolvedValueType)} values`,
|
|
651
670
|
{ valueType: resolvedValueType },
|
|
652
671
|
{
|
|
@@ -657,7 +676,7 @@ function assertCompatibleSubqueryValueTypes(field, subquery) {
|
|
|
657
676
|
if (isInSubqueryTypeCompatible(fieldValueType, subqueryValueType)) {
|
|
658
677
|
return;
|
|
659
678
|
}
|
|
660
|
-
throw new
|
|
679
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
661
680
|
`IN/NOT IN type mismatch: field type "${String(fieldValueType)}" does not match subquery column type "${String(subqueryValueType)}"`,
|
|
662
681
|
{
|
|
663
682
|
fieldValueType,
|
|
@@ -676,7 +695,7 @@ var RECORDED_ISOLATION_REQUIRES_POSTGRES_CHECK = {
|
|
|
676
695
|
};
|
|
677
696
|
function requireRecordedSchema(target) {
|
|
678
697
|
if (target.tableNames === void 0) {
|
|
679
|
-
throw new
|
|
698
|
+
throw new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
680
699
|
"Recorded-time capture requires the backend to expose tableNames.",
|
|
681
700
|
{ dialect: target.dialect },
|
|
682
701
|
{
|
|
@@ -684,11 +703,11 @@ function requireRecordedSchema(target) {
|
|
|
684
703
|
}
|
|
685
704
|
);
|
|
686
705
|
}
|
|
687
|
-
return
|
|
706
|
+
return chunkCPEL3YIR_cjs.createSqlSchema(target.tableNames);
|
|
688
707
|
}
|
|
689
708
|
function requireCaptureStatements(target) {
|
|
690
709
|
if (target.executeStatement === void 0) {
|
|
691
|
-
throw new
|
|
710
|
+
throw new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
692
711
|
"Recorded-time capture requires backend.executeStatement support on the transaction backend.",
|
|
693
712
|
{ dialect: target.dialect },
|
|
694
713
|
{
|
|
@@ -699,10 +718,10 @@ function requireCaptureStatements(target) {
|
|
|
699
718
|
}
|
|
700
719
|
async function executeStatement(target, query) {
|
|
701
720
|
requireCaptureStatements(target);
|
|
702
|
-
await target.executeStatement(
|
|
721
|
+
await target.executeStatement(chunkU5W4LKZV_cjs.asCompiledStatementSql(query));
|
|
703
722
|
}
|
|
704
723
|
function unsupportedPostgresIsolationError(isolationLevel) {
|
|
705
|
-
return new
|
|
724
|
+
return new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
706
725
|
"Recorded-time capture on PostgreSQL requires read_committed isolation.",
|
|
707
726
|
{ isolationLevel: isolationLevel ?? "unknown" },
|
|
708
727
|
{
|
|
@@ -728,7 +747,7 @@ async function assertRecordedCaptureTransactionIsolation(target, options) {
|
|
|
728
747
|
if (!RECORDED_ISOLATION_REQUIRES_POSTGRES_CHECK[target.dialect]) return;
|
|
729
748
|
if (options?.accessMode === "read_only") return;
|
|
730
749
|
const rows = await target.execute(
|
|
731
|
-
|
|
750
|
+
chunkU5W4LKZV_cjs.asCompiledRowsSql(chunkU5W4LKZV_cjs.sql`
|
|
732
751
|
SELECT current_setting('transaction_isolation') AS transaction_isolation
|
|
733
752
|
`)
|
|
734
753
|
);
|
|
@@ -739,7 +758,7 @@ async function assertRecordedCaptureTransactionIsolation(target, options) {
|
|
|
739
758
|
throw unsupportedPostgresIsolationError(isolationLevel);
|
|
740
759
|
}
|
|
741
760
|
function recordedCaptureRequiresCallbackTransactionError(details = {}) {
|
|
742
|
-
return new
|
|
761
|
+
return new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
743
762
|
"withTransaction() has no recorded-time capture flush point when history is enabled.",
|
|
744
763
|
{
|
|
745
764
|
...details,
|
|
@@ -751,7 +770,7 @@ function recordedCaptureRequiresCallbackTransactionError(details = {}) {
|
|
|
751
770
|
);
|
|
752
771
|
}
|
|
753
772
|
function historyUnsafeRawWriteError(surface) {
|
|
754
|
-
return new
|
|
773
|
+
return new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
755
774
|
`${surface} is not available when history capture is enabled because raw SQL writes bypass recorded-time capture.`,
|
|
756
775
|
{
|
|
757
776
|
code: "RECORDED_CAPTURE_RAW_SQL_DISABLED"
|
|
@@ -762,7 +781,7 @@ function historyUnsafeRawWriteError(surface) {
|
|
|
762
781
|
);
|
|
763
782
|
}
|
|
764
783
|
function revisionTrackingUnsafeRawWriteError(surface) {
|
|
765
|
-
return new
|
|
784
|
+
return new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
766
785
|
`${surface} is not available when revision tracking is enabled because raw SQL writes bypass the revision anchor.`,
|
|
767
786
|
{
|
|
768
787
|
code: "REVISION_TRACKING_RAW_SQL_DISABLED"
|
|
@@ -798,7 +817,7 @@ function rawWriteGuards(target, prefix) {
|
|
|
798
817
|
}
|
|
799
818
|
function assertCapturableBackend(backend) {
|
|
800
819
|
if (!backend.capabilities.transactions) {
|
|
801
|
-
throw new
|
|
820
|
+
throw new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
802
821
|
"history: true requires a backend with transaction support.",
|
|
803
822
|
{ dialect: backend.dialect },
|
|
804
823
|
{
|
|
@@ -807,7 +826,7 @@ function assertCapturableBackend(backend) {
|
|
|
807
826
|
);
|
|
808
827
|
}
|
|
809
828
|
if (backend.executeStatement === void 0) {
|
|
810
|
-
throw new
|
|
829
|
+
throw new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
811
830
|
"history: true requires a backend that supports executeStatement.",
|
|
812
831
|
{ dialect: backend.dialect },
|
|
813
832
|
{
|
|
@@ -816,7 +835,7 @@ function assertCapturableBackend(backend) {
|
|
|
816
835
|
);
|
|
817
836
|
}
|
|
818
837
|
if (backend.capabilities.returning === false) {
|
|
819
|
-
throw new
|
|
838
|
+
throw new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
820
839
|
"history: true requires a backend that supports UPDATE \u2026 RETURNING.",
|
|
821
840
|
{ dialect: backend.dialect },
|
|
822
841
|
{
|
|
@@ -825,7 +844,7 @@ function assertCapturableBackend(backend) {
|
|
|
825
844
|
);
|
|
826
845
|
}
|
|
827
846
|
if (backend.tableNames === void 0) {
|
|
828
|
-
throw new
|
|
847
|
+
throw new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
829
848
|
"history: true requires a backend that exposes tableNames.",
|
|
830
849
|
{ dialect: backend.dialect },
|
|
831
850
|
{
|
|
@@ -836,7 +855,7 @@ function assertCapturableBackend(backend) {
|
|
|
836
855
|
}
|
|
837
856
|
function assertRevisionTrackableBackend(backend) {
|
|
838
857
|
if (!backend.capabilities.transactions) {
|
|
839
|
-
throw new
|
|
858
|
+
throw new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
840
859
|
"revisionTracking: true requires a backend with transaction support.",
|
|
841
860
|
{ dialect: backend.dialect },
|
|
842
861
|
{
|
|
@@ -845,7 +864,7 @@ function assertRevisionTrackableBackend(backend) {
|
|
|
845
864
|
);
|
|
846
865
|
}
|
|
847
866
|
if (backend.executeStatement === void 0) {
|
|
848
|
-
throw new
|
|
867
|
+
throw new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
849
868
|
"revisionTracking: true requires a backend that supports executeStatement.",
|
|
850
869
|
{ dialect: backend.dialect },
|
|
851
870
|
{
|
|
@@ -854,7 +873,7 @@ function assertRevisionTrackableBackend(backend) {
|
|
|
854
873
|
);
|
|
855
874
|
}
|
|
856
875
|
if (backend.tableNames === void 0) {
|
|
857
|
-
throw new
|
|
876
|
+
throw new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
858
877
|
"revisionTracking: true requires a backend that exposes tableNames.",
|
|
859
878
|
{ dialect: backend.dialect },
|
|
860
879
|
{
|
|
@@ -863,7 +882,7 @@ function assertRevisionTrackableBackend(backend) {
|
|
|
863
882
|
);
|
|
864
883
|
}
|
|
865
884
|
if (backend.ensureRevisionOriginsTable === void 0) {
|
|
866
|
-
throw new
|
|
885
|
+
throw new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
867
886
|
"revisionTracking: true requires a backend that can bootstrap revision origins.",
|
|
868
887
|
{ dialect: backend.dialect },
|
|
869
888
|
{
|
|
@@ -883,7 +902,7 @@ var USES_RECORDED_GRAPH_ADVISORY_LOCK = {
|
|
|
883
902
|
sqlite: false
|
|
884
903
|
};
|
|
885
904
|
function graphAdvisoryLockSql(namespace, graphId) {
|
|
886
|
-
return
|
|
905
|
+
return chunkU5W4LKZV_cjs.sql`
|
|
887
906
|
SELECT pg_advisory_xact_lock(
|
|
888
907
|
hashtext(${namespace}),
|
|
889
908
|
hashtext(${graphId})
|
|
@@ -915,7 +934,7 @@ function registerRecordedGraphLockMemo(backend, memo) {
|
|
|
915
934
|
}
|
|
916
935
|
async function acquireRecordedGraphWriteLock(target, graphId) {
|
|
917
936
|
await target.execute(
|
|
918
|
-
|
|
937
|
+
chunkU5W4LKZV_cjs.asCompiledRowsSql(recordedGraphWriteAdvisoryLockSql(graphId))
|
|
919
938
|
);
|
|
920
939
|
}
|
|
921
940
|
async function lockRecordedGraphWrite(target, graphId, memo) {
|
|
@@ -941,7 +960,7 @@ async function lockRecordedGraphWrite(target, graphId, memo) {
|
|
|
941
960
|
return graphWriteLockEvidence();
|
|
942
961
|
}
|
|
943
962
|
function failInvalidClock(value, cause) {
|
|
944
|
-
throw new
|
|
963
|
+
throw new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
945
964
|
"Recorded clock row contained an invalid revision or wall time",
|
|
946
965
|
{ value },
|
|
947
966
|
{
|
|
@@ -952,13 +971,13 @@ function failInvalidClock(value, cause) {
|
|
|
952
971
|
}
|
|
953
972
|
function recordedClockRevision(value) {
|
|
954
973
|
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 >=
|
|
974
|
+
if (typeof revision !== "number" || !Number.isSafeInteger(revision) || revision < RECORDED_MIN_REVISION || revision >= chunkEQ7JKLZO_cjs.RECORDED_MAX_REVISION) {
|
|
956
975
|
return failInvalidClock(value);
|
|
957
976
|
}
|
|
958
977
|
return revision;
|
|
959
978
|
}
|
|
960
979
|
function recordedClockWallTime(value) {
|
|
961
|
-
return
|
|
980
|
+
return chunkZTAJL4DT_cjs.canonicalizeDatabaseTimestamp(value) ?? failInvalidClock(value);
|
|
962
981
|
}
|
|
963
982
|
function recordedClockParts(row) {
|
|
964
983
|
const revision = recordedClockRevision(row.revision);
|
|
@@ -966,7 +985,7 @@ function recordedClockParts(row) {
|
|
|
966
985
|
return { revision, recordedAt: recordedClockWallTime(row.recorded_at) };
|
|
967
986
|
}
|
|
968
987
|
function nextRecordedCommitParts(previous) {
|
|
969
|
-
const wallTime =
|
|
988
|
+
const wallTime = chunkZTAJL4DT_cjs.nowIso();
|
|
970
989
|
if (previous === void 0) {
|
|
971
990
|
return { revision: 1, recordedAt: wallTime };
|
|
972
991
|
}
|
|
@@ -984,11 +1003,11 @@ function nonDecreasingWallTime(current, previous) {
|
|
|
984
1003
|
}
|
|
985
1004
|
async function readRecordedClock(target, schema, graphId) {
|
|
986
1005
|
const parts = await readRecordedClockParts(target, schema, graphId);
|
|
987
|
-
return parts === void 0 ? void 0 :
|
|
1006
|
+
return parts === void 0 ? void 0 : chunkEQ7JKLZO_cjs.createRecordedInstant(parts.revision, parts.recordedAt);
|
|
988
1007
|
}
|
|
989
1008
|
async function readRecordedClockParts(target, schema, graphId) {
|
|
990
1009
|
const rows = await target.execute(
|
|
991
|
-
|
|
1010
|
+
chunkU5W4LKZV_cjs.asCompiledRowsSql(chunkU5W4LKZV_cjs.sql`
|
|
992
1011
|
SELECT revision, recorded_at
|
|
993
1012
|
FROM ${schema.recordedClockTable}
|
|
994
1013
|
WHERE graph_id = ${graphId}
|
|
@@ -999,7 +1018,7 @@ async function readRecordedClockParts(target, schema, graphId) {
|
|
|
999
1018
|
}
|
|
1000
1019
|
async function readRevisionOrigin(target, schema, graphId) {
|
|
1001
1020
|
const rows = await target.execute(
|
|
1002
|
-
|
|
1021
|
+
chunkU5W4LKZV_cjs.asCompiledRowsSql(chunkU5W4LKZV_cjs.sql`
|
|
1003
1022
|
SELECT origin
|
|
1004
1023
|
FROM ${schema.revisionOriginsTable}
|
|
1005
1024
|
WHERE graph_id = ${graphId}
|
|
@@ -1008,7 +1027,7 @@ async function readRevisionOrigin(target, schema, graphId) {
|
|
|
1008
1027
|
const first = rows[0];
|
|
1009
1028
|
if (first === void 0) return void 0;
|
|
1010
1029
|
if (typeof first.origin !== "string" || first.origin.length === 0) {
|
|
1011
|
-
throw new
|
|
1030
|
+
throw new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
1012
1031
|
"Revision origin row contained an invalid origin",
|
|
1013
1032
|
{ graphId, origin: first.origin }
|
|
1014
1033
|
);
|
|
@@ -1018,7 +1037,7 @@ async function readRevisionOrigin(target, schema, graphId) {
|
|
|
1018
1037
|
async function ensureRevisionOrigin(target, schema, graphId) {
|
|
1019
1038
|
const ensureTable = target.ensureRevisionOriginsTable;
|
|
1020
1039
|
if (ensureTable === void 0) {
|
|
1021
|
-
throw new
|
|
1040
|
+
throw new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
1022
1041
|
"Revision tracking requires a backend that can bootstrap revision origins.",
|
|
1023
1042
|
{ dialect: target.dialect },
|
|
1024
1043
|
{
|
|
@@ -1031,7 +1050,7 @@ async function ensureRevisionOrigin(target, schema, graphId) {
|
|
|
1031
1050
|
if (existing !== void 0) return existing;
|
|
1032
1051
|
await executeStatement(
|
|
1033
1052
|
target,
|
|
1034
|
-
|
|
1053
|
+
chunkU5W4LKZV_cjs.sql`
|
|
1035
1054
|
INSERT INTO ${schema.revisionOriginsTable} (graph_id, origin)
|
|
1036
1055
|
VALUES (${graphId}, ${generateId()})
|
|
1037
1056
|
ON CONFLICT (graph_id) DO NOTHING
|
|
@@ -1039,7 +1058,7 @@ async function ensureRevisionOrigin(target, schema, graphId) {
|
|
|
1039
1058
|
);
|
|
1040
1059
|
const origin = await readRevisionOrigin(target, schema, graphId);
|
|
1041
1060
|
if (origin !== void 0) return origin;
|
|
1042
|
-
throw new
|
|
1061
|
+
throw new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
1043
1062
|
"Revision origin was not persisted after initialization.",
|
|
1044
1063
|
{ graphId, dialect: target.dialect }
|
|
1045
1064
|
);
|
|
@@ -1047,7 +1066,7 @@ async function ensureRevisionOrigin(target, schema, graphId) {
|
|
|
1047
1066
|
async function writeRecordedClock(target, schema, graphId, parts) {
|
|
1048
1067
|
await executeStatement(
|
|
1049
1068
|
target,
|
|
1050
|
-
|
|
1069
|
+
chunkU5W4LKZV_cjs.sql`
|
|
1051
1070
|
INSERT INTO ${schema.recordedClockTable} (graph_id, revision, recorded_at)
|
|
1052
1071
|
VALUES (${graphId}, ${parts.revision}, ${parts.recordedAt})
|
|
1053
1072
|
ON CONFLICT (graph_id) DO UPDATE
|
|
@@ -1059,7 +1078,7 @@ async function lockRecordedClock(target, schema, graphId, ownsWriteLock) {
|
|
|
1059
1078
|
switch (target.dialect) {
|
|
1060
1079
|
case "postgres": {
|
|
1061
1080
|
await target.execute(
|
|
1062
|
-
|
|
1081
|
+
chunkU5W4LKZV_cjs.asCompiledRowsSql(recordedClockAdvisoryLockSql(graphId))
|
|
1063
1082
|
);
|
|
1064
1083
|
return;
|
|
1065
1084
|
}
|
|
@@ -1067,7 +1086,7 @@ async function lockRecordedClock(target, schema, graphId, ownsWriteLock) {
|
|
|
1067
1086
|
if (ownsWriteLock) return;
|
|
1068
1087
|
await executeStatement(
|
|
1069
1088
|
target,
|
|
1070
|
-
|
|
1089
|
+
chunkU5W4LKZV_cjs.sql`
|
|
1071
1090
|
INSERT INTO ${schema.recordedClockTable} (graph_id, revision, recorded_at)
|
|
1072
1091
|
VALUES (${graphId}, ${RECORDED_MIN_REVISION}, ${RECORDED_MIN_TIME})
|
|
1073
1092
|
ON CONFLICT (graph_id) DO UPDATE SET revision = revision
|
|
@@ -1082,18 +1101,18 @@ async function lockRecordedClock(target, schema, graphId, ownsWriteLock) {
|
|
|
1082
1101
|
}
|
|
1083
1102
|
async function allocateRecordedCommit(target, schema, graphId, ownsWriteLock, previousRevision) {
|
|
1084
1103
|
await lockRecordedClock(target, schema, graphId, ownsWriteLock);
|
|
1085
|
-
const previous = previousRevision === void 0 ? await readRecordedClockParts(target, schema, graphId) :
|
|
1104
|
+
const previous = previousRevision === void 0 ? await readRecordedClockParts(target, schema, graphId) : chunkEQ7JKLZO_cjs.parseRecordedInstant(previousRevision, "previous recorded revision");
|
|
1086
1105
|
const { revision, recordedAt } = nextRecordedCommitParts(previous);
|
|
1087
|
-
if (revision >=
|
|
1088
|
-
throw new
|
|
1089
|
-
`Recorded commit clock reached the open revision sentinel ${
|
|
1106
|
+
if (revision >= chunkEQ7JKLZO_cjs.RECORDED_MAX_REVISION) {
|
|
1107
|
+
throw new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
1108
|
+
`Recorded commit clock reached the open revision sentinel ${chunkEQ7JKLZO_cjs.RECORDED_MAX_REVISION}`,
|
|
1090
1109
|
{ graphId, revision },
|
|
1091
1110
|
{
|
|
1092
1111
|
suggestion: "Start a new graph before exhausting the per-graph recorded revision space."
|
|
1093
1112
|
}
|
|
1094
1113
|
);
|
|
1095
1114
|
}
|
|
1096
|
-
const instant =
|
|
1115
|
+
const instant = chunkEQ7JKLZO_cjs.createRecordedInstant(revision, recordedAt);
|
|
1097
1116
|
await writeRecordedClock(target, schema, graphId, { revision, recordedAt });
|
|
1098
1117
|
return { instant, revision, recordedAt };
|
|
1099
1118
|
}
|
|
@@ -1120,6 +1139,7 @@ var GRAPH_BACKEND_PROJECTION_KEYS = [
|
|
|
1120
1139
|
"insertNodesBatch",
|
|
1121
1140
|
"insertNodesBatchReturning",
|
|
1122
1141
|
"updateNode",
|
|
1142
|
+
"updateNodeSet",
|
|
1123
1143
|
"deleteNode",
|
|
1124
1144
|
"hardDeleteNode",
|
|
1125
1145
|
"getNode",
|
|
@@ -1141,19 +1161,26 @@ var GRAPH_BACKEND_PROJECTION_KEYS = [
|
|
|
1141
1161
|
"findNodesByKind",
|
|
1142
1162
|
"countNodesByKind",
|
|
1143
1163
|
"findEdgesByKind",
|
|
1164
|
+
"findEdgesByEndpointSet",
|
|
1165
|
+
"findEdgesByHeterogeneousEndpointSet",
|
|
1144
1166
|
"countEdgesByKind",
|
|
1145
1167
|
"insertUnique",
|
|
1146
1168
|
"insertUniqueBatch",
|
|
1147
1169
|
"deleteUnique",
|
|
1170
|
+
"hardDeleteUniquesByNodeIds",
|
|
1148
1171
|
"checkUnique",
|
|
1149
1172
|
"checkUniqueBatch",
|
|
1150
1173
|
"getActiveSchema",
|
|
1151
1174
|
"getSchemaVersion",
|
|
1152
1175
|
"commitSchemaVersion",
|
|
1176
|
+
"commitSchemaVersionIfKindsEmpty",
|
|
1177
|
+
"lockSchemaVersionForWrite",
|
|
1153
1178
|
"setActiveVersion",
|
|
1179
|
+
"schemaWriteTransaction",
|
|
1154
1180
|
"upsertEmbedding",
|
|
1155
1181
|
"upsertEmbeddingBatch",
|
|
1156
1182
|
"deleteEmbedding",
|
|
1183
|
+
"deleteEmbeddingBatch",
|
|
1157
1184
|
"vectorSearch",
|
|
1158
1185
|
"createVectorIndex",
|
|
1159
1186
|
"dropVectorIndex",
|
|
@@ -1185,6 +1212,8 @@ var GRAPH_BACKEND_PROJECTION_KEYS = [
|
|
|
1185
1212
|
"assertVectorSlotInitialized",
|
|
1186
1213
|
"assertVectorSlotsInitialized",
|
|
1187
1214
|
"deleteVectorSlotContribution",
|
|
1215
|
+
"verifyContributions",
|
|
1216
|
+
"repairContributions",
|
|
1188
1217
|
"ensureFulltextTable",
|
|
1189
1218
|
"getReconciliationMarker",
|
|
1190
1219
|
"setReconciliationMarker",
|
|
@@ -1270,28 +1299,28 @@ function compileFieldColumn(field, cteAlias, cteColumnPrefix) {
|
|
|
1270
1299
|
if (cteColumnPrefix !== void 0) {
|
|
1271
1300
|
const qualifier2 = cteColumnPrefix === "" ? "" : `${cteColumnPrefix}.`;
|
|
1272
1301
|
if (field.path.length === 1 && field.path[0] === "id") {
|
|
1273
|
-
return
|
|
1302
|
+
return chunkU5W4LKZV_cjs.sql.raw(`${qualifier2}id`);
|
|
1274
1303
|
}
|
|
1275
1304
|
if (field.path.length === 1 && field.path[0] === "kind") {
|
|
1276
|
-
return
|
|
1305
|
+
return chunkU5W4LKZV_cjs.sql.raw(`${qualifier2}kind`);
|
|
1277
1306
|
}
|
|
1278
1307
|
if (field.path.length > 0 && field.path[0] === "props") {
|
|
1279
|
-
return
|
|
1308
|
+
return chunkU5W4LKZV_cjs.sql.raw(`${qualifier2}props`);
|
|
1280
1309
|
}
|
|
1281
|
-
return
|
|
1310
|
+
return chunkU5W4LKZV_cjs.sql.raw(`${qualifier2}${field.path.join("_")}`);
|
|
1282
1311
|
}
|
|
1283
1312
|
const prefix = field.alias;
|
|
1284
1313
|
const qualifier = cteAlias ? `${cteAlias}.` : "";
|
|
1285
1314
|
if (field.path.length === 1 && field.path[0] === "id") {
|
|
1286
|
-
return
|
|
1315
|
+
return chunkU5W4LKZV_cjs.sql.raw(`${qualifier}${prefix}_id`);
|
|
1287
1316
|
}
|
|
1288
1317
|
if (field.path.length === 1 && field.path[0] === "kind") {
|
|
1289
|
-
return
|
|
1318
|
+
return chunkU5W4LKZV_cjs.sql.raw(`${qualifier}${prefix}_kind`);
|
|
1290
1319
|
}
|
|
1291
1320
|
if (field.path.length > 0 && field.path[0] === "props") {
|
|
1292
|
-
return
|
|
1321
|
+
return chunkU5W4LKZV_cjs.sql.raw(`${qualifier}${prefix}_props`);
|
|
1293
1322
|
}
|
|
1294
|
-
return
|
|
1323
|
+
return chunkU5W4LKZV_cjs.sql.raw(`${qualifier}${prefix}_${field.path.join("_")}`);
|
|
1295
1324
|
}
|
|
1296
1325
|
function getFieldPointer(field) {
|
|
1297
1326
|
if (field.jsonPointer !== void 0) {
|
|
@@ -1311,6 +1340,9 @@ function normalizeValueType2(valueType) {
|
|
|
1311
1340
|
}
|
|
1312
1341
|
return valueType;
|
|
1313
1342
|
}
|
|
1343
|
+
function resolveParameterValueType(left, right) {
|
|
1344
|
+
return normalizeValueType2(right.valueType) ?? normalizeValueType2(left.valueType);
|
|
1345
|
+
}
|
|
1314
1346
|
function compileFieldValue(field, dialect, valueType, cteAlias, pointerOverride, cteColumnPrefix) {
|
|
1315
1347
|
const resolved = normalizeValueType2(valueType);
|
|
1316
1348
|
const column = compileFieldColumn(field, cteAlias, cteColumnPrefix);
|
|
@@ -1374,7 +1406,7 @@ function resolveLiteralValueTypes(literals) {
|
|
|
1374
1406
|
}
|
|
1375
1407
|
}
|
|
1376
1408
|
if (resolved.size > 1) {
|
|
1377
|
-
throw new
|
|
1409
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
1378
1410
|
"Mixed literal value types are not supported in predicates",
|
|
1379
1411
|
{ valueTypes: [...resolved] }
|
|
1380
1412
|
);
|
|
@@ -1408,9 +1440,9 @@ function convertValueForSql(value, dialect) {
|
|
|
1408
1440
|
}
|
|
1409
1441
|
function compileStringPattern(op, pattern) {
|
|
1410
1442
|
const escaped = pattern.replaceAll(
|
|
1411
|
-
|
|
1412
|
-
`${
|
|
1413
|
-
).replaceAll("%", `${
|
|
1443
|
+
chunkU5W4LKZV_cjs.LIKE_ESCAPE_CHARACTER,
|
|
1444
|
+
`${chunkU5W4LKZV_cjs.LIKE_ESCAPE_CHARACTER}${chunkU5W4LKZV_cjs.LIKE_ESCAPE_CHARACTER}`
|
|
1445
|
+
).replaceAll("%", `${chunkU5W4LKZV_cjs.LIKE_ESCAPE_CHARACTER}%`).replaceAll("_", `${chunkU5W4LKZV_cjs.LIKE_ESCAPE_CHARACTER}_`);
|
|
1414
1446
|
switch (op) {
|
|
1415
1447
|
case "contains": {
|
|
1416
1448
|
return `%${escaped}%`;
|
|
@@ -1431,22 +1463,22 @@ function compileStringPattern(op, pattern) {
|
|
|
1431
1463
|
}
|
|
1432
1464
|
}
|
|
1433
1465
|
function escapeLikePatternParameter(parameter) {
|
|
1434
|
-
const doubledEscape = `${
|
|
1435
|
-
return
|
|
1466
|
+
const doubledEscape = `${chunkU5W4LKZV_cjs.LIKE_ESCAPE_CHARACTER}${chunkU5W4LKZV_cjs.LIKE_ESCAPE_CHARACTER}`;
|
|
1467
|
+
return chunkU5W4LKZV_cjs.sql`REPLACE(REPLACE(REPLACE(${parameter}, ${chunkU5W4LKZV_cjs.LIKE_ESCAPE_CHARACTER}, ${doubledEscape}), '%', ${`${chunkU5W4LKZV_cjs.LIKE_ESCAPE_CHARACTER}%`}), '_', ${`${chunkU5W4LKZV_cjs.LIKE_ESCAPE_CHARACTER}_`})`;
|
|
1436
1468
|
}
|
|
1437
1469
|
function compileParameterizedStringPattern(op, parameter) {
|
|
1438
1470
|
switch (op) {
|
|
1439
1471
|
case "contains": {
|
|
1440
1472
|
const escaped = escapeLikePatternParameter(parameter);
|
|
1441
|
-
return
|
|
1473
|
+
return chunkU5W4LKZV_cjs.sql`'%' || ${escaped} || '%'`;
|
|
1442
1474
|
}
|
|
1443
1475
|
case "startsWith": {
|
|
1444
1476
|
const escaped = escapeLikePatternParameter(parameter);
|
|
1445
|
-
return
|
|
1477
|
+
return chunkU5W4LKZV_cjs.sql`${escaped} || '%'`;
|
|
1446
1478
|
}
|
|
1447
1479
|
case "endsWith": {
|
|
1448
1480
|
const escaped = escapeLikePatternParameter(parameter);
|
|
1449
|
-
return
|
|
1481
|
+
return chunkU5W4LKZV_cjs.sql`'%' || ${escaped}`;
|
|
1450
1482
|
}
|
|
1451
1483
|
case "like":
|
|
1452
1484
|
case "ilike": {
|
|
@@ -1473,18 +1505,18 @@ function compilePredicateExpression(expr, ctx) {
|
|
|
1473
1505
|
cteColumnPrefix
|
|
1474
1506
|
);
|
|
1475
1507
|
if (isParameterRef(expr.pattern)) {
|
|
1476
|
-
const placeholder =
|
|
1508
|
+
const placeholder = chunkU5W4LKZV_cjs.sql`${chunkU5W4LKZV_cjs.sql.placeholder(expr.pattern.name)}`;
|
|
1477
1509
|
const pattern2 = compileParameterizedStringPattern(expr.op, placeholder);
|
|
1478
1510
|
if (expr.op === "ilike" || expr.op === "contains" || expr.op === "startsWith" || expr.op === "endsWith") {
|
|
1479
1511
|
return dialect.ilike(field, pattern2);
|
|
1480
1512
|
}
|
|
1481
|
-
return
|
|
1513
|
+
return chunkU5W4LKZV_cjs.sql`${field} LIKE ${pattern2} ${chunkU5W4LKZV_cjs.likeEscapeClause}`;
|
|
1482
1514
|
}
|
|
1483
1515
|
const pattern = compileStringPattern(expr.op, expr.pattern);
|
|
1484
1516
|
if (expr.op === "ilike" || expr.op === "contains" || expr.op === "startsWith" || expr.op === "endsWith") {
|
|
1485
1517
|
return dialect.ilike(field, pattern);
|
|
1486
1518
|
}
|
|
1487
|
-
return
|
|
1519
|
+
return chunkU5W4LKZV_cjs.sql`${field} LIKE ${pattern} ${chunkU5W4LKZV_cjs.likeEscapeClause}`;
|
|
1488
1520
|
}
|
|
1489
1521
|
case "null_check": {
|
|
1490
1522
|
const field = compileFieldTextValue(
|
|
@@ -1494,7 +1526,7 @@ function compilePredicateExpression(expr, ctx) {
|
|
|
1494
1526
|
void 0,
|
|
1495
1527
|
cteColumnPrefix
|
|
1496
1528
|
);
|
|
1497
|
-
return expr.op === "isNull" ?
|
|
1529
|
+
return expr.op === "isNull" ? chunkU5W4LKZV_cjs.sql`${field} IS NULL` : chunkU5W4LKZV_cjs.sql`${field} IS NOT NULL`;
|
|
1498
1530
|
}
|
|
1499
1531
|
case "between": {
|
|
1500
1532
|
const lowerIsParam = isParameterRef(expr.lower);
|
|
@@ -1504,7 +1536,7 @@ function compilePredicateExpression(expr, ctx) {
|
|
|
1504
1536
|
if (!upperIsParam) boundsForType.push(expr.upper);
|
|
1505
1537
|
const valueType = boundsForType.length > 0 ? resolveComparisonValueType(expr.field, boundsForType) : normalizeValueType2(expr.field.valueType);
|
|
1506
1538
|
if (valueType === "array" || valueType === "object") {
|
|
1507
|
-
throw new
|
|
1539
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
1508
1540
|
"Between comparisons are not supported for JSON arrays or objects"
|
|
1509
1541
|
);
|
|
1510
1542
|
}
|
|
@@ -1516,25 +1548,25 @@ function compilePredicateExpression(expr, ctx) {
|
|
|
1516
1548
|
void 0,
|
|
1517
1549
|
cteColumnPrefix
|
|
1518
1550
|
);
|
|
1519
|
-
const lower = lowerIsParam ?
|
|
1520
|
-
const upper = upperIsParam ?
|
|
1521
|
-
return
|
|
1551
|
+
const lower = lowerIsParam ? chunkU5W4LKZV_cjs.sql.placeholder(expr.lower.name) : convertValueForSql(expr.lower.value, dialect);
|
|
1552
|
+
const upper = upperIsParam ? chunkU5W4LKZV_cjs.sql.placeholder(expr.upper.name) : convertValueForSql(expr.upper.value, dialect);
|
|
1553
|
+
return chunkU5W4LKZV_cjs.sql`${field} BETWEEN ${lower} AND ${upper}`;
|
|
1522
1554
|
}
|
|
1523
1555
|
case "and": {
|
|
1524
1556
|
const parts = expr.predicates.map(
|
|
1525
1557
|
(p) => compilePredicateExpression(p, ctx)
|
|
1526
1558
|
);
|
|
1527
|
-
return
|
|
1559
|
+
return chunkU5W4LKZV_cjs.sql`(${chunkU5W4LKZV_cjs.sql.join(parts, chunkU5W4LKZV_cjs.sql` AND `)})`;
|
|
1528
1560
|
}
|
|
1529
1561
|
case "or": {
|
|
1530
1562
|
const parts = expr.predicates.map(
|
|
1531
1563
|
(p) => compilePredicateExpression(p, ctx)
|
|
1532
1564
|
);
|
|
1533
|
-
return
|
|
1565
|
+
return chunkU5W4LKZV_cjs.sql`(${chunkU5W4LKZV_cjs.sql.join(parts, chunkU5W4LKZV_cjs.sql` OR `)})`;
|
|
1534
1566
|
}
|
|
1535
1567
|
case "not": {
|
|
1536
1568
|
const inner = compilePredicateExpression(expr.predicate, ctx);
|
|
1537
|
-
return
|
|
1569
|
+
return chunkU5W4LKZV_cjs.sql`NOT (${inner})`;
|
|
1538
1570
|
}
|
|
1539
1571
|
case "array_op": {
|
|
1540
1572
|
return compileArrayPredicate(expr, dialect, cteColumnPrefix);
|
|
@@ -1557,10 +1589,10 @@ function compilePredicateExpression(expr, ctx) {
|
|
|
1557
1589
|
}
|
|
1558
1590
|
}
|
|
1559
1591
|
}
|
|
1560
|
-
var STRUCTURAL_PREDICATE_NOOP =
|
|
1592
|
+
var STRUCTURAL_PREDICATE_NOOP = chunkU5W4LKZV_cjs.sql.raw("1=1");
|
|
1561
1593
|
function compileComparisonPredicate(expr, dialect, cteColumnPrefix) {
|
|
1562
1594
|
if (isParameterRef(expr.right)) {
|
|
1563
|
-
const parameterValueType =
|
|
1595
|
+
const parameterValueType = resolveParameterValueType(expr.left, expr.right);
|
|
1564
1596
|
const left2 = compileFieldValue(
|
|
1565
1597
|
expr.left,
|
|
1566
1598
|
dialect,
|
|
@@ -1569,17 +1601,26 @@ function compileComparisonPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1569
1601
|
void 0,
|
|
1570
1602
|
cteColumnPrefix
|
|
1571
1603
|
);
|
|
1604
|
+
if (expr.op === "in" || expr.op === "notIn") {
|
|
1605
|
+
return compileListParameterPredicate(
|
|
1606
|
+
left2,
|
|
1607
|
+
expr.right.name,
|
|
1608
|
+
parameterValueType,
|
|
1609
|
+
expr.op === "notIn",
|
|
1610
|
+
dialect
|
|
1611
|
+
);
|
|
1612
|
+
}
|
|
1572
1613
|
const opSql2 = COMPARISON_OP_SQL[expr.op];
|
|
1573
1614
|
if (!opSql2) {
|
|
1574
|
-
throw new
|
|
1615
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
1575
1616
|
`Comparison operation "${expr.op}" is not supported for parameterized predicates`
|
|
1576
1617
|
);
|
|
1577
1618
|
}
|
|
1578
|
-
return
|
|
1619
|
+
return chunkU5W4LKZV_cjs.sql`${left2} ${chunkU5W4LKZV_cjs.sql.raw(opSql2)} ${chunkU5W4LKZV_cjs.sql.placeholder(expr.right.name)}`;
|
|
1579
1620
|
}
|
|
1580
1621
|
const valueType = resolveComparisonValueType(expr.left, expr.right);
|
|
1581
1622
|
if (valueType === "array" || valueType === "object") {
|
|
1582
|
-
throw new
|
|
1623
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
1583
1624
|
`Comparison operation "${expr.op}" is not supported for ${valueType} values`
|
|
1584
1625
|
);
|
|
1585
1626
|
}
|
|
@@ -1594,7 +1635,7 @@ function compileComparisonPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1594
1635
|
if (expr.op === "in" || expr.op === "notIn") {
|
|
1595
1636
|
const values = Array.isArray(expr.right) ? expr.right : [expr.right];
|
|
1596
1637
|
if (values.length === 0) {
|
|
1597
|
-
return expr.op === "in" ?
|
|
1638
|
+
return expr.op === "in" ? chunkU5W4LKZV_cjs.sql.raw("1=0") : chunkU5W4LKZV_cjs.sql.raw("1=1");
|
|
1598
1639
|
}
|
|
1599
1640
|
const convertedValues = values.map(
|
|
1600
1641
|
(value) => convertValueForSql(value.value, dialect)
|
|
@@ -1606,11 +1647,26 @@ function compileComparisonPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1606
1647
|
const convertedRight = convertValueForSql(rightValue.value, dialect);
|
|
1607
1648
|
const opSql = COMPARISON_OP_SQL[expr.op];
|
|
1608
1649
|
if (!opSql) {
|
|
1609
|
-
throw new
|
|
1650
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
1610
1651
|
`Comparison operation "${expr.op}" is not supported`
|
|
1611
1652
|
);
|
|
1612
1653
|
}
|
|
1613
|
-
return
|
|
1654
|
+
return chunkU5W4LKZV_cjs.sql`${left} ${chunkU5W4LKZV_cjs.sql.raw(opSql)} ${convertedRight}`;
|
|
1655
|
+
}
|
|
1656
|
+
function compileListParameterPredicate(left, parameterName, elementType, negated, dialect) {
|
|
1657
|
+
if (elementType === "array" || elementType === "object" || elementType === "embedding") {
|
|
1658
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
1659
|
+
`IN/NOT IN is not supported for ${elementType} values`,
|
|
1660
|
+
{ valueType: elementType },
|
|
1661
|
+
{
|
|
1662
|
+
suggestion: "Use scalar fields (string/number/boolean/date) in IN/NOT IN predicates."
|
|
1663
|
+
}
|
|
1664
|
+
);
|
|
1665
|
+
}
|
|
1666
|
+
return dialect.inListParameter(left, chunkU5W4LKZV_cjs.sql.placeholder(parameterName), {
|
|
1667
|
+
negated,
|
|
1668
|
+
elementType
|
|
1669
|
+
});
|
|
1614
1670
|
}
|
|
1615
1671
|
function compileArrayPredicate(expr, dialect, cteColumnPrefix) {
|
|
1616
1672
|
const field = compileFieldJsonValue(
|
|
@@ -1623,30 +1679,30 @@ function compileArrayPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1623
1679
|
const values = expr.values?.map((v) => convertValueForSql(v.value, dialect)) ?? [];
|
|
1624
1680
|
switch (expr.op) {
|
|
1625
1681
|
case "isEmpty": {
|
|
1626
|
-
return
|
|
1682
|
+
return chunkU5W4LKZV_cjs.sql`(${field} IS NULL OR ${dialect.jsonArrayLength(field)} = 0)`;
|
|
1627
1683
|
}
|
|
1628
1684
|
case "isNotEmpty": {
|
|
1629
|
-
return
|
|
1685
|
+
return chunkU5W4LKZV_cjs.sql`(${field} IS NOT NULL AND ${dialect.jsonArrayLength(field)} > 0)`;
|
|
1630
1686
|
}
|
|
1631
1687
|
case "lengthEq": {
|
|
1632
|
-
return
|
|
1688
|
+
return chunkU5W4LKZV_cjs.sql`${dialect.jsonArrayLength(field)} = ${expr.length}`;
|
|
1633
1689
|
}
|
|
1634
1690
|
case "lengthGt": {
|
|
1635
|
-
return
|
|
1691
|
+
return chunkU5W4LKZV_cjs.sql`${dialect.jsonArrayLength(field)} > ${expr.length}`;
|
|
1636
1692
|
}
|
|
1637
1693
|
case "lengthGte": {
|
|
1638
|
-
return
|
|
1694
|
+
return chunkU5W4LKZV_cjs.sql`${dialect.jsonArrayLength(field)} >= ${expr.length}`;
|
|
1639
1695
|
}
|
|
1640
1696
|
case "lengthLt": {
|
|
1641
|
-
return
|
|
1697
|
+
return chunkU5W4LKZV_cjs.sql`${dialect.jsonArrayLength(field)} < ${expr.length}`;
|
|
1642
1698
|
}
|
|
1643
1699
|
case "lengthLte": {
|
|
1644
|
-
return
|
|
1700
|
+
return chunkU5W4LKZV_cjs.sql`${dialect.jsonArrayLength(field)} <= ${expr.length}`;
|
|
1645
1701
|
}
|
|
1646
1702
|
case "contains": {
|
|
1647
1703
|
const value = values[0];
|
|
1648
1704
|
if (value === void 0) {
|
|
1649
|
-
return
|
|
1705
|
+
return chunkU5W4LKZV_cjs.sql.raw("1=0");
|
|
1650
1706
|
}
|
|
1651
1707
|
return dialect.jsonArrayContains(field, value);
|
|
1652
1708
|
}
|
|
@@ -1669,13 +1725,13 @@ function compileObjectPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1669
1725
|
}
|
|
1670
1726
|
case "pathEquals": {
|
|
1671
1727
|
if (!expr.value) {
|
|
1672
|
-
throw new
|
|
1728
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
1673
1729
|
"pathEquals requires a comparison value"
|
|
1674
1730
|
);
|
|
1675
1731
|
}
|
|
1676
1732
|
const valueType = resolvePredicateValueType(expr.valueType, expr.value);
|
|
1677
1733
|
if (valueType === "array" || valueType === "object") {
|
|
1678
|
-
throw new
|
|
1734
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
1679
1735
|
"pathEquals is not supported for JSON arrays or objects"
|
|
1680
1736
|
);
|
|
1681
1737
|
}
|
|
@@ -1687,11 +1743,11 @@ function compileObjectPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1687
1743
|
pointer,
|
|
1688
1744
|
cteColumnPrefix
|
|
1689
1745
|
);
|
|
1690
|
-
return
|
|
1746
|
+
return chunkU5W4LKZV_cjs.sql`${left} = ${convertValueForSql(expr.value.value, dialect)}`;
|
|
1691
1747
|
}
|
|
1692
1748
|
case "pathContains": {
|
|
1693
1749
|
if (!expr.value) {
|
|
1694
|
-
throw new
|
|
1750
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
1695
1751
|
"pathContains requires a comparison value"
|
|
1696
1752
|
);
|
|
1697
1753
|
}
|
|
@@ -1719,12 +1775,12 @@ function compileAggregatePredicate(expr, dialect) {
|
|
|
1719
1775
|
const aggregate = compileAggregateExpr(expr.aggregate, dialect);
|
|
1720
1776
|
const op = COMPARISON_OP_SQL[expr.op];
|
|
1721
1777
|
if (!op) {
|
|
1722
|
-
throw new
|
|
1778
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
1723
1779
|
`Comparison operation "${expr.op}" is not supported for aggregate predicates`
|
|
1724
1780
|
);
|
|
1725
1781
|
}
|
|
1726
1782
|
const convertedValue = convertValueForSql(expr.value.value, dialect);
|
|
1727
|
-
return
|
|
1783
|
+
return chunkU5W4LKZV_cjs.sql`${aggregate} ${chunkU5W4LKZV_cjs.sql.raw(op)} ${convertedValue}`;
|
|
1728
1784
|
}
|
|
1729
1785
|
function compileAggregateExpr(expr, dialect) {
|
|
1730
1786
|
const cteAlias = `cte_${expr.field.alias}`;
|
|
@@ -1736,25 +1792,25 @@ function compileAggregateExpr(expr, dialect) {
|
|
|
1736
1792
|
);
|
|
1737
1793
|
switch (expr.function) {
|
|
1738
1794
|
case "count": {
|
|
1739
|
-
return
|
|
1795
|
+
return chunkU5W4LKZV_cjs.sql`COUNT(${field})`;
|
|
1740
1796
|
}
|
|
1741
1797
|
case "countDistinct": {
|
|
1742
|
-
return
|
|
1798
|
+
return chunkU5W4LKZV_cjs.sql`COUNT(DISTINCT ${field})`;
|
|
1743
1799
|
}
|
|
1744
1800
|
case "sum": {
|
|
1745
|
-
return
|
|
1801
|
+
return chunkU5W4LKZV_cjs.sql`SUM(${field})`;
|
|
1746
1802
|
}
|
|
1747
1803
|
case "avg": {
|
|
1748
|
-
return
|
|
1804
|
+
return chunkU5W4LKZV_cjs.sql`AVG(${field})`;
|
|
1749
1805
|
}
|
|
1750
1806
|
case "min": {
|
|
1751
|
-
return
|
|
1807
|
+
return chunkU5W4LKZV_cjs.sql`MIN(${field})`;
|
|
1752
1808
|
}
|
|
1753
1809
|
case "max": {
|
|
1754
|
-
return
|
|
1810
|
+
return chunkU5W4LKZV_cjs.sql`MAX(${field})`;
|
|
1755
1811
|
}
|
|
1756
1812
|
default: {
|
|
1757
|
-
throw new
|
|
1813
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
1758
1814
|
`Unknown aggregate function: ${expr.function}`
|
|
1759
1815
|
);
|
|
1760
1816
|
}
|
|
@@ -1762,15 +1818,15 @@ function compileAggregateExpr(expr, dialect) {
|
|
|
1762
1818
|
}
|
|
1763
1819
|
function compileExistsSubquery(expr, ctx) {
|
|
1764
1820
|
if (expr.subquery.graphId === void 0) {
|
|
1765
|
-
throw new
|
|
1821
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError("EXISTS subquery must have a graphId");
|
|
1766
1822
|
}
|
|
1767
1823
|
const subSql = ctx.compileQuery(expr.subquery, expr.subquery.graphId);
|
|
1768
|
-
return expr.negated ?
|
|
1824
|
+
return expr.negated ? chunkU5W4LKZV_cjs.sql`NOT EXISTS (${subSql})` : chunkU5W4LKZV_cjs.sql`EXISTS (${subSql})`;
|
|
1769
1825
|
}
|
|
1770
1826
|
function compileInSubquery(expr, ctx) {
|
|
1771
1827
|
const subqueryColumnCount = getSubqueryColumnCount(expr.subquery);
|
|
1772
1828
|
if (subqueryColumnCount !== 1) {
|
|
1773
|
-
throw new
|
|
1829
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
1774
1830
|
`IN/NOT IN subquery must project exactly 1 column, but got ${subqueryColumnCount}`,
|
|
1775
1831
|
{ subqueryColumnCount }
|
|
1776
1832
|
);
|
|
@@ -1779,13 +1835,13 @@ function compileInSubquery(expr, ctx) {
|
|
|
1779
1835
|
const subqueryValueType = getSingleSubqueryColumnValueType(expr.subquery);
|
|
1780
1836
|
const resolvedValueType = fieldValueType ?? subqueryValueType;
|
|
1781
1837
|
if (isUnsupportedInSubqueryValueType(resolvedValueType)) {
|
|
1782
|
-
throw new
|
|
1838
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
1783
1839
|
`IN/NOT IN subquery does not support ${String(resolvedValueType)} values`,
|
|
1784
1840
|
{ valueType: resolvedValueType }
|
|
1785
1841
|
);
|
|
1786
1842
|
}
|
|
1787
1843
|
if (!isInSubqueryTypeCompatible(fieldValueType, subqueryValueType)) {
|
|
1788
|
-
throw new
|
|
1844
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
1789
1845
|
`IN/NOT IN type mismatch: field type "${String(fieldValueType)}" does not match subquery column type "${String(subqueryValueType)}"`,
|
|
1790
1846
|
{
|
|
1791
1847
|
fieldValueType,
|
|
@@ -1795,7 +1851,7 @@ function compileInSubquery(expr, ctx) {
|
|
|
1795
1851
|
}
|
|
1796
1852
|
const valueType = fieldValueType ?? subqueryValueType;
|
|
1797
1853
|
if (expr.subquery.graphId === void 0) {
|
|
1798
|
-
throw new
|
|
1854
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
1799
1855
|
"IN/NOT IN subquery must have a graphId"
|
|
1800
1856
|
);
|
|
1801
1857
|
}
|
|
@@ -1808,14 +1864,14 @@ function compileInSubquery(expr, ctx) {
|
|
|
1808
1864
|
ctx.cteColumnPrefix
|
|
1809
1865
|
);
|
|
1810
1866
|
const subSql = ctx.compileQuery(expr.subquery, expr.subquery.graphId);
|
|
1811
|
-
return expr.negated ?
|
|
1867
|
+
return expr.negated ? chunkU5W4LKZV_cjs.sql`${fieldSql} NOT IN (${subSql})` : chunkU5W4LKZV_cjs.sql`${fieldSql} IN (${subSql})`;
|
|
1812
1868
|
}
|
|
1813
1869
|
function extractStructuralPredicates(predicates, isMatch, rejectionMessage) {
|
|
1814
1870
|
const results = [];
|
|
1815
1871
|
function visit(expr, inDisallowedBranch) {
|
|
1816
1872
|
if (isMatch(expr)) {
|
|
1817
1873
|
if (inDisallowedBranch) {
|
|
1818
|
-
throw new
|
|
1874
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(rejectionMessage);
|
|
1819
1875
|
}
|
|
1820
1876
|
results.push(expr);
|
|
1821
1877
|
return;
|
|
@@ -1869,9 +1925,9 @@ function extractFulltextMatchPredicates(predicates) {
|
|
|
1869
1925
|
// src/query/compiler/predicate-utils.ts
|
|
1870
1926
|
var EMPTY_PREDICATES = [];
|
|
1871
1927
|
function sqlValueList(values) {
|
|
1872
|
-
return
|
|
1873
|
-
values.map((value) =>
|
|
1874
|
-
|
|
1928
|
+
return chunkU5W4LKZV_cjs.sql.join(
|
|
1929
|
+
values.map((value) => chunkU5W4LKZV_cjs.sql`${value}`),
|
|
1930
|
+
chunkU5W4LKZV_cjs.sql`, `
|
|
1875
1931
|
);
|
|
1876
1932
|
}
|
|
1877
1933
|
function buildPredicateIndexKey(alias, targetType) {
|
|
@@ -1908,12 +1964,12 @@ function compilePredicateClauses(predicates, predicateContext) {
|
|
|
1908
1964
|
}
|
|
1909
1965
|
function compileKindFilter(column, kinds) {
|
|
1910
1966
|
if (kinds.length === 0) {
|
|
1911
|
-
return
|
|
1967
|
+
return chunkU5W4LKZV_cjs.sql`1 = 0`;
|
|
1912
1968
|
}
|
|
1913
1969
|
if (kinds.length === 1) {
|
|
1914
|
-
return
|
|
1970
|
+
return chunkU5W4LKZV_cjs.sql`${column} = ${kinds[0]}`;
|
|
1915
1971
|
}
|
|
1916
|
-
return
|
|
1972
|
+
return chunkU5W4LKZV_cjs.sql`${column} IN (${sqlValueList(kinds)})`;
|
|
1917
1973
|
}
|
|
1918
1974
|
function getNodeKindsForAlias(ast, alias) {
|
|
1919
1975
|
if (alias === ast.start.alias) {
|
|
@@ -1924,7 +1980,7 @@ function getNodeKindsForAlias(ast, alias) {
|
|
|
1924
1980
|
return traversal.nodeKinds;
|
|
1925
1981
|
}
|
|
1926
1982
|
}
|
|
1927
|
-
throw new
|
|
1983
|
+
throw new chunkC4F7VJ5D_cjs.CompilerInvariantError(`Unknown traversal source alias: ${alias}`);
|
|
1928
1984
|
}
|
|
1929
1985
|
function getHybridTargetAlias(vectorPredicate, fulltextPredicate) {
|
|
1930
1986
|
if (!vectorPredicate || !fulltextPredicate) return void 0;
|
|
@@ -2009,13 +2065,13 @@ var RECORDED_EDGE_COLUMNS = [
|
|
|
2009
2065
|
"tx_id",
|
|
2010
2066
|
"meta"
|
|
2011
2067
|
];
|
|
2012
|
-
var RECORDED_NODE_COLUMN_LIST =
|
|
2013
|
-
var RECORDED_EDGE_COLUMN_LIST =
|
|
2068
|
+
var RECORDED_NODE_COLUMN_LIST = chunkU5W4LKZV_cjs.sql.raw(RECORDED_NODE_COLUMNS.join(", "));
|
|
2069
|
+
var RECORDED_EDGE_COLUMN_LIST = chunkU5W4LKZV_cjs.sql.raw(RECORDED_EDGE_COLUMNS.join(", "));
|
|
2014
2070
|
var RECORDED_BIND_PARAM_BUDGET = 900;
|
|
2015
2071
|
function recordedBindParamBudget(target) {
|
|
2016
2072
|
const budget = target.capabilities.maxBindParameters ?? RECORDED_BIND_PARAM_BUDGET;
|
|
2017
2073
|
if (!Number.isSafeInteger(budget) || budget < 1) {
|
|
2018
|
-
throw new
|
|
2074
|
+
throw new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
2019
2075
|
`backend capabilities.maxBindParameters must be a positive integer, got: ${String(budget)}`,
|
|
2020
2076
|
{
|
|
2021
2077
|
code: "INVALID_BACKEND_CAPABILITY",
|
|
@@ -2031,44 +2087,44 @@ function recordedChunkSize(target, columnCount) {
|
|
|
2031
2087
|
return Math.max(1, Math.floor(budget / columnCount));
|
|
2032
2088
|
}
|
|
2033
2089
|
function sqlNull(value) {
|
|
2034
|
-
return value === void 0 ?
|
|
2090
|
+
return value === void 0 ? chunkU5W4LKZV_cjs.sql.raw("NULL") : chunkU5W4LKZV_cjs.sql`${value}`;
|
|
2035
2091
|
}
|
|
2036
2092
|
function recordedCommonCells() {
|
|
2037
2093
|
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: () =>
|
|
2094
|
+
history_id: () => chunkU5W4LKZV_cjs.sql`${generateId()}`,
|
|
2095
|
+
graph_id: (row) => chunkU5W4LKZV_cjs.sql`${row.graph_id}`,
|
|
2096
|
+
id: (row) => chunkU5W4LKZV_cjs.sql`${row.id}`,
|
|
2097
|
+
kind: (row) => chunkU5W4LKZV_cjs.sql`${row.kind}`,
|
|
2098
|
+
props: (row) => chunkU5W4LKZV_cjs.sql`${chunkEKFUG4G7_cjs.rowPropsToJsonText(row.props)}`,
|
|
2099
|
+
valid_from: (row) => chunkU5W4LKZV_cjs.sql`${sqlNull(row.valid_from)}`,
|
|
2100
|
+
valid_to: (row) => chunkU5W4LKZV_cjs.sql`${sqlNull(row.valid_to)}`,
|
|
2101
|
+
created_at: (row) => chunkU5W4LKZV_cjs.sql`${row.created_at}`,
|
|
2102
|
+
updated_at: (row) => chunkU5W4LKZV_cjs.sql`${row.updated_at}`,
|
|
2103
|
+
deleted_at: (row) => chunkU5W4LKZV_cjs.sql`${sqlNull(row.deleted_at)}`,
|
|
2104
|
+
recorded_from: (_row, recordedRevision) => chunkU5W4LKZV_cjs.sql`${recordedRevision}`,
|
|
2105
|
+
recorded_to: () => chunkU5W4LKZV_cjs.sql`${chunkEQ7JKLZO_cjs.RECORDED_MAX_REVISION}`,
|
|
2106
|
+
op: (_row, _recordedCommit, operation) => chunkU5W4LKZV_cjs.sql`${operation}`,
|
|
2107
|
+
schema_version: () => chunkU5W4LKZV_cjs.sql`NULL`,
|
|
2108
|
+
tx_id: () => chunkU5W4LKZV_cjs.sql`NULL`,
|
|
2109
|
+
meta: () => chunkU5W4LKZV_cjs.sql`${RECORDED_HISTORY_META}`
|
|
2054
2110
|
};
|
|
2055
2111
|
}
|
|
2056
2112
|
var recordedNodeCells = {
|
|
2057
2113
|
...recordedCommonCells(),
|
|
2058
|
-
version: (row) =>
|
|
2114
|
+
version: (row) => chunkU5W4LKZV_cjs.sql`${row.version}`
|
|
2059
2115
|
};
|
|
2060
2116
|
var recordedEdgeCells = {
|
|
2061
2117
|
...recordedCommonCells(),
|
|
2062
|
-
from_kind: (row) =>
|
|
2063
|
-
from_id: (row) =>
|
|
2064
|
-
to_kind: (row) =>
|
|
2065
|
-
to_id: (row) =>
|
|
2118
|
+
from_kind: (row) => chunkU5W4LKZV_cjs.sql`${row.from_kind}`,
|
|
2119
|
+
from_id: (row) => chunkU5W4LKZV_cjs.sql`${row.from_id}`,
|
|
2120
|
+
to_kind: (row) => chunkU5W4LKZV_cjs.sql`${row.to_kind}`,
|
|
2121
|
+
to_id: (row) => chunkU5W4LKZV_cjs.sql`${row.to_id}`
|
|
2066
2122
|
};
|
|
2067
2123
|
function recordedValuesTuple(columns, cells, row, recordedRevision, operation) {
|
|
2068
2124
|
const tuple = columns.map(
|
|
2069
2125
|
(column) => cells[column](row, recordedRevision, operation)
|
|
2070
2126
|
);
|
|
2071
|
-
return
|
|
2127
|
+
return chunkU5W4LKZV_cjs.sql`(${chunkU5W4LKZV_cjs.sql.join(tuple, chunkU5W4LKZV_cjs.sql`, `)})`;
|
|
2072
2128
|
}
|
|
2073
2129
|
async function insertRecordedRows(target, table, columnList, columns, cells, inserts, recordedRevision) {
|
|
2074
2130
|
if (inserts.length === 0) return;
|
|
@@ -2083,9 +2139,9 @@ async function insertRecordedRows(target, table, columnList, columns, cells, ins
|
|
|
2083
2139
|
);
|
|
2084
2140
|
await executeStatement(
|
|
2085
2141
|
target,
|
|
2086
|
-
|
|
2142
|
+
chunkU5W4LKZV_cjs.sql`
|
|
2087
2143
|
INSERT INTO ${table} (${columnList})
|
|
2088
|
-
VALUES ${
|
|
2144
|
+
VALUES ${chunkU5W4LKZV_cjs.sql.join(values, chunkU5W4LKZV_cjs.sql`, `)}
|
|
2089
2145
|
`
|
|
2090
2146
|
);
|
|
2091
2147
|
}
|
|
@@ -2130,14 +2186,14 @@ function entityKey(entity) {
|
|
|
2130
2186
|
}
|
|
2131
2187
|
}
|
|
2132
2188
|
async function closeOpenReturning(target, table, graphId, ids, recordedRevision, kind) {
|
|
2133
|
-
const kindFilter = kind === void 0 ?
|
|
2189
|
+
const kindFilter = kind === void 0 ? chunkU5W4LKZV_cjs.sql`` : chunkU5W4LKZV_cjs.sql`AND kind = ${kind}`;
|
|
2134
2190
|
const rows = await target.execute(
|
|
2135
|
-
|
|
2191
|
+
chunkU5W4LKZV_cjs.asCompiledRowsSql(chunkU5W4LKZV_cjs.sql`
|
|
2136
2192
|
UPDATE ${table}
|
|
2137
2193
|
SET recorded_to = ${recordedRevision}
|
|
2138
2194
|
WHERE graph_id = ${graphId}
|
|
2139
2195
|
${kindFilter}
|
|
2140
|
-
AND recorded_to = ${
|
|
2196
|
+
AND recorded_to = ${chunkEQ7JKLZO_cjs.RECORDED_MAX_REVISION}
|
|
2141
2197
|
AND id IN (${sqlValueList(ids)})
|
|
2142
2198
|
RETURNING id, deleted_at
|
|
2143
2199
|
`)
|
|
@@ -2231,24 +2287,24 @@ async function flushEdges(target, schema, graphId, entities, recordedRevision) {
|
|
|
2231
2287
|
async function closeOpenByKind(target, table, graphId, kind, recordedRevision) {
|
|
2232
2288
|
await executeStatement(
|
|
2233
2289
|
target,
|
|
2234
|
-
|
|
2290
|
+
chunkU5W4LKZV_cjs.sql`
|
|
2235
2291
|
UPDATE ${table}
|
|
2236
2292
|
SET recorded_to = ${recordedRevision}
|
|
2237
2293
|
WHERE graph_id = ${graphId}
|
|
2238
2294
|
AND kind = ${kind}
|
|
2239
|
-
AND recorded_to = ${
|
|
2295
|
+
AND recorded_to = ${chunkEQ7JKLZO_cjs.RECORDED_MAX_REVISION}
|
|
2240
2296
|
`
|
|
2241
2297
|
);
|
|
2242
2298
|
}
|
|
2243
2299
|
async function closeOpenEdgesByNodeKind(target, schema, graphId, nodeKind, recordedRevision) {
|
|
2244
2300
|
await executeStatement(
|
|
2245
2301
|
target,
|
|
2246
|
-
|
|
2302
|
+
chunkU5W4LKZV_cjs.sql`
|
|
2247
2303
|
UPDATE ${schema.recordedEdgesTable}
|
|
2248
2304
|
SET recorded_to = ${recordedRevision}
|
|
2249
2305
|
WHERE graph_id = ${graphId}
|
|
2250
2306
|
AND (from_kind = ${nodeKind} OR to_kind = ${nodeKind})
|
|
2251
|
-
AND recorded_to = ${
|
|
2307
|
+
AND recorded_to = ${chunkEQ7JKLZO_cjs.RECORDED_MAX_REVISION}
|
|
2252
2308
|
`
|
|
2253
2309
|
);
|
|
2254
2310
|
}
|
|
@@ -2286,7 +2342,7 @@ async function closeRecordedHardDeletedKind(target, schema, graphId, removal, ow
|
|
|
2286
2342
|
}
|
|
2287
2343
|
async function queryConnectedEdgeIds(target, schema, params) {
|
|
2288
2344
|
const rows = await target.execute(
|
|
2289
|
-
|
|
2345
|
+
chunkU5W4LKZV_cjs.asCompiledRowsSql(chunkU5W4LKZV_cjs.sql`
|
|
2290
2346
|
SELECT id
|
|
2291
2347
|
FROM ${schema.edgesTable}
|
|
2292
2348
|
WHERE graph_id = ${params.graphId}
|
|
@@ -2307,9 +2363,9 @@ function normalizedColumnType(value) {
|
|
|
2307
2363
|
}
|
|
2308
2364
|
async function readColumnTypes(backend, table) {
|
|
2309
2365
|
const rows = backend.dialect === "sqlite" ? await backend.execute(
|
|
2310
|
-
|
|
2366
|
+
chunkU5W4LKZV_cjs.asCompiledRowsSql(chunkU5W4LKZV_cjs.sql`PRAGMA table_info(${chunkU5W4LKZV_cjs.sql.identifier(table)})`)
|
|
2311
2367
|
) : await backend.execute(
|
|
2312
|
-
|
|
2368
|
+
chunkU5W4LKZV_cjs.asCompiledRowsSql(chunkU5W4LKZV_cjs.sql`
|
|
2313
2369
|
SELECT column_name AS name, data_type AS type
|
|
2314
2370
|
FROM information_schema.columns
|
|
2315
2371
|
WHERE table_schema = current_schema()
|
|
@@ -2384,7 +2440,7 @@ async function assertCurrentRecordedSchema(backend, schema) {
|
|
|
2384
2440
|
return [{ ...requirement, actual: actual ?? "missing" }];
|
|
2385
2441
|
});
|
|
2386
2442
|
if (incompatible.length === 0) return;
|
|
2387
|
-
throw new
|
|
2443
|
+
throw new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
2388
2444
|
"Recorded-time schema is incompatible with history capture.",
|
|
2389
2445
|
{
|
|
2390
2446
|
code: "RECORDED_SCHEMA_INCOMPATIBLE",
|
|
@@ -2432,7 +2488,7 @@ function edgeRowIdentityKey(row) {
|
|
|
2432
2488
|
return edgeIdentityKey(row.graph_id, row.id);
|
|
2433
2489
|
}
|
|
2434
2490
|
function recordedCaptureSealedError(details) {
|
|
2435
|
-
return new
|
|
2491
|
+
return new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
2436
2492
|
"Recorded-time capture session is sealed: a graph write happened after the transaction's capture was flushed.",
|
|
2437
2493
|
details,
|
|
2438
2494
|
{
|
|
@@ -2465,7 +2521,7 @@ function createRecordedCaptureSession() {
|
|
|
2465
2521
|
},
|
|
2466
2522
|
async flush(target, schema, ownsWriteLock) {
|
|
2467
2523
|
if (sealed) {
|
|
2468
|
-
throw new
|
|
2524
|
+
throw new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
2469
2525
|
"Recorded-time capture session was already flushed.",
|
|
2470
2526
|
{},
|
|
2471
2527
|
{
|
|
@@ -2526,7 +2582,7 @@ function createRecordedTransactionBackend(target, session, schema) {
|
|
|
2526
2582
|
await lockRecordedGraphWrite(target, graphId, graphLocks);
|
|
2527
2583
|
}
|
|
2528
2584
|
}
|
|
2529
|
-
const overlay =
|
|
2585
|
+
const overlay = chunkEKFUG4G7_cjs.createBackendOverlay(target, {
|
|
2530
2586
|
...rawWriteGuards(target, "tx.backend"),
|
|
2531
2587
|
async insertNode(params) {
|
|
2532
2588
|
session.assertOpen();
|
|
@@ -2579,6 +2635,17 @@ function createRecordedTransactionBackend(target, session, schema) {
|
|
|
2579
2635
|
session.touchNode(params.graphId, params.kind, params.id, row);
|
|
2580
2636
|
return row;
|
|
2581
2637
|
},
|
|
2638
|
+
...target.updateNodeSet === void 0 ? {} : {
|
|
2639
|
+
async updateNodeSet(params) {
|
|
2640
|
+
session.assertOpen();
|
|
2641
|
+
await lockGraph(params.graphId);
|
|
2642
|
+
const result = await chunk764JHTLT_cjs.requireDefined(target.updateNodeSet)(params);
|
|
2643
|
+
for (const row of result.rows) {
|
|
2644
|
+
session.touchNode(row.graph_id, row.kind, row.id, row);
|
|
2645
|
+
}
|
|
2646
|
+
return result;
|
|
2647
|
+
}
|
|
2648
|
+
},
|
|
2582
2649
|
async deleteNode(params) {
|
|
2583
2650
|
session.assertOpen();
|
|
2584
2651
|
await lockGraph(params.graphId);
|
|
@@ -2692,7 +2759,7 @@ function createRecordedTransactionScope(target, schema, ownsWriteLock = false) {
|
|
|
2692
2759
|
return {
|
|
2693
2760
|
backend: createRecordedTransactionBackend(target, session, resolvedSchema),
|
|
2694
2761
|
async flush() {
|
|
2695
|
-
return
|
|
2762
|
+
return chunkJQXSZHF2_cjs.withRecordedRelationsPrecondition(
|
|
2696
2763
|
session.flush(target, resolvedSchema, ownsWriteLock),
|
|
2697
2764
|
{ dialect: target.dialect, surface: "capture-flush" }
|
|
2698
2765
|
);
|
|
@@ -2713,7 +2780,7 @@ function createRecordedBackend(backend, schema) {
|
|
|
2713
2780
|
assertCapturableBackend(backend);
|
|
2714
2781
|
const capture = (fn) => runCapturedAutocommit(backend, schema, fn);
|
|
2715
2782
|
const projectedBackend = createGraphBackendProjection(backend);
|
|
2716
|
-
return
|
|
2783
|
+
return chunkEKFUG4G7_cjs.createBackendOverlay(projectedBackend, {
|
|
2717
2784
|
...rawWriteGuards(backend, "backend"),
|
|
2718
2785
|
async insertNode(params) {
|
|
2719
2786
|
return capture((target) => target.insertNode(params));
|
|
@@ -2742,6 +2809,20 @@ function createRecordedBackend(backend, schema) {
|
|
|
2742
2809
|
async updateNode(params) {
|
|
2743
2810
|
return capture((target) => target.updateNode(params));
|
|
2744
2811
|
},
|
|
2812
|
+
...backend.updateNodeSet === void 0 ? {} : {
|
|
2813
|
+
async updateNodeSet(params) {
|
|
2814
|
+
return capture((target) => {
|
|
2815
|
+
const updateNodeSet = target.updateNodeSet;
|
|
2816
|
+
if (updateNodeSet === void 0) {
|
|
2817
|
+
throw new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
2818
|
+
"Recorded updateNodeSet capability disappeared inside a transaction",
|
|
2819
|
+
{ operation: "updateNodeSet" }
|
|
2820
|
+
);
|
|
2821
|
+
}
|
|
2822
|
+
return updateNodeSet(params);
|
|
2823
|
+
});
|
|
2824
|
+
}
|
|
2825
|
+
},
|
|
2745
2826
|
async deleteNode(params) {
|
|
2746
2827
|
await capture((target) => target.deleteNode(params));
|
|
2747
2828
|
},
|
|
@@ -2902,16 +2983,28 @@ async function syncEmbeddingsBatchForKind(args, schema, items) {
|
|
|
2902
2983
|
});
|
|
2903
2984
|
}
|
|
2904
2985
|
}
|
|
2905
|
-
|
|
2906
|
-
await backend.
|
|
2986
|
+
if (deletionIds.length > 0 && backend.deleteEmbeddingBatch !== void 0) {
|
|
2987
|
+
await backend.deleteEmbeddingBatch({
|
|
2907
2988
|
graphId,
|
|
2908
2989
|
nodeKind,
|
|
2909
|
-
|
|
2990
|
+
nodeIds: deletionIds,
|
|
2910
2991
|
fieldPath: field.fieldPath,
|
|
2911
2992
|
dimensions: field.dimensions,
|
|
2912
2993
|
metric: field.metric,
|
|
2913
2994
|
indexType: field.indexType
|
|
2914
2995
|
});
|
|
2996
|
+
} else {
|
|
2997
|
+
for (const nodeId of deletionIds) {
|
|
2998
|
+
await backend.deleteEmbedding({
|
|
2999
|
+
graphId,
|
|
3000
|
+
nodeKind,
|
|
3001
|
+
nodeId,
|
|
3002
|
+
fieldPath: field.fieldPath,
|
|
3003
|
+
dimensions: field.dimensions,
|
|
3004
|
+
metric: field.metric,
|
|
3005
|
+
indexType: field.indexType
|
|
3006
|
+
});
|
|
3007
|
+
}
|
|
2915
3008
|
}
|
|
2916
3009
|
}
|
|
2917
3010
|
}
|
|
@@ -3132,7 +3225,7 @@ function checkCardinality(edgeKind, fromKind, fromId, cardinality, existingEdgeC
|
|
|
3132
3225
|
}
|
|
3133
3226
|
case "one": {
|
|
3134
3227
|
if (existingEdgeCount > 0) {
|
|
3135
|
-
return new
|
|
3228
|
+
return new chunkC4F7VJ5D_cjs.CardinalityError({
|
|
3136
3229
|
edgeKind,
|
|
3137
3230
|
fromKind,
|
|
3138
3231
|
fromId,
|
|
@@ -3147,7 +3240,7 @@ function checkCardinality(edgeKind, fromKind, fromId, cardinality, existingEdgeC
|
|
|
3147
3240
|
}
|
|
3148
3241
|
case "oneActive": {
|
|
3149
3242
|
if (hasActiveEdge) {
|
|
3150
|
-
return new
|
|
3243
|
+
return new chunkC4F7VJ5D_cjs.CardinalityError({
|
|
3151
3244
|
edgeKind,
|
|
3152
3245
|
fromKind,
|
|
3153
3246
|
fromId,
|
|
@@ -3161,7 +3254,7 @@ function checkCardinality(edgeKind, fromKind, fromId, cardinality, existingEdgeC
|
|
|
3161
3254
|
}
|
|
3162
3255
|
function checkUniqueEdge(edgeKind, fromKind, fromId, _toKind, _toId, existingCount) {
|
|
3163
3256
|
if (existingCount > 0) {
|
|
3164
|
-
return new
|
|
3257
|
+
return new chunkC4F7VJ5D_cjs.CardinalityError({
|
|
3165
3258
|
edgeKind,
|
|
3166
3259
|
fromKind,
|
|
3167
3260
|
fromId,
|
|
@@ -3174,7 +3267,7 @@ function checkUniqueEdge(edgeKind, fromKind, fromId, _toKind, _toId, existingCou
|
|
|
3174
3267
|
function validateEdgeEndpoints(edgeKind, fromKind, toKind, registration, registry) {
|
|
3175
3268
|
const validFromKinds = registration.from.map((node) => node.kind);
|
|
3176
3269
|
if (!registry.isAssignableToAny(fromKind, validFromKinds)) {
|
|
3177
|
-
return new
|
|
3270
|
+
return new chunkC4F7VJ5D_cjs.EndpointError({
|
|
3178
3271
|
edgeKind,
|
|
3179
3272
|
endpoint: "from",
|
|
3180
3273
|
actualKind: fromKind,
|
|
@@ -3183,7 +3276,7 @@ function validateEdgeEndpoints(edgeKind, fromKind, toKind, registration, registr
|
|
|
3183
3276
|
}
|
|
3184
3277
|
const validToKinds = registration.to.map((node) => node.kind);
|
|
3185
3278
|
if (!registry.isAssignableToAny(toKind, validToKinds)) {
|
|
3186
|
-
return new
|
|
3279
|
+
return new chunkC4F7VJ5D_cjs.EndpointError({
|
|
3187
3280
|
edgeKind,
|
|
3188
3281
|
endpoint: "to",
|
|
3189
3282
|
actualKind: toKind,
|
|
@@ -3195,7 +3288,7 @@ function validateEdgeEndpoints(edgeKind, fromKind, toKind, registration, registr
|
|
|
3195
3288
|
function checkDisjointness(nodeId, nodeKind, existingKinds, registry) {
|
|
3196
3289
|
for (const existingKind of existingKinds) {
|
|
3197
3290
|
if (registry.areDisjoint(nodeKind, existingKind)) {
|
|
3198
|
-
return new
|
|
3291
|
+
return new chunkC4F7VJ5D_cjs.DisjointError({
|
|
3199
3292
|
nodeId,
|
|
3200
3293
|
attemptedKind: nodeKind,
|
|
3201
3294
|
conflictingKind: existingKind
|
|
@@ -3232,7 +3325,7 @@ async function checkUniquenessConstraints(ctx, kind, id, props, constraints) {
|
|
|
3232
3325
|
key
|
|
3233
3326
|
});
|
|
3234
3327
|
if (existing && existing.node_id !== id) {
|
|
3235
|
-
throw new
|
|
3328
|
+
throw new chunkC4F7VJ5D_cjs.UniquenessError({
|
|
3236
3329
|
constraintName: constraint.name,
|
|
3237
3330
|
kind: kindToCheck,
|
|
3238
3331
|
existingId: existing.node_id,
|
|
@@ -3338,7 +3431,7 @@ async function updateUniquenessEntries(ctx, kind, id, oldProps, newProps, constr
|
|
|
3338
3431
|
key: newKey
|
|
3339
3432
|
});
|
|
3340
3433
|
if (existing && existing.node_id !== id) {
|
|
3341
|
-
throw new
|
|
3434
|
+
throw new chunkC4F7VJ5D_cjs.UniquenessError({
|
|
3342
3435
|
constraintName: constraint.name,
|
|
3343
3436
|
kind: kindToCheck,
|
|
3344
3437
|
existingId: existing.node_id,
|
|
@@ -3395,7 +3488,7 @@ async function enforceNodeDeleteBehavior(ctx, args, backend, policy) {
|
|
|
3395
3488
|
if (connectedEdges.length === 0) return;
|
|
3396
3489
|
switch (behavior) {
|
|
3397
3490
|
case "restrict": {
|
|
3398
|
-
throw new
|
|
3491
|
+
throw new chunkC4F7VJ5D_cjs.RestrictedDeleteError({
|
|
3399
3492
|
nodeKind: args.kind,
|
|
3400
3493
|
nodeId: args.id,
|
|
3401
3494
|
edgeCount: connectedEdges.length,
|
|
@@ -3468,7 +3561,7 @@ async function applyNodeInsertSideEffectsBatch(ctx, items, backend) {
|
|
|
3468
3561
|
);
|
|
3469
3562
|
}
|
|
3470
3563
|
function parseRowProps(row) {
|
|
3471
|
-
return
|
|
3564
|
+
return chunkEKFUG4G7_cjs.rowPropsToObject(row.props);
|
|
3472
3565
|
}
|
|
3473
3566
|
async function applyNodeUpdate(ctx, args, backend) {
|
|
3474
3567
|
const { kind, id } = args.existing;
|
|
@@ -3667,6 +3760,7 @@ exports.readRecordedClock = readRecordedClock;
|
|
|
3667
3760
|
exports.readRevisionOrigin = readRevisionOrigin;
|
|
3668
3761
|
exports.recordedBindParamBudget = recordedBindParamBudget;
|
|
3669
3762
|
exports.recordedCaptureRequiresCallbackTransactionError = recordedCaptureRequiresCallbackTransactionError;
|
|
3763
|
+
exports.resolveParameterValueType = resolveParameterValueType;
|
|
3670
3764
|
exports.runInsertBatch = runInsertBatch;
|
|
3671
3765
|
exports.runInsertBatchReturning = runInsertBatchReturning;
|
|
3672
3766
|
exports.runInsertNoReturn = runInsertNoReturn;
|
|
@@ -3682,5 +3776,5 @@ exports.uncapturedGraphWriteLock = uncapturedGraphWriteLock;
|
|
|
3682
3776
|
exports.validateEdgeEndpoints = validateEdgeEndpoints;
|
|
3683
3777
|
exports.withPinnedReadInstant = withPinnedReadInstant;
|
|
3684
3778
|
exports.withRecordedFlushObserver = withRecordedFlushObserver;
|
|
3685
|
-
//# sourceMappingURL=chunk-
|
|
3686
|
-
//# sourceMappingURL=chunk-
|
|
3779
|
+
//# sourceMappingURL=chunk-J7LXTUTP.cjs.map
|
|
3780
|
+
//# sourceMappingURL=chunk-J7LXTUTP.cjs.map
|