@nicia-ai/typegraph 0.46.1 → 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-NK5Q7UNE.cjs → chunk-26YKDNUD.cjs} +10 -10
- package/dist/{chunk-NK5Q7UNE.cjs.map → chunk-26YKDNUD.cjs.map} +1 -1
- package/dist/{chunk-PQBQG7IM.js → chunk-3DMMGT6S.js} +3 -3
- package/dist/{chunk-PQBQG7IM.js.map → chunk-3DMMGT6S.js.map} +1 -1
- package/dist/{chunk-XBYVV3MP.cjs → chunk-3HGRTCDU.cjs} +6 -4
- package/dist/chunk-3HGRTCDU.cjs.map +1 -0
- package/dist/{chunk-NFCVHQ5P.cjs → chunk-3U5ABFDW.cjs} +26 -26
- package/dist/{chunk-NFCVHQ5P.cjs.map → chunk-3U5ABFDW.cjs.map} +1 -1
- package/dist/{chunk-MCLYU6BN.cjs → chunk-425IZOQ5.cjs} +11 -164
- package/dist/chunk-425IZOQ5.cjs.map +1 -0
- package/dist/{chunk-M4BDU5RX.cjs → chunk-5FBRVORR.cjs} +12 -12
- package/dist/{chunk-M4BDU5RX.cjs.map → chunk-5FBRVORR.cjs.map} +1 -1
- package/dist/{chunk-C23WSN5E.js → chunk-5FT3TLPK.js} +20 -14
- package/dist/chunk-5FT3TLPK.js.map +1 -0
- package/dist/{chunk-YBFHZUXX.js → chunk-5UMTUOM5.js} +6 -6
- package/dist/{chunk-YBFHZUXX.js.map → chunk-5UMTUOM5.js.map} +1 -1
- package/dist/{chunk-HFHTMECK.js → chunk-6FWSNSRE.js} +7 -7
- package/dist/{chunk-HFHTMECK.js.map → chunk-6FWSNSRE.js.map} +1 -1
- package/dist/{chunk-65E3XWGF.cjs → chunk-6JVZSOHQ.cjs} +91 -91
- package/dist/{chunk-65E3XWGF.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-LBJKZXDE.cjs → chunk-6NGW27EO.cjs} +10 -10
- package/dist/{chunk-LBJKZXDE.cjs.map → chunk-6NGW27EO.cjs.map} +1 -1
- package/dist/{chunk-5UVRGXD3.js → chunk-6SWPJEYN.js} +5 -5
- package/dist/{chunk-5UVRGXD3.js.map → chunk-6SWPJEYN.js.map} +1 -1
- package/dist/{chunk-BKCUOV7A.js → chunk-7SQSZN2J.js} +5 -5
- package/dist/{chunk-BKCUOV7A.js.map → chunk-7SQSZN2J.js.map} +1 -1
- package/dist/{chunk-YAAM3M2S.cjs → chunk-AMMWA76F.cjs} +51 -59
- package/dist/chunk-AMMWA76F.cjs.map +1 -0
- package/dist/{chunk-62ZP23AW.cjs → chunk-AOSSQDVO.cjs} +13 -13
- package/dist/{chunk-62ZP23AW.cjs.map → chunk-AOSSQDVO.cjs.map} +1 -1
- package/dist/{chunk-NLI2AVEF.js → chunk-AVGUJWVX.js} +30 -10
- package/dist/chunk-AVGUJWVX.js.map +1 -0
- package/dist/{chunk-TQR4KBY2.cjs → chunk-BCQ76AXA.cjs} +262 -155
- package/dist/chunk-BCQ76AXA.cjs.map +1 -0
- package/dist/{chunk-CXBHOOIQ.cjs → chunk-BFUOME67.cjs} +11 -11
- package/dist/{chunk-CXBHOOIQ.cjs.map → chunk-BFUOME67.cjs.map} +1 -1
- package/dist/{chunk-PNTCATDE.cjs → chunk-BR7SHKGM.cjs} +1672 -1400
- package/dist/chunk-BR7SHKGM.cjs.map +1 -0
- package/dist/{chunk-ASTI57H3.js → chunk-CHAOFCHV.js} +3 -3
- package/dist/{chunk-ASTI57H3.js.map → chunk-CHAOFCHV.js.map} +1 -1
- package/dist/chunk-CICO5GXD.cjs +12 -0
- package/dist/{chunk-A4OC4DVN.cjs.map → chunk-CICO5GXD.cjs.map} +1 -1
- package/dist/{chunk-T4XNKYXB.js → chunk-D5R42W5D.js} +4 -4
- package/dist/{chunk-T4XNKYXB.js.map → chunk-D5R42W5D.js.map} +1 -1
- package/dist/{chunk-S6PW7VV5.js → chunk-DJZTXBWY.js} +410 -138
- package/dist/chunk-DJZTXBWY.js.map +1 -0
- package/dist/{chunk-UDISNXDL.cjs → chunk-DO7SAMEK.cjs} +47 -47
- package/dist/{chunk-UDISNXDL.cjs.map → chunk-DO7SAMEK.cjs.map} +1 -1
- package/dist/{chunk-VCRRKBLN.cjs → chunk-EDN4Y4ZG.cjs} +9 -9
- package/dist/{chunk-VCRRKBLN.cjs.map → chunk-EDN4Y4ZG.cjs.map} +1 -1
- package/dist/{chunk-YVWGEQJE.cjs → chunk-EMIB2RXD.cjs} +139 -133
- package/dist/chunk-EMIB2RXD.cjs.map +1 -0
- package/dist/{chunk-2Z2Z3ZD6.js → chunk-EP4RUYD6.js} +3 -3
- package/dist/{chunk-2Z2Z3ZD6.js.map → chunk-EP4RUYD6.js.map} +1 -1
- package/dist/{chunk-M3WP7RQZ.js → chunk-FNOMT74T.js} +10 -8
- package/dist/chunk-FNOMT74T.js.map +1 -0
- package/dist/{chunk-E4WNQBEF.cjs → chunk-FQPEMEWX.cjs} +12 -12
- package/dist/{chunk-E4WNQBEF.cjs.map → chunk-FQPEMEWX.cjs.map} +1 -1
- package/dist/{chunk-WDGA7IYB.js → chunk-GLHXM7C4.js} +3 -3
- package/dist/{chunk-WDGA7IYB.js.map → chunk-GLHXM7C4.js.map} +1 -1
- package/dist/{chunk-7BQXPCGN.cjs → chunk-GYEG3ZLZ.cjs} +10 -10
- package/dist/{chunk-7BQXPCGN.cjs.map → chunk-GYEG3ZLZ.cjs.map} +1 -1
- package/dist/{chunk-VLT6PEWR.cjs → chunk-GYUJZARH.cjs} +4 -4
- package/dist/{chunk-VLT6PEWR.cjs.map → chunk-GYUJZARH.cjs.map} +1 -1
- package/dist/{chunk-RMQLSPA2.cjs → chunk-HDL2ARHX.cjs} +27 -27
- package/dist/{chunk-RMQLSPA2.cjs.map → chunk-HDL2ARHX.cjs.map} +1 -1
- package/dist/{chunk-775A4ZMN.js → chunk-HEV35TGT.js} +4 -4
- package/dist/{chunk-775A4ZMN.js.map → chunk-HEV35TGT.js.map} +1 -1
- package/dist/{chunk-3DHZCOT7.cjs → chunk-I4G3SQPF.cjs} +20 -20
- package/dist/{chunk-3DHZCOT7.cjs.map → chunk-I4G3SQPF.cjs.map} +1 -1
- package/dist/{chunk-VGTJPTIC.js → chunk-JONXFAPO.js} +5 -5
- package/dist/{chunk-VGTJPTIC.js.map → chunk-JONXFAPO.js.map} +1 -1
- package/dist/{chunk-BSFJMMV3.cjs → chunk-JR6SX5RH.cjs} +4 -4
- package/dist/{chunk-BSFJMMV3.cjs.map → chunk-JR6SX5RH.cjs.map} +1 -1
- package/dist/{chunk-YBQOHKHN.cjs → chunk-KABFHAL7.cjs} +100 -99
- package/dist/chunk-KABFHAL7.cjs.map +1 -0
- package/dist/{chunk-7VQXLT5O.js → chunk-KH7XW7VV.js} +111 -27
- package/dist/chunk-KH7XW7VV.js.map +1 -0
- package/dist/{chunk-DCQVHAYQ.js → chunk-KKBDXCLQ.js} +4 -4
- package/dist/{chunk-DCQVHAYQ.js.map → chunk-KKBDXCLQ.js.map} +1 -1
- package/dist/{chunk-4UGOKMI5.cjs → chunk-L3LQNR34.cjs} +161 -161
- package/dist/{chunk-4UGOKMI5.cjs.map → chunk-L3LQNR34.cjs.map} +1 -1
- package/dist/{chunk-NMWDXFPH.js → chunk-LEWHMOUY.js} +46 -56
- package/dist/chunk-LEWHMOUY.js.map +1 -0
- package/dist/{chunk-U63GDNRC.cjs → chunk-LRQKXRXO.cjs} +4 -4
- package/dist/{chunk-U63GDNRC.cjs.map → chunk-LRQKXRXO.cjs.map} +1 -1
- package/dist/{chunk-5763DULU.js → chunk-M35DF33T.js} +147 -40
- package/dist/chunk-M35DF33T.js.map +1 -0
- package/dist/{chunk-Q3G6A4I3.cjs → chunk-MFZR4QKM.cjs} +30 -28
- package/dist/chunk-MFZR4QKM.cjs.map +1 -0
- package/dist/chunk-MKJ4KXL5.cjs +12 -0
- package/dist/{chunk-VQH4VAWD.cjs.map → chunk-MKJ4KXL5.cjs.map} +1 -1
- package/dist/{chunk-NI72YOJB.cjs → chunk-MRDBBHIZ.cjs} +70 -2
- package/dist/chunk-MRDBBHIZ.cjs.map +1 -0
- package/dist/{chunk-DTVWX77L.cjs → chunk-MX4DHSQP.cjs} +1023 -360
- package/dist/chunk-MX4DHSQP.cjs.map +1 -0
- package/dist/{chunk-2LG2XB2M.js → chunk-MYKHJI2J.js} +3 -3
- package/dist/{chunk-2LG2XB2M.js.map → chunk-MYKHJI2J.js.map} +1 -1
- package/dist/{chunk-JZUR7ZWE.js → chunk-NAZ2RA4L.js} +3 -3
- package/dist/{chunk-JZUR7ZWE.js.map → chunk-NAZ2RA4L.js.map} +1 -1
- package/dist/{chunk-XL7SLCXS.js → chunk-NG2RB5WL.js} +4 -145
- package/dist/chunk-NG2RB5WL.js.map +1 -0
- package/dist/{chunk-GF3KXUTW.js → chunk-NNQ6A3RM.js} +803 -143
- package/dist/chunk-NNQ6A3RM.js.map +1 -0
- package/dist/{chunk-MSY7FSX4.js → chunk-NVY5CJFP.js} +4 -4
- package/dist/{chunk-MSY7FSX4.js.map → chunk-NVY5CJFP.js.map} +1 -1
- package/dist/{chunk-XCAGZAKP.cjs → chunk-OI2GQ25X.cjs} +7 -7
- package/dist/{chunk-XCAGZAKP.cjs.map → chunk-OI2GQ25X.cjs.map} +1 -1
- package/dist/{chunk-PF6F5NLJ.cjs → chunk-OIFSOPSR.cjs} +259 -238
- package/dist/chunk-OIFSOPSR.cjs.map +1 -0
- package/dist/{chunk-UV3SN74I.js → chunk-OMZ37BM2.js} +5 -5
- package/dist/{chunk-UV3SN74I.js.map → chunk-OMZ37BM2.js.map} +1 -1
- package/dist/{chunk-PNN7RHVR.cjs → chunk-OORXGFL5.cjs} +48 -48
- package/dist/{chunk-PNN7RHVR.cjs.map → chunk-OORXGFL5.cjs.map} +1 -1
- package/dist/{chunk-YWGVVALJ.js → chunk-OVI7IXYX.js} +3 -3
- package/dist/{chunk-YWGVVALJ.js.map → chunk-OVI7IXYX.js.map} +1 -1
- package/dist/{chunk-I5MOXA4H.js → chunk-P6YLZTRE.js} +3 -3
- package/dist/{chunk-I5MOXA4H.js.map → chunk-P6YLZTRE.js.map} +1 -1
- package/dist/{chunk-WQZLUGVR.js → chunk-QS3NQZVC.js} +82 -16
- package/dist/chunk-QS3NQZVC.js.map +1 -0
- package/dist/{chunk-5262ZMTR.js → chunk-QTD6HX4O.js} +5 -5
- package/dist/{chunk-5262ZMTR.js.map → chunk-QTD6HX4O.js.map} +1 -1
- package/dist/{chunk-MXJDTH5B.cjs → chunk-ROR5ZR6A.cjs} +45 -45
- package/dist/{chunk-MXJDTH5B.cjs.map → chunk-ROR5ZR6A.cjs.map} +1 -1
- package/dist/{chunk-CBTIUB76.js → chunk-SDBBMD4N.js} +3 -3
- package/dist/{chunk-CBTIUB76.js.map → chunk-SDBBMD4N.js.map} +1 -1
- package/dist/{chunk-L65OU2U3.js → chunk-SE6EGQSD.js} +78 -16
- package/dist/chunk-SE6EGQSD.js.map +1 -0
- package/dist/{chunk-JXA2ZP2Q.js → chunk-SHFBB23Q.js} +4 -4
- package/dist/{chunk-JXA2ZP2Q.js.map → chunk-SHFBB23Q.js.map} +1 -1
- package/dist/{chunk-AKLS3BYZ.js → chunk-SHSSRCFR.js} +5 -3
- package/dist/chunk-SHSSRCFR.js.map +1 -0
- package/dist/{chunk-2NA5DYLO.cjs → chunk-TZEGUG6D.cjs} +4 -4
- package/dist/{chunk-2NA5DYLO.cjs.map → chunk-TZEGUG6D.cjs.map} +1 -1
- package/dist/{chunk-CMWHLBVN.cjs → chunk-U5EDAVOJ.cjs} +140 -74
- package/dist/chunk-U5EDAVOJ.cjs.map +1 -0
- package/dist/{chunk-MUK4BU7K.cjs → chunk-UPAJHMW3.cjs} +210 -126
- package/dist/chunk-UPAJHMW3.cjs.map +1 -0
- package/dist/{chunk-PT7RIRIZ.cjs → chunk-WGX7JH7E.cjs} +235 -170
- package/dist/chunk-WGX7JH7E.cjs.map +1 -0
- package/dist/{chunk-U5SON7R2.cjs → chunk-WODMN3Q2.cjs} +27 -27
- package/dist/{chunk-U5SON7R2.cjs.map → chunk-WODMN3Q2.cjs.map} +1 -1
- package/dist/{chunk-K5ELX2GT.js → chunk-XVWOYKIK.js} +3 -3
- package/dist/{chunk-K5ELX2GT.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-LGHCOKTT.js → chunk-XYBQI6LE.js} +14 -14
- package/dist/{chunk-LGHCOKTT.js.map → chunk-XYBQI6LE.js.map} +1 -1
- package/dist/{chunk-YDFDBE6D.js → chunk-ZDKTPBGV.js} +4 -4
- package/dist/{chunk-YDFDBE6D.js.map → chunk-ZDKTPBGV.js.map} +1 -1
- package/dist/{chunk-MZLPX2R7.js → chunk-ZHNXLS3C.js} +9 -8
- package/dist/chunk-ZHNXLS3C.js.map +1 -0
- package/dist/{chunk-J3WZ3FA2.js → chunk-ZLONH2UD.js} +67 -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-BXfGHbPN.d.ts → ddl-CprnMXJ-.d.ts} +3 -3
- package/dist/{ddl-BJcOp4WZ.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-BSHvKfok.d.ts → index-CHTv4XMZ.d.cts} +64 -3
- package/dist/{index-DxaYCv8Y.d.cts → index-CzoJ3MUw.d.ts} +64 -3
- package/dist/index.cjs +232 -215
- 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-CfZAimti.d.ts → manager-B6sOQzcQ.d.ts} +2 -2
- package/dist/{manager-HGk6E_HW.d.cts → manager-DlY1vlla.d.cts} +2 -2
- package/dist/{materialize-indexes-BMJP6Tms.d.ts → materialize-indexes-DQL4xcpf.d.ts} +1 -1
- package/dist/{materialize-indexes-6A7dWGtb.d.cts → materialize-indexes-sskhp-c_.d.cts} +1 -1
- package/dist/{postgres-DFYWENdR.d.cts → postgres-B6YOUcaK.d.ts} +1 -1
- package/dist/{postgres-e7a9TdvR.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-CIje5XYD.d.cts → searchable-0Cn_lY8U.d.cts} +1 -1
- package/dist/{searchable-9OQoPuRs.d.ts → searchable-D9gMiwcS.d.ts} +1 -1
- package/dist/{sqlite-DerU5tc7.d.ts → sqlite-ClXuBYAj.d.ts} +1 -1
- package/dist/{sqlite-DitnISa9.d.cts → sqlite-DioSxaPe.d.cts} +1 -1
- package/dist/{store-ClQ-MZQS.d.ts → store-5j-w5onJ.d.ts} +128 -69
- package/dist/{store-B0h6x7wo.d.cts → store-CFedKGU5.d.cts} +128 -69
- package/dist/{temporal-Bn-Fi8FJ.d.cts → temporal-Ce1pG0S1.d.cts} +1 -1
- package/dist/{temporal-BtM4UALv.d.ts → temporal-CjO9FH1l.d.ts} +1 -1
- package/dist/{types-KFfk-8Ah.d.ts → types-BrdOFu48.d.ts} +1 -1
- package/dist/{types-HkveCCx0.d.ts → types-DKkMJZjR.d.cts} +39 -12
- package/dist/{types-HkveCCx0.d.cts → types-DKkMJZjR.d.ts} +39 -12
- package/dist/{types-CoIx8HX5.d.cts → types-oj_OGAaZ.d.cts} +1 -1
- package/dist/{where-ws5hf-Ov.d.ts → where-C8w2627G.d.ts} +1 -1
- package/dist/{where--fk7_0kv.d.cts → where-D1wKCJ4Q.d.cts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-5763DULU.js.map +0 -1
- package/dist/chunk-7VQXLT5O.js.map +0 -1
- package/dist/chunk-A4OC4DVN.cjs +0 -12
- package/dist/chunk-AKLS3BYZ.js.map +0 -1
- package/dist/chunk-C23WSN5E.js.map +0 -1
- package/dist/chunk-CMWHLBVN.cjs.map +0 -1
- package/dist/chunk-DTVWX77L.cjs.map +0 -1
- package/dist/chunk-GF3KXUTW.js.map +0 -1
- package/dist/chunk-J3WZ3FA2.js.map +0 -1
- package/dist/chunk-L65OU2U3.js.map +0 -1
- package/dist/chunk-M3WP7RQZ.js.map +0 -1
- package/dist/chunk-MCLYU6BN.cjs.map +0 -1
- package/dist/chunk-MUK4BU7K.cjs.map +0 -1
- package/dist/chunk-MZLPX2R7.js.map +0 -1
- package/dist/chunk-NI72YOJB.cjs.map +0 -1
- package/dist/chunk-NLI2AVEF.js.map +0 -1
- package/dist/chunk-NMWDXFPH.js.map +0 -1
- package/dist/chunk-PF6F5NLJ.cjs.map +0 -1
- package/dist/chunk-PNTCATDE.cjs.map +0 -1
- package/dist/chunk-PT7RIRIZ.cjs.map +0 -1
- package/dist/chunk-Q3G6A4I3.cjs.map +0 -1
- package/dist/chunk-S6PW7VV5.js.map +0 -1
- package/dist/chunk-TQR4KBY2.cjs.map +0 -1
- package/dist/chunk-VQH4VAWD.cjs +0 -12
- package/dist/chunk-WQZLUGVR.js.map +0 -1
- package/dist/chunk-XBYVV3MP.cjs.map +0 -1
- package/dist/chunk-XL7SLCXS.js.map +0 -1
- package/dist/chunk-YAAM3M2S.cjs.map +0 -1
- package/dist/chunk-YBQOHKHN.cjs.map +0 -1
- package/dist/chunk-YVWGEQJE.cjs.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,9 +746,10 @@ 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
|
-
contributionMaterializer.assertInitialized
|
|
751
|
+
contributionMaterializer.assertInitialized,
|
|
752
|
+
contributionMaterializer.refuseUnavailableFulltext
|
|
645
753
|
),
|
|
646
754
|
drainAndClose
|
|
647
755
|
};
|
|
@@ -662,33 +770,33 @@ function createPostgresBackend(db, options = {}) {
|
|
|
662
770
|
);
|
|
663
771
|
const executeCompiled = trustedExecutionAdapter.executeCompiled;
|
|
664
772
|
if (executeCompiled === void 0) {
|
|
665
|
-
throw new
|
|
773
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
666
774
|
"Trusted import could not bind raw execution to the PostgreSQL transaction.",
|
|
667
775
|
{ capability: "trustedImport", dialect: "postgres" }
|
|
668
776
|
);
|
|
669
777
|
}
|
|
670
|
-
const trustedTx =
|
|
778
|
+
const trustedTx = chunk3HGRTCDU_cjs.createBackendOverlay(tx, {
|
|
671
779
|
executeRaw(sqlText, params) {
|
|
672
780
|
return executeCompiled({ params, sql: sqlText });
|
|
673
781
|
}
|
|
674
782
|
});
|
|
675
|
-
await
|
|
676
|
-
await
|
|
677
|
-
const indexDefinitions = await
|
|
783
|
+
await chunkUPAJHMW3_cjs.lockPostgresTrustedImportTables(trustedTx, tableNames);
|
|
784
|
+
await chunkUPAJHMW3_cjs.assertTrustedImportDatabaseEmpty(trustedTx, tableNames);
|
|
785
|
+
const indexDefinitions = await chunkUPAJHMW3_cjs.suspendPostgresSecondaryIndexes(
|
|
678
786
|
trustedTx,
|
|
679
787
|
tableNames
|
|
680
788
|
);
|
|
681
789
|
const result = await fn(
|
|
682
|
-
|
|
790
|
+
chunkUPAJHMW3_cjs.createPostgresTrustedImportSession(trustedTx, tableNames)
|
|
683
791
|
);
|
|
684
|
-
await
|
|
685
|
-
await
|
|
792
|
+
await chunkUPAJHMW3_cjs.restoreSecondaryIndexes(trustedTx, indexDefinitions);
|
|
793
|
+
await chunkUPAJHMW3_cjs.analyzeImportedTables(trustedTx, tableNames);
|
|
686
794
|
return result;
|
|
687
795
|
});
|
|
688
796
|
}
|
|
689
797
|
} : {},
|
|
690
798
|
async bootstrapTables() {
|
|
691
|
-
const statements =
|
|
799
|
+
const statements = chunkHDL2ARHX_cjs.generatePostgresDDL(tables2, fulltextStrategy);
|
|
692
800
|
for (const statement of statements) {
|
|
693
801
|
await executeConcurrentCreateDdl(statement);
|
|
694
802
|
}
|
|
@@ -723,9 +831,10 @@ function createPostgresBackend(db, options = {}) {
|
|
|
723
831
|
// uninitialized database throws `StoreNotInitializedError` loudly
|
|
724
832
|
// rather than self-healing on a read/write path (#135). Shared
|
|
725
833
|
// verbatim with the tx-scoped gate via `gateFulltextMethods`.
|
|
726
|
-
...
|
|
834
|
+
...chunkUPAJHMW3_cjs.gateFulltextMethods(
|
|
727
835
|
operations,
|
|
728
|
-
contributionMaterializer.assertInitialized
|
|
836
|
+
contributionMaterializer.assertInitialized,
|
|
837
|
+
contributionMaterializer.refuseUnavailableFulltext
|
|
729
838
|
),
|
|
730
839
|
async executeDdl(ddl) {
|
|
731
840
|
await db.execute(drizzleOrm.sql.raw(ddl));
|
|
@@ -740,6 +849,18 @@ function createPostgresBackend(db, options = {}) {
|
|
|
740
849
|
`ALTER TABLE "${tableName}" ADD COLUMN IF NOT EXISTS "claim_token" text;`
|
|
741
850
|
);
|
|
742
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
|
+
},
|
|
743
864
|
async claimIndexMaterialization(params) {
|
|
744
865
|
const t = tables2.indexMaterializations;
|
|
745
866
|
const rows = await db.execute(drizzleOrm.sql`
|
|
@@ -778,26 +899,26 @@ function createPostgresBackend(db, options = {}) {
|
|
|
778
899
|
const rows = await db.select().from(t).where(drizzleOrm.eq(t.indexName, indexName));
|
|
779
900
|
const row = rows[0];
|
|
780
901
|
if (row === void 0) return void 0;
|
|
781
|
-
return
|
|
902
|
+
return chunkUPAJHMW3_cjs.mapMaterializationRow(row, chunkUPAJHMW3_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.decode);
|
|
782
903
|
},
|
|
783
904
|
async getIndexMaterializations(statusKeys) {
|
|
784
905
|
if (statusKeys.length === 0) return [];
|
|
785
906
|
const t = tables2.indexMaterializations;
|
|
786
907
|
const rows = await db.select().from(t).where(drizzleOrm.inArray(t.indexName, [...statusKeys]));
|
|
787
908
|
return rows.map(
|
|
788
|
-
(row) =>
|
|
909
|
+
(row) => chunkUPAJHMW3_cjs.mapMaterializationRow(row, chunkUPAJHMW3_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.decode)
|
|
789
910
|
);
|
|
790
911
|
},
|
|
791
912
|
async recordIndexMaterialization(params) {
|
|
792
913
|
const t = tables2.indexMaterializations;
|
|
793
914
|
await db.insert(t).values(
|
|
794
|
-
|
|
915
|
+
chunkUPAJHMW3_cjs.buildMaterializationInsertValues(
|
|
795
916
|
params,
|
|
796
|
-
|
|
917
|
+
chunkUPAJHMW3_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.encode
|
|
797
918
|
)
|
|
798
919
|
).onConflictDoUpdate({
|
|
799
920
|
target: t.indexName,
|
|
800
|
-
set:
|
|
921
|
+
set: chunkUPAJHMW3_cjs.buildMaterializationOnConflictSet(params.materializedAt)
|
|
801
922
|
});
|
|
802
923
|
},
|
|
803
924
|
async ensureContributionMaterializationsTable() {
|
|
@@ -819,26 +940,26 @@ function createPostgresBackend(db, options = {}) {
|
|
|
819
940
|
const t = tables2.kindRemovals;
|
|
820
941
|
const rows = await db.select().from(t).where(drizzleOrm.and(drizzleOrm.eq(t.graphId, graphId), drizzleOrm.isNull(t.removedAt)));
|
|
821
942
|
return rows.map(
|
|
822
|
-
(row) =>
|
|
943
|
+
(row) => chunkUPAJHMW3_cjs.mapKindRemovalRow(row, chunkUPAJHMW3_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.decode)
|
|
823
944
|
);
|
|
824
945
|
},
|
|
825
946
|
async getAllKindRemovals(graphId) {
|
|
826
947
|
const t = tables2.kindRemovals;
|
|
827
948
|
const rows = await db.select().from(t).where(drizzleOrm.eq(t.graphId, graphId));
|
|
828
949
|
return rows.map(
|
|
829
|
-
(row) =>
|
|
950
|
+
(row) => chunkUPAJHMW3_cjs.mapKindRemovalRow(row, chunkUPAJHMW3_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.decode)
|
|
830
951
|
);
|
|
831
952
|
},
|
|
832
953
|
async recordKindRemoval(params) {
|
|
833
954
|
const t = tables2.kindRemovals;
|
|
834
955
|
await db.insert(t).values(
|
|
835
|
-
|
|
956
|
+
chunkUPAJHMW3_cjs.buildKindRemovalInsertValues(
|
|
836
957
|
params,
|
|
837
|
-
|
|
958
|
+
chunkUPAJHMW3_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.encode
|
|
838
959
|
)
|
|
839
960
|
).onConflictDoUpdate({
|
|
840
961
|
target: [t.graphId, t.kindName, t.entity, t.schemaVersion],
|
|
841
|
-
set:
|
|
962
|
+
set: chunkUPAJHMW3_cjs.buildKindRemovalOnConflictSet(t.removedAt, params.removedAt)
|
|
842
963
|
});
|
|
843
964
|
},
|
|
844
965
|
async ensureReconciliationMarkersTable() {
|
|
@@ -917,8 +1038,8 @@ function createPostgresBackend(db, options = {}) {
|
|
|
917
1038
|
const presentGuardedTables = tablePresence.filter((entry) => entry.exists).map((entry) => entry.tableName);
|
|
918
1039
|
for (const tableName of presentGuardedTables) {
|
|
919
1040
|
await db.execute(
|
|
920
|
-
|
|
921
|
-
|
|
1041
|
+
chunkWODMN3Q2_cjs.toDrizzleSql(
|
|
1042
|
+
chunkEDN4Y4ZG_cjs.sql`ANALYZE (SKIP_LOCKED) ${chunkEDN4Y4ZG_cjs.sql.identifier(tableName)}`,
|
|
922
1043
|
"postgres"
|
|
923
1044
|
)
|
|
924
1045
|
);
|
|
@@ -933,7 +1054,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
933
1054
|
async commitSchemaVersionIfKindsEmpty(params, probes) {
|
|
934
1055
|
return runSchemaWriteTransaction(
|
|
935
1056
|
params.graphId,
|
|
936
|
-
(target) =>
|
|
1057
|
+
(target) => chunkUPAJHMW3_cjs.commitSchemaVersionIfKindsEmpty(target, params, probes)
|
|
937
1058
|
);
|
|
938
1059
|
},
|
|
939
1060
|
async commitSchemaVersionWithPreflight(params, preflight) {
|
|
@@ -955,9 +1076,9 @@ function createPostgresBackend(db, options = {}) {
|
|
|
955
1076
|
return backend.transactionWithNative((tx) => fn(tx), options2);
|
|
956
1077
|
},
|
|
957
1078
|
async transactionWithNative(fn, options2) {
|
|
958
|
-
const temporaryWrites = options2?.temporaryWrites ===
|
|
1079
|
+
const temporaryWrites = options2?.temporaryWrites === chunk3HGRTCDU_cjs.INTERNAL_TEMPORARY_WRITES;
|
|
959
1080
|
if (temporaryWrites && options2.accessMode !== "read_only") {
|
|
960
|
-
throw new
|
|
1081
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
961
1082
|
"Temporary-write transactions must be semantically read-only.",
|
|
962
1083
|
{ dialect: "postgres" }
|
|
963
1084
|
);
|
|
@@ -981,7 +1102,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
981
1102
|
},
|
|
982
1103
|
adoptTransaction(externalTx) {
|
|
983
1104
|
if (!capabilities.transactions) {
|
|
984
|
-
throw new
|
|
1105
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
985
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.",
|
|
986
1107
|
{
|
|
987
1108
|
backend: "postgres",
|
|
@@ -990,7 +1111,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
990
1111
|
}
|
|
991
1112
|
);
|
|
992
1113
|
}
|
|
993
|
-
|
|
1114
|
+
chunkUPAJHMW3_cjs.assertAdoptedDialect(
|
|
994
1115
|
externalTx,
|
|
995
1116
|
pgCore.PgTransaction,
|
|
996
1117
|
"postgres"
|
|
@@ -1001,7 +1122,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
1001
1122
|
}
|
|
1002
1123
|
};
|
|
1003
1124
|
if (serializedClient !== void 0) {
|
|
1004
|
-
|
|
1125
|
+
chunk3HGRTCDU_cjs.markSerializedTransactionResource(backend, serializedClient);
|
|
1005
1126
|
}
|
|
1006
1127
|
return backend;
|
|
1007
1128
|
}
|
|
@@ -1099,10 +1220,10 @@ function createPostgresOperationBackend(options) {
|
|
|
1099
1220
|
}
|
|
1100
1221
|
async function vectorSearchGucOverrides(params) {
|
|
1101
1222
|
const overrides = [];
|
|
1102
|
-
const efSearchParameter =
|
|
1223
|
+
const efSearchParameter = chunkL3LQNR34_cjs.resolveEfSearchOverride({
|
|
1103
1224
|
efSearch: params.efSearch,
|
|
1104
1225
|
indexType: params.indexType,
|
|
1105
|
-
tuning:
|
|
1226
|
+
tuning: chunkL3LQNR34_cjs.vectorSearchFrontierTuning(vectorStrategy),
|
|
1106
1227
|
transactions: capabilities.transactions,
|
|
1107
1228
|
dialect: "PostgreSQL",
|
|
1108
1229
|
engine: vectorStrategy?.name ?? "this backend"
|
|
@@ -1127,7 +1248,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1127
1248
|
async function runVectorSearchGucGroup(overrides, query) {
|
|
1128
1249
|
const runExclusive = executionAdapter.runExclusive;
|
|
1129
1250
|
if (runExclusive === void 0) {
|
|
1130
|
-
throw new
|
|
1251
|
+
throw new chunkMRDBBHIZ_cjs.CompilerInvariantError(
|
|
1131
1252
|
"A transaction-scoped Postgres backend must expose runExclusive; its execution adapter was not wrapped by createSerialExecutionAdapter."
|
|
1132
1253
|
);
|
|
1133
1254
|
}
|
|
@@ -1171,17 +1292,17 @@ function createPostgresOperationBackend(options) {
|
|
|
1171
1292
|
});
|
|
1172
1293
|
}
|
|
1173
1294
|
const batchConfig = computePostgresBatchChunkSizes(
|
|
1174
|
-
capabilities.maxBindParameters ??
|
|
1295
|
+
capabilities.maxBindParameters ?? chunk3HGRTCDU_cjs.POSTGRES_MAX_BIND_PARAMETERS
|
|
1175
1296
|
);
|
|
1176
|
-
const commonBackend =
|
|
1297
|
+
const commonBackend = chunkUPAJHMW3_cjs.createCommonOperationBackend({
|
|
1177
1298
|
batchConfig,
|
|
1178
1299
|
execution: {
|
|
1179
1300
|
execAll,
|
|
1180
1301
|
execGet,
|
|
1181
1302
|
execRun
|
|
1182
1303
|
},
|
|
1183
|
-
nowIso:
|
|
1184
|
-
maxBindParameters: capabilities.maxBindParameters ??
|
|
1304
|
+
nowIso: chunkAMMWA76F_cjs.nowIso,
|
|
1305
|
+
maxBindParameters: capabilities.maxBindParameters ?? chunk3HGRTCDU_cjs.POSTGRES_MAX_BIND_PARAMETERS,
|
|
1185
1306
|
operationStrategy,
|
|
1186
1307
|
rowMappers: {
|
|
1187
1308
|
toEdgeRow,
|
|
@@ -1199,28 +1320,28 @@ function createPostgresOperationBackend(options) {
|
|
|
1199
1320
|
};
|
|
1200
1321
|
const vectorEmbeddingMethods = vectorStrategy === void 0 ? {} : {
|
|
1201
1322
|
async upsertEmbedding(params) {
|
|
1202
|
-
const slot =
|
|
1323
|
+
const slot = chunkUPAJHMW3_cjs.vectorSlotFromParams(params);
|
|
1203
1324
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1204
|
-
const statements = vectorStrategy.buildUpsert(slot, params,
|
|
1325
|
+
const statements = vectorStrategy.buildUpsert(slot, params, chunkAMMWA76F_cjs.nowIso());
|
|
1205
1326
|
try {
|
|
1206
1327
|
for (const statement of statements) {
|
|
1207
1328
|
await execRun(statement);
|
|
1208
1329
|
}
|
|
1209
1330
|
} catch (error) {
|
|
1210
|
-
throw
|
|
1331
|
+
throw chunkUPAJHMW3_cjs.mapVectorWriteError(error, params);
|
|
1211
1332
|
}
|
|
1212
1333
|
},
|
|
1213
1334
|
async upsertEmbeddingBatch(params) {
|
|
1214
1335
|
if (params.rows.length === 0) return;
|
|
1215
|
-
const slot =
|
|
1336
|
+
const slot = chunkUPAJHMW3_cjs.vectorSlotFromParams(params);
|
|
1216
1337
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1217
1338
|
const rowsById = new Map(
|
|
1218
1339
|
params.rows.map((row) => [row.nodeId, row])
|
|
1219
1340
|
);
|
|
1220
1341
|
const rows = [...rowsById.values()];
|
|
1221
|
-
const timestamp =
|
|
1342
|
+
const timestamp = chunkAMMWA76F_cjs.nowIso();
|
|
1222
1343
|
try {
|
|
1223
|
-
for (const chunk2 of
|
|
1344
|
+
for (const chunk2 of chunkJR6SX5RH_cjs.chunk(
|
|
1224
1345
|
rows,
|
|
1225
1346
|
batchConfig.embeddingUpsertBatchSize
|
|
1226
1347
|
)) {
|
|
@@ -1249,11 +1370,11 @@ function createPostgresOperationBackend(options) {
|
|
|
1249
1370
|
}
|
|
1250
1371
|
}
|
|
1251
1372
|
} catch (error) {
|
|
1252
|
-
throw
|
|
1373
|
+
throw chunkUPAJHMW3_cjs.mapVectorWriteError(error, params);
|
|
1253
1374
|
}
|
|
1254
1375
|
},
|
|
1255
1376
|
async deleteEmbedding(params) {
|
|
1256
|
-
const slot =
|
|
1377
|
+
const slot = chunkUPAJHMW3_cjs.vectorSlotFromParams(params);
|
|
1257
1378
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1258
1379
|
const statements = vectorStrategy.buildDelete(slot, params);
|
|
1259
1380
|
for (const statement of statements) {
|
|
@@ -1262,9 +1383,9 @@ function createPostgresOperationBackend(options) {
|
|
|
1262
1383
|
},
|
|
1263
1384
|
async deleteEmbeddingBatch(params) {
|
|
1264
1385
|
if (params.nodeIds.length === 0) return;
|
|
1265
|
-
const slot =
|
|
1386
|
+
const slot = chunkUPAJHMW3_cjs.vectorSlotFromParams(params);
|
|
1266
1387
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1267
|
-
for (const nodeIds of
|
|
1388
|
+
for (const nodeIds of chunkJR6SX5RH_cjs.chunk(
|
|
1268
1389
|
[...new Set(params.nodeIds)],
|
|
1269
1390
|
batchConfig.embeddingUpsertBatchSize
|
|
1270
1391
|
)) {
|
|
@@ -1276,19 +1397,19 @@ function createPostgresOperationBackend(options) {
|
|
|
1276
1397
|
}
|
|
1277
1398
|
},
|
|
1278
1399
|
async vectorSearch(params) {
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
const slot =
|
|
1400
|
+
chunkL3LQNR34_cjs.assertVectorSearchLimit(params.limit);
|
|
1401
|
+
chunkROR5ZR6A_cjs.assertPgvectorEfSearch(params.efSearch);
|
|
1402
|
+
const slot = chunkUPAJHMW3_cjs.vectorSlotFromParams(params);
|
|
1282
1403
|
const query = vectorStrategy.buildSearch(
|
|
1283
1404
|
slot,
|
|
1284
1405
|
params,
|
|
1285
1406
|
// Store-compiled candidates (predicates + subclass + currency)
|
|
1286
1407
|
// take precedence; the live-node default covers direct backend use.
|
|
1287
|
-
params.candidates ??
|
|
1408
|
+
params.candidates ?? chunkUPAJHMW3_cjs.buildLiveNodeCandidates(
|
|
1288
1409
|
tableNames.nodes,
|
|
1289
1410
|
params.graphId,
|
|
1290
1411
|
params.nodeKind,
|
|
1291
|
-
|
|
1412
|
+
chunkAMMWA76F_cjs.nowIso()
|
|
1292
1413
|
)
|
|
1293
1414
|
);
|
|
1294
1415
|
const gucOverrides = await vectorSearchGucOverrides(params);
|
|
@@ -1296,7 +1417,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1296
1417
|
try {
|
|
1297
1418
|
rows = await runVectorSearch(gucOverrides, query);
|
|
1298
1419
|
} catch (error) {
|
|
1299
|
-
throw
|
|
1420
|
+
throw chunkUPAJHMW3_cjs.mapVectorWriteError(error, params);
|
|
1300
1421
|
}
|
|
1301
1422
|
return rows.map((row) => ({
|
|
1302
1423
|
nodeId: row.node_id,
|
|
@@ -1308,10 +1429,10 @@ function createPostgresOperationBackend(options) {
|
|
|
1308
1429
|
// multi-statement fallback by simply not exposing the member.
|
|
1309
1430
|
...capabilities.windowFunctions ? {
|
|
1310
1431
|
async hybridSearch(params) {
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
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({
|
|
1315
1436
|
graphId: params.graphId,
|
|
1316
1437
|
nodeKind: params.nodeKind,
|
|
1317
1438
|
fieldPath: params.vector.fieldPath,
|
|
@@ -1319,11 +1440,11 @@ function createPostgresOperationBackend(options) {
|
|
|
1319
1440
|
metric: params.vector.metric,
|
|
1320
1441
|
indexType: params.vector.indexType
|
|
1321
1442
|
});
|
|
1322
|
-
const candidates = params.candidates ??
|
|
1443
|
+
const candidates = params.candidates ?? chunkUPAJHMW3_cjs.buildLiveNodeCandidates(
|
|
1323
1444
|
tableNames.nodes,
|
|
1324
1445
|
params.graphId,
|
|
1325
1446
|
params.nodeKind,
|
|
1326
|
-
|
|
1447
|
+
chunkAMMWA76F_cjs.nowIso()
|
|
1327
1448
|
);
|
|
1328
1449
|
const vectorParams = {
|
|
1329
1450
|
graphId: params.graphId,
|
|
@@ -1339,11 +1460,11 @@ function createPostgresOperationBackend(options) {
|
|
|
1339
1460
|
const vectorSql = vectorStrategy.buildSearch(
|
|
1340
1461
|
slot,
|
|
1341
1462
|
vectorParams,
|
|
1342
|
-
|
|
1463
|
+
chunkEDN4Y4ZG_cjs.sql.raw("SELECT node_id FROM tg_hybrid_cand")
|
|
1343
1464
|
);
|
|
1344
1465
|
const statement = operationStrategy.buildHybridSearch(
|
|
1345
1466
|
{ ...params, candidates },
|
|
1346
|
-
|
|
1467
|
+
chunkWODMN3Q2_cjs.toDrizzleSql(vectorSql, "postgres"),
|
|
1347
1468
|
params.vector.metric === "cosine"
|
|
1348
1469
|
);
|
|
1349
1470
|
const gucOverrides = await vectorSearchGucOverrides({
|
|
@@ -1357,9 +1478,9 @@ function createPostgresOperationBackend(options) {
|
|
|
1357
1478
|
statement
|
|
1358
1479
|
);
|
|
1359
1480
|
} catch (error) {
|
|
1360
|
-
throw
|
|
1481
|
+
throw chunkUPAJHMW3_cjs.mapVectorWriteError(error, vectorParams);
|
|
1361
1482
|
}
|
|
1362
|
-
return raw.map((row) =>
|
|
1483
|
+
return raw.map((row) => chunkUPAJHMW3_cjs.mapHybridSearchRow(row, toNodeRow));
|
|
1363
1484
|
}
|
|
1364
1485
|
} : {}
|
|
1365
1486
|
};
|
|
@@ -1414,7 +1535,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1414
1535
|
tableNames,
|
|
1415
1536
|
async lockSchemaVersionForWrite(params) {
|
|
1416
1537
|
if (!transactionScoped) {
|
|
1417
|
-
throw new
|
|
1538
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
1418
1539
|
"The schema write fence requires an explicit PostgreSQL transaction.",
|
|
1419
1540
|
{
|
|
1420
1541
|
code: "SCHEMA_WRITE_FENCE_TRANSACTION_REQUIRED",
|
|
@@ -1424,7 +1545,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1424
1545
|
}
|
|
1425
1546
|
const locked = await lockActiveSchemaVersion(params.graphId);
|
|
1426
1547
|
if (locked !== void 0) {
|
|
1427
|
-
|
|
1548
|
+
chunkUPAJHMW3_cjs.assertActiveSchemaVersion(
|
|
1428
1549
|
params.graphId,
|
|
1429
1550
|
params.expectedVersion,
|
|
1430
1551
|
locked
|
|
@@ -1432,7 +1553,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1432
1553
|
return;
|
|
1433
1554
|
}
|
|
1434
1555
|
const settled = await commonBackend.getActiveSchema(params.graphId);
|
|
1435
|
-
throw new
|
|
1556
|
+
throw new chunkMRDBBHIZ_cjs.StaleVersionError({
|
|
1436
1557
|
graphId: params.graphId,
|
|
1437
1558
|
expected: params.expectedVersion,
|
|
1438
1559
|
actual: settled?.version ?? 0
|
|
@@ -1441,43 +1562,29 @@ function createPostgresOperationBackend(options) {
|
|
|
1441
1562
|
// === Vector Index Operations ===
|
|
1442
1563
|
async createVectorIndex(params) {
|
|
1443
1564
|
if (vectorStrategy === void 0) return;
|
|
1444
|
-
const slot =
|
|
1565
|
+
const slot = chunkUPAJHMW3_cjs.vectorSlotFromCreateIndexParams(params);
|
|
1445
1566
|
await contributionMaterializer.ensureVectorSlot(slot);
|
|
1446
1567
|
const indexStatement = vectorStrategy.buildCreateIndex?.(slot, {
|
|
1447
1568
|
concurrent: params.concurrent === true
|
|
1448
1569
|
});
|
|
1449
1570
|
if (indexStatement !== void 0) {
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
slot.fieldPath
|
|
1463
|
-
)
|
|
1464
|
-
);
|
|
1465
|
-
await execRun(
|
|
1466
|
-
chunkVCRRKBLN_cjs.sql`ALTER TABLE ${table} SET (parallel_workers = 0)`
|
|
1467
|
-
);
|
|
1468
|
-
try {
|
|
1469
|
-
await execRun(indexStatement);
|
|
1470
|
-
} finally {
|
|
1471
|
-
await execRun(
|
|
1472
|
-
chunkVCRRKBLN_cjs.sql`ALTER TABLE ${table} RESET (parallel_workers)`
|
|
1473
|
-
);
|
|
1474
|
-
}
|
|
1475
|
-
}
|
|
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
|
+
);
|
|
1476
1583
|
}
|
|
1477
1584
|
},
|
|
1478
1585
|
// === Fulltext Operations ===
|
|
1479
1586
|
async upsertFulltext(params) {
|
|
1480
|
-
const timestamp =
|
|
1587
|
+
const timestamp = chunkAMMWA76F_cjs.nowIso();
|
|
1481
1588
|
const statements = operationStrategy.buildUpsertFulltext(
|
|
1482
1589
|
params,
|
|
1483
1590
|
timestamp
|
|
@@ -1494,8 +1601,8 @@ function createPostgresOperationBackend(options) {
|
|
|
1494
1601
|
},
|
|
1495
1602
|
async upsertFulltextBatch(params) {
|
|
1496
1603
|
if (params.rows.length === 0) return;
|
|
1497
|
-
const timestamp =
|
|
1498
|
-
for (const rows of
|
|
1604
|
+
const timestamp = chunkAMMWA76F_cjs.nowIso();
|
|
1605
|
+
for (const rows of chunkJR6SX5RH_cjs.chunk(
|
|
1499
1606
|
params.rows,
|
|
1500
1607
|
batchConfig.fulltextUpsertBatchSize
|
|
1501
1608
|
)) {
|
|
@@ -1510,7 +1617,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1510
1617
|
},
|
|
1511
1618
|
async deleteFulltextBatch(params) {
|
|
1512
1619
|
if (params.nodeIds.length === 0) return;
|
|
1513
|
-
for (const nodeIds of
|
|
1620
|
+
for (const nodeIds of chunkJR6SX5RH_cjs.chunk(
|
|
1514
1621
|
params.nodeIds,
|
|
1515
1622
|
batchConfig.fulltextDeleteChunkSize
|
|
1516
1623
|
)) {
|
|
@@ -1528,25 +1635,25 @@ function createPostgresOperationBackend(options) {
|
|
|
1528
1635
|
const rows = await execAll(query);
|
|
1529
1636
|
return rows.map((row, index) => ({
|
|
1530
1637
|
nodeId: row.node_id,
|
|
1531
|
-
score:
|
|
1638
|
+
score: chunkAMMWA76F_cjs.coerceNumericScore(row.score),
|
|
1532
1639
|
rank: index + 1,
|
|
1533
1640
|
...row.snippet === null ? {} : { snippet: row.snippet }
|
|
1534
1641
|
}));
|
|
1535
1642
|
},
|
|
1536
1643
|
async dropVectorIndex(params) {
|
|
1537
1644
|
if (vectorStrategy === void 0) return;
|
|
1538
|
-
const slot =
|
|
1645
|
+
const slot = chunkUPAJHMW3_cjs.vectorSlotFromDropIndexParams(params);
|
|
1539
1646
|
const dropStatement = vectorStrategy.buildDropIndex?.(slot);
|
|
1540
1647
|
if (dropStatement === void 0) return;
|
|
1541
1648
|
try {
|
|
1542
1649
|
await execRun(dropStatement);
|
|
1543
1650
|
} catch (error) {
|
|
1544
|
-
if (!
|
|
1651
|
+
if (!chunkJR6SX5RH_cjs.isMissingTableError(error)) throw error;
|
|
1545
1652
|
}
|
|
1546
1653
|
},
|
|
1547
1654
|
// === Query Execution ===
|
|
1548
1655
|
async execute(query) {
|
|
1549
|
-
const annTypes =
|
|
1656
|
+
const annTypes = chunkEDN4Y4ZG_cjs.isSqlFragment(query) ? chunkEDN4Y4ZG_cjs.annIndexScanTypes(query) : void 0;
|
|
1550
1657
|
if (annTypes !== void 0 && vectorStrategy !== void 0) {
|
|
1551
1658
|
const overrides = [];
|
|
1552
1659
|
for (const indexType of annTypes) {
|
|
@@ -1587,5 +1694,5 @@ function createTransactionBackend(options) {
|
|
|
1587
1694
|
}
|
|
1588
1695
|
|
|
1589
1696
|
exports.createPostgresBackend = createPostgresBackend;
|
|
1590
|
-
//# sourceMappingURL=chunk-
|
|
1591
|
-
//# sourceMappingURL=chunk-
|
|
1697
|
+
//# sourceMappingURL=chunk-BCQ76AXA.cjs.map
|
|
1698
|
+
//# sourceMappingURL=chunk-BCQ76AXA.cjs.map
|