@nicia-ai/typegraph 0.46.2 → 0.47.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/README.md +20 -1
- 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 -49
- package/dist/backend/index.d.cts +3 -3
- package/dist/backend/index.d.ts +3 -3
- package/dist/backend/index.js +11 -10
- package/dist/backend/postgres/index.cjs +27 -26
- package/dist/backend/postgres/index.d.cts +6 -6
- package/dist/backend/postgres/index.d.ts +6 -6
- package/dist/backend/postgres/index.js +14 -13
- package/dist/backend/postgres/pglite-store.cjs +34 -33
- package/dist/backend/postgres/pglite-store.cjs.map +1 -1
- package/dist/backend/postgres/pglite-store.d.cts +8 -8
- package/dist/backend/postgres/pglite-store.d.ts +8 -8
- package/dist/backend/postgres/pglite-store.js +30 -29
- package/dist/backend/postgres/pglite-store.js.map +1 -1
- package/dist/backend/postgres/pglite.cjs +16 -15
- package/dist/backend/postgres/pglite.d.cts +3 -3
- package/dist/backend/postgres/pglite.d.ts +3 -3
- package/dist/backend/postgres/pglite.js +15 -14
- package/dist/backend/sqlite/index.cjs +24 -23
- package/dist/backend/sqlite/index.d.cts +6 -6
- package/dist/backend/sqlite/index.d.ts +6 -6
- package/dist/backend/sqlite/index.js +12 -11
- package/dist/backend/sqlite/libsql.cjs +19 -18
- package/dist/backend/sqlite/libsql.cjs.map +1 -1
- package/dist/backend/sqlite/libsql.d.cts +3 -3
- package/dist/backend/sqlite/libsql.d.ts +3 -3
- package/dist/backend/sqlite/libsql.js +14 -13
- package/dist/backend/sqlite/libsql.js.map +1 -1
- package/dist/backend/sqlite/local-store.cjs +35 -34
- package/dist/backend/sqlite/local-store.cjs.map +1 -1
- package/dist/backend/sqlite/local-store.d.cts +8 -8
- package/dist/backend/sqlite/local-store.d.ts +8 -8
- package/dist/backend/sqlite/local-store.js +31 -30
- package/dist/backend/sqlite/local-store.js.map +1 -1
- package/dist/backend/sqlite/local.cjs +17 -16
- package/dist/backend/sqlite/local.d.cts +3 -3
- package/dist/backend/sqlite/local.d.ts +3 -3
- package/dist/backend/sqlite/local.js +15 -14
- package/dist/{chunk-TCT66A7N.cjs → chunk-26YKDNUD.cjs} +10 -10
- package/dist/{chunk-TCT66A7N.cjs.map → chunk-26YKDNUD.cjs.map} +1 -1
- package/dist/{chunk-QOJ2L2AD.js → chunk-3DMMGT6S.js} +3 -3
- package/dist/{chunk-QOJ2L2AD.js.map → chunk-3DMMGT6S.js.map} +1 -1
- package/dist/{chunk-ANKOXPCC.cjs → chunk-3HGRTCDU.cjs} +6 -4
- package/dist/chunk-3HGRTCDU.cjs.map +1 -0
- package/dist/{chunk-QU7QLJA4.cjs → chunk-3U5ABFDW.cjs} +26 -26
- package/dist/{chunk-QU7QLJA4.cjs.map → chunk-3U5ABFDW.cjs.map} +1 -1
- package/dist/{chunk-5PDSCELM.cjs → chunk-425IZOQ5.cjs} +11 -164
- package/dist/chunk-425IZOQ5.cjs.map +1 -0
- package/dist/{chunk-S7WIRFNS.cjs → chunk-5FBRVORR.cjs} +12 -12
- package/dist/{chunk-S7WIRFNS.cjs.map → chunk-5FBRVORR.cjs.map} +1 -1
- package/dist/{chunk-GWXXHOLU.js → chunk-5FT3TLPK.js} +11 -11
- package/dist/{chunk-GWXXHOLU.js.map → chunk-5FT3TLPK.js.map} +1 -1
- package/dist/{chunk-S3G5VLSW.js → chunk-5UMTUOM5.js} +6 -6
- package/dist/{chunk-S3G5VLSW.js.map → chunk-5UMTUOM5.js.map} +1 -1
- package/dist/{chunk-RFDEYLIK.js → chunk-6FWSNSRE.js} +7 -7
- package/dist/{chunk-RFDEYLIK.js.map → chunk-6FWSNSRE.js.map} +1 -1
- package/dist/{chunk-F36KZDFX.cjs → chunk-6JVZSOHQ.cjs} +91 -91
- package/dist/{chunk-F36KZDFX.cjs.map → chunk-6JVZSOHQ.cjs.map} +1 -1
- package/dist/chunk-6KFLYYOC.cjs +161 -0
- package/dist/chunk-6KFLYYOC.cjs.map +1 -0
- package/dist/{chunk-D6GCNNMK.cjs → chunk-6NGW27EO.cjs} +10 -10
- package/dist/{chunk-D6GCNNMK.cjs.map → chunk-6NGW27EO.cjs.map} +1 -1
- package/dist/{chunk-WHS2Y43J.js → chunk-6SWPJEYN.js} +5 -5
- package/dist/{chunk-WHS2Y43J.js.map → chunk-6SWPJEYN.js.map} +1 -1
- package/dist/{chunk-7TKNK32B.js → chunk-7SQSZN2J.js} +5 -5
- package/dist/{chunk-7TKNK32B.js.map → chunk-7SQSZN2J.js.map} +1 -1
- package/dist/{chunk-BEB4OFZF.cjs → chunk-AMMWA76F.cjs} +51 -59
- package/dist/chunk-AMMWA76F.cjs.map +1 -0
- package/dist/{chunk-PYKF7UIL.cjs → chunk-AOSSQDVO.cjs} +13 -13
- package/dist/{chunk-PYKF7UIL.cjs.map → chunk-AOSSQDVO.cjs.map} +1 -1
- package/dist/{chunk-EDHV4CBU.js → chunk-AVGUJWVX.js} +30 -10
- package/dist/chunk-AVGUJWVX.js.map +1 -0
- package/dist/{chunk-C2ZP5YS6.cjs → chunk-BCQ76AXA.cjs} +258 -153
- package/dist/chunk-BCQ76AXA.cjs.map +1 -0
- package/dist/{chunk-WA64ZSCA.cjs → chunk-BFUOME67.cjs} +11 -11
- package/dist/{chunk-WA64ZSCA.cjs.map → chunk-BFUOME67.cjs.map} +1 -1
- package/dist/{chunk-C6KE2HSQ.cjs → chunk-BR7SHKGM.cjs} +1611 -1382
- package/dist/chunk-BR7SHKGM.cjs.map +1 -0
- package/dist/{chunk-FCIZNUW5.js → chunk-CHAOFCHV.js} +3 -3
- package/dist/{chunk-FCIZNUW5.js.map → chunk-CHAOFCHV.js.map} +1 -1
- package/dist/chunk-CICO5GXD.cjs +12 -0
- package/dist/{chunk-73MWKDFK.cjs.map → chunk-CICO5GXD.cjs.map} +1 -1
- package/dist/{chunk-SXWLLQ3D.js → chunk-D5R42W5D.js} +4 -4
- package/dist/{chunk-SXWLLQ3D.js.map → chunk-D5R42W5D.js.map} +1 -1
- package/dist/{chunk-YQ4JONWE.js → chunk-DJZTXBWY.js} +342 -113
- package/dist/chunk-DJZTXBWY.js.map +1 -0
- package/dist/{chunk-BZZI7B43.cjs → chunk-DO7SAMEK.cjs} +47 -47
- package/dist/{chunk-BZZI7B43.cjs.map → chunk-DO7SAMEK.cjs.map} +1 -1
- package/dist/{chunk-2ZWM2RFH.cjs → chunk-EDN4Y4ZG.cjs} +9 -9
- package/dist/{chunk-2ZWM2RFH.cjs.map → chunk-EDN4Y4ZG.cjs.map} +1 -1
- package/dist/{chunk-E4OSGBCM.cjs → chunk-EMIB2RXD.cjs} +131 -131
- package/dist/{chunk-E4OSGBCM.cjs.map → chunk-EMIB2RXD.cjs.map} +1 -1
- package/dist/{chunk-GWUWRZXW.js → chunk-EP4RUYD6.js} +3 -3
- package/dist/{chunk-GWUWRZXW.js.map → chunk-EP4RUYD6.js.map} +1 -1
- package/dist/{chunk-LHYSY6SE.js → chunk-FNOMT74T.js} +10 -8
- package/dist/chunk-FNOMT74T.js.map +1 -0
- package/dist/{chunk-ZBVZ7HXD.cjs → chunk-FQPEMEWX.cjs} +12 -12
- package/dist/{chunk-ZBVZ7HXD.cjs.map → chunk-FQPEMEWX.cjs.map} +1 -1
- package/dist/{chunk-LNIWCQR4.js → chunk-GLHXM7C4.js} +3 -3
- package/dist/{chunk-LNIWCQR4.js.map → chunk-GLHXM7C4.js.map} +1 -1
- package/dist/{chunk-6BD6ZBKT.cjs → chunk-GYEG3ZLZ.cjs} +10 -10
- package/dist/{chunk-6BD6ZBKT.cjs.map → chunk-GYEG3ZLZ.cjs.map} +1 -1
- package/dist/{chunk-XBHRKLZU.cjs → chunk-GYUJZARH.cjs} +4 -4
- package/dist/{chunk-XBHRKLZU.cjs.map → chunk-GYUJZARH.cjs.map} +1 -1
- package/dist/{chunk-A7NMUYEL.cjs → chunk-HDL2ARHX.cjs} +27 -27
- package/dist/{chunk-A7NMUYEL.cjs.map → chunk-HDL2ARHX.cjs.map} +1 -1
- package/dist/{chunk-5ZJOB5YS.js → chunk-HEV35TGT.js} +4 -4
- package/dist/{chunk-5ZJOB5YS.js.map → chunk-HEV35TGT.js.map} +1 -1
- package/dist/{chunk-UTVQPZPN.cjs → chunk-I4G3SQPF.cjs} +20 -20
- package/dist/{chunk-UTVQPZPN.cjs.map → chunk-I4G3SQPF.cjs.map} +1 -1
- package/dist/{chunk-JCNTKRAK.js → chunk-JONXFAPO.js} +5 -5
- package/dist/{chunk-JCNTKRAK.js.map → chunk-JONXFAPO.js.map} +1 -1
- package/dist/{chunk-GVAMRRZR.cjs → chunk-JR6SX5RH.cjs} +4 -4
- package/dist/{chunk-GVAMRRZR.cjs.map → chunk-JR6SX5RH.cjs.map} +1 -1
- package/dist/{chunk-N3QTGPC7.cjs → chunk-KABFHAL7.cjs} +100 -99
- package/dist/chunk-KABFHAL7.cjs.map +1 -0
- package/dist/{chunk-KXSMF6PL.js → chunk-KH7XW7VV.js} +20 -12
- package/dist/chunk-KH7XW7VV.js.map +1 -0
- package/dist/{chunk-EDJDDY6H.js → chunk-KKBDXCLQ.js} +4 -4
- package/dist/{chunk-EDJDDY6H.js.map → chunk-KKBDXCLQ.js.map} +1 -1
- package/dist/{chunk-ZHOAZD7Q.cjs → chunk-L3LQNR34.cjs} +161 -161
- package/dist/{chunk-ZHOAZD7Q.cjs.map → chunk-L3LQNR34.cjs.map} +1 -1
- package/dist/{chunk-IHRDX7K6.js → chunk-LEWHMOUY.js} +46 -56
- package/dist/chunk-LEWHMOUY.js.map +1 -0
- package/dist/{chunk-AF3TWL5C.cjs → chunk-LRQKXRXO.cjs} +4 -4
- package/dist/{chunk-AF3TWL5C.cjs.map → chunk-LRQKXRXO.cjs.map} +1 -1
- package/dist/{chunk-WYFB7BN3.js → chunk-M35DF33T.js} +143 -38
- package/dist/chunk-M35DF33T.js.map +1 -0
- package/dist/{chunk-32UETY6S.cjs → chunk-MFZR4QKM.cjs} +30 -28
- package/dist/chunk-MFZR4QKM.cjs.map +1 -0
- package/dist/chunk-MKJ4KXL5.cjs +12 -0
- package/dist/{chunk-6LAXM4J2.cjs.map → chunk-MKJ4KXL5.cjs.map} +1 -1
- package/dist/{chunk-KCH7WQA5.cjs → chunk-MRDBBHIZ.cjs} +48 -2
- package/dist/chunk-MRDBBHIZ.cjs.map +1 -0
- package/dist/{chunk-QPOQX2DI.cjs → chunk-MX4DHSQP.cjs} +1023 -360
- package/dist/chunk-MX4DHSQP.cjs.map +1 -0
- package/dist/{chunk-FXNHZFZV.js → chunk-MYKHJI2J.js} +3 -3
- package/dist/{chunk-FXNHZFZV.js.map → chunk-MYKHJI2J.js.map} +1 -1
- package/dist/{chunk-DSAWGCMP.js → chunk-NAZ2RA4L.js} +3 -3
- package/dist/{chunk-DSAWGCMP.js.map → chunk-NAZ2RA4L.js.map} +1 -1
- package/dist/{chunk-R7EWHKID.js → chunk-NG2RB5WL.js} +4 -145
- package/dist/chunk-NG2RB5WL.js.map +1 -0
- package/dist/{chunk-A2LJG5GM.js → chunk-NNQ6A3RM.js} +803 -143
- package/dist/chunk-NNQ6A3RM.js.map +1 -0
- package/dist/{chunk-72WUT4GG.js → chunk-NVY5CJFP.js} +4 -4
- package/dist/{chunk-72WUT4GG.js.map → chunk-NVY5CJFP.js.map} +1 -1
- package/dist/{chunk-ZIH42CRX.cjs → chunk-OI2GQ25X.cjs} +7 -7
- package/dist/{chunk-ZIH42CRX.cjs.map → chunk-OI2GQ25X.cjs.map} +1 -1
- package/dist/{chunk-A4R3H7RU.cjs → chunk-OIFSOPSR.cjs} +259 -238
- package/dist/chunk-OIFSOPSR.cjs.map +1 -0
- package/dist/{chunk-AU3IJNNP.js → chunk-OMZ37BM2.js} +5 -5
- package/dist/{chunk-AU3IJNNP.js.map → chunk-OMZ37BM2.js.map} +1 -1
- package/dist/{chunk-C4DYN2SD.cjs → chunk-OORXGFL5.cjs} +48 -48
- package/dist/{chunk-C4DYN2SD.cjs.map → chunk-OORXGFL5.cjs.map} +1 -1
- package/dist/{chunk-BRN3RGD2.js → chunk-OVI7IXYX.js} +3 -3
- package/dist/{chunk-BRN3RGD2.js.map → chunk-OVI7IXYX.js.map} +1 -1
- package/dist/{chunk-WMKEGJG4.js → chunk-P6YLZTRE.js} +3 -3
- package/dist/{chunk-WMKEGJG4.js.map → chunk-P6YLZTRE.js.map} +1 -1
- package/dist/{chunk-AT3MLMJV.js → chunk-QS3NQZVC.js} +82 -16
- package/dist/chunk-QS3NQZVC.js.map +1 -0
- package/dist/{chunk-EJSYWAEV.js → chunk-QTD6HX4O.js} +5 -5
- package/dist/{chunk-EJSYWAEV.js.map → chunk-QTD6HX4O.js.map} +1 -1
- package/dist/{chunk-JL5UEBWT.cjs → chunk-ROR5ZR6A.cjs} +45 -45
- package/dist/{chunk-JL5UEBWT.cjs.map → chunk-ROR5ZR6A.cjs.map} +1 -1
- package/dist/{chunk-FSLTU57P.js → chunk-SDBBMD4N.js} +3 -3
- package/dist/{chunk-FSLTU57P.js.map → chunk-SDBBMD4N.js.map} +1 -1
- package/dist/{chunk-WEJHA7AD.js → chunk-SE6EGQSD.js} +78 -16
- package/dist/chunk-SE6EGQSD.js.map +1 -0
- package/dist/{chunk-36LIJXWC.js → chunk-SHFBB23Q.js} +4 -4
- package/dist/{chunk-36LIJXWC.js.map → chunk-SHFBB23Q.js.map} +1 -1
- package/dist/{chunk-FA6Z7B5L.js → chunk-SHSSRCFR.js} +5 -3
- package/dist/chunk-SHSSRCFR.js.map +1 -0
- package/dist/{chunk-KOAI3KIV.cjs → chunk-TZEGUG6D.cjs} +4 -4
- package/dist/{chunk-KOAI3KIV.cjs.map → chunk-TZEGUG6D.cjs.map} +1 -1
- package/dist/{chunk-HNYLMPQQ.cjs → chunk-U5EDAVOJ.cjs} +140 -74
- package/dist/chunk-U5EDAVOJ.cjs.map +1 -0
- package/dist/{chunk-RHDOAQCT.cjs → chunk-UPAJHMW3.cjs} +122 -114
- package/dist/chunk-UPAJHMW3.cjs.map +1 -0
- package/dist/{chunk-BQM5P2NO.cjs → chunk-WGX7JH7E.cjs} +235 -170
- package/dist/chunk-WGX7JH7E.cjs.map +1 -0
- package/dist/{chunk-DYPRZ53S.cjs → chunk-WODMN3Q2.cjs} +27 -27
- package/dist/{chunk-DYPRZ53S.cjs.map → chunk-WODMN3Q2.cjs.map} +1 -1
- package/dist/{chunk-OZJCH7ZS.js → chunk-XVWOYKIK.js} +3 -3
- package/dist/{chunk-OZJCH7ZS.js.map → chunk-XVWOYKIK.js.map} +1 -1
- package/dist/chunk-XY5OMOJD.js +147 -0
- package/dist/chunk-XY5OMOJD.js.map +1 -0
- package/dist/{chunk-KA4L2NZ3.js → chunk-XYBQI6LE.js} +14 -14
- package/dist/{chunk-KA4L2NZ3.js.map → chunk-XYBQI6LE.js.map} +1 -1
- package/dist/{chunk-EAMVXR5B.js → chunk-ZDKTPBGV.js} +4 -4
- package/dist/{chunk-EAMVXR5B.js.map → chunk-ZDKTPBGV.js.map} +1 -1
- package/dist/{chunk-Z43KWLZF.js → chunk-ZHNXLS3C.js} +9 -8
- package/dist/chunk-ZHNXLS3C.js.map +1 -0
- package/dist/{chunk-62ZXBMSD.js → chunk-ZLONH2UD.js} +46 -3
- package/dist/chunk-ZLONH2UD.js.map +1 -0
- package/dist/core/index.cjs +28 -27
- package/dist/core/index.d.cts +4 -4
- package/dist/core/index.d.ts +4 -4
- package/dist/core/index.js +8 -7
- package/dist/{ddl-opIn8DfX.d.ts → ddl-CprnMXJ-.d.ts} +3 -3
- package/dist/{ddl-mE07h_EM.d.cts → ddl-DJA7Lci5.d.cts} +3 -3
- 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 +4 -4
- package/dist/graph-merge/index.cjs +3204 -635
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +502 -60
- package/dist/graph-merge/index.d.ts +502 -60
- package/dist/graph-merge/index.js +2979 -427
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/{index-Deyu8IXL.d.ts → index-CHTv4XMZ.d.cts} +47 -3
- package/dist/{index-DrRS51Ld.d.cts → index-CzoJ3MUw.d.ts} +47 -3
- package/dist/index.cjs +229 -216
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +35 -34
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.cjs +13 -13
- package/dist/indexes/index.d.cts +4 -4
- package/dist/indexes/index.d.ts +4 -4
- package/dist/indexes/index.js +6 -6
- package/dist/interchange/index.cjs +53 -52
- package/dist/interchange/index.cjs.map +1 -1
- package/dist/interchange/index.d.cts +17 -13
- package/dist/interchange/index.d.ts +17 -13
- package/dist/interchange/index.js +17 -16
- package/dist/interchange/index.js.map +1 -1
- package/dist/{manager-DX983gJ0.d.ts → manager-B6sOQzcQ.d.ts} +2 -2
- package/dist/{manager-ptr3JLRP.d.cts → manager-DlY1vlla.d.cts} +2 -2
- package/dist/{materialize-indexes-CpXoggWU.d.ts → materialize-indexes-DQL4xcpf.d.ts} +1 -1
- package/dist/{materialize-indexes-BXz77YqO.d.cts → materialize-indexes-sskhp-c_.d.cts} +1 -1
- package/dist/{postgres-DwgEXSPI.d.cts → postgres-B6YOUcaK.d.ts} +1 -1
- package/dist/{postgres-QdOMHTBz.d.ts → postgres-BXy_nyMs.d.cts} +1 -1
- package/dist/profiler/index.d.cts +9 -9
- package/dist/profiler/index.d.ts +9 -9
- package/dist/provenance/index.cjs +43 -42
- 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 +10 -9
- package/dist/provenance/index.js.map +1 -1
- package/dist/schema/index.cjs +45 -44
- package/dist/schema/index.d.cts +6 -6
- package/dist/schema/index.d.ts +6 -6
- package/dist/schema/index.js +18 -17
- package/dist/{searchable-BrUh0pdc.d.cts → searchable-0Cn_lY8U.d.cts} +1 -1
- package/dist/{searchable-BOUuA83f.d.ts → searchable-D9gMiwcS.d.ts} +1 -1
- package/dist/{sqlite-BfYcV61E.d.cts → sqlite-ClXuBYAj.d.ts} +1 -1
- package/dist/{sqlite-DK40XVR1.d.ts → sqlite-DioSxaPe.d.cts} +1 -1
- package/dist/{store-Bo1psfVZ.d.ts → store-5j-w5onJ.d.ts} +120 -71
- package/dist/{store-FTqBpuJD.d.cts → store-CFedKGU5.d.cts} +120 -71
- package/dist/{temporal-CXewwLTB.d.cts → temporal-Ce1pG0S1.d.cts} +1 -1
- package/dist/{temporal-DPtn0HOu.d.ts → temporal-CjO9FH1l.d.ts} +1 -1
- package/dist/{types-CeT7xM4M.d.ts → types-BrdOFu48.d.ts} +1 -1
- package/dist/{types-Du78EvpN.d.ts → types-DKkMJZjR.d.cts} +32 -6
- package/dist/{types-Du78EvpN.d.cts → types-DKkMJZjR.d.ts} +32 -6
- package/dist/{types-XR1nHERK.d.cts → types-oj_OGAaZ.d.cts} +1 -1
- package/dist/{where-CMbFiWwp.d.ts → where-C8w2627G.d.ts} +1 -1
- package/dist/{where-CJsp-YUf.d.cts → where-D1wKCJ4Q.d.cts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-32UETY6S.cjs.map +0 -1
- package/dist/chunk-5PDSCELM.cjs.map +0 -1
- package/dist/chunk-62ZXBMSD.js.map +0 -1
- package/dist/chunk-6LAXM4J2.cjs +0 -12
- package/dist/chunk-73MWKDFK.cjs +0 -12
- package/dist/chunk-A2LJG5GM.js.map +0 -1
- package/dist/chunk-A4R3H7RU.cjs.map +0 -1
- package/dist/chunk-ANKOXPCC.cjs.map +0 -1
- package/dist/chunk-AT3MLMJV.js.map +0 -1
- package/dist/chunk-BEB4OFZF.cjs.map +0 -1
- package/dist/chunk-BQM5P2NO.cjs.map +0 -1
- package/dist/chunk-C2ZP5YS6.cjs.map +0 -1
- package/dist/chunk-C6KE2HSQ.cjs.map +0 -1
- package/dist/chunk-EDHV4CBU.js.map +0 -1
- package/dist/chunk-FA6Z7B5L.js.map +0 -1
- package/dist/chunk-HNYLMPQQ.cjs.map +0 -1
- package/dist/chunk-IHRDX7K6.js.map +0 -1
- package/dist/chunk-KCH7WQA5.cjs.map +0 -1
- package/dist/chunk-KXSMF6PL.js.map +0 -1
- package/dist/chunk-LHYSY6SE.js.map +0 -1
- package/dist/chunk-N3QTGPC7.cjs.map +0 -1
- package/dist/chunk-QPOQX2DI.cjs.map +0 -1
- package/dist/chunk-R7EWHKID.js.map +0 -1
- package/dist/chunk-RHDOAQCT.cjs.map +0 -1
- package/dist/chunk-WEJHA7AD.js.map +0 -1
- package/dist/chunk-WYFB7BN3.js.map +0 -1
- package/dist/chunk-YQ4JONWE.js.map +0 -1
- package/dist/chunk-Z43KWLZF.js.map +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
3
|
+
var chunkUPAJHMW3_cjs = require('./chunk-UPAJHMW3.cjs');
|
|
4
|
+
var chunkROR5ZR6A_cjs = require('./chunk-ROR5ZR6A.cjs');
|
|
5
|
+
var chunkAMMWA76F_cjs = require('./chunk-AMMWA76F.cjs');
|
|
6
|
+
var chunkHDL2ARHX_cjs = require('./chunk-HDL2ARHX.cjs');
|
|
7
|
+
var chunkWODMN3Q2_cjs = require('./chunk-WODMN3Q2.cjs');
|
|
8
|
+
var chunkJR6SX5RH_cjs = require('./chunk-JR6SX5RH.cjs');
|
|
9
|
+
var chunk3HGRTCDU_cjs = require('./chunk-3HGRTCDU.cjs');
|
|
10
|
+
var chunkL3LQNR34_cjs = require('./chunk-L3LQNR34.cjs');
|
|
11
|
+
var chunkEDN4Y4ZG_cjs = require('./chunk-EDN4Y4ZG.cjs');
|
|
12
|
+
var chunkMRDBBHIZ_cjs = require('./chunk-MRDBBHIZ.cjs');
|
|
13
13
|
var chunkN66HCGCY_cjs = require('./chunk-N66HCGCY.cjs');
|
|
14
14
|
var drizzleOrm = require('drizzle-orm');
|
|
15
15
|
var pgCore = require('drizzle-orm/pg-core');
|
|
@@ -53,7 +53,7 @@ var DEFAULT_POSTGRES_STATEMENT_CACHE_MAX = 256;
|
|
|
53
53
|
var STATEMENT_NAME_CACHE = /* @__PURE__ */ new Map();
|
|
54
54
|
var nextStatementId = 0;
|
|
55
55
|
function statementNameFor(sqlText, cacheMax) {
|
|
56
|
-
return
|
|
56
|
+
return chunkUPAJHMW3_cjs.getOrCreateLru(STATEMENT_NAME_CACHE, sqlText, cacheMax, () => {
|
|
57
57
|
const name = `tg_${nextStatementId}`;
|
|
58
58
|
nextStatementId += 1;
|
|
59
59
|
return name;
|
|
@@ -167,7 +167,7 @@ function createPostgresExecutionAdapter(db, options = {}) {
|
|
|
167
167
|
options.useTransactionClient ?? false
|
|
168
168
|
);
|
|
169
169
|
function compile(query) {
|
|
170
|
-
return
|
|
170
|
+
return chunkWODMN3Q2_cjs.compileQueryWithDialect(db, query, "PostgreSQL");
|
|
171
171
|
}
|
|
172
172
|
function assertCompiledWithinBindParameterLimit(compiledQuery) {
|
|
173
173
|
assertWithinBindParameterLimit(
|
|
@@ -182,7 +182,7 @@ function createPostgresExecutionAdapter(db, options = {}) {
|
|
|
182
182
|
assertCompiledWithinBindParameterLimit(compile(query));
|
|
183
183
|
return executeDrizzleQuery(
|
|
184
184
|
db,
|
|
185
|
-
|
|
185
|
+
chunkEDN4Y4ZG_cjs.isSqlFragment(query) ? chunkWODMN3Q2_cjs.toDrizzleSql(query, "postgres") : query
|
|
186
186
|
);
|
|
187
187
|
}
|
|
188
188
|
};
|
|
@@ -201,7 +201,7 @@ function createPostgresExecutionAdapter(db, options = {}) {
|
|
|
201
201
|
async execute(query) {
|
|
202
202
|
const compiled = compile(query);
|
|
203
203
|
assertCompiledWithinBindParameterLimit(compiled);
|
|
204
|
-
if (
|
|
204
|
+
if (chunkEDN4Y4ZG_cjs.isSqlFragment(query) && chunkEDN4Y4ZG_cjs.shouldForceCustomPlan(query)) {
|
|
205
205
|
const result = await pgQueryClient.queryUnnamed(
|
|
206
206
|
compiled.sql,
|
|
207
207
|
compiled.params
|
|
@@ -224,7 +224,7 @@ function assertWithinBindParameterLimit(parameterCount, maxBindParameters) {
|
|
|
224
224
|
if (maxBindParameters === void 0 || parameterCount <= maxBindParameters) {
|
|
225
225
|
return;
|
|
226
226
|
}
|
|
227
|
-
throw new
|
|
227
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
228
228
|
`PostgreSQL statement uses ${parameterCount} bound parameters, exceeding this backend's limit of ${maxBindParameters}.`,
|
|
229
229
|
{
|
|
230
230
|
capability: "maxBindParameters",
|
|
@@ -245,7 +245,7 @@ function createStatementQueue() {
|
|
|
245
245
|
let closed = false;
|
|
246
246
|
return {
|
|
247
247
|
enqueue(task) {
|
|
248
|
-
if (closed) return Promise.reject(new
|
|
248
|
+
if (closed) return Promise.reject(new chunkMRDBBHIZ_cjs.TransactionClosedError());
|
|
249
249
|
const result = tail.then(() => task());
|
|
250
250
|
tail = result.then(ignoreOutcome, ignoreOutcome);
|
|
251
251
|
return result;
|
|
@@ -310,11 +310,11 @@ function computePostgresBatchChunkSizes(maxBindParameters) {
|
|
|
310
310
|
),
|
|
311
311
|
embeddingUpsertBatchSize: Math.max(
|
|
312
312
|
1,
|
|
313
|
-
Math.floor(maxBindParameters /
|
|
313
|
+
Math.floor(maxBindParameters / chunkUPAJHMW3_cjs.EMBEDDING_UPSERT_PARAM_COUNT)
|
|
314
314
|
),
|
|
315
315
|
findEdgesEndpointChunkSize: Math.max(
|
|
316
316
|
1,
|
|
317
|
-
maxBindParameters -
|
|
317
|
+
maxBindParameters - chunkUPAJHMW3_cjs.FIND_EDGES_ENDPOINT_FIXED_PARAM_COUNT
|
|
318
318
|
),
|
|
319
319
|
fulltextDeleteChunkSize: Math.max(
|
|
320
320
|
1,
|
|
@@ -352,24 +352,131 @@ var IDENTITY_TABLE_LOGICAL_NAMES = /* @__PURE__ */ new Set([
|
|
|
352
352
|
"identityClosure",
|
|
353
353
|
"identitySeparation"
|
|
354
354
|
]);
|
|
355
|
-
var
|
|
356
|
-
var
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
355
|
+
var TRIGRAM_EXTENSION_DDL_LOCK_KEY = "typegraph:pg-trgm-ddl";
|
|
356
|
+
var TRIGRAM_EXTENSION_DDL = "CREATE EXTENSION IF NOT EXISTS pg_trgm;";
|
|
357
|
+
function parallelWorkerResetSql(tableName) {
|
|
358
|
+
return `ALTER TABLE "${tableName.replaceAll('"', '""')}" RESET (parallel_workers);`;
|
|
359
|
+
}
|
|
360
|
+
function parallelWorkerResetError(tableName, resetError) {
|
|
361
|
+
return new Error(
|
|
362
|
+
`PostgreSQL did not restore the durable parallel_workers setting on vector table ${JSON.stringify(tableName)}. Run ${parallelWorkerResetSql(tableName)} before retrying index materialization.`,
|
|
363
|
+
{ cause: resetError }
|
|
364
|
+
);
|
|
365
|
+
}
|
|
366
|
+
function vectorSerialFallbackPreparationError(step, parallelBuildError, preparationError) {
|
|
367
|
+
const action = step === "drop-index" ? "drop the partial vector index" : "disable parallel workers for the serial retry";
|
|
368
|
+
return new AggregateError(
|
|
369
|
+
[preparationError],
|
|
370
|
+
`PostgreSQL could not ${action} after the parallel vector index build exhausted resources.`,
|
|
371
|
+
{ cause: parallelBuildError }
|
|
372
|
+
);
|
|
373
|
+
}
|
|
374
|
+
function reportParallelWorkerResetFailure(tableName, resetError) {
|
|
375
|
+
try {
|
|
376
|
+
if (typeof console === "undefined" || typeof console.error !== "function") {
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
const reported = console.error(
|
|
380
|
+
`[typegraph] The serial vector index rebuild failed and cleanup also failed. ${parallelWorkerResetError(tableName, resetError).message}`,
|
|
381
|
+
resetError
|
|
382
|
+
);
|
|
383
|
+
void Promise.resolve(reported).catch(() => {
|
|
384
|
+
});
|
|
385
|
+
} catch {
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
async function resetVectorParallelWorkers(execute, tableName) {
|
|
389
|
+
try {
|
|
390
|
+
await execute(
|
|
391
|
+
chunkEDN4Y4ZG_cjs.sql`ALTER TABLE ${chunkEDN4Y4ZG_cjs.sql.identifier(tableName)} RESET (parallel_workers)`
|
|
392
|
+
);
|
|
393
|
+
} catch (resetError) {
|
|
394
|
+
throw parallelWorkerResetError(tableName, resetError);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
async function runVectorIndexBuildWithSerialFallback(execute, tableName, indexStatement, dropStatement) {
|
|
398
|
+
await resetVectorParallelWorkers(execute, tableName);
|
|
399
|
+
try {
|
|
400
|
+
await execute(indexStatement);
|
|
401
|
+
} catch (error) {
|
|
402
|
+
if (!chunkJR6SX5RH_cjs.isInsufficientResourcesError(error)) throw error;
|
|
403
|
+
if (dropStatement !== void 0) {
|
|
404
|
+
try {
|
|
405
|
+
await execute(dropStatement);
|
|
406
|
+
} catch (dropError) {
|
|
407
|
+
throw vectorSerialFallbackPreparationError(
|
|
408
|
+
"drop-index",
|
|
409
|
+
error,
|
|
410
|
+
dropError
|
|
411
|
+
);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
await runSerialVectorIndexBuild(
|
|
415
|
+
execute,
|
|
416
|
+
tableName,
|
|
417
|
+
indexStatement,
|
|
418
|
+
error
|
|
419
|
+
);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
async function runPostgresVectorIndexBuild(vectorStrategy, execute, tableName, indexStatement, dropStatement) {
|
|
423
|
+
if (vectorStrategy !== chunkROR5ZR6A_cjs.pgvectorStrategy) {
|
|
424
|
+
await execute(indexStatement);
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
await runVectorIndexBuildWithSerialFallback(
|
|
428
|
+
execute,
|
|
429
|
+
tableName,
|
|
430
|
+
indexStatement,
|
|
431
|
+
dropStatement
|
|
432
|
+
);
|
|
433
|
+
}
|
|
434
|
+
async function runSerialVectorIndexBuild(execute, tableName, indexStatement, parallelBuildError) {
|
|
435
|
+
const table = chunkEDN4Y4ZG_cjs.sql.identifier(tableName);
|
|
436
|
+
try {
|
|
437
|
+
await execute(chunkEDN4Y4ZG_cjs.sql`ALTER TABLE ${table} SET (parallel_workers = 0)`);
|
|
438
|
+
} catch (setError) {
|
|
439
|
+
if (parallelBuildError === void 0) throw setError;
|
|
440
|
+
throw vectorSerialFallbackPreparationError(
|
|
441
|
+
"disable-parallel-workers",
|
|
442
|
+
parallelBuildError,
|
|
443
|
+
setError
|
|
444
|
+
);
|
|
445
|
+
}
|
|
446
|
+
let buildFailure;
|
|
447
|
+
try {
|
|
448
|
+
await execute(indexStatement);
|
|
449
|
+
} catch (error) {
|
|
450
|
+
buildFailure = { error };
|
|
451
|
+
}
|
|
452
|
+
try {
|
|
453
|
+
await execute(chunkEDN4Y4ZG_cjs.sql`ALTER TABLE ${table} RESET (parallel_workers)`);
|
|
454
|
+
} catch (resetError) {
|
|
455
|
+
if (buildFailure === void 0) {
|
|
456
|
+
throw parallelWorkerResetError(tableName, resetError);
|
|
457
|
+
}
|
|
458
|
+
reportParallelWorkerResetFailure(tableName, resetError);
|
|
459
|
+
}
|
|
460
|
+
if (buildFailure !== void 0) throw buildFailure.error;
|
|
461
|
+
}
|
|
462
|
+
var toNodeRow = chunkAMMWA76F_cjs.createNodeRowMapper(chunkAMMWA76F_cjs.POSTGRES_ROW_MAPPER_CONFIG);
|
|
463
|
+
var toEdgeRow = chunkAMMWA76F_cjs.createEdgeRowMapper(chunkAMMWA76F_cjs.POSTGRES_ROW_MAPPER_CONFIG);
|
|
464
|
+
var toUniqueRow = chunkAMMWA76F_cjs.createUniqueRowMapper(chunkAMMWA76F_cjs.POSTGRES_ROW_MAPPER_CONFIG);
|
|
465
|
+
var toSchemaVersionRow = chunkAMMWA76F_cjs.createSchemaVersionRowMapper(
|
|
466
|
+
chunkAMMWA76F_cjs.POSTGRES_ROW_MAPPER_CONFIG
|
|
360
467
|
);
|
|
361
468
|
function buildPostgresCapabilities(fulltextStrategy, vectorStrategy) {
|
|
362
469
|
return {
|
|
363
|
-
...
|
|
364
|
-
...vectorStrategy === void 0 ? {} : { vector:
|
|
365
|
-
fulltext:
|
|
470
|
+
...chunk3HGRTCDU_cjs.POSTGRES_CAPABILITIES,
|
|
471
|
+
...vectorStrategy === void 0 ? {} : { vector: chunkL3LQNR34_cjs.buildVectorCapabilities(vectorStrategy) },
|
|
472
|
+
fulltext: chunkL3LQNR34_cjs.buildFulltextCapabilities(fulltextStrategy)
|
|
366
473
|
};
|
|
367
474
|
}
|
|
368
475
|
function createPostgresBackend(db, options = {}) {
|
|
369
476
|
const serializedClient = getSerializedPostgresClient(db);
|
|
370
|
-
const tables2 = options.tables ??
|
|
371
|
-
const fulltextStrategy = options.fulltext ??
|
|
372
|
-
const vectorStrategy = options.vector === false ? void 0 : options.vector ??
|
|
477
|
+
const tables2 = options.tables ?? chunkHDL2ARHX_cjs.tables;
|
|
478
|
+
const fulltextStrategy = options.fulltext ?? chunkL3LQNR34_cjs.tsvectorStrategy;
|
|
479
|
+
const vectorStrategy = options.vector === false ? void 0 : options.vector ?? chunkROR5ZR6A_cjs.pgvectorStrategy;
|
|
373
480
|
const iterativeScanProbe = createIterativeScanProbe();
|
|
374
481
|
const baseCapabilities = buildPostgresCapabilities(
|
|
375
482
|
fulltextStrategy,
|
|
@@ -382,14 +489,14 @@ function createPostgresBackend(db, options = {}) {
|
|
|
382
489
|
supported: false
|
|
383
490
|
}
|
|
384
491
|
} : {};
|
|
385
|
-
const configuredMaxBindParameters = options.capabilities?.maxBindParameters ??
|
|
492
|
+
const configuredMaxBindParameters = options.capabilities?.maxBindParameters ?? chunk3HGRTCDU_cjs.POSTGRES_MAX_BIND_PARAMETERS;
|
|
386
493
|
const driverBindParameterOverrides = isPgliteDatabase(db) ? {
|
|
387
494
|
maxBindParameters: Math.min(
|
|
388
495
|
configuredMaxBindParameters,
|
|
389
496
|
PGLITE_MAX_BIND_PARAMETERS
|
|
390
497
|
)
|
|
391
498
|
} : {};
|
|
392
|
-
const declaredCapabilities =
|
|
499
|
+
const declaredCapabilities = chunk3HGRTCDU_cjs.normalizeGraphAnalyticsCapabilities({
|
|
393
500
|
...baseCapabilities,
|
|
394
501
|
...httpOnlyOverrides,
|
|
395
502
|
...options.capabilities,
|
|
@@ -400,7 +507,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
400
507
|
contributions: {
|
|
401
508
|
supported: true,
|
|
402
509
|
probe: true,
|
|
403
|
-
rebuild:
|
|
510
|
+
rebuild: chunkUPAJHMW3_cjs.contributionRebuildSupported(
|
|
404
511
|
fulltextStrategy,
|
|
405
512
|
tables2.fulltextTableName,
|
|
406
513
|
declaredCapabilities.transactions
|
|
@@ -410,7 +517,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
410
517
|
const adapterOptions = {
|
|
411
518
|
...options.prepareStatements === void 0 ? {} : { prepareStatements: options.prepareStatements },
|
|
412
519
|
...options.preparedStatementCacheMax === void 0 ? {} : { preparedStatementCacheMax: options.preparedStatementCacheMax },
|
|
413
|
-
maxBindParameters: capabilities.maxBindParameters ??
|
|
520
|
+
maxBindParameters: capabilities.maxBindParameters ?? chunk3HGRTCDU_cjs.POSTGRES_MAX_BIND_PARAMETERS
|
|
414
521
|
};
|
|
415
522
|
const executionAdapter = createPostgresExecutionAdapter(db, adapterOptions);
|
|
416
523
|
const tableNames = {
|
|
@@ -433,8 +540,8 @@ function createPostgresBackend(db, options = {}) {
|
|
|
433
540
|
drizzleOrm.getTableName(tables2.uniques),
|
|
434
541
|
tableNames.fulltext
|
|
435
542
|
].map(
|
|
436
|
-
(name) =>
|
|
437
|
-
|
|
543
|
+
(name) => chunkWODMN3Q2_cjs.toDrizzleSql(
|
|
544
|
+
chunkEDN4Y4ZG_cjs.sql`ANALYZE (SKIP_LOCKED) ${chunkEDN4Y4ZG_cjs.sql.identifier(name)}`,
|
|
438
545
|
"postgres"
|
|
439
546
|
)
|
|
440
547
|
);
|
|
@@ -447,11 +554,11 @@ function createPostgresBackend(db, options = {}) {
|
|
|
447
554
|
tableNames.identityClosure,
|
|
448
555
|
tableNames.identitySeparation
|
|
449
556
|
];
|
|
450
|
-
const operationStrategy =
|
|
557
|
+
const operationStrategy = chunkUPAJHMW3_cjs.createPostgresOperationStrategy(
|
|
451
558
|
tables2,
|
|
452
559
|
fulltextStrategy
|
|
453
560
|
);
|
|
454
|
-
const guardedTableExists =
|
|
561
|
+
const guardedTableExists = chunkUPAJHMW3_cjs.createCachedTableExistence(
|
|
455
562
|
async (tableName) => {
|
|
456
563
|
const rows = await executionAdapter.execute(
|
|
457
564
|
operationStrategy.buildTableExists(tableName)
|
|
@@ -466,24 +573,24 @@ function createPostgresBackend(db, options = {}) {
|
|
|
466
573
|
try {
|
|
467
574
|
await db.execute(statement);
|
|
468
575
|
} catch (error) {
|
|
469
|
-
if (!
|
|
576
|
+
if (!chunkJR6SX5RH_cjs.isPostgresConcurrentDdlRaceError(error)) throw error;
|
|
470
577
|
await db.execute(statement);
|
|
471
578
|
}
|
|
472
579
|
}
|
|
473
580
|
async function ensureTableWithConcurrentCreateRetry(table) {
|
|
474
|
-
await executeConcurrentCreateDdl(
|
|
581
|
+
await executeConcurrentCreateDdl(chunkHDL2ARHX_cjs.generatePgCreateTableSQL(table));
|
|
475
582
|
}
|
|
476
583
|
async function ensureContributionMaterializationsTableImpl() {
|
|
477
584
|
await ensureTableWithConcurrentCreateRetry(matTable);
|
|
478
585
|
}
|
|
479
586
|
function identityContributionsFor(identityTableNames) {
|
|
480
|
-
const identityTables =
|
|
587
|
+
const identityTables = chunkHDL2ARHX_cjs.createPostgresTables({
|
|
481
588
|
identityAssertions: identityTableNames.identityAssertions,
|
|
482
589
|
recordedIdentityAssertions: identityTableNames.recordedIdentityAssertions,
|
|
483
590
|
identityClosure: identityTableNames.identityClosure,
|
|
484
591
|
identitySeparation: identityTableNames.identitySeparation
|
|
485
592
|
});
|
|
486
|
-
return
|
|
593
|
+
return chunkHDL2ARHX_cjs.postgresContributions(identityTables, fulltextStrategy).filter(
|
|
487
594
|
(contribution) => IDENTITY_TABLE_LOGICAL_NAMES.has(contribution.logicalName)
|
|
488
595
|
);
|
|
489
596
|
}
|
|
@@ -498,25 +605,25 @@ function createPostgresBackend(db, options = {}) {
|
|
|
498
605
|
);
|
|
499
606
|
const row = rows[0];
|
|
500
607
|
if (row === void 0) return void 0;
|
|
501
|
-
return
|
|
608
|
+
return chunkUPAJHMW3_cjs.mapContributionMaterializationRow(
|
|
502
609
|
row,
|
|
503
|
-
|
|
610
|
+
chunkUPAJHMW3_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.decode
|
|
504
611
|
);
|
|
505
612
|
}
|
|
506
613
|
async function getContributionMaterializationRows(graphId) {
|
|
507
614
|
const rows = await db.select().from(matTable).where(drizzleOrm.eq(matTable.graphId, graphId));
|
|
508
615
|
return rows.map(
|
|
509
|
-
(row) =>
|
|
616
|
+
(row) => chunkUPAJHMW3_cjs.mapContributionMaterializationRow(
|
|
510
617
|
row,
|
|
511
|
-
|
|
618
|
+
chunkUPAJHMW3_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.decode
|
|
512
619
|
)
|
|
513
620
|
);
|
|
514
621
|
}
|
|
515
622
|
async function recordContributionMaterializationRow(params) {
|
|
516
623
|
await db.insert(matTable).values(
|
|
517
|
-
|
|
624
|
+
chunkUPAJHMW3_cjs.buildContributionInsertValues(
|
|
518
625
|
params,
|
|
519
|
-
|
|
626
|
+
chunkUPAJHMW3_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.encode
|
|
520
627
|
)
|
|
521
628
|
).onConflictDoUpdate({
|
|
522
629
|
target: [
|
|
@@ -525,7 +632,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
525
632
|
matTable.owner,
|
|
526
633
|
matTable.tableName
|
|
527
634
|
],
|
|
528
|
-
set:
|
|
635
|
+
set: chunkUPAJHMW3_cjs.buildContributionOnConflictSet(
|
|
529
636
|
matTable.materializedAt,
|
|
530
637
|
params.materializedAt
|
|
531
638
|
)
|
|
@@ -545,9 +652,9 @@ function createPostgresBackend(db, options = {}) {
|
|
|
545
652
|
const rows = await executionAdapter.execute(
|
|
546
653
|
operationStrategy.buildTableExists(tableName)
|
|
547
654
|
);
|
|
548
|
-
return
|
|
655
|
+
return chunkUPAJHMW3_cjs.tableExistsFromRow(rows[0]);
|
|
549
656
|
}
|
|
550
|
-
const contributionMaterializer =
|
|
657
|
+
const contributionMaterializer = chunkUPAJHMW3_cjs.createContributionMaterializer({
|
|
551
658
|
dialect: "postgres",
|
|
552
659
|
fulltextStrategy,
|
|
553
660
|
fulltextTableName: tables2.fulltextTableName,
|
|
@@ -588,7 +695,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
588
695
|
});
|
|
589
696
|
function runSchemaWriteTransaction(graphId, fn) {
|
|
590
697
|
if (!capabilities.transactions) {
|
|
591
|
-
throw new
|
|
698
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
592
699
|
"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.",
|
|
593
700
|
{
|
|
594
701
|
backend: "postgres",
|
|
@@ -639,7 +746,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
639
746
|
schemaVersionsTable: tables2.schemaVersions
|
|
640
747
|
});
|
|
641
748
|
return {
|
|
642
|
-
backend:
|
|
749
|
+
backend: chunkUPAJHMW3_cjs.gateFulltext(
|
|
643
750
|
backend2,
|
|
644
751
|
contributionMaterializer.assertInitialized,
|
|
645
752
|
contributionMaterializer.refuseUnavailableFulltext
|
|
@@ -663,33 +770,33 @@ function createPostgresBackend(db, options = {}) {
|
|
|
663
770
|
);
|
|
664
771
|
const executeCompiled = trustedExecutionAdapter.executeCompiled;
|
|
665
772
|
if (executeCompiled === void 0) {
|
|
666
|
-
throw new
|
|
773
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
667
774
|
"Trusted import could not bind raw execution to the PostgreSQL transaction.",
|
|
668
775
|
{ capability: "trustedImport", dialect: "postgres" }
|
|
669
776
|
);
|
|
670
777
|
}
|
|
671
|
-
const trustedTx =
|
|
778
|
+
const trustedTx = chunk3HGRTCDU_cjs.createBackendOverlay(tx, {
|
|
672
779
|
executeRaw(sqlText, params) {
|
|
673
780
|
return executeCompiled({ params, sql: sqlText });
|
|
674
781
|
}
|
|
675
782
|
});
|
|
676
|
-
await
|
|
677
|
-
await
|
|
678
|
-
const indexDefinitions = await
|
|
783
|
+
await chunkUPAJHMW3_cjs.lockPostgresTrustedImportTables(trustedTx, tableNames);
|
|
784
|
+
await chunkUPAJHMW3_cjs.assertTrustedImportDatabaseEmpty(trustedTx, tableNames);
|
|
785
|
+
const indexDefinitions = await chunkUPAJHMW3_cjs.suspendPostgresSecondaryIndexes(
|
|
679
786
|
trustedTx,
|
|
680
787
|
tableNames
|
|
681
788
|
);
|
|
682
789
|
const result = await fn(
|
|
683
|
-
|
|
790
|
+
chunkUPAJHMW3_cjs.createPostgresTrustedImportSession(trustedTx, tableNames)
|
|
684
791
|
);
|
|
685
|
-
await
|
|
686
|
-
await
|
|
792
|
+
await chunkUPAJHMW3_cjs.restoreSecondaryIndexes(trustedTx, indexDefinitions);
|
|
793
|
+
await chunkUPAJHMW3_cjs.analyzeImportedTables(trustedTx, tableNames);
|
|
687
794
|
return result;
|
|
688
795
|
});
|
|
689
796
|
}
|
|
690
797
|
} : {},
|
|
691
798
|
async bootstrapTables() {
|
|
692
|
-
const statements =
|
|
799
|
+
const statements = chunkHDL2ARHX_cjs.generatePostgresDDL(tables2, fulltextStrategy);
|
|
693
800
|
for (const statement of statements) {
|
|
694
801
|
await executeConcurrentCreateDdl(statement);
|
|
695
802
|
}
|
|
@@ -724,7 +831,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
724
831
|
// uninitialized database throws `StoreNotInitializedError` loudly
|
|
725
832
|
// rather than self-healing on a read/write path (#135). Shared
|
|
726
833
|
// verbatim with the tx-scoped gate via `gateFulltextMethods`.
|
|
727
|
-
...
|
|
834
|
+
...chunkUPAJHMW3_cjs.gateFulltextMethods(
|
|
728
835
|
operations,
|
|
729
836
|
contributionMaterializer.assertInitialized,
|
|
730
837
|
contributionMaterializer.refuseUnavailableFulltext
|
|
@@ -742,6 +849,18 @@ function createPostgresBackend(db, options = {}) {
|
|
|
742
849
|
`ALTER TABLE "${tableName}" ADD COLUMN IF NOT EXISTS "claim_token" text;`
|
|
743
850
|
);
|
|
744
851
|
},
|
|
852
|
+
async ensureTrigramExtension() {
|
|
853
|
+
if (!capabilities.transactions) {
|
|
854
|
+
await executeConcurrentCreateDdl(TRIGRAM_EXTENSION_DDL);
|
|
855
|
+
return;
|
|
856
|
+
}
|
|
857
|
+
await db.transaction(async (tx) => {
|
|
858
|
+
await tx.execute(
|
|
859
|
+
drizzleOrm.sql`SELECT pg_advisory_xact_lock(hashtext(${TRIGRAM_EXTENSION_DDL_LOCK_KEY}), 0)`
|
|
860
|
+
);
|
|
861
|
+
await tx.execute(drizzleOrm.sql.raw(TRIGRAM_EXTENSION_DDL));
|
|
862
|
+
});
|
|
863
|
+
},
|
|
745
864
|
async claimIndexMaterialization(params) {
|
|
746
865
|
const t = tables2.indexMaterializations;
|
|
747
866
|
const rows = await db.execute(drizzleOrm.sql`
|
|
@@ -780,26 +899,26 @@ function createPostgresBackend(db, options = {}) {
|
|
|
780
899
|
const rows = await db.select().from(t).where(drizzleOrm.eq(t.indexName, indexName));
|
|
781
900
|
const row = rows[0];
|
|
782
901
|
if (row === void 0) return void 0;
|
|
783
|
-
return
|
|
902
|
+
return chunkUPAJHMW3_cjs.mapMaterializationRow(row, chunkUPAJHMW3_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.decode);
|
|
784
903
|
},
|
|
785
904
|
async getIndexMaterializations(statusKeys) {
|
|
786
905
|
if (statusKeys.length === 0) return [];
|
|
787
906
|
const t = tables2.indexMaterializations;
|
|
788
907
|
const rows = await db.select().from(t).where(drizzleOrm.inArray(t.indexName, [...statusKeys]));
|
|
789
908
|
return rows.map(
|
|
790
|
-
(row) =>
|
|
909
|
+
(row) => chunkUPAJHMW3_cjs.mapMaterializationRow(row, chunkUPAJHMW3_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.decode)
|
|
791
910
|
);
|
|
792
911
|
},
|
|
793
912
|
async recordIndexMaterialization(params) {
|
|
794
913
|
const t = tables2.indexMaterializations;
|
|
795
914
|
await db.insert(t).values(
|
|
796
|
-
|
|
915
|
+
chunkUPAJHMW3_cjs.buildMaterializationInsertValues(
|
|
797
916
|
params,
|
|
798
|
-
|
|
917
|
+
chunkUPAJHMW3_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.encode
|
|
799
918
|
)
|
|
800
919
|
).onConflictDoUpdate({
|
|
801
920
|
target: t.indexName,
|
|
802
|
-
set:
|
|
921
|
+
set: chunkUPAJHMW3_cjs.buildMaterializationOnConflictSet(params.materializedAt)
|
|
803
922
|
});
|
|
804
923
|
},
|
|
805
924
|
async ensureContributionMaterializationsTable() {
|
|
@@ -821,26 +940,26 @@ function createPostgresBackend(db, options = {}) {
|
|
|
821
940
|
const t = tables2.kindRemovals;
|
|
822
941
|
const rows = await db.select().from(t).where(drizzleOrm.and(drizzleOrm.eq(t.graphId, graphId), drizzleOrm.isNull(t.removedAt)));
|
|
823
942
|
return rows.map(
|
|
824
|
-
(row) =>
|
|
943
|
+
(row) => chunkUPAJHMW3_cjs.mapKindRemovalRow(row, chunkUPAJHMW3_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.decode)
|
|
825
944
|
);
|
|
826
945
|
},
|
|
827
946
|
async getAllKindRemovals(graphId) {
|
|
828
947
|
const t = tables2.kindRemovals;
|
|
829
948
|
const rows = await db.select().from(t).where(drizzleOrm.eq(t.graphId, graphId));
|
|
830
949
|
return rows.map(
|
|
831
|
-
(row) =>
|
|
950
|
+
(row) => chunkUPAJHMW3_cjs.mapKindRemovalRow(row, chunkUPAJHMW3_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.decode)
|
|
832
951
|
);
|
|
833
952
|
},
|
|
834
953
|
async recordKindRemoval(params) {
|
|
835
954
|
const t = tables2.kindRemovals;
|
|
836
955
|
await db.insert(t).values(
|
|
837
|
-
|
|
956
|
+
chunkUPAJHMW3_cjs.buildKindRemovalInsertValues(
|
|
838
957
|
params,
|
|
839
|
-
|
|
958
|
+
chunkUPAJHMW3_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.encode
|
|
840
959
|
)
|
|
841
960
|
).onConflictDoUpdate({
|
|
842
961
|
target: [t.graphId, t.kindName, t.entity, t.schemaVersion],
|
|
843
|
-
set:
|
|
962
|
+
set: chunkUPAJHMW3_cjs.buildKindRemovalOnConflictSet(t.removedAt, params.removedAt)
|
|
844
963
|
});
|
|
845
964
|
},
|
|
846
965
|
async ensureReconciliationMarkersTable() {
|
|
@@ -919,8 +1038,8 @@ function createPostgresBackend(db, options = {}) {
|
|
|
919
1038
|
const presentGuardedTables = tablePresence.filter((entry) => entry.exists).map((entry) => entry.tableName);
|
|
920
1039
|
for (const tableName of presentGuardedTables) {
|
|
921
1040
|
await db.execute(
|
|
922
|
-
|
|
923
|
-
|
|
1041
|
+
chunkWODMN3Q2_cjs.toDrizzleSql(
|
|
1042
|
+
chunkEDN4Y4ZG_cjs.sql`ANALYZE (SKIP_LOCKED) ${chunkEDN4Y4ZG_cjs.sql.identifier(tableName)}`,
|
|
924
1043
|
"postgres"
|
|
925
1044
|
)
|
|
926
1045
|
);
|
|
@@ -935,7 +1054,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
935
1054
|
async commitSchemaVersionIfKindsEmpty(params, probes) {
|
|
936
1055
|
return runSchemaWriteTransaction(
|
|
937
1056
|
params.graphId,
|
|
938
|
-
(target) =>
|
|
1057
|
+
(target) => chunkUPAJHMW3_cjs.commitSchemaVersionIfKindsEmpty(target, params, probes)
|
|
939
1058
|
);
|
|
940
1059
|
},
|
|
941
1060
|
async commitSchemaVersionWithPreflight(params, preflight) {
|
|
@@ -957,9 +1076,9 @@ function createPostgresBackend(db, options = {}) {
|
|
|
957
1076
|
return backend.transactionWithNative((tx) => fn(tx), options2);
|
|
958
1077
|
},
|
|
959
1078
|
async transactionWithNative(fn, options2) {
|
|
960
|
-
const temporaryWrites = options2?.temporaryWrites ===
|
|
1079
|
+
const temporaryWrites = options2?.temporaryWrites === chunk3HGRTCDU_cjs.INTERNAL_TEMPORARY_WRITES;
|
|
961
1080
|
if (temporaryWrites && options2.accessMode !== "read_only") {
|
|
962
|
-
throw new
|
|
1081
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
963
1082
|
"Temporary-write transactions must be semantically read-only.",
|
|
964
1083
|
{ dialect: "postgres" }
|
|
965
1084
|
);
|
|
@@ -983,7 +1102,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
983
1102
|
},
|
|
984
1103
|
adoptTransaction(externalTx) {
|
|
985
1104
|
if (!capabilities.transactions) {
|
|
986
|
-
throw new
|
|
1105
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
987
1106
|
"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.",
|
|
988
1107
|
{
|
|
989
1108
|
backend: "postgres",
|
|
@@ -992,7 +1111,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
992
1111
|
}
|
|
993
1112
|
);
|
|
994
1113
|
}
|
|
995
|
-
|
|
1114
|
+
chunkUPAJHMW3_cjs.assertAdoptedDialect(
|
|
996
1115
|
externalTx,
|
|
997
1116
|
pgCore.PgTransaction,
|
|
998
1117
|
"postgres"
|
|
@@ -1003,7 +1122,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
1003
1122
|
}
|
|
1004
1123
|
};
|
|
1005
1124
|
if (serializedClient !== void 0) {
|
|
1006
|
-
|
|
1125
|
+
chunk3HGRTCDU_cjs.markSerializedTransactionResource(backend, serializedClient);
|
|
1007
1126
|
}
|
|
1008
1127
|
return backend;
|
|
1009
1128
|
}
|
|
@@ -1101,10 +1220,10 @@ function createPostgresOperationBackend(options) {
|
|
|
1101
1220
|
}
|
|
1102
1221
|
async function vectorSearchGucOverrides(params) {
|
|
1103
1222
|
const overrides = [];
|
|
1104
|
-
const efSearchParameter =
|
|
1223
|
+
const efSearchParameter = chunkL3LQNR34_cjs.resolveEfSearchOverride({
|
|
1105
1224
|
efSearch: params.efSearch,
|
|
1106
1225
|
indexType: params.indexType,
|
|
1107
|
-
tuning:
|
|
1226
|
+
tuning: chunkL3LQNR34_cjs.vectorSearchFrontierTuning(vectorStrategy),
|
|
1108
1227
|
transactions: capabilities.transactions,
|
|
1109
1228
|
dialect: "PostgreSQL",
|
|
1110
1229
|
engine: vectorStrategy?.name ?? "this backend"
|
|
@@ -1129,7 +1248,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1129
1248
|
async function runVectorSearchGucGroup(overrides, query) {
|
|
1130
1249
|
const runExclusive = executionAdapter.runExclusive;
|
|
1131
1250
|
if (runExclusive === void 0) {
|
|
1132
|
-
throw new
|
|
1251
|
+
throw new chunkMRDBBHIZ_cjs.CompilerInvariantError(
|
|
1133
1252
|
"A transaction-scoped Postgres backend must expose runExclusive; its execution adapter was not wrapped by createSerialExecutionAdapter."
|
|
1134
1253
|
);
|
|
1135
1254
|
}
|
|
@@ -1173,17 +1292,17 @@ function createPostgresOperationBackend(options) {
|
|
|
1173
1292
|
});
|
|
1174
1293
|
}
|
|
1175
1294
|
const batchConfig = computePostgresBatchChunkSizes(
|
|
1176
|
-
capabilities.maxBindParameters ??
|
|
1295
|
+
capabilities.maxBindParameters ?? chunk3HGRTCDU_cjs.POSTGRES_MAX_BIND_PARAMETERS
|
|
1177
1296
|
);
|
|
1178
|
-
const commonBackend =
|
|
1297
|
+
const commonBackend = chunkUPAJHMW3_cjs.createCommonOperationBackend({
|
|
1179
1298
|
batchConfig,
|
|
1180
1299
|
execution: {
|
|
1181
1300
|
execAll,
|
|
1182
1301
|
execGet,
|
|
1183
1302
|
execRun
|
|
1184
1303
|
},
|
|
1185
|
-
nowIso:
|
|
1186
|
-
maxBindParameters: capabilities.maxBindParameters ??
|
|
1304
|
+
nowIso: chunkAMMWA76F_cjs.nowIso,
|
|
1305
|
+
maxBindParameters: capabilities.maxBindParameters ?? chunk3HGRTCDU_cjs.POSTGRES_MAX_BIND_PARAMETERS,
|
|
1187
1306
|
operationStrategy,
|
|
1188
1307
|
rowMappers: {
|
|
1189
1308
|
toEdgeRow,
|
|
@@ -1201,28 +1320,28 @@ function createPostgresOperationBackend(options) {
|
|
|
1201
1320
|
};
|
|
1202
1321
|
const vectorEmbeddingMethods = vectorStrategy === void 0 ? {} : {
|
|
1203
1322
|
async upsertEmbedding(params) {
|
|
1204
|
-
const slot =
|
|
1323
|
+
const slot = chunkUPAJHMW3_cjs.vectorSlotFromParams(params);
|
|
1205
1324
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1206
|
-
const statements = vectorStrategy.buildUpsert(slot, params,
|
|
1325
|
+
const statements = vectorStrategy.buildUpsert(slot, params, chunkAMMWA76F_cjs.nowIso());
|
|
1207
1326
|
try {
|
|
1208
1327
|
for (const statement of statements) {
|
|
1209
1328
|
await execRun(statement);
|
|
1210
1329
|
}
|
|
1211
1330
|
} catch (error) {
|
|
1212
|
-
throw
|
|
1331
|
+
throw chunkUPAJHMW3_cjs.mapVectorWriteError(error, params);
|
|
1213
1332
|
}
|
|
1214
1333
|
},
|
|
1215
1334
|
async upsertEmbeddingBatch(params) {
|
|
1216
1335
|
if (params.rows.length === 0) return;
|
|
1217
|
-
const slot =
|
|
1336
|
+
const slot = chunkUPAJHMW3_cjs.vectorSlotFromParams(params);
|
|
1218
1337
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1219
1338
|
const rowsById = new Map(
|
|
1220
1339
|
params.rows.map((row) => [row.nodeId, row])
|
|
1221
1340
|
);
|
|
1222
1341
|
const rows = [...rowsById.values()];
|
|
1223
|
-
const timestamp =
|
|
1342
|
+
const timestamp = chunkAMMWA76F_cjs.nowIso();
|
|
1224
1343
|
try {
|
|
1225
|
-
for (const chunk2 of
|
|
1344
|
+
for (const chunk2 of chunkJR6SX5RH_cjs.chunk(
|
|
1226
1345
|
rows,
|
|
1227
1346
|
batchConfig.embeddingUpsertBatchSize
|
|
1228
1347
|
)) {
|
|
@@ -1251,11 +1370,11 @@ function createPostgresOperationBackend(options) {
|
|
|
1251
1370
|
}
|
|
1252
1371
|
}
|
|
1253
1372
|
} catch (error) {
|
|
1254
|
-
throw
|
|
1373
|
+
throw chunkUPAJHMW3_cjs.mapVectorWriteError(error, params);
|
|
1255
1374
|
}
|
|
1256
1375
|
},
|
|
1257
1376
|
async deleteEmbedding(params) {
|
|
1258
|
-
const slot =
|
|
1377
|
+
const slot = chunkUPAJHMW3_cjs.vectorSlotFromParams(params);
|
|
1259
1378
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1260
1379
|
const statements = vectorStrategy.buildDelete(slot, params);
|
|
1261
1380
|
for (const statement of statements) {
|
|
@@ -1264,9 +1383,9 @@ function createPostgresOperationBackend(options) {
|
|
|
1264
1383
|
},
|
|
1265
1384
|
async deleteEmbeddingBatch(params) {
|
|
1266
1385
|
if (params.nodeIds.length === 0) return;
|
|
1267
|
-
const slot =
|
|
1386
|
+
const slot = chunkUPAJHMW3_cjs.vectorSlotFromParams(params);
|
|
1268
1387
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1269
|
-
for (const nodeIds of
|
|
1388
|
+
for (const nodeIds of chunkJR6SX5RH_cjs.chunk(
|
|
1270
1389
|
[...new Set(params.nodeIds)],
|
|
1271
1390
|
batchConfig.embeddingUpsertBatchSize
|
|
1272
1391
|
)) {
|
|
@@ -1278,19 +1397,19 @@ function createPostgresOperationBackend(options) {
|
|
|
1278
1397
|
}
|
|
1279
1398
|
},
|
|
1280
1399
|
async vectorSearch(params) {
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
const slot =
|
|
1400
|
+
chunkL3LQNR34_cjs.assertVectorSearchLimit(params.limit);
|
|
1401
|
+
chunkROR5ZR6A_cjs.assertPgvectorEfSearch(params.efSearch);
|
|
1402
|
+
const slot = chunkUPAJHMW3_cjs.vectorSlotFromParams(params);
|
|
1284
1403
|
const query = vectorStrategy.buildSearch(
|
|
1285
1404
|
slot,
|
|
1286
1405
|
params,
|
|
1287
1406
|
// Store-compiled candidates (predicates + subclass + currency)
|
|
1288
1407
|
// take precedence; the live-node default covers direct backend use.
|
|
1289
|
-
params.candidates ??
|
|
1408
|
+
params.candidates ?? chunkUPAJHMW3_cjs.buildLiveNodeCandidates(
|
|
1290
1409
|
tableNames.nodes,
|
|
1291
1410
|
params.graphId,
|
|
1292
1411
|
params.nodeKind,
|
|
1293
|
-
|
|
1412
|
+
chunkAMMWA76F_cjs.nowIso()
|
|
1294
1413
|
)
|
|
1295
1414
|
);
|
|
1296
1415
|
const gucOverrides = await vectorSearchGucOverrides(params);
|
|
@@ -1298,7 +1417,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1298
1417
|
try {
|
|
1299
1418
|
rows = await runVectorSearch(gucOverrides, query);
|
|
1300
1419
|
} catch (error) {
|
|
1301
|
-
throw
|
|
1420
|
+
throw chunkUPAJHMW3_cjs.mapVectorWriteError(error, params);
|
|
1302
1421
|
}
|
|
1303
1422
|
return rows.map((row) => ({
|
|
1304
1423
|
nodeId: row.node_id,
|
|
@@ -1310,10 +1429,10 @@ function createPostgresOperationBackend(options) {
|
|
|
1310
1429
|
// multi-statement fallback by simply not exposing the member.
|
|
1311
1430
|
...capabilities.windowFunctions ? {
|
|
1312
1431
|
async hybridSearch(params) {
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
const slot =
|
|
1432
|
+
chunkL3LQNR34_cjs.assertVectorSearchLimit(params.limit);
|
|
1433
|
+
chunkL3LQNR34_cjs.assertVectorSearchLimit(params.vector.k);
|
|
1434
|
+
chunkROR5ZR6A_cjs.assertPgvectorEfSearch(params.vector.efSearch);
|
|
1435
|
+
const slot = chunkUPAJHMW3_cjs.vectorSlotFromParams({
|
|
1317
1436
|
graphId: params.graphId,
|
|
1318
1437
|
nodeKind: params.nodeKind,
|
|
1319
1438
|
fieldPath: params.vector.fieldPath,
|
|
@@ -1321,11 +1440,11 @@ function createPostgresOperationBackend(options) {
|
|
|
1321
1440
|
metric: params.vector.metric,
|
|
1322
1441
|
indexType: params.vector.indexType
|
|
1323
1442
|
});
|
|
1324
|
-
const candidates = params.candidates ??
|
|
1443
|
+
const candidates = params.candidates ?? chunkUPAJHMW3_cjs.buildLiveNodeCandidates(
|
|
1325
1444
|
tableNames.nodes,
|
|
1326
1445
|
params.graphId,
|
|
1327
1446
|
params.nodeKind,
|
|
1328
|
-
|
|
1447
|
+
chunkAMMWA76F_cjs.nowIso()
|
|
1329
1448
|
);
|
|
1330
1449
|
const vectorParams = {
|
|
1331
1450
|
graphId: params.graphId,
|
|
@@ -1341,11 +1460,11 @@ function createPostgresOperationBackend(options) {
|
|
|
1341
1460
|
const vectorSql = vectorStrategy.buildSearch(
|
|
1342
1461
|
slot,
|
|
1343
1462
|
vectorParams,
|
|
1344
|
-
|
|
1463
|
+
chunkEDN4Y4ZG_cjs.sql.raw("SELECT node_id FROM tg_hybrid_cand")
|
|
1345
1464
|
);
|
|
1346
1465
|
const statement = operationStrategy.buildHybridSearch(
|
|
1347
1466
|
{ ...params, candidates },
|
|
1348
|
-
|
|
1467
|
+
chunkWODMN3Q2_cjs.toDrizzleSql(vectorSql, "postgres"),
|
|
1349
1468
|
params.vector.metric === "cosine"
|
|
1350
1469
|
);
|
|
1351
1470
|
const gucOverrides = await vectorSearchGucOverrides({
|
|
@@ -1359,9 +1478,9 @@ function createPostgresOperationBackend(options) {
|
|
|
1359
1478
|
statement
|
|
1360
1479
|
);
|
|
1361
1480
|
} catch (error) {
|
|
1362
|
-
throw
|
|
1481
|
+
throw chunkUPAJHMW3_cjs.mapVectorWriteError(error, vectorParams);
|
|
1363
1482
|
}
|
|
1364
|
-
return raw.map((row) =>
|
|
1483
|
+
return raw.map((row) => chunkUPAJHMW3_cjs.mapHybridSearchRow(row, toNodeRow));
|
|
1365
1484
|
}
|
|
1366
1485
|
} : {}
|
|
1367
1486
|
};
|
|
@@ -1416,7 +1535,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1416
1535
|
tableNames,
|
|
1417
1536
|
async lockSchemaVersionForWrite(params) {
|
|
1418
1537
|
if (!transactionScoped) {
|
|
1419
|
-
throw new
|
|
1538
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
1420
1539
|
"The schema write fence requires an explicit PostgreSQL transaction.",
|
|
1421
1540
|
{
|
|
1422
1541
|
code: "SCHEMA_WRITE_FENCE_TRANSACTION_REQUIRED",
|
|
@@ -1426,7 +1545,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1426
1545
|
}
|
|
1427
1546
|
const locked = await lockActiveSchemaVersion(params.graphId);
|
|
1428
1547
|
if (locked !== void 0) {
|
|
1429
|
-
|
|
1548
|
+
chunkUPAJHMW3_cjs.assertActiveSchemaVersion(
|
|
1430
1549
|
params.graphId,
|
|
1431
1550
|
params.expectedVersion,
|
|
1432
1551
|
locked
|
|
@@ -1434,7 +1553,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1434
1553
|
return;
|
|
1435
1554
|
}
|
|
1436
1555
|
const settled = await commonBackend.getActiveSchema(params.graphId);
|
|
1437
|
-
throw new
|
|
1556
|
+
throw new chunkMRDBBHIZ_cjs.StaleVersionError({
|
|
1438
1557
|
graphId: params.graphId,
|
|
1439
1558
|
expected: params.expectedVersion,
|
|
1440
1559
|
actual: settled?.version ?? 0
|
|
@@ -1443,43 +1562,29 @@ function createPostgresOperationBackend(options) {
|
|
|
1443
1562
|
// === Vector Index Operations ===
|
|
1444
1563
|
async createVectorIndex(params) {
|
|
1445
1564
|
if (vectorStrategy === void 0) return;
|
|
1446
|
-
const slot =
|
|
1565
|
+
const slot = chunkUPAJHMW3_cjs.vectorSlotFromCreateIndexParams(params);
|
|
1447
1566
|
await contributionMaterializer.ensureVectorSlot(slot);
|
|
1448
1567
|
const indexStatement = vectorStrategy.buildCreateIndex?.(slot, {
|
|
1449
1568
|
concurrent: params.concurrent === true
|
|
1450
1569
|
});
|
|
1451
1570
|
if (indexStatement !== void 0) {
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
slot.fieldPath
|
|
1465
|
-
)
|
|
1466
|
-
);
|
|
1467
|
-
await execRun(
|
|
1468
|
-
chunk2ZWM2RFH_cjs.sql`ALTER TABLE ${table} SET (parallel_workers = 0)`
|
|
1469
|
-
);
|
|
1470
|
-
try {
|
|
1471
|
-
await execRun(indexStatement);
|
|
1472
|
-
} finally {
|
|
1473
|
-
await execRun(
|
|
1474
|
-
chunk2ZWM2RFH_cjs.sql`ALTER TABLE ${table} RESET (parallel_workers)`
|
|
1475
|
-
);
|
|
1476
|
-
}
|
|
1477
|
-
}
|
|
1571
|
+
const strategyTableName = vectorStrategy.tableName(
|
|
1572
|
+
slot.graphId,
|
|
1573
|
+
slot.nodeKind,
|
|
1574
|
+
slot.fieldPath
|
|
1575
|
+
);
|
|
1576
|
+
await runPostgresVectorIndexBuild(
|
|
1577
|
+
vectorStrategy,
|
|
1578
|
+
execRun,
|
|
1579
|
+
strategyTableName,
|
|
1580
|
+
indexStatement,
|
|
1581
|
+
vectorStrategy.buildDropIndex?.(slot)
|
|
1582
|
+
);
|
|
1478
1583
|
}
|
|
1479
1584
|
},
|
|
1480
1585
|
// === Fulltext Operations ===
|
|
1481
1586
|
async upsertFulltext(params) {
|
|
1482
|
-
const timestamp =
|
|
1587
|
+
const timestamp = chunkAMMWA76F_cjs.nowIso();
|
|
1483
1588
|
const statements = operationStrategy.buildUpsertFulltext(
|
|
1484
1589
|
params,
|
|
1485
1590
|
timestamp
|
|
@@ -1496,8 +1601,8 @@ function createPostgresOperationBackend(options) {
|
|
|
1496
1601
|
},
|
|
1497
1602
|
async upsertFulltextBatch(params) {
|
|
1498
1603
|
if (params.rows.length === 0) return;
|
|
1499
|
-
const timestamp =
|
|
1500
|
-
for (const rows of
|
|
1604
|
+
const timestamp = chunkAMMWA76F_cjs.nowIso();
|
|
1605
|
+
for (const rows of chunkJR6SX5RH_cjs.chunk(
|
|
1501
1606
|
params.rows,
|
|
1502
1607
|
batchConfig.fulltextUpsertBatchSize
|
|
1503
1608
|
)) {
|
|
@@ -1512,7 +1617,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1512
1617
|
},
|
|
1513
1618
|
async deleteFulltextBatch(params) {
|
|
1514
1619
|
if (params.nodeIds.length === 0) return;
|
|
1515
|
-
for (const nodeIds of
|
|
1620
|
+
for (const nodeIds of chunkJR6SX5RH_cjs.chunk(
|
|
1516
1621
|
params.nodeIds,
|
|
1517
1622
|
batchConfig.fulltextDeleteChunkSize
|
|
1518
1623
|
)) {
|
|
@@ -1530,25 +1635,25 @@ function createPostgresOperationBackend(options) {
|
|
|
1530
1635
|
const rows = await execAll(query);
|
|
1531
1636
|
return rows.map((row, index) => ({
|
|
1532
1637
|
nodeId: row.node_id,
|
|
1533
|
-
score:
|
|
1638
|
+
score: chunkAMMWA76F_cjs.coerceNumericScore(row.score),
|
|
1534
1639
|
rank: index + 1,
|
|
1535
1640
|
...row.snippet === null ? {} : { snippet: row.snippet }
|
|
1536
1641
|
}));
|
|
1537
1642
|
},
|
|
1538
1643
|
async dropVectorIndex(params) {
|
|
1539
1644
|
if (vectorStrategy === void 0) return;
|
|
1540
|
-
const slot =
|
|
1645
|
+
const slot = chunkUPAJHMW3_cjs.vectorSlotFromDropIndexParams(params);
|
|
1541
1646
|
const dropStatement = vectorStrategy.buildDropIndex?.(slot);
|
|
1542
1647
|
if (dropStatement === void 0) return;
|
|
1543
1648
|
try {
|
|
1544
1649
|
await execRun(dropStatement);
|
|
1545
1650
|
} catch (error) {
|
|
1546
|
-
if (!
|
|
1651
|
+
if (!chunkJR6SX5RH_cjs.isMissingTableError(error)) throw error;
|
|
1547
1652
|
}
|
|
1548
1653
|
},
|
|
1549
1654
|
// === Query Execution ===
|
|
1550
1655
|
async execute(query) {
|
|
1551
|
-
const annTypes =
|
|
1656
|
+
const annTypes = chunkEDN4Y4ZG_cjs.isSqlFragment(query) ? chunkEDN4Y4ZG_cjs.annIndexScanTypes(query) : void 0;
|
|
1552
1657
|
if (annTypes !== void 0 && vectorStrategy !== void 0) {
|
|
1553
1658
|
const overrides = [];
|
|
1554
1659
|
for (const indexType of annTypes) {
|
|
@@ -1589,5 +1694,5 @@ function createTransactionBackend(options) {
|
|
|
1589
1694
|
}
|
|
1590
1695
|
|
|
1591
1696
|
exports.createPostgresBackend = createPostgresBackend;
|
|
1592
|
-
//# sourceMappingURL=chunk-
|
|
1593
|
-
//# sourceMappingURL=chunk-
|
|
1697
|
+
//# sourceMappingURL=chunk-BCQ76AXA.cjs.map
|
|
1698
|
+
//# sourceMappingURL=chunk-BCQ76AXA.cjs.map
|