@nicia-ai/typegraph 0.43.0 → 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-KDRF3NR2.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-64LERBFM.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-JNXZQBN3.js → chunk-BCP7LLOY.js} +687 -456
- 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-CTWZPYJW.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-BLBG2VZ5.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-L5AUCL5P.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-L2BYRYHC.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-NDQLPKBX.cjs → chunk-XR4YZFKW.cjs} +1740 -1509
- 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-DHXw7QAl.d.cts → index-By89Sezh.d.ts} +37 -7
- package/dist/{index-DQzVJBHa.d.ts → 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-DpJqtbSX.d.cts → postgres-DaEWvN4x.d.cts} +1 -1
- package/dist/{postgres-C5-WMKFA.d.ts → 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-Ch5tSYQY.d.ts → sqlite-BrMoSsI7.d.cts} +1 -1
- package/dist/{sqlite-Da7jiYu9.d.cts → sqlite-CHhZUyO5.d.ts} +1 -1
- package/dist/{store-view-DdwBNjZQ.d.ts → store-view-Bvdku0Ht.d.ts} +181 -34
- package/dist/{store-view-D1F6KqsE.d.cts → store-view-w-md0nQ4.d.cts} +181 -34
- 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.cts → types-Cjvkj0jA.d.cts} +351 -12
- package/dist/{types-Dh-EgT-w.d.ts → 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-42XYPKZU.js.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-BLBG2VZ5.cjs.map +0 -1
- package/dist/chunk-CTWZPYJW.js.map +0 -1
- package/dist/chunk-ECU53PMN.cjs.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-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-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-X2XOQZT3.cjs.map +0 -1
- package/dist/chunk-YPVQYM3L.js.map +0 -1
- package/dist/chunk-ZIRC2U6G.js.map +0 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
3
|
+
var chunkST3LPB2V_cjs = require('./chunk-ST3LPB2V.cjs');
|
|
4
|
+
var chunkMCHP7RHZ_cjs = require('./chunk-MCHP7RHZ.cjs');
|
|
5
|
+
var chunkHJH3RMXG_cjs = require('./chunk-HJH3RMXG.cjs');
|
|
6
|
+
var chunk6JZUSDY2_cjs = require('./chunk-6JZUSDY2.cjs');
|
|
7
|
+
var chunkNN3QSOVS_cjs = require('./chunk-NN3QSOVS.cjs');
|
|
8
8
|
var chunkZDH3DX3C_cjs = require('./chunk-ZDH3DX3C.cjs');
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
9
|
+
var chunk3PRKZW6D_cjs = require('./chunk-3PRKZW6D.cjs');
|
|
10
|
+
var chunkWBUFJ7BS_cjs = require('./chunk-WBUFJ7BS.cjs');
|
|
11
|
+
var chunkOVUUTCPJ_cjs = require('./chunk-OVUUTCPJ.cjs');
|
|
12
|
+
var chunkU5W4LKZV_cjs = require('./chunk-U5W4LKZV.cjs');
|
|
13
13
|
var chunk764JHTLT_cjs = require('./chunk-764JHTLT.cjs');
|
|
14
|
-
var
|
|
14
|
+
var chunkC4F7VJ5D_cjs = require('./chunk-C4F7VJ5D.cjs');
|
|
15
15
|
var drizzleOrm = require('drizzle-orm');
|
|
16
16
|
var pgCore = require('drizzle-orm/pg-core');
|
|
17
17
|
|
|
@@ -50,7 +50,7 @@ var DEFAULT_POSTGRES_STATEMENT_CACHE_MAX = 256;
|
|
|
50
50
|
var STATEMENT_NAME_CACHE = /* @__PURE__ */ new Map();
|
|
51
51
|
var nextStatementId = 0;
|
|
52
52
|
function statementNameFor(sqlText, cacheMax) {
|
|
53
|
-
return
|
|
53
|
+
return chunkST3LPB2V_cjs.getOrCreateLru(STATEMENT_NAME_CACHE, sqlText, cacheMax, () => {
|
|
54
54
|
const name = `tg_${nextStatementId}`;
|
|
55
55
|
nextStatementId += 1;
|
|
56
56
|
return name;
|
|
@@ -164,7 +164,7 @@ function createPostgresExecutionAdapter(db, options = {}) {
|
|
|
164
164
|
options.useTransactionClient ?? false
|
|
165
165
|
);
|
|
166
166
|
function compile(query) {
|
|
167
|
-
return
|
|
167
|
+
return chunkNN3QSOVS_cjs.compileQueryWithDialect(db, query, "PostgreSQL");
|
|
168
168
|
}
|
|
169
169
|
function assertCompiledWithinBindParameterLimit(compiledQuery) {
|
|
170
170
|
assertWithinBindParameterLimit(
|
|
@@ -179,7 +179,7 @@ function createPostgresExecutionAdapter(db, options = {}) {
|
|
|
179
179
|
assertCompiledWithinBindParameterLimit(compile(query));
|
|
180
180
|
return executeDrizzleQuery(
|
|
181
181
|
db,
|
|
182
|
-
|
|
182
|
+
chunkU5W4LKZV_cjs.isSqlFragment(query) ? chunkNN3QSOVS_cjs.toDrizzleSql(query, "postgres") : query
|
|
183
183
|
);
|
|
184
184
|
}
|
|
185
185
|
};
|
|
@@ -198,7 +198,7 @@ function createPostgresExecutionAdapter(db, options = {}) {
|
|
|
198
198
|
async execute(query) {
|
|
199
199
|
const compiled = compile(query);
|
|
200
200
|
assertCompiledWithinBindParameterLimit(compiled);
|
|
201
|
-
if (
|
|
201
|
+
if (chunkU5W4LKZV_cjs.isSqlFragment(query) && chunkU5W4LKZV_cjs.shouldForceCustomPlan(query)) {
|
|
202
202
|
const result = await pgQueryClient.queryUnnamed(
|
|
203
203
|
compiled.sql,
|
|
204
204
|
compiled.params
|
|
@@ -221,7 +221,7 @@ function assertWithinBindParameterLimit(parameterCount, maxBindParameters) {
|
|
|
221
221
|
if (maxBindParameters === void 0 || parameterCount <= maxBindParameters) {
|
|
222
222
|
return;
|
|
223
223
|
}
|
|
224
|
-
throw new
|
|
224
|
+
throw new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
225
225
|
`PostgreSQL statement uses ${parameterCount} bound parameters, exceeding this backend's limit of ${maxBindParameters}.`,
|
|
226
226
|
{
|
|
227
227
|
capability: "maxBindParameters",
|
|
@@ -242,7 +242,7 @@ function createStatementQueue() {
|
|
|
242
242
|
let closed = false;
|
|
243
243
|
return {
|
|
244
244
|
enqueue(task) {
|
|
245
|
-
if (closed) return Promise.reject(new
|
|
245
|
+
if (closed) return Promise.reject(new chunkC4F7VJ5D_cjs.TransactionClosedError());
|
|
246
246
|
const result = tail.then(() => task());
|
|
247
247
|
tail = result.then(ignoreOutcome, ignoreOutcome);
|
|
248
248
|
return result;
|
|
@@ -306,7 +306,11 @@ function computePostgresBatchChunkSizes(maxBindParameters) {
|
|
|
306
306
|
),
|
|
307
307
|
embeddingUpsertBatchSize: Math.max(
|
|
308
308
|
1,
|
|
309
|
-
Math.floor(maxBindParameters /
|
|
309
|
+
Math.floor(maxBindParameters / chunkST3LPB2V_cjs.EMBEDDING_UPSERT_PARAM_COUNT)
|
|
310
|
+
),
|
|
311
|
+
findEdgesEndpointChunkSize: Math.max(
|
|
312
|
+
1,
|
|
313
|
+
maxBindParameters - chunkST3LPB2V_cjs.FIND_EDGES_ENDPOINT_FIXED_PARAM_COUNT
|
|
310
314
|
),
|
|
311
315
|
fulltextDeleteChunkSize: Math.max(
|
|
312
316
|
1,
|
|
@@ -334,23 +338,23 @@ function computePostgresBatchChunkSizes(maxBindParameters) {
|
|
|
334
338
|
)
|
|
335
339
|
};
|
|
336
340
|
}
|
|
337
|
-
var toNodeRow =
|
|
338
|
-
var toEdgeRow =
|
|
339
|
-
var toUniqueRow =
|
|
340
|
-
var toSchemaVersionRow =
|
|
341
|
-
|
|
341
|
+
var toNodeRow = chunkHJH3RMXG_cjs.createNodeRowMapper(chunkHJH3RMXG_cjs.POSTGRES_ROW_MAPPER_CONFIG);
|
|
342
|
+
var toEdgeRow = chunkHJH3RMXG_cjs.createEdgeRowMapper(chunkHJH3RMXG_cjs.POSTGRES_ROW_MAPPER_CONFIG);
|
|
343
|
+
var toUniqueRow = chunkHJH3RMXG_cjs.createUniqueRowMapper(chunkHJH3RMXG_cjs.POSTGRES_ROW_MAPPER_CONFIG);
|
|
344
|
+
var toSchemaVersionRow = chunkHJH3RMXG_cjs.createSchemaVersionRowMapper(
|
|
345
|
+
chunkHJH3RMXG_cjs.POSTGRES_ROW_MAPPER_CONFIG
|
|
342
346
|
);
|
|
343
347
|
function buildPostgresCapabilities(fulltextStrategy, vectorStrategy) {
|
|
344
348
|
return {
|
|
345
|
-
...
|
|
346
|
-
...vectorStrategy === void 0 ? {} : { vector:
|
|
347
|
-
fulltext:
|
|
349
|
+
...chunk3PRKZW6D_cjs.POSTGRES_CAPABILITIES,
|
|
350
|
+
...vectorStrategy === void 0 ? {} : { vector: chunkOVUUTCPJ_cjs.buildVectorCapabilities(vectorStrategy) },
|
|
351
|
+
fulltext: chunkOVUUTCPJ_cjs.buildFulltextCapabilities(fulltextStrategy)
|
|
348
352
|
};
|
|
349
353
|
}
|
|
350
354
|
function createPostgresBackend(db, options = {}) {
|
|
351
|
-
const tables2 = options.tables ??
|
|
352
|
-
const fulltextStrategy = options.fulltext ??
|
|
353
|
-
const vectorStrategy = options.vector === false ? void 0 : options.vector ??
|
|
355
|
+
const tables2 = options.tables ?? chunk6JZUSDY2_cjs.tables;
|
|
356
|
+
const fulltextStrategy = options.fulltext ?? chunkOVUUTCPJ_cjs.tsvectorStrategy;
|
|
357
|
+
const vectorStrategy = options.vector === false ? void 0 : options.vector ?? chunkMCHP7RHZ_cjs.pgvectorStrategy;
|
|
354
358
|
const iterativeScanProbe = createIterativeScanProbe();
|
|
355
359
|
const baseCapabilities = buildPostgresCapabilities(
|
|
356
360
|
fulltextStrategy,
|
|
@@ -363,14 +367,14 @@ function createPostgresBackend(db, options = {}) {
|
|
|
363
367
|
supported: false
|
|
364
368
|
}
|
|
365
369
|
} : {};
|
|
366
|
-
const configuredMaxBindParameters = options.capabilities?.maxBindParameters ??
|
|
370
|
+
const configuredMaxBindParameters = options.capabilities?.maxBindParameters ?? chunk3PRKZW6D_cjs.POSTGRES_MAX_BIND_PARAMETERS;
|
|
367
371
|
const driverBindParameterOverrides = isPgliteDatabase(db) ? {
|
|
368
372
|
maxBindParameters: Math.min(
|
|
369
373
|
configuredMaxBindParameters,
|
|
370
374
|
PGLITE_MAX_BIND_PARAMETERS
|
|
371
375
|
)
|
|
372
376
|
} : {};
|
|
373
|
-
const capabilities =
|
|
377
|
+
const capabilities = chunk3PRKZW6D_cjs.normalizeGraphAnalyticsCapabilities({
|
|
374
378
|
...baseCapabilities,
|
|
375
379
|
...httpOnlyOverrides,
|
|
376
380
|
...options.capabilities,
|
|
@@ -379,7 +383,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
379
383
|
const adapterOptions = {
|
|
380
384
|
...options.prepareStatements === void 0 ? {} : { prepareStatements: options.prepareStatements },
|
|
381
385
|
...options.preparedStatementCacheMax === void 0 ? {} : { preparedStatementCacheMax: options.preparedStatementCacheMax },
|
|
382
|
-
maxBindParameters: capabilities.maxBindParameters ??
|
|
386
|
+
maxBindParameters: capabilities.maxBindParameters ?? chunk3PRKZW6D_cjs.POSTGRES_MAX_BIND_PARAMETERS
|
|
383
387
|
};
|
|
384
388
|
const executionAdapter = createPostgresExecutionAdapter(db, adapterOptions);
|
|
385
389
|
const tableNames = {
|
|
@@ -398,8 +402,8 @@ function createPostgresBackend(db, options = {}) {
|
|
|
398
402
|
drizzleOrm.getTableName(tables2.uniques),
|
|
399
403
|
tableNames.fulltext
|
|
400
404
|
].map(
|
|
401
|
-
(name) =>
|
|
402
|
-
|
|
405
|
+
(name) => chunkNN3QSOVS_cjs.toDrizzleSql(
|
|
406
|
+
chunkU5W4LKZV_cjs.sql`ANALYZE (SKIP_LOCKED) ${chunkU5W4LKZV_cjs.sql.identifier(name)}`,
|
|
403
407
|
"postgres"
|
|
404
408
|
)
|
|
405
409
|
);
|
|
@@ -408,11 +412,11 @@ function createPostgresBackend(db, options = {}) {
|
|
|
408
412
|
tableNames.recordedEdges,
|
|
409
413
|
tableNames.recordedClock
|
|
410
414
|
];
|
|
411
|
-
const operationStrategy =
|
|
415
|
+
const operationStrategy = chunkST3LPB2V_cjs.createPostgresOperationStrategy(
|
|
412
416
|
tables2,
|
|
413
417
|
fulltextStrategy
|
|
414
418
|
);
|
|
415
|
-
const recordedTableExists =
|
|
419
|
+
const recordedTableExists = chunkST3LPB2V_cjs.createCachedTableExistence(
|
|
416
420
|
async (tableName) => {
|
|
417
421
|
const rows = await executionAdapter.execute(
|
|
418
422
|
operationStrategy.buildTableExists(tableName)
|
|
@@ -423,7 +427,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
423
427
|
);
|
|
424
428
|
const matTable = tables2.contributionMaterializations;
|
|
425
429
|
async function ensureContributionMaterializationsTableImpl() {
|
|
426
|
-
await db.execute(drizzleOrm.sql.raw(
|
|
430
|
+
await db.execute(drizzleOrm.sql.raw(chunk6JZUSDY2_cjs.generatePgCreateTableSQL(matTable)));
|
|
427
431
|
}
|
|
428
432
|
async function getContributionMaterializationRow(identity) {
|
|
429
433
|
const rows = await db.select().from(matTable).where(
|
|
@@ -436,25 +440,25 @@ function createPostgresBackend(db, options = {}) {
|
|
|
436
440
|
);
|
|
437
441
|
const row = rows[0];
|
|
438
442
|
if (row === void 0) return void 0;
|
|
439
|
-
return
|
|
443
|
+
return chunkST3LPB2V_cjs.mapContributionMaterializationRow(
|
|
440
444
|
row,
|
|
441
|
-
|
|
445
|
+
chunkST3LPB2V_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.decode
|
|
442
446
|
);
|
|
443
447
|
}
|
|
444
448
|
async function getContributionMaterializationRows(graphId) {
|
|
445
449
|
const rows = await db.select().from(matTable).where(drizzleOrm.eq(matTable.graphId, graphId));
|
|
446
450
|
return rows.map(
|
|
447
|
-
(row) =>
|
|
451
|
+
(row) => chunkST3LPB2V_cjs.mapContributionMaterializationRow(
|
|
448
452
|
row,
|
|
449
|
-
|
|
453
|
+
chunkST3LPB2V_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.decode
|
|
450
454
|
)
|
|
451
455
|
);
|
|
452
456
|
}
|
|
453
457
|
async function recordContributionMaterializationRow(params) {
|
|
454
458
|
await db.insert(matTable).values(
|
|
455
|
-
|
|
459
|
+
chunkST3LPB2V_cjs.buildContributionInsertValues(
|
|
456
460
|
params,
|
|
457
|
-
|
|
461
|
+
chunkST3LPB2V_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.encode
|
|
458
462
|
)
|
|
459
463
|
).onConflictDoUpdate({
|
|
460
464
|
target: [
|
|
@@ -463,7 +467,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
463
467
|
matTable.owner,
|
|
464
468
|
matTable.tableName
|
|
465
469
|
],
|
|
466
|
-
set:
|
|
470
|
+
set: chunkST3LPB2V_cjs.buildContributionOnConflictSet(
|
|
467
471
|
matTable.materializedAt,
|
|
468
472
|
params.materializedAt
|
|
469
473
|
)
|
|
@@ -479,7 +483,13 @@ function createPostgresBackend(db, options = {}) {
|
|
|
479
483
|
)
|
|
480
484
|
);
|
|
481
485
|
}
|
|
482
|
-
|
|
486
|
+
async function contributionTableExists(tableName) {
|
|
487
|
+
const rows = await executionAdapter.execute(
|
|
488
|
+
operationStrategy.buildTableExists(tableName)
|
|
489
|
+
);
|
|
490
|
+
return chunkST3LPB2V_cjs.tableExistsFromRow(rows[0]);
|
|
491
|
+
}
|
|
492
|
+
const contributionMaterializer = chunkST3LPB2V_cjs.createContributionMaterializer({
|
|
483
493
|
dialect: "postgres",
|
|
484
494
|
fulltextStrategy,
|
|
485
495
|
fulltextTableName: tables2.fulltextTableName,
|
|
@@ -490,7 +500,8 @@ function createPostgresBackend(db, options = {}) {
|
|
|
490
500
|
ensureMarkerTable: ensureContributionMaterializationsTableImpl,
|
|
491
501
|
getMarkers: getContributionMaterializationRows,
|
|
492
502
|
recordMarker: recordContributionMaterializationRow,
|
|
493
|
-
deleteMarker: deleteContributionMaterializationRow
|
|
503
|
+
deleteMarker: deleteContributionMaterializationRow,
|
|
504
|
+
tableExists: contributionTableExists
|
|
494
505
|
});
|
|
495
506
|
const operations = createPostgresOperationBackend({
|
|
496
507
|
db,
|
|
@@ -502,12 +513,14 @@ function createPostgresBackend(db, options = {}) {
|
|
|
502
513
|
fulltextStrategy,
|
|
503
514
|
vectorStrategy,
|
|
504
515
|
contributionMaterializer,
|
|
505
|
-
iterativeScanProbe
|
|
516
|
+
iterativeScanProbe,
|
|
517
|
+
schemaVersionsTable: tables2.schemaVersions,
|
|
518
|
+
transactionScoped: false
|
|
506
519
|
});
|
|
507
520
|
function runSchemaWriteTransaction(graphId, fn) {
|
|
508
521
|
if (!capabilities.transactions) {
|
|
509
|
-
throw new
|
|
510
|
-
"
|
|
522
|
+
throw new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
523
|
+
"Schema writes and removal cleanup require atomic transactions, but this Postgres backend does not provide them. The drizzle-orm/neon-http driver communicates over HTTP and cannot hold a session across statements; use drizzle-orm/neon-serverless (websocket) for transactional writes.",
|
|
511
524
|
{
|
|
512
525
|
backend: "postgres",
|
|
513
526
|
capability: "transactions",
|
|
@@ -517,6 +530,13 @@ function createPostgresBackend(db, options = {}) {
|
|
|
517
530
|
}
|
|
518
531
|
return db.transaction(async (tx) => {
|
|
519
532
|
await tx.execute(drizzleOrm.sql`SELECT pg_advisory_xact_lock(hashtext(${graphId}))`);
|
|
533
|
+
await tx.execute(drizzleOrm.sql`
|
|
534
|
+
SELECT ${tables2.schemaVersions.version}
|
|
535
|
+
FROM ${tables2.schemaVersions}
|
|
536
|
+
WHERE ${tables2.schemaVersions.graphId} = ${graphId}
|
|
537
|
+
AND ${tables2.schemaVersions.isActive} = TRUE
|
|
538
|
+
FOR UPDATE
|
|
539
|
+
`);
|
|
520
540
|
const { backend: txBackend, drainAndClose } = createTransactionBackend({
|
|
521
541
|
db: tx,
|
|
522
542
|
adapterOptions,
|
|
@@ -526,7 +546,8 @@ function createPostgresBackend(db, options = {}) {
|
|
|
526
546
|
fulltextStrategy,
|
|
527
547
|
vectorStrategy,
|
|
528
548
|
contributionMaterializer,
|
|
529
|
-
iterativeScanProbe
|
|
549
|
+
iterativeScanProbe,
|
|
550
|
+
schemaVersionsTable: tables2.schemaVersions
|
|
530
551
|
});
|
|
531
552
|
try {
|
|
532
553
|
return await fn(txBackend);
|
|
@@ -545,10 +566,11 @@ function createPostgresBackend(db, options = {}) {
|
|
|
545
566
|
fulltextStrategy,
|
|
546
567
|
vectorStrategy,
|
|
547
568
|
contributionMaterializer,
|
|
548
|
-
iterativeScanProbe
|
|
569
|
+
iterativeScanProbe,
|
|
570
|
+
schemaVersionsTable: tables2.schemaVersions
|
|
549
571
|
});
|
|
550
572
|
return {
|
|
551
|
-
backend:
|
|
573
|
+
backend: chunkST3LPB2V_cjs.gateFulltext(
|
|
552
574
|
backend2,
|
|
553
575
|
contributionMaterializer.assertInitialized
|
|
554
576
|
),
|
|
@@ -558,48 +580,53 @@ function createPostgresBackend(db, options = {}) {
|
|
|
558
580
|
const backend = {
|
|
559
581
|
...operations,
|
|
560
582
|
...capabilities.transactions && executionAdapter.executeCompiled !== void 0 ? {
|
|
561
|
-
async trustedImport(fn) {
|
|
583
|
+
async trustedImport(fn, options_) {
|
|
562
584
|
return backend.transactionWithNative(async (tx, rawSql) => {
|
|
585
|
+
if (options_?.schemaWrite !== void 0) {
|
|
586
|
+
await chunk764JHTLT_cjs.requireDefined(tx.lockSchemaVersionForWrite)({
|
|
587
|
+
...options_.schemaWrite
|
|
588
|
+
});
|
|
589
|
+
}
|
|
563
590
|
const trustedExecutionAdapter = createPostgresExecutionAdapter(
|
|
564
591
|
rawSql,
|
|
565
592
|
{ ...adapterOptions, useTransactionClient: true }
|
|
566
593
|
);
|
|
567
594
|
const executeCompiled = trustedExecutionAdapter.executeCompiled;
|
|
568
595
|
if (executeCompiled === void 0) {
|
|
569
|
-
throw new
|
|
596
|
+
throw new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
570
597
|
"Trusted import could not bind raw execution to the PostgreSQL transaction.",
|
|
571
598
|
{ capability: "trustedImport", dialect: "postgres" }
|
|
572
599
|
);
|
|
573
600
|
}
|
|
574
|
-
const trustedTx =
|
|
601
|
+
const trustedTx = chunk3PRKZW6D_cjs.createBackendOverlay(tx, {
|
|
575
602
|
executeRaw(sqlText, params) {
|
|
576
603
|
return executeCompiled({ params, sql: sqlText });
|
|
577
604
|
}
|
|
578
605
|
});
|
|
579
|
-
await
|
|
580
|
-
await
|
|
581
|
-
const indexDefinitions = await
|
|
606
|
+
await chunkST3LPB2V_cjs.lockPostgresTrustedImportTables(trustedTx, tableNames);
|
|
607
|
+
await chunkST3LPB2V_cjs.assertTrustedImportDatabaseEmpty(trustedTx, tableNames);
|
|
608
|
+
const indexDefinitions = await chunkST3LPB2V_cjs.suspendPostgresSecondaryIndexes(
|
|
582
609
|
trustedTx,
|
|
583
610
|
tableNames
|
|
584
611
|
);
|
|
585
612
|
const result = await fn(
|
|
586
|
-
|
|
613
|
+
chunkST3LPB2V_cjs.createPostgresTrustedImportSession(trustedTx, tableNames)
|
|
587
614
|
);
|
|
588
|
-
await
|
|
589
|
-
await
|
|
615
|
+
await chunkST3LPB2V_cjs.restoreSecondaryIndexes(trustedTx, indexDefinitions);
|
|
616
|
+
await chunkST3LPB2V_cjs.analyzeImportedTables(trustedTx, tableNames);
|
|
590
617
|
return result;
|
|
591
618
|
});
|
|
592
619
|
}
|
|
593
620
|
} : {},
|
|
594
621
|
async bootstrapTables() {
|
|
595
|
-
const statements =
|
|
622
|
+
const statements = chunk6JZUSDY2_cjs.generatePostgresDDL(tables2, fulltextStrategy);
|
|
596
623
|
for (const statement of statements) {
|
|
597
624
|
await db.execute(drizzleOrm.sql.raw(statement));
|
|
598
625
|
}
|
|
599
626
|
},
|
|
600
627
|
async ensureRevisionOriginsTable() {
|
|
601
628
|
await db.execute(
|
|
602
|
-
drizzleOrm.sql.raw(
|
|
629
|
+
drizzleOrm.sql.raw(chunk6JZUSDY2_cjs.generatePgCreateTableSQL(tables2.revisionOrigins))
|
|
603
630
|
);
|
|
604
631
|
},
|
|
605
632
|
// Every fulltext-touching method asserts the durable marker instead
|
|
@@ -607,7 +634,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
607
634
|
// uninitialized database throws `StoreNotInitializedError` loudly
|
|
608
635
|
// rather than self-healing on a read/write path (#135). Shared
|
|
609
636
|
// verbatim with the tx-scoped gate via `gateFulltextMethods`.
|
|
610
|
-
...
|
|
637
|
+
...chunkST3LPB2V_cjs.gateFulltextMethods(
|
|
611
638
|
operations,
|
|
612
639
|
contributionMaterializer.assertInitialized
|
|
613
640
|
),
|
|
@@ -616,7 +643,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
616
643
|
},
|
|
617
644
|
async ensureIndexMaterializationsTable() {
|
|
618
645
|
await db.execute(
|
|
619
|
-
drizzleOrm.sql.raw(
|
|
646
|
+
drizzleOrm.sql.raw(chunk6JZUSDY2_cjs.generatePgCreateTableSQL(tables2.indexMaterializations))
|
|
620
647
|
);
|
|
621
648
|
const tableName = drizzleOrm.getTableName(tables2.indexMaterializations);
|
|
622
649
|
await db.execute(
|
|
@@ -668,26 +695,26 @@ function createPostgresBackend(db, options = {}) {
|
|
|
668
695
|
const rows = await db.select().from(t).where(drizzleOrm.eq(t.indexName, indexName));
|
|
669
696
|
const row = rows[0];
|
|
670
697
|
if (row === void 0) return void 0;
|
|
671
|
-
return
|
|
698
|
+
return chunkST3LPB2V_cjs.mapMaterializationRow(row, chunkST3LPB2V_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.decode);
|
|
672
699
|
},
|
|
673
700
|
async getIndexMaterializations(statusKeys) {
|
|
674
701
|
if (statusKeys.length === 0) return [];
|
|
675
702
|
const t = tables2.indexMaterializations;
|
|
676
703
|
const rows = await db.select().from(t).where(drizzleOrm.inArray(t.indexName, [...statusKeys]));
|
|
677
704
|
return rows.map(
|
|
678
|
-
(row) =>
|
|
705
|
+
(row) => chunkST3LPB2V_cjs.mapMaterializationRow(row, chunkST3LPB2V_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.decode)
|
|
679
706
|
);
|
|
680
707
|
},
|
|
681
708
|
async recordIndexMaterialization(params) {
|
|
682
709
|
const t = tables2.indexMaterializations;
|
|
683
710
|
await db.insert(t).values(
|
|
684
|
-
|
|
711
|
+
chunkST3LPB2V_cjs.buildMaterializationInsertValues(
|
|
685
712
|
params,
|
|
686
|
-
|
|
713
|
+
chunkST3LPB2V_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.encode
|
|
687
714
|
)
|
|
688
715
|
).onConflictDoUpdate({
|
|
689
716
|
target: t.indexName,
|
|
690
|
-
set:
|
|
717
|
+
set: chunkST3LPB2V_cjs.buildMaterializationOnConflictSet(params.materializedAt)
|
|
691
718
|
});
|
|
692
719
|
},
|
|
693
720
|
async ensureContributionMaterializationsTable() {
|
|
@@ -703,37 +730,37 @@ function createPostgresBackend(db, options = {}) {
|
|
|
703
730
|
await contributionMaterializer.assertInitialized(graphId);
|
|
704
731
|
},
|
|
705
732
|
async ensureKindRemovalsTable() {
|
|
706
|
-
await db.execute(drizzleOrm.sql.raw(
|
|
733
|
+
await db.execute(drizzleOrm.sql.raw(chunk6JZUSDY2_cjs.generatePgCreateTableSQL(tables2.kindRemovals)));
|
|
707
734
|
},
|
|
708
735
|
async getPendingKindRemovals(graphId) {
|
|
709
736
|
const t = tables2.kindRemovals;
|
|
710
737
|
const rows = await db.select().from(t).where(drizzleOrm.and(drizzleOrm.eq(t.graphId, graphId), drizzleOrm.isNull(t.removedAt)));
|
|
711
738
|
return rows.map(
|
|
712
|
-
(row) =>
|
|
739
|
+
(row) => chunkST3LPB2V_cjs.mapKindRemovalRow(row, chunkST3LPB2V_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.decode)
|
|
713
740
|
);
|
|
714
741
|
},
|
|
715
742
|
async getAllKindRemovals(graphId) {
|
|
716
743
|
const t = tables2.kindRemovals;
|
|
717
744
|
const rows = await db.select().from(t).where(drizzleOrm.eq(t.graphId, graphId));
|
|
718
745
|
return rows.map(
|
|
719
|
-
(row) =>
|
|
746
|
+
(row) => chunkST3LPB2V_cjs.mapKindRemovalRow(row, chunkST3LPB2V_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.decode)
|
|
720
747
|
);
|
|
721
748
|
},
|
|
722
749
|
async recordKindRemoval(params) {
|
|
723
750
|
const t = tables2.kindRemovals;
|
|
724
751
|
await db.insert(t).values(
|
|
725
|
-
|
|
752
|
+
chunkST3LPB2V_cjs.buildKindRemovalInsertValues(
|
|
726
753
|
params,
|
|
727
|
-
|
|
754
|
+
chunkST3LPB2V_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.encode
|
|
728
755
|
)
|
|
729
756
|
).onConflictDoUpdate({
|
|
730
757
|
target: [t.graphId, t.kindName, t.entity, t.schemaVersion],
|
|
731
|
-
set:
|
|
758
|
+
set: chunkST3LPB2V_cjs.buildKindRemovalOnConflictSet(t.removedAt, params.removedAt)
|
|
732
759
|
});
|
|
733
760
|
},
|
|
734
761
|
async ensureReconciliationMarkersTable() {
|
|
735
762
|
await db.execute(
|
|
736
|
-
drizzleOrm.sql.raw(
|
|
763
|
+
drizzleOrm.sql.raw(chunk6JZUSDY2_cjs.generatePgCreateTableSQL(tables2.reconciliationMarkers))
|
|
737
764
|
);
|
|
738
765
|
},
|
|
739
766
|
async ensureRuntimeContributions(graphId) {
|
|
@@ -747,6 +774,9 @@ function createPostgresBackend(db, options = {}) {
|
|
|
747
774
|
async ensureFulltextTable(graphId) {
|
|
748
775
|
await contributionMaterializer.ensureRuntimeContributions(graphId);
|
|
749
776
|
},
|
|
777
|
+
async verifyContributions(graphId, vectorSlots) {
|
|
778
|
+
return contributionMaterializer.verifyContributions(graphId, vectorSlots);
|
|
779
|
+
},
|
|
750
780
|
// Vector counterparts of the runtime-contribution methods. Present
|
|
751
781
|
// only when a vector strategy is wired (omitted under `vector: false`,
|
|
752
782
|
// mirroring the embedding/search methods), so a no-vector backend
|
|
@@ -793,8 +823,8 @@ function createPostgresBackend(db, options = {}) {
|
|
|
793
823
|
const presentRecordedTables = tablePresence.filter((entry) => entry.exists).map((entry) => entry.tableName);
|
|
794
824
|
for (const tableName of presentRecordedTables) {
|
|
795
825
|
await db.execute(
|
|
796
|
-
|
|
797
|
-
|
|
826
|
+
chunkNN3QSOVS_cjs.toDrizzleSql(
|
|
827
|
+
chunkU5W4LKZV_cjs.sql`ANALYZE (SKIP_LOCKED) ${chunkU5W4LKZV_cjs.sql.identifier(tableName)}`,
|
|
798
828
|
"postgres"
|
|
799
829
|
)
|
|
800
830
|
);
|
|
@@ -806,19 +836,28 @@ function createPostgresBackend(db, options = {}) {
|
|
|
806
836
|
(target) => target.commitSchemaVersion(params)
|
|
807
837
|
);
|
|
808
838
|
},
|
|
839
|
+
async commitSchemaVersionIfKindsEmpty(params, probes) {
|
|
840
|
+
return runSchemaWriteTransaction(
|
|
841
|
+
params.graphId,
|
|
842
|
+
(target) => chunkST3LPB2V_cjs.commitSchemaVersionIfKindsEmpty(target, params, probes)
|
|
843
|
+
);
|
|
844
|
+
},
|
|
809
845
|
async setActiveVersion(params) {
|
|
810
846
|
await runSchemaWriteTransaction(
|
|
811
847
|
params.graphId,
|
|
812
848
|
(target) => target.setActiveVersion(params)
|
|
813
849
|
);
|
|
814
850
|
},
|
|
851
|
+
async schemaWriteTransaction(graphId, fn) {
|
|
852
|
+
return runSchemaWriteTransaction(graphId, (target) => fn(target));
|
|
853
|
+
},
|
|
815
854
|
async transaction(fn, options2) {
|
|
816
855
|
return backend.transactionWithNative((tx) => fn(tx), options2);
|
|
817
856
|
},
|
|
818
857
|
async transactionWithNative(fn, options2) {
|
|
819
|
-
const temporaryWrites = options2?.temporaryWrites ===
|
|
858
|
+
const temporaryWrites = options2?.temporaryWrites === chunk3PRKZW6D_cjs.INTERNAL_TEMPORARY_WRITES;
|
|
820
859
|
if (temporaryWrites && options2.accessMode !== "read_only") {
|
|
821
|
-
throw new
|
|
860
|
+
throw new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
822
861
|
"Temporary-write transactions must be semantically read-only.",
|
|
823
862
|
{ dialect: "postgres" }
|
|
824
863
|
);
|
|
@@ -842,7 +881,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
842
881
|
},
|
|
843
882
|
adoptTransaction(externalTx) {
|
|
844
883
|
if (!capabilities.transactions) {
|
|
845
|
-
throw new
|
|
884
|
+
throw new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
846
885
|
"Cross-store atomicity is unavailable on this Postgres backend: its driver does not support transactions (drizzle-orm/neon-http, Cloudflare D1). Adopting an external transaction here would let the caller's relational write commit with no way to roll back the graph write. Use a node-postgres or neon-serverless (Pool/WebSocket) connection for cross-store transactions.",
|
|
847
886
|
{
|
|
848
887
|
backend: "postgres",
|
|
@@ -851,7 +890,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
851
890
|
}
|
|
852
891
|
);
|
|
853
892
|
}
|
|
854
|
-
|
|
893
|
+
chunkST3LPB2V_cjs.assertAdoptedDialect(
|
|
855
894
|
externalTx,
|
|
856
895
|
pgCore.PgTransaction,
|
|
857
896
|
"postgres"
|
|
@@ -907,7 +946,9 @@ function createPostgresOperationBackend(options) {
|
|
|
907
946
|
fulltextStrategy,
|
|
908
947
|
vectorStrategy,
|
|
909
948
|
contributionMaterializer,
|
|
910
|
-
iterativeScanProbe
|
|
949
|
+
iterativeScanProbe,
|
|
950
|
+
schemaVersionsTable,
|
|
951
|
+
transactionScoped
|
|
911
952
|
} = options;
|
|
912
953
|
async function execAll(query) {
|
|
913
954
|
return executionAdapter.execute(query);
|
|
@@ -959,7 +1000,7 @@ function createPostgresOperationBackend(options) {
|
|
|
959
1000
|
async function runVectorSearchGucGroup(overrides, query) {
|
|
960
1001
|
const runExclusive = executionAdapter.runExclusive;
|
|
961
1002
|
if (runExclusive === void 0) {
|
|
962
|
-
throw new
|
|
1003
|
+
throw new chunkC4F7VJ5D_cjs.CompilerInvariantError(
|
|
963
1004
|
"A transaction-scoped Postgres backend must expose runExclusive; its execution adapter was not wrapped by createSerialExecutionAdapter."
|
|
964
1005
|
);
|
|
965
1006
|
}
|
|
@@ -1003,16 +1044,16 @@ function createPostgresOperationBackend(options) {
|
|
|
1003
1044
|
});
|
|
1004
1045
|
}
|
|
1005
1046
|
const batchConfig = computePostgresBatchChunkSizes(
|
|
1006
|
-
capabilities.maxBindParameters ??
|
|
1047
|
+
capabilities.maxBindParameters ?? chunk3PRKZW6D_cjs.POSTGRES_MAX_BIND_PARAMETERS
|
|
1007
1048
|
);
|
|
1008
|
-
const commonBackend =
|
|
1049
|
+
const commonBackend = chunkST3LPB2V_cjs.createCommonOperationBackend({
|
|
1009
1050
|
batchConfig,
|
|
1010
1051
|
execution: {
|
|
1011
1052
|
execAll,
|
|
1012
1053
|
execGet,
|
|
1013
1054
|
execRun
|
|
1014
1055
|
},
|
|
1015
|
-
nowIso:
|
|
1056
|
+
nowIso: chunkHJH3RMXG_cjs.nowIso,
|
|
1016
1057
|
operationStrategy,
|
|
1017
1058
|
rowMappers: {
|
|
1018
1059
|
toEdgeRow,
|
|
@@ -1030,26 +1071,26 @@ function createPostgresOperationBackend(options) {
|
|
|
1030
1071
|
};
|
|
1031
1072
|
const vectorEmbeddingMethods = vectorStrategy === void 0 ? {} : {
|
|
1032
1073
|
async upsertEmbedding(params) {
|
|
1033
|
-
const slot =
|
|
1074
|
+
const slot = chunkST3LPB2V_cjs.vectorSlotFromParams(params);
|
|
1034
1075
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1035
|
-
const statements = vectorStrategy.buildUpsert(slot, params,
|
|
1076
|
+
const statements = vectorStrategy.buildUpsert(slot, params, chunkHJH3RMXG_cjs.nowIso());
|
|
1036
1077
|
try {
|
|
1037
1078
|
for (const statement of statements) {
|
|
1038
1079
|
await execRun(statement);
|
|
1039
1080
|
}
|
|
1040
1081
|
} catch (error) {
|
|
1041
|
-
throw
|
|
1082
|
+
throw chunkST3LPB2V_cjs.mapVectorWriteError(error, params);
|
|
1042
1083
|
}
|
|
1043
1084
|
},
|
|
1044
1085
|
async upsertEmbeddingBatch(params) {
|
|
1045
1086
|
if (params.rows.length === 0) return;
|
|
1046
|
-
const slot =
|
|
1087
|
+
const slot = chunkST3LPB2V_cjs.vectorSlotFromParams(params);
|
|
1047
1088
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1048
1089
|
const rowsById = new Map(
|
|
1049
1090
|
params.rows.map((row) => [row.nodeId, row])
|
|
1050
1091
|
);
|
|
1051
1092
|
const rows = [...rowsById.values()];
|
|
1052
|
-
const timestamp =
|
|
1093
|
+
const timestamp = chunkHJH3RMXG_cjs.nowIso();
|
|
1053
1094
|
try {
|
|
1054
1095
|
for (const chunk2 of chunkZDH3DX3C_cjs.chunk(
|
|
1055
1096
|
rows,
|
|
@@ -1080,11 +1121,11 @@ function createPostgresOperationBackend(options) {
|
|
|
1080
1121
|
}
|
|
1081
1122
|
}
|
|
1082
1123
|
} catch (error) {
|
|
1083
|
-
throw
|
|
1124
|
+
throw chunkST3LPB2V_cjs.mapVectorWriteError(error, params);
|
|
1084
1125
|
}
|
|
1085
1126
|
},
|
|
1086
1127
|
async deleteEmbedding(params) {
|
|
1087
|
-
const slot =
|
|
1128
|
+
const slot = chunkST3LPB2V_cjs.vectorSlotFromParams(params);
|
|
1088
1129
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1089
1130
|
const statements = vectorStrategy.buildDelete(slot, params);
|
|
1090
1131
|
for (const statement of statements) {
|
|
@@ -1092,19 +1133,19 @@ function createPostgresOperationBackend(options) {
|
|
|
1092
1133
|
}
|
|
1093
1134
|
},
|
|
1094
1135
|
async vectorSearch(params) {
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
const slot =
|
|
1136
|
+
chunkOVUUTCPJ_cjs.assertVectorSearchLimit(params.limit);
|
|
1137
|
+
chunkMCHP7RHZ_cjs.assertPgvectorEfSearch(params.efSearch);
|
|
1138
|
+
const slot = chunkST3LPB2V_cjs.vectorSlotFromParams(params);
|
|
1098
1139
|
const query = vectorStrategy.buildSearch(
|
|
1099
1140
|
slot,
|
|
1100
1141
|
params,
|
|
1101
1142
|
// Store-compiled candidates (predicates + subclass + currency)
|
|
1102
1143
|
// take precedence; the live-node default covers direct backend use.
|
|
1103
|
-
params.candidates ??
|
|
1144
|
+
params.candidates ?? chunkST3LPB2V_cjs.buildLiveNodeCandidates(
|
|
1104
1145
|
tableNames.nodes,
|
|
1105
1146
|
params.graphId,
|
|
1106
1147
|
params.nodeKind,
|
|
1107
|
-
|
|
1148
|
+
chunkHJH3RMXG_cjs.nowIso()
|
|
1108
1149
|
)
|
|
1109
1150
|
);
|
|
1110
1151
|
const gucOverrides = await vectorSearchGucOverrides(params);
|
|
@@ -1112,7 +1153,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1112
1153
|
try {
|
|
1113
1154
|
rows = await runVectorSearch(gucOverrides, query);
|
|
1114
1155
|
} catch (error) {
|
|
1115
|
-
throw
|
|
1156
|
+
throw chunkST3LPB2V_cjs.mapVectorWriteError(error, params);
|
|
1116
1157
|
}
|
|
1117
1158
|
return rows.map((row) => ({
|
|
1118
1159
|
nodeId: row.node_id,
|
|
@@ -1124,10 +1165,10 @@ function createPostgresOperationBackend(options) {
|
|
|
1124
1165
|
// multi-statement fallback by simply not exposing the member.
|
|
1125
1166
|
...capabilities.windowFunctions ? {
|
|
1126
1167
|
async hybridSearch(params) {
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
const slot =
|
|
1168
|
+
chunkOVUUTCPJ_cjs.assertVectorSearchLimit(params.limit);
|
|
1169
|
+
chunkOVUUTCPJ_cjs.assertVectorSearchLimit(params.vector.k);
|
|
1170
|
+
chunkMCHP7RHZ_cjs.assertPgvectorEfSearch(params.vector.efSearch);
|
|
1171
|
+
const slot = chunkST3LPB2V_cjs.vectorSlotFromParams({
|
|
1131
1172
|
graphId: params.graphId,
|
|
1132
1173
|
nodeKind: params.nodeKind,
|
|
1133
1174
|
fieldPath: params.vector.fieldPath,
|
|
@@ -1135,11 +1176,11 @@ function createPostgresOperationBackend(options) {
|
|
|
1135
1176
|
metric: params.vector.metric,
|
|
1136
1177
|
indexType: params.vector.indexType
|
|
1137
1178
|
});
|
|
1138
|
-
const candidates = params.candidates ??
|
|
1179
|
+
const candidates = params.candidates ?? chunkST3LPB2V_cjs.buildLiveNodeCandidates(
|
|
1139
1180
|
tableNames.nodes,
|
|
1140
1181
|
params.graphId,
|
|
1141
1182
|
params.nodeKind,
|
|
1142
|
-
|
|
1183
|
+
chunkHJH3RMXG_cjs.nowIso()
|
|
1143
1184
|
);
|
|
1144
1185
|
const vectorParams = {
|
|
1145
1186
|
graphId: params.graphId,
|
|
@@ -1155,11 +1196,11 @@ function createPostgresOperationBackend(options) {
|
|
|
1155
1196
|
const vectorSql = vectorStrategy.buildSearch(
|
|
1156
1197
|
slot,
|
|
1157
1198
|
vectorParams,
|
|
1158
|
-
|
|
1199
|
+
chunkU5W4LKZV_cjs.sql.raw("SELECT node_id FROM tg_hybrid_cand")
|
|
1159
1200
|
);
|
|
1160
1201
|
const statement = operationStrategy.buildHybridSearch(
|
|
1161
1202
|
{ ...params, candidates },
|
|
1162
|
-
|
|
1203
|
+
chunkNN3QSOVS_cjs.toDrizzleSql(vectorSql, "postgres"),
|
|
1163
1204
|
params.vector.metric === "cosine"
|
|
1164
1205
|
);
|
|
1165
1206
|
const gucOverrides = await vectorSearchGucOverrides({
|
|
@@ -1173,9 +1214,9 @@ function createPostgresOperationBackend(options) {
|
|
|
1173
1214
|
statement
|
|
1174
1215
|
);
|
|
1175
1216
|
} catch (error) {
|
|
1176
|
-
throw
|
|
1217
|
+
throw chunkST3LPB2V_cjs.mapVectorWriteError(error, vectorParams);
|
|
1177
1218
|
}
|
|
1178
|
-
return raw.map((row) =>
|
|
1219
|
+
return raw.map((row) => chunkST3LPB2V_cjs.mapHybridSearchRow(row, toNodeRow));
|
|
1179
1220
|
}
|
|
1180
1221
|
} : {}
|
|
1181
1222
|
};
|
|
@@ -1183,15 +1224,52 @@ function createPostgresOperationBackend(options) {
|
|
|
1183
1224
|
...commonBackend,
|
|
1184
1225
|
...executeRawMethod,
|
|
1185
1226
|
...vectorEmbeddingMethods,
|
|
1227
|
+
async deleteSchemaVectorSlotContribution(slot) {
|
|
1228
|
+
if (vectorStrategy === void 0) return;
|
|
1229
|
+
for (const contribution of vectorStrategy.ownedTables(slot)) {
|
|
1230
|
+
await execRun(
|
|
1231
|
+
operationStrategy.buildDeleteContributionMaterialization({
|
|
1232
|
+
graphId: slot.graphId,
|
|
1233
|
+
logicalName: contribution.logicalName,
|
|
1234
|
+
owner: contribution.owner,
|
|
1235
|
+
tableName: contribution.tableName
|
|
1236
|
+
})
|
|
1237
|
+
);
|
|
1238
|
+
}
|
|
1239
|
+
contributionMaterializer.evictVectorSlot(slot);
|
|
1240
|
+
},
|
|
1186
1241
|
capabilities,
|
|
1187
1242
|
fulltextStrategy,
|
|
1188
1243
|
...vectorStrategy === void 0 ? {} : { vectorStrategy },
|
|
1189
1244
|
dialect: "postgres",
|
|
1190
1245
|
tableNames,
|
|
1246
|
+
async lockSchemaVersionForWrite(params) {
|
|
1247
|
+
if (!transactionScoped) {
|
|
1248
|
+
throw new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
1249
|
+
"The schema write fence requires an explicit PostgreSQL transaction.",
|
|
1250
|
+
{
|
|
1251
|
+
code: "SCHEMA_WRITE_FENCE_TRANSACTION_REQUIRED",
|
|
1252
|
+
graphId: params.graphId
|
|
1253
|
+
}
|
|
1254
|
+
);
|
|
1255
|
+
}
|
|
1256
|
+
const active = await execGet(drizzleOrm.sql`
|
|
1257
|
+
SELECT ${schemaVersionsTable.version} AS version
|
|
1258
|
+
FROM ${schemaVersionsTable}
|
|
1259
|
+
WHERE ${schemaVersionsTable.graphId} = ${params.graphId}
|
|
1260
|
+
AND ${schemaVersionsTable.isActive} = TRUE
|
|
1261
|
+
FOR SHARE
|
|
1262
|
+
`);
|
|
1263
|
+
chunkST3LPB2V_cjs.assertActiveSchemaVersion(
|
|
1264
|
+
params.graphId,
|
|
1265
|
+
params.expectedVersion,
|
|
1266
|
+
active?.version ?? 0
|
|
1267
|
+
);
|
|
1268
|
+
},
|
|
1191
1269
|
// === Vector Index Operations ===
|
|
1192
1270
|
async createVectorIndex(params) {
|
|
1193
1271
|
if (vectorStrategy === void 0) return;
|
|
1194
|
-
const slot =
|
|
1272
|
+
const slot = chunkST3LPB2V_cjs.vectorSlotFromCreateIndexParams(params);
|
|
1195
1273
|
await contributionMaterializer.ensureVectorSlot(slot);
|
|
1196
1274
|
const indexStatement = vectorStrategy.buildCreateIndex?.(slot, {
|
|
1197
1275
|
concurrent: params.concurrent === true
|
|
@@ -1200,12 +1278,12 @@ function createPostgresOperationBackend(options) {
|
|
|
1200
1278
|
try {
|
|
1201
1279
|
await execRun(indexStatement);
|
|
1202
1280
|
} catch (error) {
|
|
1203
|
-
if (!
|
|
1281
|
+
if (!chunkWBUFJ7BS_cjs.isInsufficientResourcesError(error)) throw error;
|
|
1204
1282
|
const dropStatement = vectorStrategy.buildDropIndex?.(slot);
|
|
1205
1283
|
if (dropStatement !== void 0) {
|
|
1206
1284
|
await execRun(dropStatement);
|
|
1207
1285
|
}
|
|
1208
|
-
const table =
|
|
1286
|
+
const table = chunkU5W4LKZV_cjs.sql.identifier(
|
|
1209
1287
|
vectorStrategy.tableName(
|
|
1210
1288
|
slot.graphId,
|
|
1211
1289
|
slot.nodeKind,
|
|
@@ -1213,13 +1291,13 @@ function createPostgresOperationBackend(options) {
|
|
|
1213
1291
|
)
|
|
1214
1292
|
);
|
|
1215
1293
|
await execRun(
|
|
1216
|
-
|
|
1294
|
+
chunkU5W4LKZV_cjs.sql`ALTER TABLE ${table} SET (parallel_workers = 0)`
|
|
1217
1295
|
);
|
|
1218
1296
|
try {
|
|
1219
1297
|
await execRun(indexStatement);
|
|
1220
1298
|
} finally {
|
|
1221
1299
|
await execRun(
|
|
1222
|
-
|
|
1300
|
+
chunkU5W4LKZV_cjs.sql`ALTER TABLE ${table} RESET (parallel_workers)`
|
|
1223
1301
|
);
|
|
1224
1302
|
}
|
|
1225
1303
|
}
|
|
@@ -1227,7 +1305,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1227
1305
|
},
|
|
1228
1306
|
// === Fulltext Operations ===
|
|
1229
1307
|
async upsertFulltext(params) {
|
|
1230
|
-
const timestamp =
|
|
1308
|
+
const timestamp = chunkHJH3RMXG_cjs.nowIso();
|
|
1231
1309
|
const statements = operationStrategy.buildUpsertFulltext(
|
|
1232
1310
|
params,
|
|
1233
1311
|
timestamp
|
|
@@ -1244,7 +1322,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1244
1322
|
},
|
|
1245
1323
|
async upsertFulltextBatch(params) {
|
|
1246
1324
|
if (params.rows.length === 0) return;
|
|
1247
|
-
const timestamp =
|
|
1325
|
+
const timestamp = chunkHJH3RMXG_cjs.nowIso();
|
|
1248
1326
|
for (const rows of chunkZDH3DX3C_cjs.chunk(
|
|
1249
1327
|
params.rows,
|
|
1250
1328
|
batchConfig.fulltextUpsertBatchSize
|
|
@@ -1278,25 +1356,25 @@ function createPostgresOperationBackend(options) {
|
|
|
1278
1356
|
const rows = await execAll(query);
|
|
1279
1357
|
return rows.map((row, index) => ({
|
|
1280
1358
|
nodeId: row.node_id,
|
|
1281
|
-
score:
|
|
1359
|
+
score: chunkHJH3RMXG_cjs.coerceNumericScore(row.score),
|
|
1282
1360
|
rank: index + 1,
|
|
1283
1361
|
...row.snippet === null ? {} : { snippet: row.snippet }
|
|
1284
1362
|
}));
|
|
1285
1363
|
},
|
|
1286
1364
|
async dropVectorIndex(params) {
|
|
1287
1365
|
if (vectorStrategy === void 0) return;
|
|
1288
|
-
const slot =
|
|
1366
|
+
const slot = chunkST3LPB2V_cjs.vectorSlotFromDropIndexParams(params);
|
|
1289
1367
|
const dropStatement = vectorStrategy.buildDropIndex?.(slot);
|
|
1290
1368
|
if (dropStatement === void 0) return;
|
|
1291
1369
|
try {
|
|
1292
1370
|
await execRun(dropStatement);
|
|
1293
1371
|
} catch (error) {
|
|
1294
|
-
if (!
|
|
1372
|
+
if (!chunkWBUFJ7BS_cjs.isMissingTableError(error)) throw error;
|
|
1295
1373
|
}
|
|
1296
1374
|
},
|
|
1297
1375
|
// === Query Execution ===
|
|
1298
1376
|
async execute(query) {
|
|
1299
|
-
const annTypes =
|
|
1377
|
+
const annTypes = chunkU5W4LKZV_cjs.isSqlFragment(query) ? chunkU5W4LKZV_cjs.annIndexScanTypes(query) : void 0;
|
|
1300
1378
|
if (annTypes !== void 0 && vectorStrategy !== void 0) {
|
|
1301
1379
|
const overrides = [];
|
|
1302
1380
|
for (const indexType of annTypes) {
|
|
@@ -1329,11 +1407,13 @@ function createTransactionBackend(options) {
|
|
|
1329
1407
|
contributionMaterializer: options.contributionMaterializer,
|
|
1330
1408
|
// The probe is process-wide truth, so the outer instance's is reused
|
|
1331
1409
|
// rather than a fresh one per transaction.
|
|
1332
|
-
iterativeScanProbe: options.iterativeScanProbe
|
|
1410
|
+
iterativeScanProbe: options.iterativeScanProbe,
|
|
1411
|
+
schemaVersionsTable: options.schemaVersionsTable,
|
|
1412
|
+
transactionScoped: true
|
|
1333
1413
|
});
|
|
1334
1414
|
return { backend, drainAndClose: txExecutionAdapter.drainAndClose };
|
|
1335
1415
|
}
|
|
1336
1416
|
|
|
1337
1417
|
exports.createPostgresBackend = createPostgresBackend;
|
|
1338
|
-
//# sourceMappingURL=chunk-
|
|
1339
|
-
//# sourceMappingURL=chunk-
|
|
1418
|
+
//# sourceMappingURL=chunk-PDGEXGS6.cjs.map
|
|
1419
|
+
//# sourceMappingURL=chunk-PDGEXGS6.cjs.map
|