@nicia-ai/typegraph 0.46.2 → 0.48.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 +58 -49
- package/dist/backend/index.d.cts +37 -55
- package/dist/backend/index.d.ts +37 -55
- package/dist/backend/index.js +11 -10
- package/dist/backend/postgres/index.cjs +27 -26
- package/dist/backend/postgres/index.d.cts +21 -7
- package/dist/backend/postgres/index.d.ts +21 -7
- 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 +20 -7
- package/dist/backend/sqlite/index.d.ts +20 -7
- 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-E4OSGBCM.cjs → chunk-2HIYYMWY.cjs} +139 -136
- package/dist/chunk-2HIYYMWY.cjs.map +1 -0
- package/dist/chunk-2QGYQBS2.cjs +161 -0
- package/dist/chunk-2QGYQBS2.cjs.map +1 -0
- package/dist/{chunk-GWXXHOLU.js → chunk-2SYZXD54.js} +21 -18
- package/dist/chunk-2SYZXD54.js.map +1 -0
- package/dist/{chunk-KA4L2NZ3.js → chunk-2TYSSBU5.js} +14 -14
- package/dist/{chunk-KA4L2NZ3.js.map → chunk-2TYSSBU5.js.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-F36KZDFX.cjs → chunk-3FPR224C.cjs} +91 -91
- package/dist/{chunk-F36KZDFX.cjs.map → chunk-3FPR224C.cjs.map} +1 -1
- package/dist/{chunk-32UETY6S.cjs → chunk-3KOY4FH3.cjs} +207 -28
- package/dist/chunk-3KOY4FH3.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-RFDEYLIK.js → chunk-4WMMBDS5.js} +7 -7
- package/dist/chunk-4WMMBDS5.js.map +1 -0
- package/dist/{chunk-R7EWHKID.js → chunk-5K2BKEBD.js} +19 -145
- package/dist/chunk-5K2BKEBD.js.map +1 -0
- package/dist/chunk-5PRKMB24.cjs +124 -0
- package/dist/chunk-5PRKMB24.cjs.map +1 -0
- package/dist/chunk-6LN7FIVU.js +107 -0
- package/dist/chunk-6LN7FIVU.js.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-UTVQPZPN.cjs → chunk-7XUYFFR4.cjs} +20 -20
- package/dist/chunk-7XUYFFR4.cjs.map +1 -0
- package/dist/{chunk-KXSMF6PL.js → chunk-ACGSAMD3.js} +39 -34
- package/dist/chunk-ACGSAMD3.js.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-AT3MLMJV.js → chunk-AX6JGVTZ.js} +91 -20
- package/dist/chunk-AX6JGVTZ.js.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-YQ4JONWE.js → chunk-BRRP76WO.js} +401 -131
- package/dist/chunk-BRRP76WO.js.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-S3G5VLSW.js → chunk-CT3ZKTOF.js} +7 -6
- package/dist/chunk-CT3ZKTOF.js.map +1 -0
- 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-BZZI7B43.cjs → chunk-DO7SAMEK.cjs} +47 -47
- package/dist/{chunk-BZZI7B43.cjs.map → chunk-DO7SAMEK.cjs.map} +1 -1
- package/dist/chunk-DZAICA5J.js +147 -0
- package/dist/chunk-DZAICA5J.js.map +1 -0
- 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-A4R3H7RU.cjs → chunk-EZEEWCFJ.cjs} +264 -361
- package/dist/chunk-EZEEWCFJ.cjs.map +1 -0
- package/dist/{chunk-BEB4OFZF.cjs → chunk-FA2AFWLP.cjs} +51 -59
- package/dist/chunk-FA2AFWLP.cjs.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-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-LHYSY6SE.js → chunk-I4GAZH5Z.js} +186 -9
- package/dist/chunk-I4GAZH5Z.js.map +1 -0
- package/dist/{chunk-BQM5P2NO.cjs → chunk-JB6T4GLL.cjs} +260 -223
- package/dist/chunk-JB6T4GLL.cjs.map +1 -0
- package/dist/{chunk-QPOQX2DI.cjs → chunk-JFRT7S3B.cjs} +1026 -369
- package/dist/chunk-JFRT7S3B.cjs.map +1 -0
- 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-WEJHA7AD.js → chunk-KF6K7TGH.js} +109 -75
- package/dist/chunk-KF6K7TGH.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-AF3TWL5C.cjs → chunk-LRQKXRXO.cjs} +4 -4
- package/dist/{chunk-AF3TWL5C.cjs.map → chunk-LRQKXRXO.cjs.map} +1 -1
- 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-FXNHZFZV.js → chunk-MYKHJI2J.js} +3 -3
- package/dist/{chunk-FXNHZFZV.js.map → chunk-MYKHJI2J.js.map} +1 -1
- package/dist/{chunk-Z43KWLZF.js → chunk-NACVVDWB.js} +213 -12
- package/dist/chunk-NACVVDWB.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-WYFB7BN3.js → chunk-OD4SSY2U.js} +166 -48
- package/dist/chunk-OD4SSY2U.js.map +1 -0
- 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-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-HNYLMPQQ.cjs → chunk-OTUPEF2W.cjs} +149 -78
- package/dist/chunk-OTUPEF2W.cjs.map +1 -0
- 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-C2ZP5YS6.cjs → chunk-PFBRJBUL.cjs} +278 -160
- package/dist/chunk-PFBRJBUL.cjs.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-EDHV4CBU.js → chunk-S5TERQVW.js} +37 -134
- package/dist/chunk-S5TERQVW.js.map +1 -0
- 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-36LIJXWC.js → chunk-SHFBB23Q.js} +4 -4
- package/dist/{chunk-36LIJXWC.js.map → chunk-SHFBB23Q.js.map} +1 -1
- package/dist/chunk-SIT26LAZ.cjs +614 -0
- package/dist/chunk-SIT26LAZ.cjs.map +1 -0
- package/dist/{chunk-C6KE2HSQ.cjs → chunk-SR725PWF.cjs} +1662 -1392
- package/dist/chunk-SR725PWF.cjs.map +1 -0
- package/dist/{chunk-S7WIRFNS.cjs → chunk-TKZXMWQF.cjs} +13 -12
- package/dist/chunk-TKZXMWQF.cjs.map +1 -0
- package/dist/{chunk-5PDSCELM.cjs → chunk-TQHGE7UC.cjs} +29 -164
- package/dist/chunk-TQHGE7UC.cjs.map +1 -0
- package/dist/{chunk-XBHRKLZU.cjs → chunk-TUNPBZY3.cjs} +4 -4
- package/dist/{chunk-XBHRKLZU.cjs.map → chunk-TUNPBZY3.cjs.map} +1 -1
- 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-UGHG7PGX.js +592 -0
- package/dist/chunk-UGHG7PGX.js.map +1 -0
- package/dist/{chunk-N3QTGPC7.cjs → chunk-UMGZDVOA.cjs} +303 -101
- package/dist/chunk-UMGZDVOA.cjs.map +1 -0
- package/dist/{chunk-RHDOAQCT.cjs → chunk-WCCATHMB.cjs} +140 -135
- package/dist/chunk-WCCATHMB.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-IHRDX7K6.js → chunk-YIURNGXI.js} +46 -56
- package/dist/chunk-YIURNGXI.js.map +1 -0
- package/dist/{chunk-GWUWRZXW.js → chunk-YVF2EM7B.js} +3 -3
- package/dist/{chunk-GWUWRZXW.js.map → chunk-YVF2EM7B.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-A2LJG5GM.js → chunk-ZFMCDJGB.js} +803 -148
- package/dist/chunk-ZFMCDJGB.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-BL1NZLMY.d.cts +78 -0
- package/dist/ddl-D_oW-EVO.d.ts +78 -0
- 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 +3418 -706
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +550 -58
- package/dist/graph-merge/index.d.ts +550 -58
- package/dist/graph-merge/index.js +3191 -497
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/{index-Deyu8IXL.d.ts → index-COs_z6nV.d.cts} +47 -3
- package/dist/{index-DrRS51Ld.d.cts → index-D7d1u2gr.d.ts} +47 -3
- package/dist/index.cjs +233 -216
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -12
- package/dist/index.d.ts +12 -12
- 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-ptr3JLRP.d.cts → manager-CYaff3n3.d.cts} +2 -2
- package/dist/{manager-DX983gJ0.d.ts → manager-D9eRT_ns.d.ts} +2 -2
- package/dist/{materialize-indexes-CpXoggWU.d.ts → materialize-indexes-DJ3ykH59.d.ts} +1 -1
- package/dist/{materialize-indexes-BXz77YqO.d.cts → materialize-indexes-DTtAnvfY.d.cts} +1 -1
- package/dist/{postgres-DwgEXSPI.d.cts → postgres-CcL4bAHS.d.ts} +1 -1
- package/dist/{postgres-QdOMHTBz.d.ts → postgres-DMj39MEu.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 +46 -46
- 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 +13 -13
- package/dist/provenance/index.js.map +1 -1
- package/dist/repair-validity-windows-BFNZvd_H.d.cts +166 -0
- package/dist/repair-validity-windows-DlUSqwCg.d.ts +166 -0
- 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-BOUuA83f.d.ts → searchable-DHJMh_nj.d.cts} +1 -1
- package/dist/{searchable-BrUh0pdc.d.cts → searchable-bpE1bBfc.d.ts} +1 -1
- package/dist/{sqlite-BfYcV61E.d.cts → sqlite-D7Oz0SQh.d.ts} +1 -1
- package/dist/{sqlite-DK40XVR1.d.ts → sqlite-YppHrNFb.d.cts} +1 -1
- package/dist/{store-FTqBpuJD.d.cts → store-JUVvtmR4.d.cts} +228 -92
- package/dist/{store-Bo1psfVZ.d.ts → store-UzrGvZOo.d.ts} +228 -92
- package/dist/{temporal-DPtn0HOu.d.ts → temporal-5GqpYCk2.d.cts} +1 -1
- package/dist/{temporal-CXewwLTB.d.cts → temporal-CbnLzTmM.d.ts} +1 -1
- package/dist/{types-Du78EvpN.d.ts → types-BqFZTQmV.d.cts} +60 -9
- package/dist/{types-Du78EvpN.d.cts → types-BqFZTQmV.d.ts} +60 -9
- package/dist/{types-CeT7xM4M.d.ts → types-Bx74kaTt.d.ts} +1 -1
- package/dist/{types-XR1nHERK.d.cts → types-CXAhpW-c.d.cts} +1 -1
- package/dist/{where-CJsp-YUf.d.cts → where-DI_Fqz-X.d.cts} +1 -1
- package/dist/{where-CMbFiWwp.d.ts → where-O-k2wgYm.d.ts} +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 +0 -267
- 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-DSAWGCMP.js +0 -254
- package/dist/chunk-DSAWGCMP.js.map +0 -1
- package/dist/chunk-E4OSGBCM.cjs.map +0 -1
- package/dist/chunk-EDHV4CBU.js.map +0 -1
- package/dist/chunk-FA6Z7B5L.js +0 -244
- package/dist/chunk-FA6Z7B5L.js.map +0 -1
- package/dist/chunk-GVAMRRZR.cjs +0 -268
- package/dist/chunk-GVAMRRZR.cjs.map +0 -1
- package/dist/chunk-GWXXHOLU.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-RFDEYLIK.js.map +0 -1
- package/dist/chunk-RHDOAQCT.cjs.map +0 -1
- package/dist/chunk-S3G5VLSW.js.map +0 -1
- package/dist/chunk-S7WIRFNS.cjs.map +0 -1
- package/dist/chunk-UTVQPZPN.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
- package/dist/ddl-mE07h_EM.d.cts +0 -38
- package/dist/ddl-opIn8DfX.d.ts +0 -38
|
@@ -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 chunkWCCATHMB_cjs = require('./chunk-WCCATHMB.cjs');
|
|
4
|
+
var chunkROR5ZR6A_cjs = require('./chunk-ROR5ZR6A.cjs');
|
|
5
|
+
var chunkFA2AFWLP_cjs = require('./chunk-FA2AFWLP.cjs');
|
|
6
|
+
var chunkHDL2ARHX_cjs = require('./chunk-HDL2ARHX.cjs');
|
|
7
|
+
var chunkWODMN3Q2_cjs = require('./chunk-WODMN3Q2.cjs');
|
|
8
|
+
var chunkSIT26LAZ_cjs = require('./chunk-SIT26LAZ.cjs');
|
|
9
|
+
var chunk5PRKMB24_cjs = require('./chunk-5PRKMB24.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 chunkWCCATHMB_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 / chunkWCCATHMB_cjs.EMBEDDING_UPSERT_PARAM_COUNT)
|
|
314
314
|
),
|
|
315
315
|
findEdgesEndpointChunkSize: Math.max(
|
|
316
316
|
1,
|
|
317
|
-
maxBindParameters -
|
|
317
|
+
maxBindParameters - chunkWCCATHMB_cjs.FIND_EDGES_ENDPOINT_FIXED_PARAM_COUNT
|
|
318
318
|
),
|
|
319
319
|
fulltextDeleteChunkSize: Math.max(
|
|
320
320
|
1,
|
|
@@ -352,24 +352,134 @@ 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 (!chunkSIT26LAZ_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 = chunkFA2AFWLP_cjs.createNodeRowMapper(chunkFA2AFWLP_cjs.POSTGRES_ROW_MAPPER_CONFIG);
|
|
463
|
+
var toEdgeRow = chunkFA2AFWLP_cjs.createEdgeRowMapper(chunkFA2AFWLP_cjs.POSTGRES_ROW_MAPPER_CONFIG);
|
|
464
|
+
var toUniqueRow = chunkFA2AFWLP_cjs.createUniqueRowMapper(chunkFA2AFWLP_cjs.POSTGRES_ROW_MAPPER_CONFIG);
|
|
465
|
+
var toSchemaVersionRow = chunkFA2AFWLP_cjs.createSchemaVersionRowMapper(
|
|
466
|
+
chunkFA2AFWLP_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
|
+
...chunk5PRKMB24_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
|
-
const
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
476
|
+
const resourceAudit = chunkSIT26LAZ_cjs.resolveDeclaredBackendResource(
|
|
477
|
+
getSerializedPostgresClient(db),
|
|
478
|
+
options.serializedResource
|
|
479
|
+
);
|
|
480
|
+
const tables2 = options.tables ?? chunkHDL2ARHX_cjs.tables;
|
|
481
|
+
const fulltextStrategy = options.fulltext ?? chunkL3LQNR34_cjs.tsvectorStrategy;
|
|
482
|
+
const vectorStrategy = options.vector === false ? void 0 : options.vector ?? chunkROR5ZR6A_cjs.pgvectorStrategy;
|
|
373
483
|
const iterativeScanProbe = createIterativeScanProbe();
|
|
374
484
|
const baseCapabilities = buildPostgresCapabilities(
|
|
375
485
|
fulltextStrategy,
|
|
@@ -382,14 +492,14 @@ function createPostgresBackend(db, options = {}) {
|
|
|
382
492
|
supported: false
|
|
383
493
|
}
|
|
384
494
|
} : {};
|
|
385
|
-
const configuredMaxBindParameters = options.capabilities?.maxBindParameters ??
|
|
495
|
+
const configuredMaxBindParameters = options.capabilities?.maxBindParameters ?? chunk5PRKMB24_cjs.POSTGRES_MAX_BIND_PARAMETERS;
|
|
386
496
|
const driverBindParameterOverrides = isPgliteDatabase(db) ? {
|
|
387
497
|
maxBindParameters: Math.min(
|
|
388
498
|
configuredMaxBindParameters,
|
|
389
499
|
PGLITE_MAX_BIND_PARAMETERS
|
|
390
500
|
)
|
|
391
501
|
} : {};
|
|
392
|
-
const declaredCapabilities =
|
|
502
|
+
const declaredCapabilities = chunk5PRKMB24_cjs.normalizeGraphAnalyticsCapabilities({
|
|
393
503
|
...baseCapabilities,
|
|
394
504
|
...httpOnlyOverrides,
|
|
395
505
|
...options.capabilities,
|
|
@@ -400,7 +510,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
400
510
|
contributions: {
|
|
401
511
|
supported: true,
|
|
402
512
|
probe: true,
|
|
403
|
-
rebuild:
|
|
513
|
+
rebuild: chunkWCCATHMB_cjs.contributionRebuildSupported(
|
|
404
514
|
fulltextStrategy,
|
|
405
515
|
tables2.fulltextTableName,
|
|
406
516
|
declaredCapabilities.transactions
|
|
@@ -410,7 +520,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
410
520
|
const adapterOptions = {
|
|
411
521
|
...options.prepareStatements === void 0 ? {} : { prepareStatements: options.prepareStatements },
|
|
412
522
|
...options.preparedStatementCacheMax === void 0 ? {} : { preparedStatementCacheMax: options.preparedStatementCacheMax },
|
|
413
|
-
maxBindParameters: capabilities.maxBindParameters ??
|
|
523
|
+
maxBindParameters: capabilities.maxBindParameters ?? chunk5PRKMB24_cjs.POSTGRES_MAX_BIND_PARAMETERS
|
|
414
524
|
};
|
|
415
525
|
const executionAdapter = createPostgresExecutionAdapter(db, adapterOptions);
|
|
416
526
|
const tableNames = {
|
|
@@ -433,8 +543,8 @@ function createPostgresBackend(db, options = {}) {
|
|
|
433
543
|
drizzleOrm.getTableName(tables2.uniques),
|
|
434
544
|
tableNames.fulltext
|
|
435
545
|
].map(
|
|
436
|
-
(name) =>
|
|
437
|
-
|
|
546
|
+
(name) => chunkWODMN3Q2_cjs.toDrizzleSql(
|
|
547
|
+
chunkEDN4Y4ZG_cjs.sql`ANALYZE (SKIP_LOCKED) ${chunkEDN4Y4ZG_cjs.sql.identifier(name)}`,
|
|
438
548
|
"postgres"
|
|
439
549
|
)
|
|
440
550
|
);
|
|
@@ -447,11 +557,11 @@ function createPostgresBackend(db, options = {}) {
|
|
|
447
557
|
tableNames.identityClosure,
|
|
448
558
|
tableNames.identitySeparation
|
|
449
559
|
];
|
|
450
|
-
const operationStrategy =
|
|
560
|
+
const operationStrategy = chunkWCCATHMB_cjs.createPostgresOperationStrategy(
|
|
451
561
|
tables2,
|
|
452
562
|
fulltextStrategy
|
|
453
563
|
);
|
|
454
|
-
const guardedTableExists =
|
|
564
|
+
const guardedTableExists = chunkWCCATHMB_cjs.createCachedTableExistence(
|
|
455
565
|
async (tableName) => {
|
|
456
566
|
const rows = await executionAdapter.execute(
|
|
457
567
|
operationStrategy.buildTableExists(tableName)
|
|
@@ -466,24 +576,24 @@ function createPostgresBackend(db, options = {}) {
|
|
|
466
576
|
try {
|
|
467
577
|
await db.execute(statement);
|
|
468
578
|
} catch (error) {
|
|
469
|
-
if (!
|
|
579
|
+
if (!chunkSIT26LAZ_cjs.isPostgresConcurrentDdlRaceError(error)) throw error;
|
|
470
580
|
await db.execute(statement);
|
|
471
581
|
}
|
|
472
582
|
}
|
|
473
583
|
async function ensureTableWithConcurrentCreateRetry(table) {
|
|
474
|
-
await executeConcurrentCreateDdl(
|
|
584
|
+
await executeConcurrentCreateDdl(chunkHDL2ARHX_cjs.generatePgCreateTableSQL(table));
|
|
475
585
|
}
|
|
476
586
|
async function ensureContributionMaterializationsTableImpl() {
|
|
477
587
|
await ensureTableWithConcurrentCreateRetry(matTable);
|
|
478
588
|
}
|
|
479
589
|
function identityContributionsFor(identityTableNames) {
|
|
480
|
-
const identityTables =
|
|
590
|
+
const identityTables = chunkHDL2ARHX_cjs.createPostgresTables({
|
|
481
591
|
identityAssertions: identityTableNames.identityAssertions,
|
|
482
592
|
recordedIdentityAssertions: identityTableNames.recordedIdentityAssertions,
|
|
483
593
|
identityClosure: identityTableNames.identityClosure,
|
|
484
594
|
identitySeparation: identityTableNames.identitySeparation
|
|
485
595
|
});
|
|
486
|
-
return
|
|
596
|
+
return chunkHDL2ARHX_cjs.postgresContributions(identityTables, fulltextStrategy).filter(
|
|
487
597
|
(contribution) => IDENTITY_TABLE_LOGICAL_NAMES.has(contribution.logicalName)
|
|
488
598
|
);
|
|
489
599
|
}
|
|
@@ -498,25 +608,25 @@ function createPostgresBackend(db, options = {}) {
|
|
|
498
608
|
);
|
|
499
609
|
const row = rows[0];
|
|
500
610
|
if (row === void 0) return void 0;
|
|
501
|
-
return
|
|
611
|
+
return chunkWCCATHMB_cjs.mapContributionMaterializationRow(
|
|
502
612
|
row,
|
|
503
|
-
|
|
613
|
+
chunkWCCATHMB_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.decode
|
|
504
614
|
);
|
|
505
615
|
}
|
|
506
616
|
async function getContributionMaterializationRows(graphId) {
|
|
507
617
|
const rows = await db.select().from(matTable).where(drizzleOrm.eq(matTable.graphId, graphId));
|
|
508
618
|
return rows.map(
|
|
509
|
-
(row) =>
|
|
619
|
+
(row) => chunkWCCATHMB_cjs.mapContributionMaterializationRow(
|
|
510
620
|
row,
|
|
511
|
-
|
|
621
|
+
chunkWCCATHMB_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.decode
|
|
512
622
|
)
|
|
513
623
|
);
|
|
514
624
|
}
|
|
515
625
|
async function recordContributionMaterializationRow(params) {
|
|
516
626
|
await db.insert(matTable).values(
|
|
517
|
-
|
|
627
|
+
chunkWCCATHMB_cjs.buildContributionInsertValues(
|
|
518
628
|
params,
|
|
519
|
-
|
|
629
|
+
chunkWCCATHMB_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.encode
|
|
520
630
|
)
|
|
521
631
|
).onConflictDoUpdate({
|
|
522
632
|
target: [
|
|
@@ -525,7 +635,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
525
635
|
matTable.owner,
|
|
526
636
|
matTable.tableName
|
|
527
637
|
],
|
|
528
|
-
set:
|
|
638
|
+
set: chunkWCCATHMB_cjs.buildContributionOnConflictSet(
|
|
529
639
|
matTable.materializedAt,
|
|
530
640
|
params.materializedAt
|
|
531
641
|
)
|
|
@@ -545,9 +655,9 @@ function createPostgresBackend(db, options = {}) {
|
|
|
545
655
|
const rows = await executionAdapter.execute(
|
|
546
656
|
operationStrategy.buildTableExists(tableName)
|
|
547
657
|
);
|
|
548
|
-
return
|
|
658
|
+
return chunkWCCATHMB_cjs.tableExistsFromRow(rows[0]);
|
|
549
659
|
}
|
|
550
|
-
const contributionMaterializer =
|
|
660
|
+
const contributionMaterializer = chunkWCCATHMB_cjs.createContributionMaterializer({
|
|
551
661
|
dialect: "postgres",
|
|
552
662
|
fulltextStrategy,
|
|
553
663
|
fulltextTableName: tables2.fulltextTableName,
|
|
@@ -588,7 +698,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
588
698
|
});
|
|
589
699
|
function runSchemaWriteTransaction(graphId, fn) {
|
|
590
700
|
if (!capabilities.transactions) {
|
|
591
|
-
throw new
|
|
701
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
592
702
|
"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
703
|
{
|
|
594
704
|
backend: "postgres",
|
|
@@ -639,7 +749,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
639
749
|
schemaVersionsTable: tables2.schemaVersions
|
|
640
750
|
});
|
|
641
751
|
return {
|
|
642
|
-
backend:
|
|
752
|
+
backend: chunkWCCATHMB_cjs.gateFulltext(
|
|
643
753
|
backend2,
|
|
644
754
|
contributionMaterializer.assertInitialized,
|
|
645
755
|
contributionMaterializer.refuseUnavailableFulltext
|
|
@@ -663,33 +773,33 @@ function createPostgresBackend(db, options = {}) {
|
|
|
663
773
|
);
|
|
664
774
|
const executeCompiled = trustedExecutionAdapter.executeCompiled;
|
|
665
775
|
if (executeCompiled === void 0) {
|
|
666
|
-
throw new
|
|
776
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
667
777
|
"Trusted import could not bind raw execution to the PostgreSQL transaction.",
|
|
668
778
|
{ capability: "trustedImport", dialect: "postgres" }
|
|
669
779
|
);
|
|
670
780
|
}
|
|
671
|
-
const trustedTx =
|
|
781
|
+
const trustedTx = chunkSIT26LAZ_cjs.deriveBackend(tx, {
|
|
672
782
|
executeRaw(sqlText, params) {
|
|
673
783
|
return executeCompiled({ params, sql: sqlText });
|
|
674
784
|
}
|
|
675
785
|
});
|
|
676
|
-
await
|
|
677
|
-
await
|
|
678
|
-
const indexDefinitions = await
|
|
786
|
+
await chunkWCCATHMB_cjs.lockPostgresTrustedImportTables(trustedTx, tableNames);
|
|
787
|
+
await chunkWCCATHMB_cjs.assertTrustedImportDatabaseEmpty(trustedTx, tableNames);
|
|
788
|
+
const indexDefinitions = await chunkWCCATHMB_cjs.suspendPostgresSecondaryIndexes(
|
|
679
789
|
trustedTx,
|
|
680
790
|
tableNames
|
|
681
791
|
);
|
|
682
792
|
const result = await fn(
|
|
683
|
-
|
|
793
|
+
chunkWCCATHMB_cjs.createPostgresTrustedImportSession(trustedTx, tableNames)
|
|
684
794
|
);
|
|
685
|
-
await
|
|
686
|
-
await
|
|
795
|
+
await chunkWCCATHMB_cjs.restoreSecondaryIndexes(trustedTx, indexDefinitions);
|
|
796
|
+
await chunkWCCATHMB_cjs.analyzeImportedTables(trustedTx, tableNames);
|
|
687
797
|
return result;
|
|
688
798
|
});
|
|
689
799
|
}
|
|
690
800
|
} : {},
|
|
691
801
|
async bootstrapTables() {
|
|
692
|
-
const statements =
|
|
802
|
+
const statements = chunkHDL2ARHX_cjs.generatePostgresDDL(tables2, fulltextStrategy);
|
|
693
803
|
for (const statement of statements) {
|
|
694
804
|
await executeConcurrentCreateDdl(statement);
|
|
695
805
|
}
|
|
@@ -724,7 +834,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
724
834
|
// uninitialized database throws `StoreNotInitializedError` loudly
|
|
725
835
|
// rather than self-healing on a read/write path (#135). Shared
|
|
726
836
|
// verbatim with the tx-scoped gate via `gateFulltextMethods`.
|
|
727
|
-
...
|
|
837
|
+
...chunkWCCATHMB_cjs.gateFulltextMethods(
|
|
728
838
|
operations,
|
|
729
839
|
contributionMaterializer.assertInitialized,
|
|
730
840
|
contributionMaterializer.refuseUnavailableFulltext
|
|
@@ -742,6 +852,18 @@ function createPostgresBackend(db, options = {}) {
|
|
|
742
852
|
`ALTER TABLE "${tableName}" ADD COLUMN IF NOT EXISTS "claim_token" text;`
|
|
743
853
|
);
|
|
744
854
|
},
|
|
855
|
+
async ensureTrigramExtension() {
|
|
856
|
+
if (!capabilities.transactions) {
|
|
857
|
+
await executeConcurrentCreateDdl(TRIGRAM_EXTENSION_DDL);
|
|
858
|
+
return;
|
|
859
|
+
}
|
|
860
|
+
await db.transaction(async (tx) => {
|
|
861
|
+
await tx.execute(
|
|
862
|
+
drizzleOrm.sql`SELECT pg_advisory_xact_lock(hashtext(${TRIGRAM_EXTENSION_DDL_LOCK_KEY}), 0)`
|
|
863
|
+
);
|
|
864
|
+
await tx.execute(drizzleOrm.sql.raw(TRIGRAM_EXTENSION_DDL));
|
|
865
|
+
});
|
|
866
|
+
},
|
|
745
867
|
async claimIndexMaterialization(params) {
|
|
746
868
|
const t = tables2.indexMaterializations;
|
|
747
869
|
const rows = await db.execute(drizzleOrm.sql`
|
|
@@ -780,26 +902,26 @@ function createPostgresBackend(db, options = {}) {
|
|
|
780
902
|
const rows = await db.select().from(t).where(drizzleOrm.eq(t.indexName, indexName));
|
|
781
903
|
const row = rows[0];
|
|
782
904
|
if (row === void 0) return void 0;
|
|
783
|
-
return
|
|
905
|
+
return chunkWCCATHMB_cjs.mapMaterializationRow(row, chunkWCCATHMB_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.decode);
|
|
784
906
|
},
|
|
785
907
|
async getIndexMaterializations(statusKeys) {
|
|
786
908
|
if (statusKeys.length === 0) return [];
|
|
787
909
|
const t = tables2.indexMaterializations;
|
|
788
910
|
const rows = await db.select().from(t).where(drizzleOrm.inArray(t.indexName, [...statusKeys]));
|
|
789
911
|
return rows.map(
|
|
790
|
-
(row) =>
|
|
912
|
+
(row) => chunkWCCATHMB_cjs.mapMaterializationRow(row, chunkWCCATHMB_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.decode)
|
|
791
913
|
);
|
|
792
914
|
},
|
|
793
915
|
async recordIndexMaterialization(params) {
|
|
794
916
|
const t = tables2.indexMaterializations;
|
|
795
917
|
await db.insert(t).values(
|
|
796
|
-
|
|
918
|
+
chunkWCCATHMB_cjs.buildMaterializationInsertValues(
|
|
797
919
|
params,
|
|
798
|
-
|
|
920
|
+
chunkWCCATHMB_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.encode
|
|
799
921
|
)
|
|
800
922
|
).onConflictDoUpdate({
|
|
801
923
|
target: t.indexName,
|
|
802
|
-
set:
|
|
924
|
+
set: chunkWCCATHMB_cjs.buildMaterializationOnConflictSet(params.materializedAt)
|
|
803
925
|
});
|
|
804
926
|
},
|
|
805
927
|
async ensureContributionMaterializationsTable() {
|
|
@@ -821,26 +943,26 @@ function createPostgresBackend(db, options = {}) {
|
|
|
821
943
|
const t = tables2.kindRemovals;
|
|
822
944
|
const rows = await db.select().from(t).where(drizzleOrm.and(drizzleOrm.eq(t.graphId, graphId), drizzleOrm.isNull(t.removedAt)));
|
|
823
945
|
return rows.map(
|
|
824
|
-
(row) =>
|
|
946
|
+
(row) => chunkWCCATHMB_cjs.mapKindRemovalRow(row, chunkWCCATHMB_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.decode)
|
|
825
947
|
);
|
|
826
948
|
},
|
|
827
949
|
async getAllKindRemovals(graphId) {
|
|
828
950
|
const t = tables2.kindRemovals;
|
|
829
951
|
const rows = await db.select().from(t).where(drizzleOrm.eq(t.graphId, graphId));
|
|
830
952
|
return rows.map(
|
|
831
|
-
(row) =>
|
|
953
|
+
(row) => chunkWCCATHMB_cjs.mapKindRemovalRow(row, chunkWCCATHMB_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.decode)
|
|
832
954
|
);
|
|
833
955
|
},
|
|
834
956
|
async recordKindRemoval(params) {
|
|
835
957
|
const t = tables2.kindRemovals;
|
|
836
958
|
await db.insert(t).values(
|
|
837
|
-
|
|
959
|
+
chunkWCCATHMB_cjs.buildKindRemovalInsertValues(
|
|
838
960
|
params,
|
|
839
|
-
|
|
961
|
+
chunkWCCATHMB_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.encode
|
|
840
962
|
)
|
|
841
963
|
).onConflictDoUpdate({
|
|
842
964
|
target: [t.graphId, t.kindName, t.entity, t.schemaVersion],
|
|
843
|
-
set:
|
|
965
|
+
set: chunkWCCATHMB_cjs.buildKindRemovalOnConflictSet(t.removedAt, params.removedAt)
|
|
844
966
|
});
|
|
845
967
|
},
|
|
846
968
|
async ensureReconciliationMarkersTable() {
|
|
@@ -919,8 +1041,8 @@ function createPostgresBackend(db, options = {}) {
|
|
|
919
1041
|
const presentGuardedTables = tablePresence.filter((entry) => entry.exists).map((entry) => entry.tableName);
|
|
920
1042
|
for (const tableName of presentGuardedTables) {
|
|
921
1043
|
await db.execute(
|
|
922
|
-
|
|
923
|
-
|
|
1044
|
+
chunkWODMN3Q2_cjs.toDrizzleSql(
|
|
1045
|
+
chunkEDN4Y4ZG_cjs.sql`ANALYZE (SKIP_LOCKED) ${chunkEDN4Y4ZG_cjs.sql.identifier(tableName)}`,
|
|
924
1046
|
"postgres"
|
|
925
1047
|
)
|
|
926
1048
|
);
|
|
@@ -935,7 +1057,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
935
1057
|
async commitSchemaVersionIfKindsEmpty(params, probes) {
|
|
936
1058
|
return runSchemaWriteTransaction(
|
|
937
1059
|
params.graphId,
|
|
938
|
-
(target) =>
|
|
1060
|
+
(target) => chunkWCCATHMB_cjs.commitSchemaVersionIfKindsEmpty(target, params, probes)
|
|
939
1061
|
);
|
|
940
1062
|
},
|
|
941
1063
|
async commitSchemaVersionWithPreflight(params, preflight) {
|
|
@@ -957,9 +1079,9 @@ function createPostgresBackend(db, options = {}) {
|
|
|
957
1079
|
return backend.transactionWithNative((tx) => fn(tx), options2);
|
|
958
1080
|
},
|
|
959
1081
|
async transactionWithNative(fn, options2) {
|
|
960
|
-
const temporaryWrites = options2?.temporaryWrites ===
|
|
1082
|
+
const temporaryWrites = options2?.temporaryWrites === chunk5PRKMB24_cjs.INTERNAL_TEMPORARY_WRITES;
|
|
961
1083
|
if (temporaryWrites && options2.accessMode !== "read_only") {
|
|
962
|
-
throw new
|
|
1084
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
963
1085
|
"Temporary-write transactions must be semantically read-only.",
|
|
964
1086
|
{ dialect: "postgres" }
|
|
965
1087
|
);
|
|
@@ -983,7 +1105,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
983
1105
|
},
|
|
984
1106
|
adoptTransaction(externalTx) {
|
|
985
1107
|
if (!capabilities.transactions) {
|
|
986
|
-
throw new
|
|
1108
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
987
1109
|
"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
1110
|
{
|
|
989
1111
|
backend: "postgres",
|
|
@@ -992,7 +1114,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
992
1114
|
}
|
|
993
1115
|
);
|
|
994
1116
|
}
|
|
995
|
-
|
|
1117
|
+
chunkWCCATHMB_cjs.assertAdoptedDialect(
|
|
996
1118
|
externalTx,
|
|
997
1119
|
pgCore.PgTransaction,
|
|
998
1120
|
"postgres"
|
|
@@ -1002,9 +1124,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
1002
1124
|
async close() {
|
|
1003
1125
|
}
|
|
1004
1126
|
};
|
|
1005
|
-
|
|
1006
|
-
chunkANKOXPCC_cjs.markSerializedTransactionResource(backend, serializedClient);
|
|
1007
|
-
}
|
|
1127
|
+
chunkSIT26LAZ_cjs.auditBackendResource(backend, resourceAudit);
|
|
1008
1128
|
return backend;
|
|
1009
1129
|
}
|
|
1010
1130
|
function getSerializedPostgresClient(db) {
|
|
@@ -1023,14 +1143,24 @@ function getSerializedPostgresClient(db) {
|
|
|
1023
1143
|
function isSingleConnectionPgPool(candidate) {
|
|
1024
1144
|
const options = candidate["options"];
|
|
1025
1145
|
if (typeof options !== "object" || options === null) return false;
|
|
1026
|
-
return
|
|
1146
|
+
return isSingleConnectionPgPoolCap(
|
|
1147
|
+
options["max"]
|
|
1148
|
+
);
|
|
1149
|
+
}
|
|
1150
|
+
function isSingleConnectionPgPoolCap(value) {
|
|
1151
|
+
return value === 1 || typeof value === "string" && Number(value) === 1;
|
|
1027
1152
|
}
|
|
1028
1153
|
function isSingleConnectionCallablePgClient(client) {
|
|
1029
1154
|
if (client === void 0 || client === null) return false;
|
|
1030
1155
|
const options = client["options"];
|
|
1031
1156
|
if (!isPostgresJsClient(client)) return false;
|
|
1032
1157
|
if (typeof options !== "object" || options === null) return false;
|
|
1033
|
-
return
|
|
1158
|
+
return isSingleConnectionPostgresJsCap(
|
|
1159
|
+
options["max"]
|
|
1160
|
+
);
|
|
1161
|
+
}
|
|
1162
|
+
function isSingleConnectionPostgresJsCap(value) {
|
|
1163
|
+
return value === 1 || typeof value === "string" && Number(value) === 1;
|
|
1034
1164
|
}
|
|
1035
1165
|
function isBarePgClient(candidate) {
|
|
1036
1166
|
if (candidate["options"] !== void 0 || candidate["totalCount"] !== void 0 || candidate["idleCount"] !== void 0 || candidate["waitingCount"] !== void 0) {
|
|
@@ -1101,10 +1231,10 @@ function createPostgresOperationBackend(options) {
|
|
|
1101
1231
|
}
|
|
1102
1232
|
async function vectorSearchGucOverrides(params) {
|
|
1103
1233
|
const overrides = [];
|
|
1104
|
-
const efSearchParameter =
|
|
1234
|
+
const efSearchParameter = chunkL3LQNR34_cjs.resolveEfSearchOverride({
|
|
1105
1235
|
efSearch: params.efSearch,
|
|
1106
1236
|
indexType: params.indexType,
|
|
1107
|
-
tuning:
|
|
1237
|
+
tuning: chunkL3LQNR34_cjs.vectorSearchFrontierTuning(vectorStrategy),
|
|
1108
1238
|
transactions: capabilities.transactions,
|
|
1109
1239
|
dialect: "PostgreSQL",
|
|
1110
1240
|
engine: vectorStrategy?.name ?? "this backend"
|
|
@@ -1129,7 +1259,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1129
1259
|
async function runVectorSearchGucGroup(overrides, query) {
|
|
1130
1260
|
const runExclusive = executionAdapter.runExclusive;
|
|
1131
1261
|
if (runExclusive === void 0) {
|
|
1132
|
-
throw new
|
|
1262
|
+
throw new chunkMRDBBHIZ_cjs.CompilerInvariantError(
|
|
1133
1263
|
"A transaction-scoped Postgres backend must expose runExclusive; its execution adapter was not wrapped by createSerialExecutionAdapter."
|
|
1134
1264
|
);
|
|
1135
1265
|
}
|
|
@@ -1173,17 +1303,17 @@ function createPostgresOperationBackend(options) {
|
|
|
1173
1303
|
});
|
|
1174
1304
|
}
|
|
1175
1305
|
const batchConfig = computePostgresBatchChunkSizes(
|
|
1176
|
-
capabilities.maxBindParameters ??
|
|
1306
|
+
capabilities.maxBindParameters ?? chunk5PRKMB24_cjs.POSTGRES_MAX_BIND_PARAMETERS
|
|
1177
1307
|
);
|
|
1178
|
-
const
|
|
1308
|
+
const commonOperationMembers = chunkWCCATHMB_cjs.createCommonOperationBackend({
|
|
1179
1309
|
batchConfig,
|
|
1180
1310
|
execution: {
|
|
1181
1311
|
execAll,
|
|
1182
1312
|
execGet,
|
|
1183
1313
|
execRun
|
|
1184
1314
|
},
|
|
1185
|
-
nowIso:
|
|
1186
|
-
maxBindParameters: capabilities.maxBindParameters ??
|
|
1315
|
+
nowIso: chunkFA2AFWLP_cjs.nowIso,
|
|
1316
|
+
maxBindParameters: capabilities.maxBindParameters ?? chunk5PRKMB24_cjs.POSTGRES_MAX_BIND_PARAMETERS,
|
|
1187
1317
|
operationStrategy,
|
|
1188
1318
|
rowMappers: {
|
|
1189
1319
|
toEdgeRow,
|
|
@@ -1201,28 +1331,28 @@ function createPostgresOperationBackend(options) {
|
|
|
1201
1331
|
};
|
|
1202
1332
|
const vectorEmbeddingMethods = vectorStrategy === void 0 ? {} : {
|
|
1203
1333
|
async upsertEmbedding(params) {
|
|
1204
|
-
const slot =
|
|
1334
|
+
const slot = chunkWCCATHMB_cjs.vectorSlotFromParams(params);
|
|
1205
1335
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1206
|
-
const statements = vectorStrategy.buildUpsert(slot, params,
|
|
1336
|
+
const statements = vectorStrategy.buildUpsert(slot, params, chunkFA2AFWLP_cjs.nowIso());
|
|
1207
1337
|
try {
|
|
1208
1338
|
for (const statement of statements) {
|
|
1209
1339
|
await execRun(statement);
|
|
1210
1340
|
}
|
|
1211
1341
|
} catch (error) {
|
|
1212
|
-
throw
|
|
1342
|
+
throw chunkWCCATHMB_cjs.mapVectorWriteError(error, params);
|
|
1213
1343
|
}
|
|
1214
1344
|
},
|
|
1215
1345
|
async upsertEmbeddingBatch(params) {
|
|
1216
1346
|
if (params.rows.length === 0) return;
|
|
1217
|
-
const slot =
|
|
1347
|
+
const slot = chunkWCCATHMB_cjs.vectorSlotFromParams(params);
|
|
1218
1348
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1219
1349
|
const rowsById = new Map(
|
|
1220
1350
|
params.rows.map((row) => [row.nodeId, row])
|
|
1221
1351
|
);
|
|
1222
1352
|
const rows = [...rowsById.values()];
|
|
1223
|
-
const timestamp =
|
|
1353
|
+
const timestamp = chunkFA2AFWLP_cjs.nowIso();
|
|
1224
1354
|
try {
|
|
1225
|
-
for (const chunk2 of
|
|
1355
|
+
for (const chunk2 of chunkSIT26LAZ_cjs.chunk(
|
|
1226
1356
|
rows,
|
|
1227
1357
|
batchConfig.embeddingUpsertBatchSize
|
|
1228
1358
|
)) {
|
|
@@ -1251,11 +1381,11 @@ function createPostgresOperationBackend(options) {
|
|
|
1251
1381
|
}
|
|
1252
1382
|
}
|
|
1253
1383
|
} catch (error) {
|
|
1254
|
-
throw
|
|
1384
|
+
throw chunkWCCATHMB_cjs.mapVectorWriteError(error, params);
|
|
1255
1385
|
}
|
|
1256
1386
|
},
|
|
1257
1387
|
async deleteEmbedding(params) {
|
|
1258
|
-
const slot =
|
|
1388
|
+
const slot = chunkWCCATHMB_cjs.vectorSlotFromParams(params);
|
|
1259
1389
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1260
1390
|
const statements = vectorStrategy.buildDelete(slot, params);
|
|
1261
1391
|
for (const statement of statements) {
|
|
@@ -1264,9 +1394,9 @@ function createPostgresOperationBackend(options) {
|
|
|
1264
1394
|
},
|
|
1265
1395
|
async deleteEmbeddingBatch(params) {
|
|
1266
1396
|
if (params.nodeIds.length === 0) return;
|
|
1267
|
-
const slot =
|
|
1397
|
+
const slot = chunkWCCATHMB_cjs.vectorSlotFromParams(params);
|
|
1268
1398
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1269
|
-
for (const nodeIds of
|
|
1399
|
+
for (const nodeIds of chunkSIT26LAZ_cjs.chunk(
|
|
1270
1400
|
[...new Set(params.nodeIds)],
|
|
1271
1401
|
batchConfig.embeddingUpsertBatchSize
|
|
1272
1402
|
)) {
|
|
@@ -1278,19 +1408,19 @@ function createPostgresOperationBackend(options) {
|
|
|
1278
1408
|
}
|
|
1279
1409
|
},
|
|
1280
1410
|
async vectorSearch(params) {
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
const slot =
|
|
1411
|
+
chunkL3LQNR34_cjs.assertVectorSearchLimit(params.limit);
|
|
1412
|
+
chunkROR5ZR6A_cjs.assertPgvectorEfSearch(params.efSearch);
|
|
1413
|
+
const slot = chunkWCCATHMB_cjs.vectorSlotFromParams(params);
|
|
1284
1414
|
const query = vectorStrategy.buildSearch(
|
|
1285
1415
|
slot,
|
|
1286
1416
|
params,
|
|
1287
1417
|
// Store-compiled candidates (predicates + subclass + currency)
|
|
1288
1418
|
// take precedence; the live-node default covers direct backend use.
|
|
1289
|
-
params.candidates ??
|
|
1419
|
+
params.candidates ?? chunkWCCATHMB_cjs.buildLiveNodeCandidates(
|
|
1290
1420
|
tableNames.nodes,
|
|
1291
1421
|
params.graphId,
|
|
1292
1422
|
params.nodeKind,
|
|
1293
|
-
|
|
1423
|
+
chunkFA2AFWLP_cjs.nowIso()
|
|
1294
1424
|
)
|
|
1295
1425
|
);
|
|
1296
1426
|
const gucOverrides = await vectorSearchGucOverrides(params);
|
|
@@ -1298,7 +1428,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1298
1428
|
try {
|
|
1299
1429
|
rows = await runVectorSearch(gucOverrides, query);
|
|
1300
1430
|
} catch (error) {
|
|
1301
|
-
throw
|
|
1431
|
+
throw chunkWCCATHMB_cjs.mapVectorWriteError(error, params);
|
|
1302
1432
|
}
|
|
1303
1433
|
return rows.map((row) => ({
|
|
1304
1434
|
nodeId: row.node_id,
|
|
@@ -1310,10 +1440,10 @@ function createPostgresOperationBackend(options) {
|
|
|
1310
1440
|
// multi-statement fallback by simply not exposing the member.
|
|
1311
1441
|
...capabilities.windowFunctions ? {
|
|
1312
1442
|
async hybridSearch(params) {
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
const slot =
|
|
1443
|
+
chunkL3LQNR34_cjs.assertVectorSearchLimit(params.limit);
|
|
1444
|
+
chunkL3LQNR34_cjs.assertVectorSearchLimit(params.vector.k);
|
|
1445
|
+
chunkROR5ZR6A_cjs.assertPgvectorEfSearch(params.vector.efSearch);
|
|
1446
|
+
const slot = chunkWCCATHMB_cjs.vectorSlotFromParams({
|
|
1317
1447
|
graphId: params.graphId,
|
|
1318
1448
|
nodeKind: params.nodeKind,
|
|
1319
1449
|
fieldPath: params.vector.fieldPath,
|
|
@@ -1321,11 +1451,11 @@ function createPostgresOperationBackend(options) {
|
|
|
1321
1451
|
metric: params.vector.metric,
|
|
1322
1452
|
indexType: params.vector.indexType
|
|
1323
1453
|
});
|
|
1324
|
-
const candidates = params.candidates ??
|
|
1454
|
+
const candidates = params.candidates ?? chunkWCCATHMB_cjs.buildLiveNodeCandidates(
|
|
1325
1455
|
tableNames.nodes,
|
|
1326
1456
|
params.graphId,
|
|
1327
1457
|
params.nodeKind,
|
|
1328
|
-
|
|
1458
|
+
chunkFA2AFWLP_cjs.nowIso()
|
|
1329
1459
|
);
|
|
1330
1460
|
const vectorParams = {
|
|
1331
1461
|
graphId: params.graphId,
|
|
@@ -1341,11 +1471,11 @@ function createPostgresOperationBackend(options) {
|
|
|
1341
1471
|
const vectorSql = vectorStrategy.buildSearch(
|
|
1342
1472
|
slot,
|
|
1343
1473
|
vectorParams,
|
|
1344
|
-
|
|
1474
|
+
chunkEDN4Y4ZG_cjs.sql.raw("SELECT node_id FROM tg_hybrid_cand")
|
|
1345
1475
|
);
|
|
1346
1476
|
const statement = operationStrategy.buildHybridSearch(
|
|
1347
1477
|
{ ...params, candidates },
|
|
1348
|
-
|
|
1478
|
+
chunkWODMN3Q2_cjs.toDrizzleSql(vectorSql, "postgres"),
|
|
1349
1479
|
params.vector.metric === "cosine"
|
|
1350
1480
|
);
|
|
1351
1481
|
const gucOverrides = await vectorSearchGucOverrides({
|
|
@@ -1359,9 +1489,9 @@ function createPostgresOperationBackend(options) {
|
|
|
1359
1489
|
statement
|
|
1360
1490
|
);
|
|
1361
1491
|
} catch (error) {
|
|
1362
|
-
throw
|
|
1492
|
+
throw chunkWCCATHMB_cjs.mapVectorWriteError(error, vectorParams);
|
|
1363
1493
|
}
|
|
1364
|
-
return raw.map((row) =>
|
|
1494
|
+
return raw.map((row) => chunkWCCATHMB_cjs.mapHybridSearchRow(row, toNodeRow));
|
|
1365
1495
|
}
|
|
1366
1496
|
} : {}
|
|
1367
1497
|
};
|
|
@@ -1376,7 +1506,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1376
1506
|
return active?.version;
|
|
1377
1507
|
}
|
|
1378
1508
|
const operationBackend = {
|
|
1379
|
-
...
|
|
1509
|
+
...commonOperationMembers,
|
|
1380
1510
|
...executeRawMethod,
|
|
1381
1511
|
...vectorEmbeddingMethods,
|
|
1382
1512
|
/**
|
|
@@ -1416,7 +1546,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1416
1546
|
tableNames,
|
|
1417
1547
|
async lockSchemaVersionForWrite(params) {
|
|
1418
1548
|
if (!transactionScoped) {
|
|
1419
|
-
throw new
|
|
1549
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
1420
1550
|
"The schema write fence requires an explicit PostgreSQL transaction.",
|
|
1421
1551
|
{
|
|
1422
1552
|
code: "SCHEMA_WRITE_FENCE_TRANSACTION_REQUIRED",
|
|
@@ -1426,15 +1556,17 @@ function createPostgresOperationBackend(options) {
|
|
|
1426
1556
|
}
|
|
1427
1557
|
const locked = await lockActiveSchemaVersion(params.graphId);
|
|
1428
1558
|
if (locked !== void 0) {
|
|
1429
|
-
|
|
1559
|
+
chunkWCCATHMB_cjs.assertActiveSchemaVersion(
|
|
1430
1560
|
params.graphId,
|
|
1431
1561
|
params.expectedVersion,
|
|
1432
1562
|
locked
|
|
1433
1563
|
);
|
|
1434
1564
|
return;
|
|
1435
1565
|
}
|
|
1436
|
-
const settled = await
|
|
1437
|
-
|
|
1566
|
+
const settled = await commonOperationMembers.getActiveSchema(
|
|
1567
|
+
params.graphId
|
|
1568
|
+
);
|
|
1569
|
+
throw new chunkMRDBBHIZ_cjs.StaleVersionError({
|
|
1438
1570
|
graphId: params.graphId,
|
|
1439
1571
|
expected: params.expectedVersion,
|
|
1440
1572
|
actual: settled?.version ?? 0
|
|
@@ -1443,43 +1575,29 @@ function createPostgresOperationBackend(options) {
|
|
|
1443
1575
|
// === Vector Index Operations ===
|
|
1444
1576
|
async createVectorIndex(params) {
|
|
1445
1577
|
if (vectorStrategy === void 0) return;
|
|
1446
|
-
const slot =
|
|
1578
|
+
const slot = chunkWCCATHMB_cjs.vectorSlotFromCreateIndexParams(params);
|
|
1447
1579
|
await contributionMaterializer.ensureVectorSlot(slot);
|
|
1448
1580
|
const indexStatement = vectorStrategy.buildCreateIndex?.(slot, {
|
|
1449
1581
|
concurrent: params.concurrent === true
|
|
1450
1582
|
});
|
|
1451
1583
|
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
|
-
}
|
|
1584
|
+
const strategyTableName = vectorStrategy.tableName(
|
|
1585
|
+
slot.graphId,
|
|
1586
|
+
slot.nodeKind,
|
|
1587
|
+
slot.fieldPath
|
|
1588
|
+
);
|
|
1589
|
+
await runPostgresVectorIndexBuild(
|
|
1590
|
+
vectorStrategy,
|
|
1591
|
+
execRun,
|
|
1592
|
+
strategyTableName,
|
|
1593
|
+
indexStatement,
|
|
1594
|
+
vectorStrategy.buildDropIndex?.(slot)
|
|
1595
|
+
);
|
|
1478
1596
|
}
|
|
1479
1597
|
},
|
|
1480
1598
|
// === Fulltext Operations ===
|
|
1481
1599
|
async upsertFulltext(params) {
|
|
1482
|
-
const timestamp =
|
|
1600
|
+
const timestamp = chunkFA2AFWLP_cjs.nowIso();
|
|
1483
1601
|
const statements = operationStrategy.buildUpsertFulltext(
|
|
1484
1602
|
params,
|
|
1485
1603
|
timestamp
|
|
@@ -1496,8 +1614,8 @@ function createPostgresOperationBackend(options) {
|
|
|
1496
1614
|
},
|
|
1497
1615
|
async upsertFulltextBatch(params) {
|
|
1498
1616
|
if (params.rows.length === 0) return;
|
|
1499
|
-
const timestamp =
|
|
1500
|
-
for (const rows of
|
|
1617
|
+
const timestamp = chunkFA2AFWLP_cjs.nowIso();
|
|
1618
|
+
for (const rows of chunkSIT26LAZ_cjs.chunk(
|
|
1501
1619
|
params.rows,
|
|
1502
1620
|
batchConfig.fulltextUpsertBatchSize
|
|
1503
1621
|
)) {
|
|
@@ -1512,7 +1630,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1512
1630
|
},
|
|
1513
1631
|
async deleteFulltextBatch(params) {
|
|
1514
1632
|
if (params.nodeIds.length === 0) return;
|
|
1515
|
-
for (const nodeIds of
|
|
1633
|
+
for (const nodeIds of chunkSIT26LAZ_cjs.chunk(
|
|
1516
1634
|
params.nodeIds,
|
|
1517
1635
|
batchConfig.fulltextDeleteChunkSize
|
|
1518
1636
|
)) {
|
|
@@ -1530,25 +1648,25 @@ function createPostgresOperationBackend(options) {
|
|
|
1530
1648
|
const rows = await execAll(query);
|
|
1531
1649
|
return rows.map((row, index) => ({
|
|
1532
1650
|
nodeId: row.node_id,
|
|
1533
|
-
score:
|
|
1651
|
+
score: chunkFA2AFWLP_cjs.coerceNumericScore(row.score),
|
|
1534
1652
|
rank: index + 1,
|
|
1535
1653
|
...row.snippet === null ? {} : { snippet: row.snippet }
|
|
1536
1654
|
}));
|
|
1537
1655
|
},
|
|
1538
1656
|
async dropVectorIndex(params) {
|
|
1539
1657
|
if (vectorStrategy === void 0) return;
|
|
1540
|
-
const slot =
|
|
1658
|
+
const slot = chunkWCCATHMB_cjs.vectorSlotFromDropIndexParams(params);
|
|
1541
1659
|
const dropStatement = vectorStrategy.buildDropIndex?.(slot);
|
|
1542
1660
|
if (dropStatement === void 0) return;
|
|
1543
1661
|
try {
|
|
1544
1662
|
await execRun(dropStatement);
|
|
1545
1663
|
} catch (error) {
|
|
1546
|
-
if (!
|
|
1664
|
+
if (!chunkSIT26LAZ_cjs.isMissingTableError(error)) throw error;
|
|
1547
1665
|
}
|
|
1548
1666
|
},
|
|
1549
1667
|
// === Query Execution ===
|
|
1550
1668
|
async execute(query) {
|
|
1551
|
-
const annTypes =
|
|
1669
|
+
const annTypes = chunkEDN4Y4ZG_cjs.isSqlFragment(query) ? chunkEDN4Y4ZG_cjs.annIndexScanTypes(query) : void 0;
|
|
1552
1670
|
if (annTypes !== void 0 && vectorStrategy !== void 0) {
|
|
1553
1671
|
const overrides = [];
|
|
1554
1672
|
for (const indexType of annTypes) {
|
|
@@ -1589,5 +1707,5 @@ function createTransactionBackend(options) {
|
|
|
1589
1707
|
}
|
|
1590
1708
|
|
|
1591
1709
|
exports.createPostgresBackend = createPostgresBackend;
|
|
1592
|
-
//# sourceMappingURL=chunk-
|
|
1593
|
-
//# sourceMappingURL=chunk-
|
|
1710
|
+
//# sourceMappingURL=chunk-PFBRJBUL.cjs.map
|
|
1711
|
+
//# sourceMappingURL=chunk-PFBRJBUL.cjs.map
|