@nicia-ai/typegraph 0.42.1 → 0.44.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 +33 -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 +29 -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 +34 -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 +30 -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-3RPQDGUE.cjs → chunk-2BIG7U6E.cjs} +5 -5
- package/dist/{chunk-3RPQDGUE.cjs.map → chunk-2BIG7U6E.cjs.map} +1 -1
- 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-V2GZBPY2.cjs → chunk-2VLBGQBY.cjs} +310 -61
- package/dist/chunk-2VLBGQBY.cjs.map +1 -0
- package/dist/{chunk-RXOAXO3R.js → chunk-2WDD2NO3.js} +3 -3
- package/dist/{chunk-RXOAXO3R.js.map → chunk-2WDD2NO3.js.map} +1 -1
- package/dist/{chunk-2HKIID5K.js → chunk-2Y4IFKW7.js} +5 -5
- package/dist/{chunk-2HKIID5K.js.map → chunk-2Y4IFKW7.js.map} +1 -1
- package/dist/{chunk-ECU53PMN.cjs → chunk-3PRKZW6D.cjs} +5 -5
- package/dist/chunk-3PRKZW6D.cjs.map +1 -0
- package/dist/{chunk-2G6ZEGYO.js → chunk-46GDII45.js} +4 -4
- package/dist/{chunk-2G6ZEGYO.js.map → chunk-46GDII45.js.map} +1 -1
- package/dist/{chunk-OYJSYDIH.js → chunk-4MB3AQAQ.js} +13 -3
- package/dist/chunk-4MB3AQAQ.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-FY4VY5EV.cjs → chunk-5MUSU4ZP.cjs} +20 -20
- package/dist/chunk-5MUSU4ZP.cjs.map +1 -0
- package/dist/{chunk-ZIRC2U6G.js → chunk-63KCKSSH.js} +78 -16
- package/dist/chunk-63KCKSSH.js.map +1 -0
- package/dist/{chunk-7Y6BV3TK.cjs → chunk-66UVLHQA.cjs} +100 -100
- package/dist/{chunk-7Y6BV3TK.cjs.map → chunk-66UVLHQA.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-OMQ2NBOR.cjs → chunk-6JZUSDY2.cjs} +27 -27
- package/dist/{chunk-OMQ2NBOR.cjs.map → chunk-6JZUSDY2.cjs.map} +1 -1
- package/dist/{chunk-Z3WIL6S3.js → chunk-7G32LIQM.js} +5 -5
- package/dist/{chunk-Z3WIL6S3.js.map → chunk-7G32LIQM.js.map} +1 -1
- package/dist/{chunk-2SO5I5AI.cjs → chunk-7V2FGGI2.cjs} +250 -198
- package/dist/chunk-7V2FGGI2.cjs.map +1 -0
- package/dist/{chunk-I73ATSAH.cjs → chunk-A2I2XO52.cjs} +4 -4
- package/dist/{chunk-I73ATSAH.cjs.map → chunk-A2I2XO52.cjs.map} +1 -1
- package/dist/{chunk-O2GZM7UK.cjs → chunk-A4PBRX4C.cjs} +7 -7
- package/dist/{chunk-O2GZM7UK.cjs.map → chunk-A4PBRX4C.cjs.map} +1 -1
- package/dist/{chunk-5P6IPIT6.cjs → chunk-ALFUGRYB.cjs} +75 -65
- package/dist/chunk-ALFUGRYB.cjs.map +1 -0
- package/dist/{chunk-NXIZL7ZZ.js → chunk-ATLN63JA.js} +6 -6
- package/dist/chunk-ATLN63JA.js.map +1 -0
- package/dist/{chunk-CUPJL6TS.js → chunk-B75XRV3O.js} +3 -3
- package/dist/{chunk-CUPJL6TS.js.map → chunk-B75XRV3O.js.map} +1 -1
- package/dist/{chunk-DP7KC6CL.js → chunk-BCP7LLOY.js} +754 -476
- package/dist/chunk-BCP7LLOY.js.map +1 -0
- package/dist/{chunk-RAWG2FEU.js → chunk-BEFM74L2.js} +264 -18
- package/dist/chunk-BEFM74L2.js.map +1 -0
- package/dist/{chunk-LQLVJWUH.js → chunk-BNUFUFAU.js} +7 -7
- package/dist/chunk-BNUFUFAU.js.map +1 -0
- package/dist/{chunk-KTBTSHU6.cjs → chunk-C4F7VJ5D.cjs} +13 -3
- package/dist/chunk-C4F7VJ5D.cjs.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-O3USVVWS.js → chunk-DK2S42XB.js} +3 -3
- package/dist/{chunk-O3USVVWS.js.map → chunk-DK2S42XB.js.map} +1 -1
- package/dist/{chunk-DMZEVJGL.cjs → chunk-EE7N5XXQ.cjs} +13 -13
- package/dist/{chunk-DMZEVJGL.cjs.map → chunk-EE7N5XXQ.cjs.map} +1 -1
- package/dist/{chunk-ZGOUVMVS.js → chunk-EFELJVLA.js} +5 -5
- package/dist/{chunk-ZGOUVMVS.js.map → chunk-EFELJVLA.js.map} +1 -1
- package/dist/chunk-EPTSMFH7.cjs +12 -0
- package/dist/{chunk-U3YRCZ5L.cjs.map → chunk-EPTSMFH7.cjs.map} +1 -1
- 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-5Q3P6OIC.cjs → chunk-FGO5JFVJ.cjs} +12 -12
- package/dist/chunk-FGO5JFVJ.cjs.map +1 -0
- package/dist/{chunk-VC26BUNP.js → chunk-FMGEZBAQ.js} +5 -5
- package/dist/{chunk-VC26BUNP.js.map → chunk-FMGEZBAQ.js.map} +1 -1
- package/dist/{chunk-UZLEQFTV.js → chunk-FMMIX6N4.js} +4 -4
- package/dist/chunk-FMMIX6N4.js.map +1 -0
- package/dist/{chunk-5C75HQYQ.js → chunk-FRHHDHKH.js} +5 -5
- package/dist/{chunk-5C75HQYQ.js.map → chunk-FRHHDHKH.js.map} +1 -1
- package/dist/{chunk-EVFL2ZY5.js → chunk-FSXTPBRN.js} +63 -12
- package/dist/chunk-FSXTPBRN.js.map +1 -0
- package/dist/{chunk-TRC646QQ.cjs → chunk-GFRGG2US.cjs} +7 -7
- package/dist/{chunk-TRC646QQ.cjs.map → chunk-GFRGG2US.cjs.map} +1 -1
- package/dist/{chunk-UJRWOV5B.js → chunk-GWEDD3DH.js} +5 -5
- package/dist/{chunk-UJRWOV5B.js.map → chunk-GWEDD3DH.js.map} +1 -1
- package/dist/{chunk-AQR6BHB3.cjs → chunk-HJH3RMXG.cjs} +10 -10
- package/dist/{chunk-AQR6BHB3.cjs.map → chunk-HJH3RMXG.cjs.map} +1 -1
- package/dist/{chunk-F7TDKSVB.cjs → chunk-HOHAJ2NR.cjs} +4 -4
- package/dist/{chunk-F7TDKSVB.cjs.map → chunk-HOHAJ2NR.cjs.map} +1 -1
- package/dist/{chunk-YPVQYM3L.js → chunk-HOIFFY4M.js} +100 -20
- package/dist/chunk-HOIFFY4M.js.map +1 -0
- package/dist/{chunk-LDCWO5B6.js → chunk-IIMQJYAM.js} +3 -3
- package/dist/{chunk-LDCWO5B6.js.map → chunk-IIMQJYAM.js.map} +1 -1
- package/dist/{chunk-OM6RIOA5.cjs → chunk-IIT5K7SK.cjs} +13 -13
- package/dist/{chunk-OM6RIOA5.cjs.map → chunk-IIT5K7SK.cjs.map} +1 -1
- package/dist/{chunk-EQOQOT55.js → chunk-IJTLXNGJ.js} +5 -5
- package/dist/{chunk-EQOQOT55.js.map → chunk-IJTLXNGJ.js.map} +1 -1
- package/dist/{chunk-4XRP2N6B.js → chunk-JRP3VGHS.js} +3 -3
- package/dist/{chunk-4XRP2N6B.js.map → chunk-JRP3VGHS.js.map} +1 -1
- package/dist/{chunk-42XYPKZU.js → chunk-K3BUWSFR.js} +41 -3
- package/dist/chunk-K3BUWSFR.js.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-33PAKPED.cjs → chunk-MCHP7RHZ.cjs} +41 -41
- package/dist/{chunk-33PAKPED.cjs.map → chunk-MCHP7RHZ.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-K2HHCWZO.cjs → chunk-NCX65HBY.cjs} +137 -108
- package/dist/chunk-NCX65HBY.cjs.map +1 -0
- package/dist/{chunk-6TJ6PKPS.cjs → chunk-NN3QSOVS.cjs} +27 -27
- package/dist/{chunk-6TJ6PKPS.cjs.map → chunk-NN3QSOVS.cjs.map} +1 -1
- package/dist/{chunk-F2KVJ6FF.cjs → chunk-OSZPLZIV.cjs} +179 -117
- package/dist/chunk-OSZPLZIV.cjs.map +1 -0
- package/dist/{chunk-UTTW2Q3M.cjs → chunk-OVUUTCPJ.cjs} +171 -133
- package/dist/chunk-OVUUTCPJ.cjs.map +1 -0
- package/dist/{chunk-FMPZPOUD.js → chunk-PAW2XUZN.js} +3 -3
- package/dist/{chunk-FMPZPOUD.js.map → chunk-PAW2XUZN.js.map} +1 -1
- package/dist/{chunk-5ZPRE4CV.cjs → chunk-PDGEXGS6.cjs} +204 -124
- package/dist/chunk-PDGEXGS6.cjs.map +1 -0
- package/dist/{chunk-CVNGKTHO.js → chunk-PHXITZE4.js} +4 -4
- package/dist/{chunk-CVNGKTHO.js.map → chunk-PHXITZE4.js.map} +1 -1
- 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-5AERZSHC.cjs → chunk-QGKILWGZ.cjs} +4 -4
- package/dist/{chunk-5AERZSHC.cjs.map → chunk-QGKILWGZ.cjs.map} +1 -1
- 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-XDMPDUKL.cjs → chunk-QYWINYEA.cjs} +9 -9
- package/dist/{chunk-XDMPDUKL.cjs.map → chunk-QYWINYEA.cjs.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-6NB73BXV.js → chunk-SBPC5IP3.js} +40 -12
- package/dist/chunk-SBPC5IP3.js.map +1 -0
- package/dist/{chunk-HHBKGPEI.js → chunk-SQRD2CYF.js} +264 -21
- package/dist/chunk-SQRD2CYF.js.map +1 -0
- package/dist/{chunk-O7XVCLXW.cjs → chunk-ST3LPB2V.cjs} +324 -77
- package/dist/chunk-ST3LPB2V.cjs.map +1 -0
- package/dist/{chunk-FFQGI67R.cjs → chunk-STQ3BSED.cjs} +44 -44
- package/dist/{chunk-FFQGI67R.cjs.map → chunk-STQ3BSED.cjs.map} +1 -1
- package/dist/{chunk-JOYPNY33.js → chunk-TCRIQMBU.js} +9 -9
- package/dist/{chunk-JOYPNY33.js.map → chunk-TCRIQMBU.js.map} +1 -1
- package/dist/{chunk-ZP2KPDNN.js → chunk-TFMVL4QH.js} +3 -3
- package/dist/{chunk-ZP2KPDNN.js.map → chunk-TFMVL4QH.js.map} +1 -1
- package/dist/{chunk-4WYFRACU.js → chunk-TVLKA4AY.js} +3 -3
- package/dist/{chunk-4WYFRACU.js.map → chunk-TVLKA4AY.js.map} +1 -1
- package/dist/{chunk-X2XOQZT3.cjs → chunk-U5W4LKZV.cjs} +13 -9
- package/dist/chunk-U5W4LKZV.cjs.map +1 -0
- package/dist/{chunk-WYQILW5V.js → chunk-VITTKBWF.js} +43 -33
- package/dist/chunk-VITTKBWF.js.map +1 -0
- package/dist/{chunk-AO2WPYFZ.cjs → chunk-WBUFJ7BS.cjs} +4 -4
- package/dist/{chunk-AO2WPYFZ.cjs.map → chunk-WBUFJ7BS.cjs.map} +1 -1
- package/dist/{chunk-CI5NPLXX.js → chunk-XMYJY7NI.js} +3 -3
- package/dist/{chunk-CI5NPLXX.js.map → chunk-XMYJY7NI.js.map} +1 -1
- package/dist/{chunk-277UZV7X.cjs → chunk-XR4YZFKW.cjs} +1803 -1525
- package/dist/chunk-XR4YZFKW.cjs.map +1 -0
- package/dist/{chunk-5GV4JQNA.cjs → chunk-YNULOIR5.cjs} +43 -43
- package/dist/{chunk-5GV4JQNA.cjs.map → chunk-YNULOIR5.cjs.map} +1 -1
- 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 +28 -28
- package/dist/core/index.d.cts +5 -5
- package/dist/core/index.d.ts +5 -5
- package/dist/core/index.js +8 -8
- package/dist/{ddl-Bc4Dl8fu.d.ts → ddl-D5369kOY.d.ts} +3 -3
- package/dist/{ddl-3unqC-kg.d.cts → ddl-eWg7hx6R.d.cts} +3 -3
- package/dist/{define-graph-Byslw2OO.d.cts → define-graph-DVF-oN1i.d.cts} +1 -1
- package/dist/{define-graph-DBFnc7u_.d.ts → define-graph-SvYXOl78.d.ts} +1 -1
- 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 +104 -104
- package/dist/graph-merge/index.d.cts +9 -8
- package/dist/graph-merge/index.d.ts +9 -8
- package/dist/graph-merge/index.js +24 -24
- package/dist/{index-DQzVJBHa.d.ts → index-By89Sezh.d.ts} +37 -7
- package/dist/{index-DHXw7QAl.d.cts → index-DcQ3Sxs-.d.cts} +37 -7
- package/dist/index.cjs +210 -202
- package/dist/index.d.cts +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/index.js +34 -34
- 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 +49 -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 +23 -15
- package/dist/interchange/index.js.map +1 -1
- package/dist/{manager-Dl0-er1G.d.ts → manager-B0KjKE93.d.ts} +44 -6
- package/dist/{manager-U9_zopqr.d.cts → manager-Cn0NFIhN.d.cts} +44 -6
- package/dist/{materialize-indexes-BM3u0aXE.d.ts → materialize-indexes-BD4V3svD.d.ts} +1 -1
- package/dist/{materialize-indexes-DzMCetZe.d.cts → materialize-indexes-DVRhd5h4.d.cts} +1 -1
- package/dist/{postgres-C5-WMKFA.d.ts → postgres-DaEWvN4x.d.cts} +1 -1
- package/dist/{postgres-DpJqtbSX.d.cts → postgres-u0a0HN2D.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 +41 -41
- package/dist/schema/index.d.cts +7 -7
- package/dist/schema/index.d.ts +7 -7
- package/dist/schema/index.js +14 -14
- package/dist/{searchable-B4mUXZT6.d.cts → searchable-BT7j9_IK.d.cts} +2 -2
- package/dist/{searchable-C7jmPNLT.d.ts → searchable-CnYEancP.d.ts} +2 -2
- package/dist/{sqlite-Da7jiYu9.d.cts → sqlite-BrMoSsI7.d.cts} +1 -1
- package/dist/{sqlite-Ch5tSYQY.d.ts → sqlite-CHhZUyO5.d.ts} +1 -1
- package/dist/{store-view-CNcOG8bQ.d.cts → store-view-Bvdku0Ht.d.ts} +199 -35
- package/dist/{store-view-6C2vTWqf.d.ts → store-view-w-md0nQ4.d.cts} +199 -35
- package/dist/{temporal-BtrTYTiB.d.ts → temporal--x9T8K4S.d.ts} +1 -1
- package/dist/{temporal-CMpigMCW.d.cts → temporal-BCORwUau.d.cts} +1 -1
- package/dist/{types-G4sVM-76.d.cts → types-6-WJmSD4.d.cts} +1 -1
- package/dist/{types-D2rU5Taq.d.ts → types-COODtTJU.d.ts} +1 -1
- package/dist/{types-Dh-EgT-w.d.ts → types-Cjvkj0jA.d.cts} +351 -12
- package/dist/{types-Dh-EgT-w.d.cts → types-Cjvkj0jA.d.ts} +351 -12
- package/dist/{where-B8Y21kig.d.ts → where-5xVawAwL.d.ts} +1 -1
- package/dist/{where-DbZ9XDOI.d.cts → where-CUQmCR6d.d.cts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-277UZV7X.cjs.map +0 -1
- package/dist/chunk-2SO5I5AI.cjs.map +0 -1
- package/dist/chunk-42XYPKZU.js.map +0 -1
- package/dist/chunk-5P6IPIT6.cjs.map +0 -1
- package/dist/chunk-5Q3P6OIC.cjs.map +0 -1
- package/dist/chunk-5ZPRE4CV.cjs.map +0 -1
- package/dist/chunk-6NB73BXV.js.map +0 -1
- package/dist/chunk-DP7KC6CL.js.map +0 -1
- package/dist/chunk-ECU53PMN.cjs.map +0 -1
- package/dist/chunk-EVFL2ZY5.js.map +0 -1
- package/dist/chunk-F2KVJ6FF.cjs.map +0 -1
- package/dist/chunk-FY4VY5EV.cjs.map +0 -1
- package/dist/chunk-HHBKGPEI.js.map +0 -1
- package/dist/chunk-K2HHCWZO.cjs.map +0 -1
- package/dist/chunk-KTBTSHU6.cjs.map +0 -1
- package/dist/chunk-LQLVJWUH.js.map +0 -1
- package/dist/chunk-M4GYQF2H.js.map +0 -1
- package/dist/chunk-NXIZL7ZZ.js.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-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-VGMNGWBR.cjs +0 -12
- package/dist/chunk-WYQILW5V.js.map +0 -1
- package/dist/chunk-X2XOQZT3.cjs.map +0 -1
- package/dist/chunk-YPVQYM3L.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 chunk3PRKZW6D_cjs = require('./chunk-3PRKZW6D.cjs');
|
|
6
|
+
var chunkEQ7JKLZO_cjs = require('./chunk-EQ7JKLZO.cjs');
|
|
7
|
+
var chunkWBUFJ7BS_cjs = require('./chunk-WBUFJ7BS.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
|
}
|
|
@@ -1141,6 +1160,7 @@ var GRAPH_BACKEND_PROJECTION_KEYS = [
|
|
|
1141
1160
|
"findNodesByKind",
|
|
1142
1161
|
"countNodesByKind",
|
|
1143
1162
|
"findEdgesByKind",
|
|
1163
|
+
"findEdgesByEndpointSet",
|
|
1144
1164
|
"countEdgesByKind",
|
|
1145
1165
|
"insertUnique",
|
|
1146
1166
|
"insertUniqueBatch",
|
|
@@ -1150,7 +1170,10 @@ var GRAPH_BACKEND_PROJECTION_KEYS = [
|
|
|
1150
1170
|
"getActiveSchema",
|
|
1151
1171
|
"getSchemaVersion",
|
|
1152
1172
|
"commitSchemaVersion",
|
|
1173
|
+
"commitSchemaVersionIfKindsEmpty",
|
|
1174
|
+
"lockSchemaVersionForWrite",
|
|
1153
1175
|
"setActiveVersion",
|
|
1176
|
+
"schemaWriteTransaction",
|
|
1154
1177
|
"upsertEmbedding",
|
|
1155
1178
|
"upsertEmbeddingBatch",
|
|
1156
1179
|
"deleteEmbedding",
|
|
@@ -1185,6 +1208,7 @@ var GRAPH_BACKEND_PROJECTION_KEYS = [
|
|
|
1185
1208
|
"assertVectorSlotInitialized",
|
|
1186
1209
|
"assertVectorSlotsInitialized",
|
|
1187
1210
|
"deleteVectorSlotContribution",
|
|
1211
|
+
"verifyContributions",
|
|
1188
1212
|
"ensureFulltextTable",
|
|
1189
1213
|
"getReconciliationMarker",
|
|
1190
1214
|
"setReconciliationMarker",
|
|
@@ -1270,28 +1294,28 @@ function compileFieldColumn(field, cteAlias, cteColumnPrefix) {
|
|
|
1270
1294
|
if (cteColumnPrefix !== void 0) {
|
|
1271
1295
|
const qualifier2 = cteColumnPrefix === "" ? "" : `${cteColumnPrefix}.`;
|
|
1272
1296
|
if (field.path.length === 1 && field.path[0] === "id") {
|
|
1273
|
-
return
|
|
1297
|
+
return chunkU5W4LKZV_cjs.sql.raw(`${qualifier2}id`);
|
|
1274
1298
|
}
|
|
1275
1299
|
if (field.path.length === 1 && field.path[0] === "kind") {
|
|
1276
|
-
return
|
|
1300
|
+
return chunkU5W4LKZV_cjs.sql.raw(`${qualifier2}kind`);
|
|
1277
1301
|
}
|
|
1278
1302
|
if (field.path.length > 0 && field.path[0] === "props") {
|
|
1279
|
-
return
|
|
1303
|
+
return chunkU5W4LKZV_cjs.sql.raw(`${qualifier2}props`);
|
|
1280
1304
|
}
|
|
1281
|
-
return
|
|
1305
|
+
return chunkU5W4LKZV_cjs.sql.raw(`${qualifier2}${field.path.join("_")}`);
|
|
1282
1306
|
}
|
|
1283
1307
|
const prefix = field.alias;
|
|
1284
1308
|
const qualifier = cteAlias ? `${cteAlias}.` : "";
|
|
1285
1309
|
if (field.path.length === 1 && field.path[0] === "id") {
|
|
1286
|
-
return
|
|
1310
|
+
return chunkU5W4LKZV_cjs.sql.raw(`${qualifier}${prefix}_id`);
|
|
1287
1311
|
}
|
|
1288
1312
|
if (field.path.length === 1 && field.path[0] === "kind") {
|
|
1289
|
-
return
|
|
1313
|
+
return chunkU5W4LKZV_cjs.sql.raw(`${qualifier}${prefix}_kind`);
|
|
1290
1314
|
}
|
|
1291
1315
|
if (field.path.length > 0 && field.path[0] === "props") {
|
|
1292
|
-
return
|
|
1316
|
+
return chunkU5W4LKZV_cjs.sql.raw(`${qualifier}${prefix}_props`);
|
|
1293
1317
|
}
|
|
1294
|
-
return
|
|
1318
|
+
return chunkU5W4LKZV_cjs.sql.raw(`${qualifier}${prefix}_${field.path.join("_")}`);
|
|
1295
1319
|
}
|
|
1296
1320
|
function getFieldPointer(field) {
|
|
1297
1321
|
if (field.jsonPointer !== void 0) {
|
|
@@ -1311,6 +1335,9 @@ function normalizeValueType2(valueType) {
|
|
|
1311
1335
|
}
|
|
1312
1336
|
return valueType;
|
|
1313
1337
|
}
|
|
1338
|
+
function resolveParameterValueType(left, right) {
|
|
1339
|
+
return normalizeValueType2(right.valueType) ?? normalizeValueType2(left.valueType);
|
|
1340
|
+
}
|
|
1314
1341
|
function compileFieldValue(field, dialect, valueType, cteAlias, pointerOverride, cteColumnPrefix) {
|
|
1315
1342
|
const resolved = normalizeValueType2(valueType);
|
|
1316
1343
|
const column = compileFieldColumn(field, cteAlias, cteColumnPrefix);
|
|
@@ -1374,7 +1401,7 @@ function resolveLiteralValueTypes(literals) {
|
|
|
1374
1401
|
}
|
|
1375
1402
|
}
|
|
1376
1403
|
if (resolved.size > 1) {
|
|
1377
|
-
throw new
|
|
1404
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
1378
1405
|
"Mixed literal value types are not supported in predicates",
|
|
1379
1406
|
{ valueTypes: [...resolved] }
|
|
1380
1407
|
);
|
|
@@ -1408,9 +1435,9 @@ function convertValueForSql(value, dialect) {
|
|
|
1408
1435
|
}
|
|
1409
1436
|
function compileStringPattern(op, pattern) {
|
|
1410
1437
|
const escaped = pattern.replaceAll(
|
|
1411
|
-
|
|
1412
|
-
`${
|
|
1413
|
-
).replaceAll("%", `${
|
|
1438
|
+
chunkU5W4LKZV_cjs.LIKE_ESCAPE_CHARACTER,
|
|
1439
|
+
`${chunkU5W4LKZV_cjs.LIKE_ESCAPE_CHARACTER}${chunkU5W4LKZV_cjs.LIKE_ESCAPE_CHARACTER}`
|
|
1440
|
+
).replaceAll("%", `${chunkU5W4LKZV_cjs.LIKE_ESCAPE_CHARACTER}%`).replaceAll("_", `${chunkU5W4LKZV_cjs.LIKE_ESCAPE_CHARACTER}_`);
|
|
1414
1441
|
switch (op) {
|
|
1415
1442
|
case "contains": {
|
|
1416
1443
|
return `%${escaped}%`;
|
|
@@ -1431,22 +1458,22 @@ function compileStringPattern(op, pattern) {
|
|
|
1431
1458
|
}
|
|
1432
1459
|
}
|
|
1433
1460
|
function escapeLikePatternParameter(parameter) {
|
|
1434
|
-
const doubledEscape = `${
|
|
1435
|
-
return
|
|
1461
|
+
const doubledEscape = `${chunkU5W4LKZV_cjs.LIKE_ESCAPE_CHARACTER}${chunkU5W4LKZV_cjs.LIKE_ESCAPE_CHARACTER}`;
|
|
1462
|
+
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
1463
|
}
|
|
1437
1464
|
function compileParameterizedStringPattern(op, parameter) {
|
|
1438
1465
|
switch (op) {
|
|
1439
1466
|
case "contains": {
|
|
1440
1467
|
const escaped = escapeLikePatternParameter(parameter);
|
|
1441
|
-
return
|
|
1468
|
+
return chunkU5W4LKZV_cjs.sql`'%' || ${escaped} || '%'`;
|
|
1442
1469
|
}
|
|
1443
1470
|
case "startsWith": {
|
|
1444
1471
|
const escaped = escapeLikePatternParameter(parameter);
|
|
1445
|
-
return
|
|
1472
|
+
return chunkU5W4LKZV_cjs.sql`${escaped} || '%'`;
|
|
1446
1473
|
}
|
|
1447
1474
|
case "endsWith": {
|
|
1448
1475
|
const escaped = escapeLikePatternParameter(parameter);
|
|
1449
|
-
return
|
|
1476
|
+
return chunkU5W4LKZV_cjs.sql`'%' || ${escaped}`;
|
|
1450
1477
|
}
|
|
1451
1478
|
case "like":
|
|
1452
1479
|
case "ilike": {
|
|
@@ -1473,18 +1500,18 @@ function compilePredicateExpression(expr, ctx) {
|
|
|
1473
1500
|
cteColumnPrefix
|
|
1474
1501
|
);
|
|
1475
1502
|
if (isParameterRef(expr.pattern)) {
|
|
1476
|
-
const placeholder =
|
|
1503
|
+
const placeholder = chunkU5W4LKZV_cjs.sql`${chunkU5W4LKZV_cjs.sql.placeholder(expr.pattern.name)}`;
|
|
1477
1504
|
const pattern2 = compileParameterizedStringPattern(expr.op, placeholder);
|
|
1478
1505
|
if (expr.op === "ilike" || expr.op === "contains" || expr.op === "startsWith" || expr.op === "endsWith") {
|
|
1479
1506
|
return dialect.ilike(field, pattern2);
|
|
1480
1507
|
}
|
|
1481
|
-
return
|
|
1508
|
+
return chunkU5W4LKZV_cjs.sql`${field} LIKE ${pattern2} ${chunkU5W4LKZV_cjs.likeEscapeClause}`;
|
|
1482
1509
|
}
|
|
1483
1510
|
const pattern = compileStringPattern(expr.op, expr.pattern);
|
|
1484
1511
|
if (expr.op === "ilike" || expr.op === "contains" || expr.op === "startsWith" || expr.op === "endsWith") {
|
|
1485
1512
|
return dialect.ilike(field, pattern);
|
|
1486
1513
|
}
|
|
1487
|
-
return
|
|
1514
|
+
return chunkU5W4LKZV_cjs.sql`${field} LIKE ${pattern} ${chunkU5W4LKZV_cjs.likeEscapeClause}`;
|
|
1488
1515
|
}
|
|
1489
1516
|
case "null_check": {
|
|
1490
1517
|
const field = compileFieldTextValue(
|
|
@@ -1494,7 +1521,7 @@ function compilePredicateExpression(expr, ctx) {
|
|
|
1494
1521
|
void 0,
|
|
1495
1522
|
cteColumnPrefix
|
|
1496
1523
|
);
|
|
1497
|
-
return expr.op === "isNull" ?
|
|
1524
|
+
return expr.op === "isNull" ? chunkU5W4LKZV_cjs.sql`${field} IS NULL` : chunkU5W4LKZV_cjs.sql`${field} IS NOT NULL`;
|
|
1498
1525
|
}
|
|
1499
1526
|
case "between": {
|
|
1500
1527
|
const lowerIsParam = isParameterRef(expr.lower);
|
|
@@ -1504,7 +1531,7 @@ function compilePredicateExpression(expr, ctx) {
|
|
|
1504
1531
|
if (!upperIsParam) boundsForType.push(expr.upper);
|
|
1505
1532
|
const valueType = boundsForType.length > 0 ? resolveComparisonValueType(expr.field, boundsForType) : normalizeValueType2(expr.field.valueType);
|
|
1506
1533
|
if (valueType === "array" || valueType === "object") {
|
|
1507
|
-
throw new
|
|
1534
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
1508
1535
|
"Between comparisons are not supported for JSON arrays or objects"
|
|
1509
1536
|
);
|
|
1510
1537
|
}
|
|
@@ -1516,25 +1543,25 @@ function compilePredicateExpression(expr, ctx) {
|
|
|
1516
1543
|
void 0,
|
|
1517
1544
|
cteColumnPrefix
|
|
1518
1545
|
);
|
|
1519
|
-
const lower = lowerIsParam ?
|
|
1520
|
-
const upper = upperIsParam ?
|
|
1521
|
-
return
|
|
1546
|
+
const lower = lowerIsParam ? chunkU5W4LKZV_cjs.sql.placeholder(expr.lower.name) : convertValueForSql(expr.lower.value, dialect);
|
|
1547
|
+
const upper = upperIsParam ? chunkU5W4LKZV_cjs.sql.placeholder(expr.upper.name) : convertValueForSql(expr.upper.value, dialect);
|
|
1548
|
+
return chunkU5W4LKZV_cjs.sql`${field} BETWEEN ${lower} AND ${upper}`;
|
|
1522
1549
|
}
|
|
1523
1550
|
case "and": {
|
|
1524
1551
|
const parts = expr.predicates.map(
|
|
1525
1552
|
(p) => compilePredicateExpression(p, ctx)
|
|
1526
1553
|
);
|
|
1527
|
-
return
|
|
1554
|
+
return chunkU5W4LKZV_cjs.sql`(${chunkU5W4LKZV_cjs.sql.join(parts, chunkU5W4LKZV_cjs.sql` AND `)})`;
|
|
1528
1555
|
}
|
|
1529
1556
|
case "or": {
|
|
1530
1557
|
const parts = expr.predicates.map(
|
|
1531
1558
|
(p) => compilePredicateExpression(p, ctx)
|
|
1532
1559
|
);
|
|
1533
|
-
return
|
|
1560
|
+
return chunkU5W4LKZV_cjs.sql`(${chunkU5W4LKZV_cjs.sql.join(parts, chunkU5W4LKZV_cjs.sql` OR `)})`;
|
|
1534
1561
|
}
|
|
1535
1562
|
case "not": {
|
|
1536
1563
|
const inner = compilePredicateExpression(expr.predicate, ctx);
|
|
1537
|
-
return
|
|
1564
|
+
return chunkU5W4LKZV_cjs.sql`NOT (${inner})`;
|
|
1538
1565
|
}
|
|
1539
1566
|
case "array_op": {
|
|
1540
1567
|
return compileArrayPredicate(expr, dialect, cteColumnPrefix);
|
|
@@ -1557,10 +1584,10 @@ function compilePredicateExpression(expr, ctx) {
|
|
|
1557
1584
|
}
|
|
1558
1585
|
}
|
|
1559
1586
|
}
|
|
1560
|
-
var STRUCTURAL_PREDICATE_NOOP =
|
|
1587
|
+
var STRUCTURAL_PREDICATE_NOOP = chunkU5W4LKZV_cjs.sql.raw("1=1");
|
|
1561
1588
|
function compileComparisonPredicate(expr, dialect, cteColumnPrefix) {
|
|
1562
1589
|
if (isParameterRef(expr.right)) {
|
|
1563
|
-
const parameterValueType =
|
|
1590
|
+
const parameterValueType = resolveParameterValueType(expr.left, expr.right);
|
|
1564
1591
|
const left2 = compileFieldValue(
|
|
1565
1592
|
expr.left,
|
|
1566
1593
|
dialect,
|
|
@@ -1569,17 +1596,26 @@ function compileComparisonPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1569
1596
|
void 0,
|
|
1570
1597
|
cteColumnPrefix
|
|
1571
1598
|
);
|
|
1599
|
+
if (expr.op === "in" || expr.op === "notIn") {
|
|
1600
|
+
return compileListParameterPredicate(
|
|
1601
|
+
left2,
|
|
1602
|
+
expr.right.name,
|
|
1603
|
+
parameterValueType,
|
|
1604
|
+
expr.op === "notIn",
|
|
1605
|
+
dialect
|
|
1606
|
+
);
|
|
1607
|
+
}
|
|
1572
1608
|
const opSql2 = COMPARISON_OP_SQL[expr.op];
|
|
1573
1609
|
if (!opSql2) {
|
|
1574
|
-
throw new
|
|
1610
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
1575
1611
|
`Comparison operation "${expr.op}" is not supported for parameterized predicates`
|
|
1576
1612
|
);
|
|
1577
1613
|
}
|
|
1578
|
-
return
|
|
1614
|
+
return chunkU5W4LKZV_cjs.sql`${left2} ${chunkU5W4LKZV_cjs.sql.raw(opSql2)} ${chunkU5W4LKZV_cjs.sql.placeholder(expr.right.name)}`;
|
|
1579
1615
|
}
|
|
1580
1616
|
const valueType = resolveComparisonValueType(expr.left, expr.right);
|
|
1581
1617
|
if (valueType === "array" || valueType === "object") {
|
|
1582
|
-
throw new
|
|
1618
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
1583
1619
|
`Comparison operation "${expr.op}" is not supported for ${valueType} values`
|
|
1584
1620
|
);
|
|
1585
1621
|
}
|
|
@@ -1594,7 +1630,7 @@ function compileComparisonPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1594
1630
|
if (expr.op === "in" || expr.op === "notIn") {
|
|
1595
1631
|
const values = Array.isArray(expr.right) ? expr.right : [expr.right];
|
|
1596
1632
|
if (values.length === 0) {
|
|
1597
|
-
return expr.op === "in" ?
|
|
1633
|
+
return expr.op === "in" ? chunkU5W4LKZV_cjs.sql.raw("1=0") : chunkU5W4LKZV_cjs.sql.raw("1=1");
|
|
1598
1634
|
}
|
|
1599
1635
|
const convertedValues = values.map(
|
|
1600
1636
|
(value) => convertValueForSql(value.value, dialect)
|
|
@@ -1606,11 +1642,26 @@ function compileComparisonPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1606
1642
|
const convertedRight = convertValueForSql(rightValue.value, dialect);
|
|
1607
1643
|
const opSql = COMPARISON_OP_SQL[expr.op];
|
|
1608
1644
|
if (!opSql) {
|
|
1609
|
-
throw new
|
|
1645
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
1610
1646
|
`Comparison operation "${expr.op}" is not supported`
|
|
1611
1647
|
);
|
|
1612
1648
|
}
|
|
1613
|
-
return
|
|
1649
|
+
return chunkU5W4LKZV_cjs.sql`${left} ${chunkU5W4LKZV_cjs.sql.raw(opSql)} ${convertedRight}`;
|
|
1650
|
+
}
|
|
1651
|
+
function compileListParameterPredicate(left, parameterName, elementType, negated, dialect) {
|
|
1652
|
+
if (elementType === "array" || elementType === "object" || elementType === "embedding") {
|
|
1653
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
1654
|
+
`IN/NOT IN is not supported for ${elementType} values`,
|
|
1655
|
+
{ valueType: elementType },
|
|
1656
|
+
{
|
|
1657
|
+
suggestion: "Use scalar fields (string/number/boolean/date) in IN/NOT IN predicates."
|
|
1658
|
+
}
|
|
1659
|
+
);
|
|
1660
|
+
}
|
|
1661
|
+
return dialect.inListParameter(left, chunkU5W4LKZV_cjs.sql.placeholder(parameterName), {
|
|
1662
|
+
negated,
|
|
1663
|
+
elementType
|
|
1664
|
+
});
|
|
1614
1665
|
}
|
|
1615
1666
|
function compileArrayPredicate(expr, dialect, cteColumnPrefix) {
|
|
1616
1667
|
const field = compileFieldJsonValue(
|
|
@@ -1623,30 +1674,30 @@ function compileArrayPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1623
1674
|
const values = expr.values?.map((v) => convertValueForSql(v.value, dialect)) ?? [];
|
|
1624
1675
|
switch (expr.op) {
|
|
1625
1676
|
case "isEmpty": {
|
|
1626
|
-
return
|
|
1677
|
+
return chunkU5W4LKZV_cjs.sql`(${field} IS NULL OR ${dialect.jsonArrayLength(field)} = 0)`;
|
|
1627
1678
|
}
|
|
1628
1679
|
case "isNotEmpty": {
|
|
1629
|
-
return
|
|
1680
|
+
return chunkU5W4LKZV_cjs.sql`(${field} IS NOT NULL AND ${dialect.jsonArrayLength(field)} > 0)`;
|
|
1630
1681
|
}
|
|
1631
1682
|
case "lengthEq": {
|
|
1632
|
-
return
|
|
1683
|
+
return chunkU5W4LKZV_cjs.sql`${dialect.jsonArrayLength(field)} = ${expr.length}`;
|
|
1633
1684
|
}
|
|
1634
1685
|
case "lengthGt": {
|
|
1635
|
-
return
|
|
1686
|
+
return chunkU5W4LKZV_cjs.sql`${dialect.jsonArrayLength(field)} > ${expr.length}`;
|
|
1636
1687
|
}
|
|
1637
1688
|
case "lengthGte": {
|
|
1638
|
-
return
|
|
1689
|
+
return chunkU5W4LKZV_cjs.sql`${dialect.jsonArrayLength(field)} >= ${expr.length}`;
|
|
1639
1690
|
}
|
|
1640
1691
|
case "lengthLt": {
|
|
1641
|
-
return
|
|
1692
|
+
return chunkU5W4LKZV_cjs.sql`${dialect.jsonArrayLength(field)} < ${expr.length}`;
|
|
1642
1693
|
}
|
|
1643
1694
|
case "lengthLte": {
|
|
1644
|
-
return
|
|
1695
|
+
return chunkU5W4LKZV_cjs.sql`${dialect.jsonArrayLength(field)} <= ${expr.length}`;
|
|
1645
1696
|
}
|
|
1646
1697
|
case "contains": {
|
|
1647
1698
|
const value = values[0];
|
|
1648
1699
|
if (value === void 0) {
|
|
1649
|
-
return
|
|
1700
|
+
return chunkU5W4LKZV_cjs.sql.raw("1=0");
|
|
1650
1701
|
}
|
|
1651
1702
|
return dialect.jsonArrayContains(field, value);
|
|
1652
1703
|
}
|
|
@@ -1669,13 +1720,13 @@ function compileObjectPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1669
1720
|
}
|
|
1670
1721
|
case "pathEquals": {
|
|
1671
1722
|
if (!expr.value) {
|
|
1672
|
-
throw new
|
|
1723
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
1673
1724
|
"pathEquals requires a comparison value"
|
|
1674
1725
|
);
|
|
1675
1726
|
}
|
|
1676
1727
|
const valueType = resolvePredicateValueType(expr.valueType, expr.value);
|
|
1677
1728
|
if (valueType === "array" || valueType === "object") {
|
|
1678
|
-
throw new
|
|
1729
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
1679
1730
|
"pathEquals is not supported for JSON arrays or objects"
|
|
1680
1731
|
);
|
|
1681
1732
|
}
|
|
@@ -1687,11 +1738,11 @@ function compileObjectPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1687
1738
|
pointer,
|
|
1688
1739
|
cteColumnPrefix
|
|
1689
1740
|
);
|
|
1690
|
-
return
|
|
1741
|
+
return chunkU5W4LKZV_cjs.sql`${left} = ${convertValueForSql(expr.value.value, dialect)}`;
|
|
1691
1742
|
}
|
|
1692
1743
|
case "pathContains": {
|
|
1693
1744
|
if (!expr.value) {
|
|
1694
|
-
throw new
|
|
1745
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
1695
1746
|
"pathContains requires a comparison value"
|
|
1696
1747
|
);
|
|
1697
1748
|
}
|
|
@@ -1719,12 +1770,12 @@ function compileAggregatePredicate(expr, dialect) {
|
|
|
1719
1770
|
const aggregate = compileAggregateExpr(expr.aggregate, dialect);
|
|
1720
1771
|
const op = COMPARISON_OP_SQL[expr.op];
|
|
1721
1772
|
if (!op) {
|
|
1722
|
-
throw new
|
|
1773
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
1723
1774
|
`Comparison operation "${expr.op}" is not supported for aggregate predicates`
|
|
1724
1775
|
);
|
|
1725
1776
|
}
|
|
1726
1777
|
const convertedValue = convertValueForSql(expr.value.value, dialect);
|
|
1727
|
-
return
|
|
1778
|
+
return chunkU5W4LKZV_cjs.sql`${aggregate} ${chunkU5W4LKZV_cjs.sql.raw(op)} ${convertedValue}`;
|
|
1728
1779
|
}
|
|
1729
1780
|
function compileAggregateExpr(expr, dialect) {
|
|
1730
1781
|
const cteAlias = `cte_${expr.field.alias}`;
|
|
@@ -1736,25 +1787,25 @@ function compileAggregateExpr(expr, dialect) {
|
|
|
1736
1787
|
);
|
|
1737
1788
|
switch (expr.function) {
|
|
1738
1789
|
case "count": {
|
|
1739
|
-
return
|
|
1790
|
+
return chunkU5W4LKZV_cjs.sql`COUNT(${field})`;
|
|
1740
1791
|
}
|
|
1741
1792
|
case "countDistinct": {
|
|
1742
|
-
return
|
|
1793
|
+
return chunkU5W4LKZV_cjs.sql`COUNT(DISTINCT ${field})`;
|
|
1743
1794
|
}
|
|
1744
1795
|
case "sum": {
|
|
1745
|
-
return
|
|
1796
|
+
return chunkU5W4LKZV_cjs.sql`SUM(${field})`;
|
|
1746
1797
|
}
|
|
1747
1798
|
case "avg": {
|
|
1748
|
-
return
|
|
1799
|
+
return chunkU5W4LKZV_cjs.sql`AVG(${field})`;
|
|
1749
1800
|
}
|
|
1750
1801
|
case "min": {
|
|
1751
|
-
return
|
|
1802
|
+
return chunkU5W4LKZV_cjs.sql`MIN(${field})`;
|
|
1752
1803
|
}
|
|
1753
1804
|
case "max": {
|
|
1754
|
-
return
|
|
1805
|
+
return chunkU5W4LKZV_cjs.sql`MAX(${field})`;
|
|
1755
1806
|
}
|
|
1756
1807
|
default: {
|
|
1757
|
-
throw new
|
|
1808
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
1758
1809
|
`Unknown aggregate function: ${expr.function}`
|
|
1759
1810
|
);
|
|
1760
1811
|
}
|
|
@@ -1762,15 +1813,15 @@ function compileAggregateExpr(expr, dialect) {
|
|
|
1762
1813
|
}
|
|
1763
1814
|
function compileExistsSubquery(expr, ctx) {
|
|
1764
1815
|
if (expr.subquery.graphId === void 0) {
|
|
1765
|
-
throw new
|
|
1816
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError("EXISTS subquery must have a graphId");
|
|
1766
1817
|
}
|
|
1767
1818
|
const subSql = ctx.compileQuery(expr.subquery, expr.subquery.graphId);
|
|
1768
|
-
return expr.negated ?
|
|
1819
|
+
return expr.negated ? chunkU5W4LKZV_cjs.sql`NOT EXISTS (${subSql})` : chunkU5W4LKZV_cjs.sql`EXISTS (${subSql})`;
|
|
1769
1820
|
}
|
|
1770
1821
|
function compileInSubquery(expr, ctx) {
|
|
1771
1822
|
const subqueryColumnCount = getSubqueryColumnCount(expr.subquery);
|
|
1772
1823
|
if (subqueryColumnCount !== 1) {
|
|
1773
|
-
throw new
|
|
1824
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
1774
1825
|
`IN/NOT IN subquery must project exactly 1 column, but got ${subqueryColumnCount}`,
|
|
1775
1826
|
{ subqueryColumnCount }
|
|
1776
1827
|
);
|
|
@@ -1779,13 +1830,13 @@ function compileInSubquery(expr, ctx) {
|
|
|
1779
1830
|
const subqueryValueType = getSingleSubqueryColumnValueType(expr.subquery);
|
|
1780
1831
|
const resolvedValueType = fieldValueType ?? subqueryValueType;
|
|
1781
1832
|
if (isUnsupportedInSubqueryValueType(resolvedValueType)) {
|
|
1782
|
-
throw new
|
|
1833
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
1783
1834
|
`IN/NOT IN subquery does not support ${String(resolvedValueType)} values`,
|
|
1784
1835
|
{ valueType: resolvedValueType }
|
|
1785
1836
|
);
|
|
1786
1837
|
}
|
|
1787
1838
|
if (!isInSubqueryTypeCompatible(fieldValueType, subqueryValueType)) {
|
|
1788
|
-
throw new
|
|
1839
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
1789
1840
|
`IN/NOT IN type mismatch: field type "${String(fieldValueType)}" does not match subquery column type "${String(subqueryValueType)}"`,
|
|
1790
1841
|
{
|
|
1791
1842
|
fieldValueType,
|
|
@@ -1795,7 +1846,7 @@ function compileInSubquery(expr, ctx) {
|
|
|
1795
1846
|
}
|
|
1796
1847
|
const valueType = fieldValueType ?? subqueryValueType;
|
|
1797
1848
|
if (expr.subquery.graphId === void 0) {
|
|
1798
|
-
throw new
|
|
1849
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(
|
|
1799
1850
|
"IN/NOT IN subquery must have a graphId"
|
|
1800
1851
|
);
|
|
1801
1852
|
}
|
|
@@ -1808,14 +1859,14 @@ function compileInSubquery(expr, ctx) {
|
|
|
1808
1859
|
ctx.cteColumnPrefix
|
|
1809
1860
|
);
|
|
1810
1861
|
const subSql = ctx.compileQuery(expr.subquery, expr.subquery.graphId);
|
|
1811
|
-
return expr.negated ?
|
|
1862
|
+
return expr.negated ? chunkU5W4LKZV_cjs.sql`${fieldSql} NOT IN (${subSql})` : chunkU5W4LKZV_cjs.sql`${fieldSql} IN (${subSql})`;
|
|
1812
1863
|
}
|
|
1813
1864
|
function extractStructuralPredicates(predicates, isMatch, rejectionMessage) {
|
|
1814
1865
|
const results = [];
|
|
1815
1866
|
function visit(expr, inDisallowedBranch) {
|
|
1816
1867
|
if (isMatch(expr)) {
|
|
1817
1868
|
if (inDisallowedBranch) {
|
|
1818
|
-
throw new
|
|
1869
|
+
throw new chunkC4F7VJ5D_cjs.UnsupportedPredicateError(rejectionMessage);
|
|
1819
1870
|
}
|
|
1820
1871
|
results.push(expr);
|
|
1821
1872
|
return;
|
|
@@ -1869,9 +1920,9 @@ function extractFulltextMatchPredicates(predicates) {
|
|
|
1869
1920
|
// src/query/compiler/predicate-utils.ts
|
|
1870
1921
|
var EMPTY_PREDICATES = [];
|
|
1871
1922
|
function sqlValueList(values) {
|
|
1872
|
-
return
|
|
1873
|
-
values.map((value) =>
|
|
1874
|
-
|
|
1923
|
+
return chunkU5W4LKZV_cjs.sql.join(
|
|
1924
|
+
values.map((value) => chunkU5W4LKZV_cjs.sql`${value}`),
|
|
1925
|
+
chunkU5W4LKZV_cjs.sql`, `
|
|
1875
1926
|
);
|
|
1876
1927
|
}
|
|
1877
1928
|
function buildPredicateIndexKey(alias, targetType) {
|
|
@@ -1908,12 +1959,12 @@ function compilePredicateClauses(predicates, predicateContext) {
|
|
|
1908
1959
|
}
|
|
1909
1960
|
function compileKindFilter(column, kinds) {
|
|
1910
1961
|
if (kinds.length === 0) {
|
|
1911
|
-
return
|
|
1962
|
+
return chunkU5W4LKZV_cjs.sql`1 = 0`;
|
|
1912
1963
|
}
|
|
1913
1964
|
if (kinds.length === 1) {
|
|
1914
|
-
return
|
|
1965
|
+
return chunkU5W4LKZV_cjs.sql`${column} = ${kinds[0]}`;
|
|
1915
1966
|
}
|
|
1916
|
-
return
|
|
1967
|
+
return chunkU5W4LKZV_cjs.sql`${column} IN (${sqlValueList(kinds)})`;
|
|
1917
1968
|
}
|
|
1918
1969
|
function getNodeKindsForAlias(ast, alias) {
|
|
1919
1970
|
if (alias === ast.start.alias) {
|
|
@@ -1924,7 +1975,7 @@ function getNodeKindsForAlias(ast, alias) {
|
|
|
1924
1975
|
return traversal.nodeKinds;
|
|
1925
1976
|
}
|
|
1926
1977
|
}
|
|
1927
|
-
throw new
|
|
1978
|
+
throw new chunkC4F7VJ5D_cjs.CompilerInvariantError(`Unknown traversal source alias: ${alias}`);
|
|
1928
1979
|
}
|
|
1929
1980
|
function getHybridTargetAlias(vectorPredicate, fulltextPredicate) {
|
|
1930
1981
|
if (!vectorPredicate || !fulltextPredicate) return void 0;
|
|
@@ -2009,13 +2060,13 @@ var RECORDED_EDGE_COLUMNS = [
|
|
|
2009
2060
|
"tx_id",
|
|
2010
2061
|
"meta"
|
|
2011
2062
|
];
|
|
2012
|
-
var RECORDED_NODE_COLUMN_LIST =
|
|
2013
|
-
var RECORDED_EDGE_COLUMN_LIST =
|
|
2063
|
+
var RECORDED_NODE_COLUMN_LIST = chunkU5W4LKZV_cjs.sql.raw(RECORDED_NODE_COLUMNS.join(", "));
|
|
2064
|
+
var RECORDED_EDGE_COLUMN_LIST = chunkU5W4LKZV_cjs.sql.raw(RECORDED_EDGE_COLUMNS.join(", "));
|
|
2014
2065
|
var RECORDED_BIND_PARAM_BUDGET = 900;
|
|
2015
2066
|
function recordedBindParamBudget(target) {
|
|
2016
2067
|
const budget = target.capabilities.maxBindParameters ?? RECORDED_BIND_PARAM_BUDGET;
|
|
2017
2068
|
if (!Number.isSafeInteger(budget) || budget < 1) {
|
|
2018
|
-
throw new
|
|
2069
|
+
throw new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
2019
2070
|
`backend capabilities.maxBindParameters must be a positive integer, got: ${String(budget)}`,
|
|
2020
2071
|
{
|
|
2021
2072
|
code: "INVALID_BACKEND_CAPABILITY",
|
|
@@ -2031,44 +2082,44 @@ function recordedChunkSize(target, columnCount) {
|
|
|
2031
2082
|
return Math.max(1, Math.floor(budget / columnCount));
|
|
2032
2083
|
}
|
|
2033
2084
|
function sqlNull(value) {
|
|
2034
|
-
return value === void 0 ?
|
|
2085
|
+
return value === void 0 ? chunkU5W4LKZV_cjs.sql.raw("NULL") : chunkU5W4LKZV_cjs.sql`${value}`;
|
|
2035
2086
|
}
|
|
2036
2087
|
function recordedCommonCells() {
|
|
2037
2088
|
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: () =>
|
|
2089
|
+
history_id: () => chunkU5W4LKZV_cjs.sql`${generateId()}`,
|
|
2090
|
+
graph_id: (row) => chunkU5W4LKZV_cjs.sql`${row.graph_id}`,
|
|
2091
|
+
id: (row) => chunkU5W4LKZV_cjs.sql`${row.id}`,
|
|
2092
|
+
kind: (row) => chunkU5W4LKZV_cjs.sql`${row.kind}`,
|
|
2093
|
+
props: (row) => chunkU5W4LKZV_cjs.sql`${chunk3PRKZW6D_cjs.rowPropsToJsonText(row.props)}`,
|
|
2094
|
+
valid_from: (row) => chunkU5W4LKZV_cjs.sql`${sqlNull(row.valid_from)}`,
|
|
2095
|
+
valid_to: (row) => chunkU5W4LKZV_cjs.sql`${sqlNull(row.valid_to)}`,
|
|
2096
|
+
created_at: (row) => chunkU5W4LKZV_cjs.sql`${row.created_at}`,
|
|
2097
|
+
updated_at: (row) => chunkU5W4LKZV_cjs.sql`${row.updated_at}`,
|
|
2098
|
+
deleted_at: (row) => chunkU5W4LKZV_cjs.sql`${sqlNull(row.deleted_at)}`,
|
|
2099
|
+
recorded_from: (_row, recordedRevision) => chunkU5W4LKZV_cjs.sql`${recordedRevision}`,
|
|
2100
|
+
recorded_to: () => chunkU5W4LKZV_cjs.sql`${chunkEQ7JKLZO_cjs.RECORDED_MAX_REVISION}`,
|
|
2101
|
+
op: (_row, _recordedCommit, operation) => chunkU5W4LKZV_cjs.sql`${operation}`,
|
|
2102
|
+
schema_version: () => chunkU5W4LKZV_cjs.sql`NULL`,
|
|
2103
|
+
tx_id: () => chunkU5W4LKZV_cjs.sql`NULL`,
|
|
2104
|
+
meta: () => chunkU5W4LKZV_cjs.sql`${RECORDED_HISTORY_META}`
|
|
2054
2105
|
};
|
|
2055
2106
|
}
|
|
2056
2107
|
var recordedNodeCells = {
|
|
2057
2108
|
...recordedCommonCells(),
|
|
2058
|
-
version: (row) =>
|
|
2109
|
+
version: (row) => chunkU5W4LKZV_cjs.sql`${row.version}`
|
|
2059
2110
|
};
|
|
2060
2111
|
var recordedEdgeCells = {
|
|
2061
2112
|
...recordedCommonCells(),
|
|
2062
|
-
from_kind: (row) =>
|
|
2063
|
-
from_id: (row) =>
|
|
2064
|
-
to_kind: (row) =>
|
|
2065
|
-
to_id: (row) =>
|
|
2113
|
+
from_kind: (row) => chunkU5W4LKZV_cjs.sql`${row.from_kind}`,
|
|
2114
|
+
from_id: (row) => chunkU5W4LKZV_cjs.sql`${row.from_id}`,
|
|
2115
|
+
to_kind: (row) => chunkU5W4LKZV_cjs.sql`${row.to_kind}`,
|
|
2116
|
+
to_id: (row) => chunkU5W4LKZV_cjs.sql`${row.to_id}`
|
|
2066
2117
|
};
|
|
2067
2118
|
function recordedValuesTuple(columns, cells, row, recordedRevision, operation) {
|
|
2068
2119
|
const tuple = columns.map(
|
|
2069
2120
|
(column) => cells[column](row, recordedRevision, operation)
|
|
2070
2121
|
);
|
|
2071
|
-
return
|
|
2122
|
+
return chunkU5W4LKZV_cjs.sql`(${chunkU5W4LKZV_cjs.sql.join(tuple, chunkU5W4LKZV_cjs.sql`, `)})`;
|
|
2072
2123
|
}
|
|
2073
2124
|
async function insertRecordedRows(target, table, columnList, columns, cells, inserts, recordedRevision) {
|
|
2074
2125
|
if (inserts.length === 0) return;
|
|
@@ -2083,9 +2134,9 @@ async function insertRecordedRows(target, table, columnList, columns, cells, ins
|
|
|
2083
2134
|
);
|
|
2084
2135
|
await executeStatement(
|
|
2085
2136
|
target,
|
|
2086
|
-
|
|
2137
|
+
chunkU5W4LKZV_cjs.sql`
|
|
2087
2138
|
INSERT INTO ${table} (${columnList})
|
|
2088
|
-
VALUES ${
|
|
2139
|
+
VALUES ${chunkU5W4LKZV_cjs.sql.join(values, chunkU5W4LKZV_cjs.sql`, `)}
|
|
2089
2140
|
`
|
|
2090
2141
|
);
|
|
2091
2142
|
}
|
|
@@ -2130,14 +2181,14 @@ function entityKey(entity) {
|
|
|
2130
2181
|
}
|
|
2131
2182
|
}
|
|
2132
2183
|
async function closeOpenReturning(target, table, graphId, ids, recordedRevision, kind) {
|
|
2133
|
-
const kindFilter = kind === void 0 ?
|
|
2184
|
+
const kindFilter = kind === void 0 ? chunkU5W4LKZV_cjs.sql`` : chunkU5W4LKZV_cjs.sql`AND kind = ${kind}`;
|
|
2134
2185
|
const rows = await target.execute(
|
|
2135
|
-
|
|
2186
|
+
chunkU5W4LKZV_cjs.asCompiledRowsSql(chunkU5W4LKZV_cjs.sql`
|
|
2136
2187
|
UPDATE ${table}
|
|
2137
2188
|
SET recorded_to = ${recordedRevision}
|
|
2138
2189
|
WHERE graph_id = ${graphId}
|
|
2139
2190
|
${kindFilter}
|
|
2140
|
-
AND recorded_to = ${
|
|
2191
|
+
AND recorded_to = ${chunkEQ7JKLZO_cjs.RECORDED_MAX_REVISION}
|
|
2141
2192
|
AND id IN (${sqlValueList(ids)})
|
|
2142
2193
|
RETURNING id, deleted_at
|
|
2143
2194
|
`)
|
|
@@ -2231,24 +2282,24 @@ async function flushEdges(target, schema, graphId, entities, recordedRevision) {
|
|
|
2231
2282
|
async function closeOpenByKind(target, table, graphId, kind, recordedRevision) {
|
|
2232
2283
|
await executeStatement(
|
|
2233
2284
|
target,
|
|
2234
|
-
|
|
2285
|
+
chunkU5W4LKZV_cjs.sql`
|
|
2235
2286
|
UPDATE ${table}
|
|
2236
2287
|
SET recorded_to = ${recordedRevision}
|
|
2237
2288
|
WHERE graph_id = ${graphId}
|
|
2238
2289
|
AND kind = ${kind}
|
|
2239
|
-
AND recorded_to = ${
|
|
2290
|
+
AND recorded_to = ${chunkEQ7JKLZO_cjs.RECORDED_MAX_REVISION}
|
|
2240
2291
|
`
|
|
2241
2292
|
);
|
|
2242
2293
|
}
|
|
2243
2294
|
async function closeOpenEdgesByNodeKind(target, schema, graphId, nodeKind, recordedRevision) {
|
|
2244
2295
|
await executeStatement(
|
|
2245
2296
|
target,
|
|
2246
|
-
|
|
2297
|
+
chunkU5W4LKZV_cjs.sql`
|
|
2247
2298
|
UPDATE ${schema.recordedEdgesTable}
|
|
2248
2299
|
SET recorded_to = ${recordedRevision}
|
|
2249
2300
|
WHERE graph_id = ${graphId}
|
|
2250
2301
|
AND (from_kind = ${nodeKind} OR to_kind = ${nodeKind})
|
|
2251
|
-
AND recorded_to = ${
|
|
2302
|
+
AND recorded_to = ${chunkEQ7JKLZO_cjs.RECORDED_MAX_REVISION}
|
|
2252
2303
|
`
|
|
2253
2304
|
);
|
|
2254
2305
|
}
|
|
@@ -2286,7 +2337,7 @@ async function closeRecordedHardDeletedKind(target, schema, graphId, removal, ow
|
|
|
2286
2337
|
}
|
|
2287
2338
|
async function queryConnectedEdgeIds(target, schema, params) {
|
|
2288
2339
|
const rows = await target.execute(
|
|
2289
|
-
|
|
2340
|
+
chunkU5W4LKZV_cjs.asCompiledRowsSql(chunkU5W4LKZV_cjs.sql`
|
|
2290
2341
|
SELECT id
|
|
2291
2342
|
FROM ${schema.edgesTable}
|
|
2292
2343
|
WHERE graph_id = ${params.graphId}
|
|
@@ -2307,9 +2358,9 @@ function normalizedColumnType(value) {
|
|
|
2307
2358
|
}
|
|
2308
2359
|
async function readColumnTypes(backend, table) {
|
|
2309
2360
|
const rows = backend.dialect === "sqlite" ? await backend.execute(
|
|
2310
|
-
|
|
2361
|
+
chunkU5W4LKZV_cjs.asCompiledRowsSql(chunkU5W4LKZV_cjs.sql`PRAGMA table_info(${chunkU5W4LKZV_cjs.sql.identifier(table)})`)
|
|
2311
2362
|
) : await backend.execute(
|
|
2312
|
-
|
|
2363
|
+
chunkU5W4LKZV_cjs.asCompiledRowsSql(chunkU5W4LKZV_cjs.sql`
|
|
2313
2364
|
SELECT column_name AS name, data_type AS type
|
|
2314
2365
|
FROM information_schema.columns
|
|
2315
2366
|
WHERE table_schema = current_schema()
|
|
@@ -2384,7 +2435,7 @@ async function assertCurrentRecordedSchema(backend, schema) {
|
|
|
2384
2435
|
return [{ ...requirement, actual: actual ?? "missing" }];
|
|
2385
2436
|
});
|
|
2386
2437
|
if (incompatible.length === 0) return;
|
|
2387
|
-
throw new
|
|
2438
|
+
throw new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
2388
2439
|
"Recorded-time schema is incompatible with history capture.",
|
|
2389
2440
|
{
|
|
2390
2441
|
code: "RECORDED_SCHEMA_INCOMPATIBLE",
|
|
@@ -2432,7 +2483,7 @@ function edgeRowIdentityKey(row) {
|
|
|
2432
2483
|
return edgeIdentityKey(row.graph_id, row.id);
|
|
2433
2484
|
}
|
|
2434
2485
|
function recordedCaptureSealedError(details) {
|
|
2435
|
-
return new
|
|
2486
|
+
return new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
2436
2487
|
"Recorded-time capture session is sealed: a graph write happened after the transaction's capture was flushed.",
|
|
2437
2488
|
details,
|
|
2438
2489
|
{
|
|
@@ -2465,7 +2516,7 @@ function createRecordedCaptureSession() {
|
|
|
2465
2516
|
},
|
|
2466
2517
|
async flush(target, schema, ownsWriteLock) {
|
|
2467
2518
|
if (sealed) {
|
|
2468
|
-
throw new
|
|
2519
|
+
throw new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
2469
2520
|
"Recorded-time capture session was already flushed.",
|
|
2470
2521
|
{},
|
|
2471
2522
|
{
|
|
@@ -2526,7 +2577,7 @@ function createRecordedTransactionBackend(target, session, schema) {
|
|
|
2526
2577
|
await lockRecordedGraphWrite(target, graphId, graphLocks);
|
|
2527
2578
|
}
|
|
2528
2579
|
}
|
|
2529
|
-
const overlay =
|
|
2580
|
+
const overlay = chunk3PRKZW6D_cjs.createBackendOverlay(target, {
|
|
2530
2581
|
...rawWriteGuards(target, "tx.backend"),
|
|
2531
2582
|
async insertNode(params) {
|
|
2532
2583
|
session.assertOpen();
|
|
@@ -2692,7 +2743,7 @@ function createRecordedTransactionScope(target, schema, ownsWriteLock = false) {
|
|
|
2692
2743
|
return {
|
|
2693
2744
|
backend: createRecordedTransactionBackend(target, session, resolvedSchema),
|
|
2694
2745
|
async flush() {
|
|
2695
|
-
return
|
|
2746
|
+
return chunkWBUFJ7BS_cjs.withRecordedRelationsPrecondition(
|
|
2696
2747
|
session.flush(target, resolvedSchema, ownsWriteLock),
|
|
2697
2748
|
{ dialect: target.dialect, surface: "capture-flush" }
|
|
2698
2749
|
);
|
|
@@ -2713,7 +2764,7 @@ function createRecordedBackend(backend, schema) {
|
|
|
2713
2764
|
assertCapturableBackend(backend);
|
|
2714
2765
|
const capture = (fn) => runCapturedAutocommit(backend, schema, fn);
|
|
2715
2766
|
const projectedBackend = createGraphBackendProjection(backend);
|
|
2716
|
-
return
|
|
2767
|
+
return chunk3PRKZW6D_cjs.createBackendOverlay(projectedBackend, {
|
|
2717
2768
|
...rawWriteGuards(backend, "backend"),
|
|
2718
2769
|
async insertNode(params) {
|
|
2719
2770
|
return capture((target) => target.insertNode(params));
|
|
@@ -3132,7 +3183,7 @@ function checkCardinality(edgeKind, fromKind, fromId, cardinality, existingEdgeC
|
|
|
3132
3183
|
}
|
|
3133
3184
|
case "one": {
|
|
3134
3185
|
if (existingEdgeCount > 0) {
|
|
3135
|
-
return new
|
|
3186
|
+
return new chunkC4F7VJ5D_cjs.CardinalityError({
|
|
3136
3187
|
edgeKind,
|
|
3137
3188
|
fromKind,
|
|
3138
3189
|
fromId,
|
|
@@ -3147,7 +3198,7 @@ function checkCardinality(edgeKind, fromKind, fromId, cardinality, existingEdgeC
|
|
|
3147
3198
|
}
|
|
3148
3199
|
case "oneActive": {
|
|
3149
3200
|
if (hasActiveEdge) {
|
|
3150
|
-
return new
|
|
3201
|
+
return new chunkC4F7VJ5D_cjs.CardinalityError({
|
|
3151
3202
|
edgeKind,
|
|
3152
3203
|
fromKind,
|
|
3153
3204
|
fromId,
|
|
@@ -3161,7 +3212,7 @@ function checkCardinality(edgeKind, fromKind, fromId, cardinality, existingEdgeC
|
|
|
3161
3212
|
}
|
|
3162
3213
|
function checkUniqueEdge(edgeKind, fromKind, fromId, _toKind, _toId, existingCount) {
|
|
3163
3214
|
if (existingCount > 0) {
|
|
3164
|
-
return new
|
|
3215
|
+
return new chunkC4F7VJ5D_cjs.CardinalityError({
|
|
3165
3216
|
edgeKind,
|
|
3166
3217
|
fromKind,
|
|
3167
3218
|
fromId,
|
|
@@ -3174,7 +3225,7 @@ function checkUniqueEdge(edgeKind, fromKind, fromId, _toKind, _toId, existingCou
|
|
|
3174
3225
|
function validateEdgeEndpoints(edgeKind, fromKind, toKind, registration, registry) {
|
|
3175
3226
|
const validFromKinds = registration.from.map((node) => node.kind);
|
|
3176
3227
|
if (!registry.isAssignableToAny(fromKind, validFromKinds)) {
|
|
3177
|
-
return new
|
|
3228
|
+
return new chunkC4F7VJ5D_cjs.EndpointError({
|
|
3178
3229
|
edgeKind,
|
|
3179
3230
|
endpoint: "from",
|
|
3180
3231
|
actualKind: fromKind,
|
|
@@ -3183,7 +3234,7 @@ function validateEdgeEndpoints(edgeKind, fromKind, toKind, registration, registr
|
|
|
3183
3234
|
}
|
|
3184
3235
|
const validToKinds = registration.to.map((node) => node.kind);
|
|
3185
3236
|
if (!registry.isAssignableToAny(toKind, validToKinds)) {
|
|
3186
|
-
return new
|
|
3237
|
+
return new chunkC4F7VJ5D_cjs.EndpointError({
|
|
3187
3238
|
edgeKind,
|
|
3188
3239
|
endpoint: "to",
|
|
3189
3240
|
actualKind: toKind,
|
|
@@ -3195,7 +3246,7 @@ function validateEdgeEndpoints(edgeKind, fromKind, toKind, registration, registr
|
|
|
3195
3246
|
function checkDisjointness(nodeId, nodeKind, existingKinds, registry) {
|
|
3196
3247
|
for (const existingKind of existingKinds) {
|
|
3197
3248
|
if (registry.areDisjoint(nodeKind, existingKind)) {
|
|
3198
|
-
return new
|
|
3249
|
+
return new chunkC4F7VJ5D_cjs.DisjointError({
|
|
3199
3250
|
nodeId,
|
|
3200
3251
|
attemptedKind: nodeKind,
|
|
3201
3252
|
conflictingKind: existingKind
|
|
@@ -3232,7 +3283,7 @@ async function checkUniquenessConstraints(ctx, kind, id, props, constraints) {
|
|
|
3232
3283
|
key
|
|
3233
3284
|
});
|
|
3234
3285
|
if (existing && existing.node_id !== id) {
|
|
3235
|
-
throw new
|
|
3286
|
+
throw new chunkC4F7VJ5D_cjs.UniquenessError({
|
|
3236
3287
|
constraintName: constraint.name,
|
|
3237
3288
|
kind: kindToCheck,
|
|
3238
3289
|
existingId: existing.node_id,
|
|
@@ -3338,7 +3389,7 @@ async function updateUniquenessEntries(ctx, kind, id, oldProps, newProps, constr
|
|
|
3338
3389
|
key: newKey
|
|
3339
3390
|
});
|
|
3340
3391
|
if (existing && existing.node_id !== id) {
|
|
3341
|
-
throw new
|
|
3392
|
+
throw new chunkC4F7VJ5D_cjs.UniquenessError({
|
|
3342
3393
|
constraintName: constraint.name,
|
|
3343
3394
|
kind: kindToCheck,
|
|
3344
3395
|
existingId: existing.node_id,
|
|
@@ -3395,7 +3446,7 @@ async function enforceNodeDeleteBehavior(ctx, args, backend, policy) {
|
|
|
3395
3446
|
if (connectedEdges.length === 0) return;
|
|
3396
3447
|
switch (behavior) {
|
|
3397
3448
|
case "restrict": {
|
|
3398
|
-
throw new
|
|
3449
|
+
throw new chunkC4F7VJ5D_cjs.RestrictedDeleteError({
|
|
3399
3450
|
nodeKind: args.kind,
|
|
3400
3451
|
nodeId: args.id,
|
|
3401
3452
|
edgeCount: connectedEdges.length,
|
|
@@ -3468,7 +3519,7 @@ async function applyNodeInsertSideEffectsBatch(ctx, items, backend) {
|
|
|
3468
3519
|
);
|
|
3469
3520
|
}
|
|
3470
3521
|
function parseRowProps(row) {
|
|
3471
|
-
return
|
|
3522
|
+
return chunk3PRKZW6D_cjs.rowPropsToObject(row.props);
|
|
3472
3523
|
}
|
|
3473
3524
|
async function applyNodeUpdate(ctx, args, backend) {
|
|
3474
3525
|
const { kind, id } = args.existing;
|
|
@@ -3667,6 +3718,7 @@ exports.readRecordedClock = readRecordedClock;
|
|
|
3667
3718
|
exports.readRevisionOrigin = readRevisionOrigin;
|
|
3668
3719
|
exports.recordedBindParamBudget = recordedBindParamBudget;
|
|
3669
3720
|
exports.recordedCaptureRequiresCallbackTransactionError = recordedCaptureRequiresCallbackTransactionError;
|
|
3721
|
+
exports.resolveParameterValueType = resolveParameterValueType;
|
|
3670
3722
|
exports.runInsertBatch = runInsertBatch;
|
|
3671
3723
|
exports.runInsertBatchReturning = runInsertBatchReturning;
|
|
3672
3724
|
exports.runInsertNoReturn = runInsertNoReturn;
|
|
@@ -3682,5 +3734,5 @@ exports.uncapturedGraphWriteLock = uncapturedGraphWriteLock;
|
|
|
3682
3734
|
exports.validateEdgeEndpoints = validateEdgeEndpoints;
|
|
3683
3735
|
exports.withPinnedReadInstant = withPinnedReadInstant;
|
|
3684
3736
|
exports.withRecordedFlushObserver = withRecordedFlushObserver;
|
|
3685
|
-
//# sourceMappingURL=chunk-
|
|
3686
|
-
//# sourceMappingURL=chunk-
|
|
3737
|
+
//# sourceMappingURL=chunk-7V2FGGI2.cjs.map
|
|
3738
|
+
//# sourceMappingURL=chunk-7V2FGGI2.cjs.map
|