@nicia-ai/typegraph 0.48.0 → 0.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backend/drizzle/indexes.cjs +9 -9
- package/dist/backend/drizzle/indexes.d.cts +1 -1
- package/dist/backend/drizzle/indexes.d.ts +1 -1
- package/dist/backend/drizzle/indexes.js +5 -5
- package/dist/backend/index.cjs +56 -52
- package/dist/backend/index.d.cts +3 -3
- package/dist/backend/index.d.ts +3 -3
- package/dist/backend/index.js +11 -11
- package/dist/backend/postgres/index.cjs +34 -28
- package/dist/backend/postgres/index.d.cts +7 -7
- package/dist/backend/postgres/index.d.ts +7 -7
- package/dist/backend/postgres/index.js +17 -15
- package/dist/backend/postgres/pglite-store.cjs +36 -35
- 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 +32 -31
- package/dist/backend/postgres/pglite-store.js.map +1 -1
- package/dist/backend/postgres/pglite.cjs +19 -17
- package/dist/backend/postgres/pglite.d.cts +3 -3
- package/dist/backend/postgres/pglite.d.ts +3 -3
- package/dist/backend/postgres/pglite.js +18 -16
- package/dist/backend/sqlite/index.cjs +31 -25
- package/dist/backend/sqlite/index.d.cts +7 -7
- package/dist/backend/sqlite/index.d.ts +7 -7
- package/dist/backend/sqlite/index.js +15 -13
- package/dist/backend/sqlite/libsql.cjs +22 -20
- 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 +17 -15
- package/dist/backend/sqlite/libsql.js.map +1 -1
- package/dist/backend/sqlite/local-store.cjs +37 -36
- 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 +33 -32
- package/dist/backend/sqlite/local-store.js.map +1 -1
- package/dist/backend/sqlite/local.cjs +20 -18
- package/dist/backend/sqlite/local.d.cts +3 -3
- package/dist/backend/sqlite/local.d.ts +3 -3
- package/dist/backend/sqlite/local.js +18 -16
- package/dist/{chunk-AX6JGVTZ.js → chunk-2CYI5HRH.js} +276 -206
- package/dist/chunk-2CYI5HRH.js.map +1 -0
- package/dist/{chunk-KF6K7TGH.js → chunk-2GIV5X4P.js} +702 -422
- package/dist/chunk-2GIV5X4P.js.map +1 -0
- package/dist/{chunk-2TYSSBU5.js → chunk-2Q45FAIE.js} +15 -15
- package/dist/{chunk-2TYSSBU5.js.map → chunk-2Q45FAIE.js.map} +1 -1
- package/dist/{chunk-WODMN3Q2.cjs → chunk-45YZXI6X.cjs} +27 -27
- package/dist/{chunk-WODMN3Q2.cjs.map → chunk-45YZXI6X.cjs.map} +1 -1
- package/dist/{chunk-3DMMGT6S.js → chunk-46UGOVRW.js} +3 -3
- package/dist/{chunk-3DMMGT6S.js.map → chunk-46UGOVRW.js.map} +1 -1
- package/dist/{chunk-GLHXM7C4.js → chunk-5LKOVCPP.js} +60 -23
- package/dist/chunk-5LKOVCPP.js.map +1 -0
- package/dist/{chunk-JFRT7S3B.cjs → chunk-5OWHU7Z7.cjs} +261 -459
- package/dist/chunk-5OWHU7Z7.cjs.map +1 -0
- package/dist/{chunk-7SQSZN2J.js → chunk-5PP4KRPV.js} +5 -5
- package/dist/{chunk-7SQSZN2J.js.map → chunk-5PP4KRPV.js.map} +1 -1
- package/dist/chunk-6KQEICJ6.cjs +12 -0
- package/dist/{chunk-MKJ4KXL5.cjs.map → chunk-6KQEICJ6.cjs.map} +1 -1
- package/dist/{chunk-6SWPJEYN.js → chunk-6LEOAIIB.js} +40 -6
- package/dist/chunk-6LEOAIIB.js.map +1 -0
- package/dist/{chunk-DZAICA5J.js → chunk-6NKSE5AU.js} +4 -4
- package/dist/{chunk-DZAICA5J.js.map → chunk-6NKSE5AU.js.map} +1 -1
- package/dist/{chunk-OVI7IXYX.js → chunk-6S3PTHL4.js} +3 -3
- package/dist/{chunk-OVI7IXYX.js.map → chunk-6S3PTHL4.js.map} +1 -1
- package/dist/{chunk-3FPR224C.cjs → chunk-7CCMCMJO.cjs} +102 -102
- package/dist/{chunk-3FPR224C.cjs.map → chunk-7CCMCMJO.cjs.map} +1 -1
- package/dist/{chunk-SHFBB23Q.js → chunk-7OWE7WD6.js} +6 -4
- package/dist/chunk-7OWE7WD6.js.map +1 -0
- package/dist/chunk-7PRMDZIA.cjs +182 -0
- package/dist/chunk-7PRMDZIA.cjs.map +1 -0
- package/dist/{chunk-CHAOFCHV.js → chunk-AH2A74OZ.js} +3 -3
- package/dist/{chunk-CHAOFCHV.js.map → chunk-AH2A74OZ.js.map} +1 -1
- package/dist/{chunk-OORXGFL5.cjs → chunk-BYBDM423.cjs} +48 -48
- package/dist/{chunk-OORXGFL5.cjs.map → chunk-BYBDM423.cjs.map} +1 -1
- package/dist/{chunk-JB6T4GLL.cjs → chunk-C76WFIVZ.cjs} +808 -519
- package/dist/chunk-C76WFIVZ.cjs.map +1 -0
- package/dist/{chunk-OTUPEF2W.cjs → chunk-CS6JTQQ2.cjs} +328 -257
- package/dist/chunk-CS6JTQQ2.cjs.map +1 -0
- package/dist/{chunk-AOSSQDVO.cjs → chunk-CSNOYIB4.cjs} +13 -13
- package/dist/{chunk-AOSSQDVO.cjs.map → chunk-CSNOYIB4.cjs.map} +1 -1
- package/dist/{chunk-HEV35TGT.js → chunk-DI6VC62F.js} +13 -4
- package/dist/chunk-DI6VC62F.js.map +1 -0
- package/dist/{chunk-2QGYQBS2.cjs → chunk-DWUDZ66O.cjs} +10 -10
- package/dist/{chunk-2QGYQBS2.cjs.map → chunk-DWUDZ66O.cjs.map} +1 -1
- package/dist/{chunk-ZDKTPBGV.js → chunk-EDLKIQRI.js} +4 -4
- package/dist/{chunk-ZDKTPBGV.js.map → chunk-EDLKIQRI.js.map} +1 -1
- package/dist/chunk-EH3JZJUM.cjs +567 -0
- package/dist/chunk-EH3JZJUM.cjs.map +1 -0
- package/dist/{chunk-S5TERQVW.js → chunk-FX5ZW6PN.js} +196 -33
- package/dist/chunk-FX5ZW6PN.js.map +1 -0
- package/dist/{chunk-XVWOYKIK.js → chunk-FZHF5UWR.js} +3 -3
- package/dist/{chunk-XVWOYKIK.js.map → chunk-FZHF5UWR.js.map} +1 -1
- package/dist/{chunk-BFUOME67.cjs → chunk-G2TLHH6T.cjs} +20 -11
- package/dist/chunk-G2TLHH6T.cjs.map +1 -0
- package/dist/{chunk-5PRKMB24.cjs → chunk-GHZPZNFC.cjs} +12 -4
- package/dist/chunk-GHZPZNFC.cjs.map +1 -0
- package/dist/{chunk-ZFMCDJGB.js → chunk-GVYVGGPJ.js} +11 -199
- package/dist/chunk-GVYVGGPJ.js.map +1 -0
- package/dist/{chunk-SDBBMD4N.js → chunk-H3XP6BAV.js} +3 -3
- package/dist/{chunk-SDBBMD4N.js.map → chunk-H3XP6BAV.js.map} +1 -1
- package/dist/{chunk-ROR5ZR6A.cjs → chunk-HSEZ7X6Y.cjs} +45 -45
- package/dist/{chunk-ROR5ZR6A.cjs.map → chunk-HSEZ7X6Y.cjs.map} +1 -1
- package/dist/{chunk-LRQKXRXO.cjs → chunk-HY5BNOUN.cjs} +4 -4
- package/dist/{chunk-LRQKXRXO.cjs.map → chunk-HY5BNOUN.cjs.map} +1 -1
- package/dist/chunk-HZUB5CON.js +27 -0
- package/dist/chunk-HZUB5CON.js.map +1 -0
- package/dist/{chunk-MYKHJI2J.js → chunk-I5C6OTKR.js} +3 -3
- package/dist/{chunk-MYKHJI2J.js.map → chunk-I5C6OTKR.js.map} +1 -1
- package/dist/{chunk-3U5ABFDW.cjs → chunk-IHK5KA2Q.cjs} +31 -28
- package/dist/chunk-IHK5KA2Q.cjs.map +1 -0
- package/dist/{chunk-26YKDNUD.cjs → chunk-IPRP6TDL.cjs} +12 -10
- package/dist/chunk-IPRP6TDL.cjs.map +1 -0
- package/dist/{chunk-UGHG7PGX.js → chunk-IRPYOHRC.js} +26 -4
- package/dist/chunk-IRPYOHRC.js.map +1 -0
- package/dist/{chunk-7XUYFFR4.cjs → chunk-ISKCIQF2.cjs} +20 -20
- package/dist/{chunk-7XUYFFR4.cjs.map → chunk-ISKCIQF2.cjs.map} +1 -1
- package/dist/{chunk-OD4SSY2U.js → chunk-JG5XIJDY.js} +57 -31
- package/dist/chunk-JG5XIJDY.js.map +1 -0
- package/dist/{chunk-2HIYYMWY.cjs → chunk-K2XYLVVB.cjs} +134 -133
- package/dist/chunk-K2XYLVVB.cjs.map +1 -0
- package/dist/{chunk-5K2BKEBD.js → chunk-K46SDNQD.js} +10 -4
- package/dist/chunk-K46SDNQD.js.map +1 -0
- package/dist/{chunk-TZEGUG6D.cjs → chunk-K6VKTBST.cjs} +4 -4
- package/dist/{chunk-TZEGUG6D.cjs.map → chunk-K6VKTBST.cjs.map} +1 -1
- package/dist/chunk-KWNWG4RC.cjs +12 -0
- package/dist/{chunk-CICO5GXD.cjs.map → chunk-KWNWG4RC.cjs.map} +1 -1
- package/dist/{chunk-FQPEMEWX.cjs → chunk-LLVOQOWE.cjs} +80 -32
- package/dist/chunk-LLVOQOWE.cjs.map +1 -0
- package/dist/{chunk-TQHGE7UC.cjs → chunk-M5MSP3BI.cjs} +18 -10
- package/dist/chunk-M5MSP3BI.cjs.map +1 -0
- package/dist/{chunk-ACGSAMD3.js → chunk-MJPZNEJZ.js} +274 -292
- package/dist/chunk-MJPZNEJZ.js.map +1 -0
- package/dist/{chunk-TUNPBZY3.cjs → chunk-MM3JHVKZ.cjs} +4 -4
- package/dist/{chunk-TUNPBZY3.cjs.map → chunk-MM3JHVKZ.cjs.map} +1 -1
- package/dist/{chunk-BRRP76WO.js → chunk-MX7EKQPM.js} +457 -299
- package/dist/chunk-MX7EKQPM.js.map +1 -0
- package/dist/{chunk-2SYZXD54.js → chunk-MZ34E2GN.js} +13 -12
- package/dist/chunk-MZ34E2GN.js.map +1 -0
- package/dist/{chunk-EDN4Y4ZG.cjs → chunk-OJHD3LXJ.cjs} +9 -9
- package/dist/{chunk-EDN4Y4ZG.cjs.map → chunk-OJHD3LXJ.cjs.map} +1 -1
- package/dist/{chunk-DO7SAMEK.cjs → chunk-ON47CBE4.cjs} +47 -47
- package/dist/{chunk-DO7SAMEK.cjs.map → chunk-ON47CBE4.cjs.map} +1 -1
- package/dist/{chunk-6LN7FIVU.js → chunk-PALYTHGM.js} +11 -4
- package/dist/chunk-PALYTHGM.js.map +1 -0
- package/dist/{chunk-YVF2EM7B.js → chunk-R7MRFE5P.js} +3 -3
- package/dist/{chunk-YVF2EM7B.js.map → chunk-R7MRFE5P.js.map} +1 -1
- package/dist/{chunk-EZEEWCFJ.cjs → chunk-RDP6ZRSM.cjs} +435 -265
- package/dist/chunk-RDP6ZRSM.cjs.map +1 -0
- package/dist/{chunk-GYEG3ZLZ.cjs → chunk-RJMHU2MG.cjs} +121 -18
- package/dist/chunk-RJMHU2MG.cjs.map +1 -0
- package/dist/chunk-RWUWTJQY.cjs +30 -0
- package/dist/chunk-RWUWTJQY.cjs.map +1 -0
- package/dist/{chunk-CT3ZKTOF.js → chunk-S33YQEL7.js} +7 -7
- package/dist/{chunk-CT3ZKTOF.js.map → chunk-S33YQEL7.js.map} +1 -1
- package/dist/chunk-S3SDEQMC.js +532 -0
- package/dist/chunk-S3SDEQMC.js.map +1 -0
- package/dist/{chunk-OI2GQ25X.cjs → chunk-SHC7BCG5.cjs} +7 -7
- package/dist/{chunk-OI2GQ25X.cjs.map → chunk-SHC7BCG5.cjs.map} +1 -1
- package/dist/{chunk-L3LQNR34.cjs → chunk-TEC24ZDA.cjs} +161 -161
- package/dist/{chunk-L3LQNR34.cjs.map → chunk-TEC24ZDA.cjs.map} +1 -1
- package/dist/{chunk-HDL2ARHX.cjs → chunk-TP4NJTI3.cjs} +63 -27
- package/dist/chunk-TP4NJTI3.cjs.map +1 -0
- package/dist/{chunk-UMGZDVOA.cjs → chunk-TTCOPKUL.cjs} +124 -124
- package/dist/{chunk-UMGZDVOA.cjs.map → chunk-TTCOPKUL.cjs.map} +1 -1
- package/dist/chunk-TUVD4DFR.cjs +1207 -0
- package/dist/chunk-TUVD4DFR.cjs.map +1 -0
- package/dist/{chunk-PFBRJBUL.cjs → chunk-TYGGUWMS.cjs} +178 -152
- package/dist/chunk-TYGGUWMS.cjs.map +1 -0
- package/dist/{chunk-4WMMBDS5.js → chunk-U3Z7XKAG.js} +7 -7
- package/dist/{chunk-4WMMBDS5.js.map → chunk-U3Z7XKAG.js.map} +1 -1
- package/dist/{chunk-NACVVDWB.js → chunk-U5EL6JUV.js} +10 -10
- package/dist/{chunk-NACVVDWB.js.map → chunk-U5EL6JUV.js.map} +1 -1
- package/dist/{chunk-OMZ37BM2.js → chunk-V76FGHY3.js} +5 -5
- package/dist/{chunk-OMZ37BM2.js.map → chunk-V76FGHY3.js.map} +1 -1
- package/dist/{chunk-6NGW27EO.cjs → chunk-VLBTRXA2.cjs} +10 -10
- package/dist/{chunk-6NGW27EO.cjs.map → chunk-VLBTRXA2.cjs.map} +1 -1
- package/dist/chunk-VTJVMP4I.js +1182 -0
- package/dist/chunk-VTJVMP4I.js.map +1 -0
- package/dist/{chunk-QTD6HX4O.js → chunk-W5SOCUBL.js} +5 -5
- package/dist/{chunk-QTD6HX4O.js.map → chunk-W5SOCUBL.js.map} +1 -1
- package/dist/{chunk-SR725PWF.cjs → chunk-WCLMKNQE.cjs} +1750 -1592
- package/dist/chunk-WCLMKNQE.cjs.map +1 -0
- package/dist/{chunk-TKZXMWQF.cjs → chunk-WK23PGTP.cjs} +13 -13
- package/dist/{chunk-TKZXMWQF.cjs.map → chunk-WK23PGTP.cjs.map} +1 -1
- package/dist/{chunk-KKBDXCLQ.js → chunk-WQBAQZHR.js} +4 -4
- package/dist/{chunk-KKBDXCLQ.js.map → chunk-WQBAQZHR.js.map} +1 -1
- package/dist/{chunk-MRDBBHIZ.cjs → chunk-X4GDXBOP.cjs} +2 -2
- package/dist/chunk-X4GDXBOP.cjs.map +1 -0
- package/dist/{chunk-WCCATHMB.cjs → chunk-XMY2SXOH.cjs} +438 -456
- package/dist/chunk-XMY2SXOH.cjs.map +1 -0
- package/dist/{chunk-D5R42W5D.js → chunk-XZW2CTNO.js} +115 -12
- package/dist/chunk-XZW2CTNO.js.map +1 -0
- package/dist/{chunk-NVY5CJFP.js → chunk-Y55DLLEG.js} +9 -6
- package/dist/chunk-Y55DLLEG.js.map +1 -0
- package/dist/chunk-YA36ABIL.js +174 -0
- package/dist/chunk-YA36ABIL.js.map +1 -0
- package/dist/{chunk-ZLONH2UD.js → chunk-YDEJQWOL.js} +2 -2
- package/dist/chunk-YDEJQWOL.js.map +1 -0
- package/dist/{chunk-JONXFAPO.js → chunk-ZAQUKCUC.js} +5 -5
- package/dist/{chunk-JONXFAPO.js.map → chunk-ZAQUKCUC.js.map} +1 -1
- package/dist/{chunk-SIT26LAZ.cjs → chunk-ZBFZGLZE.cjs} +29 -5
- package/dist/chunk-ZBFZGLZE.cjs.map +1 -0
- package/dist/{chunk-P6YLZTRE.js → chunk-ZRJTM7MT.js} +3 -3
- package/dist/{chunk-P6YLZTRE.js.map → chunk-ZRJTM7MT.js.map} +1 -1
- package/dist/core/index.cjs +29 -28
- package/dist/core/index.d.cts +4 -4
- package/dist/core/index.d.ts +4 -4
- package/dist/core/index.js +9 -8
- package/dist/{ddl-D_oW-EVO.d.ts → ddl-B49O7dB_.d.ts} +3 -3
- package/dist/{ddl-BL1NZLMY.d.cts → ddl-DcZG660s.d.cts} +3 -3
- package/dist/graph-extension/index.cjs +21 -20
- package/dist/graph-extension/index.d.cts +4 -4
- package/dist/graph-extension/index.d.ts +4 -4
- package/dist/graph-extension/index.js +5 -4
- package/dist/graph-merge/index.cjs +327 -302
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +14 -11
- package/dist/graph-merge/index.d.ts +14 -11
- package/dist/graph-merge/index.js +52 -27
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/{index-D7d1u2gr.d.ts → index-B0PrmE3K.d.cts} +16 -2
- package/dist/{index-COs_z6nV.d.cts → index-CwcXsL5R.d.ts} +16 -2
- package/dist/index.cjs +223 -222
- 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 +37 -36
- 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/ingestion-import-target-CI8OWIkM.d.ts +17 -0
- package/dist/ingestion-import-target-DCpfM1PX.d.cts +17 -0
- package/dist/interchange/index.cjs +55 -54
- package/dist/interchange/index.cjs.map +1 -1
- package/dist/interchange/index.d.cts +26 -12
- package/dist/interchange/index.d.ts +26 -12
- package/dist/interchange/index.js +19 -18
- package/dist/interchange/index.js.map +1 -1
- package/dist/{manager-D9eRT_ns.d.ts → manager-Cfg1ENj1.d.ts} +30 -2
- package/dist/{manager-CYaff3n3.d.cts → manager-D348fa6W.d.cts} +30 -2
- package/dist/{materialize-indexes-DJ3ykH59.d.ts → materialize-indexes-C9GG3O3C.d.ts} +1 -1
- package/dist/{materialize-indexes-DTtAnvfY.d.cts → materialize-indexes-CrSiW_lT.d.cts} +1 -1
- package/dist/{postgres-DMj39MEu.d.cts → postgres-CH1kkM5J.d.cts} +279 -2
- package/dist/{postgres-CcL4bAHS.d.ts → postgres-UStOycLI.d.ts} +279 -2
- package/dist/profiler/index.d.cts +9 -9
- package/dist/profiler/index.d.ts +9 -9
- package/dist/provenance/index.cjs +46 -44
- 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 +12 -10
- package/dist/provenance/index.js.map +1 -1
- package/dist/{repair-validity-windows-DlUSqwCg.d.ts → repair-validity-windows-BtOEe2pS.d.ts} +2 -2
- package/dist/{repair-validity-windows-BFNZvd_H.d.cts → repair-validity-windows-aWX7VNvv.d.cts} +2 -2
- package/dist/schema/index.cjs +46 -46
- package/dist/schema/index.d.cts +6 -6
- package/dist/schema/index.d.ts +6 -6
- package/dist/schema/index.js +19 -19
- package/dist/{searchable-DHJMh_nj.d.cts → searchable-C8-RrL3l.d.cts} +1 -1
- package/dist/{searchable-bpE1bBfc.d.ts → searchable-z4BiFfHI.d.ts} +1 -1
- package/dist/{sqlite-D7Oz0SQh.d.ts → sqlite-Cyx9j9o6.d.cts} +309 -2
- package/dist/{sqlite-YppHrNFb.d.cts → sqlite-axLw5Lo5.d.ts} +309 -2
- package/dist/{store-JUVvtmR4.d.cts → store-CTfQ9taw.d.ts} +110 -13
- package/dist/{store-UzrGvZOo.d.ts → store-DR9J7JVB.d.cts} +110 -13
- package/dist/{temporal-5GqpYCk2.d.cts → temporal-B4Ky4wzh.d.cts} +1 -1
- package/dist/{temporal-CbnLzTmM.d.ts → temporal-CBOrERz5.d.ts} +1 -1
- package/dist/{types-CXAhpW-c.d.cts → types-BE921wRl.d.cts} +1 -1
- package/dist/{types-Bx74kaTt.d.ts → types-BScHXVM7.d.ts} +1 -1
- package/dist/{types-BqFZTQmV.d.cts → types-CWg4dTjj.d.cts} +257 -6
- package/dist/{types-BqFZTQmV.d.ts → types-CWg4dTjj.d.ts} +257 -6
- package/dist/{where-O-k2wgYm.d.ts → where-BWXUPV3C.d.ts} +1 -1
- package/dist/{where-DI_Fqz-X.d.cts → where-CNtx1aLc.d.cts} +1 -1
- package/package.json +4 -4
- package/dist/chunk-26YKDNUD.cjs.map +0 -1
- package/dist/chunk-2HIYYMWY.cjs.map +0 -1
- package/dist/chunk-2SYZXD54.js.map +0 -1
- package/dist/chunk-3KOY4FH3.cjs +0 -934
- package/dist/chunk-3KOY4FH3.cjs.map +0 -1
- package/dist/chunk-3U5ABFDW.cjs.map +0 -1
- package/dist/chunk-5K2BKEBD.js.map +0 -1
- package/dist/chunk-5PRKMB24.cjs.map +0 -1
- package/dist/chunk-6LN7FIVU.js.map +0 -1
- package/dist/chunk-6SWPJEYN.js.map +0 -1
- package/dist/chunk-ACGSAMD3.js.map +0 -1
- package/dist/chunk-AX6JGVTZ.js.map +0 -1
- package/dist/chunk-BFUOME67.cjs.map +0 -1
- package/dist/chunk-BRRP76WO.js.map +0 -1
- package/dist/chunk-CICO5GXD.cjs +0 -12
- package/dist/chunk-D5R42W5D.js.map +0 -1
- package/dist/chunk-EZEEWCFJ.cjs.map +0 -1
- package/dist/chunk-FA2AFWLP.cjs +0 -167
- package/dist/chunk-FA2AFWLP.cjs.map +0 -1
- package/dist/chunk-FQPEMEWX.cjs.map +0 -1
- package/dist/chunk-GLHXM7C4.js.map +0 -1
- package/dist/chunk-GYEG3ZLZ.cjs.map +0 -1
- package/dist/chunk-HDL2ARHX.cjs.map +0 -1
- package/dist/chunk-HEV35TGT.js.map +0 -1
- package/dist/chunk-I4GAZH5Z.js +0 -913
- package/dist/chunk-I4GAZH5Z.js.map +0 -1
- package/dist/chunk-JB6T4GLL.cjs.map +0 -1
- package/dist/chunk-JBQQ7THH.js +0 -20
- package/dist/chunk-JBQQ7THH.js.map +0 -1
- package/dist/chunk-JFRT7S3B.cjs.map +0 -1
- package/dist/chunk-KF6K7TGH.js.map +0 -1
- package/dist/chunk-MKJ4KXL5.cjs +0 -12
- package/dist/chunk-MRDBBHIZ.cjs.map +0 -1
- package/dist/chunk-NVY5CJFP.js.map +0 -1
- package/dist/chunk-OD4SSY2U.js.map +0 -1
- package/dist/chunk-OTUPEF2W.cjs.map +0 -1
- package/dist/chunk-PFBRJBUL.cjs.map +0 -1
- package/dist/chunk-PWLJ77UV.cjs +0 -23
- package/dist/chunk-PWLJ77UV.cjs.map +0 -1
- package/dist/chunk-S5TERQVW.js.map +0 -1
- package/dist/chunk-SHFBB23Q.js.map +0 -1
- package/dist/chunk-SIT26LAZ.cjs.map +0 -1
- package/dist/chunk-SR725PWF.cjs.map +0 -1
- package/dist/chunk-TQHGE7UC.cjs.map +0 -1
- package/dist/chunk-UGHG7PGX.js.map +0 -1
- package/dist/chunk-WCCATHMB.cjs.map +0 -1
- package/dist/chunk-YIURNGXI.js +0 -155
- package/dist/chunk-YIURNGXI.js.map +0 -1
- package/dist/chunk-ZFMCDJGB.js.map +0 -1
- package/dist/chunk-ZLONH2UD.js.map +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
3
|
+
var chunkXMY2SXOH_cjs = require('./chunk-XMY2SXOH.cjs');
|
|
4
|
+
var chunkHSEZ7X6Y_cjs = require('./chunk-HSEZ7X6Y.cjs');
|
|
5
|
+
var chunkEH3JZJUM_cjs = require('./chunk-EH3JZJUM.cjs');
|
|
6
|
+
var chunkTP4NJTI3_cjs = require('./chunk-TP4NJTI3.cjs');
|
|
7
|
+
var chunk45YZXI6X_cjs = require('./chunk-45YZXI6X.cjs');
|
|
8
|
+
var chunkZBFZGLZE_cjs = require('./chunk-ZBFZGLZE.cjs');
|
|
9
|
+
var chunkGHZPZNFC_cjs = require('./chunk-GHZPZNFC.cjs');
|
|
10
|
+
var chunkTEC24ZDA_cjs = require('./chunk-TEC24ZDA.cjs');
|
|
11
|
+
var chunkOJHD3LXJ_cjs = require('./chunk-OJHD3LXJ.cjs');
|
|
12
|
+
var chunkX4GDXBOP_cjs = require('./chunk-X4GDXBOP.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 chunkXMY2SXOH_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 chunk45YZXI6X_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
|
+
chunkOJHD3LXJ_cjs.isSqlFragment(query) ? chunk45YZXI6X_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 (chunkOJHD3LXJ_cjs.isSqlFragment(query) && chunkOJHD3LXJ_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 chunkX4GDXBOP_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 chunkX4GDXBOP_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 / chunkXMY2SXOH_cjs.EMBEDDING_UPSERT_PARAM_COUNT)
|
|
314
314
|
),
|
|
315
315
|
findEdgesEndpointChunkSize: Math.max(
|
|
316
316
|
1,
|
|
317
|
-
maxBindParameters -
|
|
317
|
+
maxBindParameters - chunkXMY2SXOH_cjs.FIND_EDGES_ENDPOINT_FIXED_PARAM_COUNT
|
|
318
318
|
),
|
|
319
319
|
fulltextDeleteChunkSize: Math.max(
|
|
320
320
|
1,
|
|
@@ -352,8 +352,17 @@ var IDENTITY_TABLE_LOGICAL_NAMES = /* @__PURE__ */ new Set([
|
|
|
352
352
|
"identityClosure",
|
|
353
353
|
"identitySeparation"
|
|
354
354
|
]);
|
|
355
|
-
|
|
356
|
-
|
|
355
|
+
async function withConcurrentCreateRetry(run) {
|
|
356
|
+
try {
|
|
357
|
+
return await run();
|
|
358
|
+
} catch (error) {
|
|
359
|
+
if (!chunkZBFZGLZE_cjs.isPostgresConcurrentDdlRaceError(error)) throw error;
|
|
360
|
+
return await run();
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
function extensionDdlLockKey(extension) {
|
|
364
|
+
return `typegraph:extension-ddl:${extension}`;
|
|
365
|
+
}
|
|
357
366
|
function parallelWorkerResetSql(tableName) {
|
|
358
367
|
return `ALTER TABLE "${tableName.replaceAll('"', '""')}" RESET (parallel_workers);`;
|
|
359
368
|
}
|
|
@@ -388,7 +397,7 @@ function reportParallelWorkerResetFailure(tableName, resetError) {
|
|
|
388
397
|
async function resetVectorParallelWorkers(execute, tableName) {
|
|
389
398
|
try {
|
|
390
399
|
await execute(
|
|
391
|
-
|
|
400
|
+
chunkOJHD3LXJ_cjs.sql`ALTER TABLE ${chunkOJHD3LXJ_cjs.sql.identifier(tableName)} RESET (parallel_workers)`
|
|
392
401
|
);
|
|
393
402
|
} catch (resetError) {
|
|
394
403
|
throw parallelWorkerResetError(tableName, resetError);
|
|
@@ -399,7 +408,7 @@ async function runVectorIndexBuildWithSerialFallback(execute, tableName, indexSt
|
|
|
399
408
|
try {
|
|
400
409
|
await execute(indexStatement);
|
|
401
410
|
} catch (error) {
|
|
402
|
-
if (!
|
|
411
|
+
if (!chunkZBFZGLZE_cjs.isInsufficientResourcesError(error)) throw error;
|
|
403
412
|
if (dropStatement !== void 0) {
|
|
404
413
|
try {
|
|
405
414
|
await execute(dropStatement);
|
|
@@ -420,7 +429,7 @@ async function runVectorIndexBuildWithSerialFallback(execute, tableName, indexSt
|
|
|
420
429
|
}
|
|
421
430
|
}
|
|
422
431
|
async function runPostgresVectorIndexBuild(vectorStrategy, execute, tableName, indexStatement, dropStatement) {
|
|
423
|
-
if (vectorStrategy !==
|
|
432
|
+
if (vectorStrategy !== chunkHSEZ7X6Y_cjs.pgvectorStrategy) {
|
|
424
433
|
await execute(indexStatement);
|
|
425
434
|
return;
|
|
426
435
|
}
|
|
@@ -432,9 +441,9 @@ async function runPostgresVectorIndexBuild(vectorStrategy, execute, tableName, i
|
|
|
432
441
|
);
|
|
433
442
|
}
|
|
434
443
|
async function runSerialVectorIndexBuild(execute, tableName, indexStatement, parallelBuildError) {
|
|
435
|
-
const table =
|
|
444
|
+
const table = chunkOJHD3LXJ_cjs.sql.identifier(tableName);
|
|
436
445
|
try {
|
|
437
|
-
await execute(
|
|
446
|
+
await execute(chunkOJHD3LXJ_cjs.sql`ALTER TABLE ${table} SET (parallel_workers = 0)`);
|
|
438
447
|
} catch (setError) {
|
|
439
448
|
if (parallelBuildError === void 0) throw setError;
|
|
440
449
|
throw vectorSerialFallbackPreparationError(
|
|
@@ -450,7 +459,7 @@ async function runSerialVectorIndexBuild(execute, tableName, indexStatement, par
|
|
|
450
459
|
buildFailure = { error };
|
|
451
460
|
}
|
|
452
461
|
try {
|
|
453
|
-
await execute(
|
|
462
|
+
await execute(chunkOJHD3LXJ_cjs.sql`ALTER TABLE ${table} RESET (parallel_workers)`);
|
|
454
463
|
} catch (resetError) {
|
|
455
464
|
if (buildFailure === void 0) {
|
|
456
465
|
throw parallelWorkerResetError(tableName, resetError);
|
|
@@ -459,27 +468,27 @@ async function runSerialVectorIndexBuild(execute, tableName, indexStatement, par
|
|
|
459
468
|
}
|
|
460
469
|
if (buildFailure !== void 0) throw buildFailure.error;
|
|
461
470
|
}
|
|
462
|
-
var toNodeRow =
|
|
463
|
-
var toEdgeRow =
|
|
464
|
-
var toUniqueRow =
|
|
465
|
-
var toSchemaVersionRow =
|
|
466
|
-
|
|
471
|
+
var toNodeRow = chunkEH3JZJUM_cjs.createNodeRowMapper(chunkEH3JZJUM_cjs.POSTGRES_ROW_MAPPER_CONFIG);
|
|
472
|
+
var toEdgeRow = chunkEH3JZJUM_cjs.createEdgeRowMapper(chunkEH3JZJUM_cjs.POSTGRES_ROW_MAPPER_CONFIG);
|
|
473
|
+
var toUniqueRow = chunkEH3JZJUM_cjs.createUniqueRowMapper(chunkEH3JZJUM_cjs.POSTGRES_ROW_MAPPER_CONFIG);
|
|
474
|
+
var toSchemaVersionRow = chunkEH3JZJUM_cjs.createSchemaVersionRowMapper(
|
|
475
|
+
chunkEH3JZJUM_cjs.POSTGRES_ROW_MAPPER_CONFIG
|
|
467
476
|
);
|
|
468
477
|
function buildPostgresCapabilities(fulltextStrategy, vectorStrategy) {
|
|
469
478
|
return {
|
|
470
|
-
...
|
|
471
|
-
...vectorStrategy === void 0 ? {} : { vector:
|
|
472
|
-
fulltext:
|
|
479
|
+
...chunkGHZPZNFC_cjs.POSTGRES_CAPABILITIES,
|
|
480
|
+
...vectorStrategy === void 0 ? {} : { vector: chunkTEC24ZDA_cjs.buildVectorCapabilities(vectorStrategy) },
|
|
481
|
+
fulltext: chunkTEC24ZDA_cjs.buildFulltextCapabilities(fulltextStrategy)
|
|
473
482
|
};
|
|
474
483
|
}
|
|
475
484
|
function createPostgresBackend(db, options = {}) {
|
|
476
|
-
const resourceAudit =
|
|
485
|
+
const resourceAudit = chunkZBFZGLZE_cjs.resolveDeclaredBackendResource(
|
|
477
486
|
getSerializedPostgresClient(db),
|
|
478
487
|
options.serializedResource
|
|
479
488
|
);
|
|
480
|
-
const tables2 = options.tables ??
|
|
481
|
-
const fulltextStrategy = options.fulltext ??
|
|
482
|
-
const vectorStrategy = options.vector === false ? void 0 : options.vector ??
|
|
489
|
+
const tables2 = options.tables ?? chunkTP4NJTI3_cjs.tables;
|
|
490
|
+
const fulltextStrategy = options.fulltext ?? chunkTEC24ZDA_cjs.tsvectorStrategy;
|
|
491
|
+
const vectorStrategy = options.vector === false ? void 0 : options.vector ?? chunkHSEZ7X6Y_cjs.pgvectorStrategy;
|
|
483
492
|
const iterativeScanProbe = createIterativeScanProbe();
|
|
484
493
|
const baseCapabilities = buildPostgresCapabilities(
|
|
485
494
|
fulltextStrategy,
|
|
@@ -492,14 +501,14 @@ function createPostgresBackend(db, options = {}) {
|
|
|
492
501
|
supported: false
|
|
493
502
|
}
|
|
494
503
|
} : {};
|
|
495
|
-
const configuredMaxBindParameters = options.capabilities?.maxBindParameters ??
|
|
504
|
+
const configuredMaxBindParameters = options.capabilities?.maxBindParameters ?? chunkGHZPZNFC_cjs.POSTGRES_MAX_BIND_PARAMETERS;
|
|
496
505
|
const driverBindParameterOverrides = isPgliteDatabase(db) ? {
|
|
497
506
|
maxBindParameters: Math.min(
|
|
498
507
|
configuredMaxBindParameters,
|
|
499
508
|
PGLITE_MAX_BIND_PARAMETERS
|
|
500
509
|
)
|
|
501
510
|
} : {};
|
|
502
|
-
const declaredCapabilities =
|
|
511
|
+
const declaredCapabilities = chunkGHZPZNFC_cjs.normalizeGraphAnalyticsCapabilities({
|
|
503
512
|
...baseCapabilities,
|
|
504
513
|
...httpOnlyOverrides,
|
|
505
514
|
...options.capabilities,
|
|
@@ -510,7 +519,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
510
519
|
contributions: {
|
|
511
520
|
supported: true,
|
|
512
521
|
probe: true,
|
|
513
|
-
rebuild:
|
|
522
|
+
rebuild: chunkXMY2SXOH_cjs.contributionRebuildSupported(
|
|
514
523
|
fulltextStrategy,
|
|
515
524
|
tables2.fulltextTableName,
|
|
516
525
|
declaredCapabilities.transactions
|
|
@@ -520,7 +529,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
520
529
|
const adapterOptions = {
|
|
521
530
|
...options.prepareStatements === void 0 ? {} : { prepareStatements: options.prepareStatements },
|
|
522
531
|
...options.preparedStatementCacheMax === void 0 ? {} : { preparedStatementCacheMax: options.preparedStatementCacheMax },
|
|
523
|
-
maxBindParameters: capabilities.maxBindParameters ??
|
|
532
|
+
maxBindParameters: capabilities.maxBindParameters ?? chunkGHZPZNFC_cjs.POSTGRES_MAX_BIND_PARAMETERS
|
|
524
533
|
};
|
|
525
534
|
const executionAdapter = createPostgresExecutionAdapter(db, adapterOptions);
|
|
526
535
|
const tableNames = {
|
|
@@ -535,7 +544,8 @@ function createPostgresBackend(db, options = {}) {
|
|
|
535
544
|
identityClosure: drizzleOrm.getTableName(tables2.identityClosure),
|
|
536
545
|
identitySeparation: drizzleOrm.getTableName(tables2.identitySeparation),
|
|
537
546
|
fulltext: tables2.fulltextTableName,
|
|
538
|
-
uniques: drizzleOrm.getTableName(tables2.uniques)
|
|
547
|
+
uniques: drizzleOrm.getTableName(tables2.uniques),
|
|
548
|
+
edgeClaims: drizzleOrm.getTableName(tables2.edgeClaims)
|
|
539
549
|
};
|
|
540
550
|
const coreAnalyzeStatements = [
|
|
541
551
|
tableNames.nodes,
|
|
@@ -543,8 +553,8 @@ function createPostgresBackend(db, options = {}) {
|
|
|
543
553
|
drizzleOrm.getTableName(tables2.uniques),
|
|
544
554
|
tableNames.fulltext
|
|
545
555
|
].map(
|
|
546
|
-
(name) =>
|
|
547
|
-
|
|
556
|
+
(name) => chunk45YZXI6X_cjs.toDrizzleSql(
|
|
557
|
+
chunkOJHD3LXJ_cjs.sql`ANALYZE (SKIP_LOCKED) ${chunkOJHD3LXJ_cjs.sql.identifier(name)}`,
|
|
548
558
|
"postgres"
|
|
549
559
|
)
|
|
550
560
|
);
|
|
@@ -557,11 +567,11 @@ function createPostgresBackend(db, options = {}) {
|
|
|
557
567
|
tableNames.identityClosure,
|
|
558
568
|
tableNames.identitySeparation
|
|
559
569
|
];
|
|
560
|
-
const operationStrategy =
|
|
570
|
+
const operationStrategy = chunkXMY2SXOH_cjs.createPostgresOperationStrategy(
|
|
561
571
|
tables2,
|
|
562
572
|
fulltextStrategy
|
|
563
573
|
);
|
|
564
|
-
const guardedTableExists =
|
|
574
|
+
const guardedTableExists = chunkXMY2SXOH_cjs.createCachedTableExistence(
|
|
565
575
|
async (tableName) => {
|
|
566
576
|
const rows = await executionAdapter.execute(
|
|
567
577
|
operationStrategy.buildTableExists(tableName)
|
|
@@ -573,27 +583,51 @@ function createPostgresBackend(db, options = {}) {
|
|
|
573
583
|
const matTable = tables2.contributionMaterializations;
|
|
574
584
|
async function executeConcurrentCreateDdl(ddl) {
|
|
575
585
|
const statement = drizzleOrm.sql.raw(ddl);
|
|
576
|
-
|
|
577
|
-
await db.execute(statement);
|
|
578
|
-
} catch (error) {
|
|
579
|
-
if (!chunkSIT26LAZ_cjs.isPostgresConcurrentDdlRaceError(error)) throw error;
|
|
586
|
+
await withConcurrentCreateRetry(async () => {
|
|
580
587
|
await db.execute(statement);
|
|
581
|
-
}
|
|
588
|
+
});
|
|
582
589
|
}
|
|
583
590
|
async function ensureTableWithConcurrentCreateRetry(table) {
|
|
584
|
-
await executeConcurrentCreateDdl(
|
|
591
|
+
await executeConcurrentCreateDdl(chunkTP4NJTI3_cjs.generatePgCreateTableSQL(table));
|
|
592
|
+
}
|
|
593
|
+
async function ensureDatabaseExtension(name) {
|
|
594
|
+
const validated = chunkGHZPZNFC_cjs.DATABASE_EXTENSION_NAMES.find(
|
|
595
|
+
(candidate) => candidate === name
|
|
596
|
+
);
|
|
597
|
+
if (validated === void 0) {
|
|
598
|
+
throw new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
599
|
+
`Unsupported database extension "${name}".`,
|
|
600
|
+
{ extension: name, supported: chunkGHZPZNFC_cjs.DATABASE_EXTENSION_NAMES },
|
|
601
|
+
{
|
|
602
|
+
suggestion: `Request one of: ${chunkGHZPZNFC_cjs.DATABASE_EXTENSION_NAMES.join(", ")}.`
|
|
603
|
+
}
|
|
604
|
+
);
|
|
605
|
+
}
|
|
606
|
+
const ddl = `CREATE EXTENSION IF NOT EXISTS "${validated}";`;
|
|
607
|
+
if (!capabilities.transactions) {
|
|
608
|
+
await executeConcurrentCreateDdl(ddl);
|
|
609
|
+
return;
|
|
610
|
+
}
|
|
611
|
+
await withConcurrentCreateRetry(async () => {
|
|
612
|
+
await db.transaction(async (tx) => {
|
|
613
|
+
await tx.execute(
|
|
614
|
+
drizzleOrm.sql`SELECT pg_advisory_xact_lock(hashtext(${extensionDdlLockKey(validated)}), 0)`
|
|
615
|
+
);
|
|
616
|
+
await tx.execute(drizzleOrm.sql.raw(ddl));
|
|
617
|
+
});
|
|
618
|
+
});
|
|
585
619
|
}
|
|
586
620
|
async function ensureContributionMaterializationsTableImpl() {
|
|
587
621
|
await ensureTableWithConcurrentCreateRetry(matTable);
|
|
588
622
|
}
|
|
589
623
|
function identityContributionsFor(identityTableNames) {
|
|
590
|
-
const identityTables =
|
|
624
|
+
const identityTables = chunkTP4NJTI3_cjs.createPostgresTables({
|
|
591
625
|
identityAssertions: identityTableNames.identityAssertions,
|
|
592
626
|
recordedIdentityAssertions: identityTableNames.recordedIdentityAssertions,
|
|
593
627
|
identityClosure: identityTableNames.identityClosure,
|
|
594
628
|
identitySeparation: identityTableNames.identitySeparation
|
|
595
629
|
});
|
|
596
|
-
return
|
|
630
|
+
return chunkTP4NJTI3_cjs.postgresContributions(identityTables, fulltextStrategy).filter(
|
|
597
631
|
(contribution) => IDENTITY_TABLE_LOGICAL_NAMES.has(contribution.logicalName)
|
|
598
632
|
);
|
|
599
633
|
}
|
|
@@ -608,25 +642,25 @@ function createPostgresBackend(db, options = {}) {
|
|
|
608
642
|
);
|
|
609
643
|
const row = rows[0];
|
|
610
644
|
if (row === void 0) return void 0;
|
|
611
|
-
return
|
|
645
|
+
return chunkXMY2SXOH_cjs.mapContributionMaterializationRow(
|
|
612
646
|
row,
|
|
613
|
-
|
|
647
|
+
chunkXMY2SXOH_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.decode
|
|
614
648
|
);
|
|
615
649
|
}
|
|
616
650
|
async function getContributionMaterializationRows(graphId) {
|
|
617
651
|
const rows = await db.select().from(matTable).where(drizzleOrm.eq(matTable.graphId, graphId));
|
|
618
652
|
return rows.map(
|
|
619
|
-
(row) =>
|
|
653
|
+
(row) => chunkXMY2SXOH_cjs.mapContributionMaterializationRow(
|
|
620
654
|
row,
|
|
621
|
-
|
|
655
|
+
chunkXMY2SXOH_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.decode
|
|
622
656
|
)
|
|
623
657
|
);
|
|
624
658
|
}
|
|
625
659
|
async function recordContributionMaterializationRow(params) {
|
|
626
660
|
await db.insert(matTable).values(
|
|
627
|
-
|
|
661
|
+
chunkXMY2SXOH_cjs.buildContributionInsertValues(
|
|
628
662
|
params,
|
|
629
|
-
|
|
663
|
+
chunkXMY2SXOH_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.encode
|
|
630
664
|
)
|
|
631
665
|
).onConflictDoUpdate({
|
|
632
666
|
target: [
|
|
@@ -635,7 +669,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
635
669
|
matTable.owner,
|
|
636
670
|
matTable.tableName
|
|
637
671
|
],
|
|
638
|
-
set:
|
|
672
|
+
set: chunkXMY2SXOH_cjs.buildContributionOnConflictSet(
|
|
639
673
|
matTable.materializedAt,
|
|
640
674
|
params.materializedAt
|
|
641
675
|
)
|
|
@@ -655,9 +689,9 @@ function createPostgresBackend(db, options = {}) {
|
|
|
655
689
|
const rows = await executionAdapter.execute(
|
|
656
690
|
operationStrategy.buildTableExists(tableName)
|
|
657
691
|
);
|
|
658
|
-
return
|
|
692
|
+
return chunkXMY2SXOH_cjs.tableExistsFromRow(rows[0]);
|
|
659
693
|
}
|
|
660
|
-
const contributionMaterializer =
|
|
694
|
+
const contributionMaterializer = chunkXMY2SXOH_cjs.createContributionMaterializer({
|
|
661
695
|
dialect: "postgres",
|
|
662
696
|
fulltextStrategy,
|
|
663
697
|
fulltextTableName: tables2.fulltextTableName,
|
|
@@ -698,7 +732,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
698
732
|
});
|
|
699
733
|
function runSchemaWriteTransaction(graphId, fn) {
|
|
700
734
|
if (!capabilities.transactions) {
|
|
701
|
-
throw new
|
|
735
|
+
throw new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
702
736
|
"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.",
|
|
703
737
|
{
|
|
704
738
|
backend: "postgres",
|
|
@@ -749,7 +783,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
749
783
|
schemaVersionsTable: tables2.schemaVersions
|
|
750
784
|
});
|
|
751
785
|
return {
|
|
752
|
-
backend:
|
|
786
|
+
backend: chunkXMY2SXOH_cjs.gateFulltext(
|
|
753
787
|
backend2,
|
|
754
788
|
contributionMaterializer.assertInitialized,
|
|
755
789
|
contributionMaterializer.refuseUnavailableFulltext
|
|
@@ -773,33 +807,33 @@ function createPostgresBackend(db, options = {}) {
|
|
|
773
807
|
);
|
|
774
808
|
const executeCompiled = trustedExecutionAdapter.executeCompiled;
|
|
775
809
|
if (executeCompiled === void 0) {
|
|
776
|
-
throw new
|
|
810
|
+
throw new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
777
811
|
"Trusted import could not bind raw execution to the PostgreSQL transaction.",
|
|
778
812
|
{ capability: "trustedImport", dialect: "postgres" }
|
|
779
813
|
);
|
|
780
814
|
}
|
|
781
|
-
const trustedTx =
|
|
815
|
+
const trustedTx = chunkZBFZGLZE_cjs.deriveBackend(tx, {
|
|
782
816
|
executeRaw(sqlText, params) {
|
|
783
817
|
return executeCompiled({ params, sql: sqlText });
|
|
784
818
|
}
|
|
785
819
|
});
|
|
786
|
-
await
|
|
787
|
-
await
|
|
788
|
-
const indexDefinitions = await
|
|
820
|
+
await chunkXMY2SXOH_cjs.lockPostgresTrustedImportTables(trustedTx, tableNames);
|
|
821
|
+
await chunkXMY2SXOH_cjs.assertTrustedImportDatabaseEmpty(trustedTx, tableNames);
|
|
822
|
+
const indexDefinitions = await chunkXMY2SXOH_cjs.suspendPostgresSecondaryIndexes(
|
|
789
823
|
trustedTx,
|
|
790
824
|
tableNames
|
|
791
825
|
);
|
|
792
826
|
const result = await fn(
|
|
793
|
-
|
|
827
|
+
chunkXMY2SXOH_cjs.createPostgresTrustedImportSession(trustedTx, tableNames)
|
|
794
828
|
);
|
|
795
|
-
await
|
|
796
|
-
await
|
|
829
|
+
await chunkXMY2SXOH_cjs.restoreSecondaryIndexes(trustedTx, indexDefinitions);
|
|
830
|
+
await chunkXMY2SXOH_cjs.analyzeImportedTables(trustedTx, tableNames);
|
|
797
831
|
return result;
|
|
798
832
|
});
|
|
799
833
|
}
|
|
800
834
|
} : {},
|
|
801
835
|
async bootstrapTables() {
|
|
802
|
-
const statements =
|
|
836
|
+
const statements = chunkTP4NJTI3_cjs.generatePostgresDDL(tables2, fulltextStrategy);
|
|
803
837
|
for (const statement of statements) {
|
|
804
838
|
await executeConcurrentCreateDdl(statement);
|
|
805
839
|
}
|
|
@@ -834,7 +868,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
834
868
|
// uninitialized database throws `StoreNotInitializedError` loudly
|
|
835
869
|
// rather than self-healing on a read/write path (#135). Shared
|
|
836
870
|
// verbatim with the tx-scoped gate via `gateFulltextMethods`.
|
|
837
|
-
...
|
|
871
|
+
...chunkXMY2SXOH_cjs.gateFulltextMethods(
|
|
838
872
|
operations,
|
|
839
873
|
contributionMaterializer.assertInitialized,
|
|
840
874
|
contributionMaterializer.refuseUnavailableFulltext
|
|
@@ -842,6 +876,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
842
876
|
async executeDdl(ddl) {
|
|
843
877
|
await db.execute(drizzleOrm.sql.raw(ddl));
|
|
844
878
|
},
|
|
879
|
+
ensureExtension: ensureDatabaseExtension,
|
|
845
880
|
async ensureIndexMaterializationsTable() {
|
|
846
881
|
await ensureTableWithConcurrentCreateRetry(tables2.indexMaterializations);
|
|
847
882
|
const tableName = drizzleOrm.getTableName(tables2.indexMaterializations);
|
|
@@ -852,17 +887,8 @@ function createPostgresBackend(db, options = {}) {
|
|
|
852
887
|
`ALTER TABLE "${tableName}" ADD COLUMN IF NOT EXISTS "claim_token" text;`
|
|
853
888
|
);
|
|
854
889
|
},
|
|
855
|
-
|
|
856
|
-
|
|
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
|
-
});
|
|
890
|
+
ensureTrigramExtension() {
|
|
891
|
+
return ensureDatabaseExtension("pg_trgm");
|
|
866
892
|
},
|
|
867
893
|
async claimIndexMaterialization(params) {
|
|
868
894
|
const t = tables2.indexMaterializations;
|
|
@@ -902,26 +928,26 @@ function createPostgresBackend(db, options = {}) {
|
|
|
902
928
|
const rows = await db.select().from(t).where(drizzleOrm.eq(t.indexName, indexName));
|
|
903
929
|
const row = rows[0];
|
|
904
930
|
if (row === void 0) return void 0;
|
|
905
|
-
return
|
|
931
|
+
return chunkXMY2SXOH_cjs.mapMaterializationRow(row, chunkXMY2SXOH_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.decode);
|
|
906
932
|
},
|
|
907
933
|
async getIndexMaterializations(statusKeys) {
|
|
908
934
|
if (statusKeys.length === 0) return [];
|
|
909
935
|
const t = tables2.indexMaterializations;
|
|
910
936
|
const rows = await db.select().from(t).where(drizzleOrm.inArray(t.indexName, [...statusKeys]));
|
|
911
937
|
return rows.map(
|
|
912
|
-
(row) =>
|
|
938
|
+
(row) => chunkXMY2SXOH_cjs.mapMaterializationRow(row, chunkXMY2SXOH_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.decode)
|
|
913
939
|
);
|
|
914
940
|
},
|
|
915
941
|
async recordIndexMaterialization(params) {
|
|
916
942
|
const t = tables2.indexMaterializations;
|
|
917
943
|
await db.insert(t).values(
|
|
918
|
-
|
|
944
|
+
chunkXMY2SXOH_cjs.buildMaterializationInsertValues(
|
|
919
945
|
params,
|
|
920
|
-
|
|
946
|
+
chunkXMY2SXOH_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.encode
|
|
921
947
|
)
|
|
922
948
|
).onConflictDoUpdate({
|
|
923
949
|
target: t.indexName,
|
|
924
|
-
set:
|
|
950
|
+
set: chunkXMY2SXOH_cjs.buildMaterializationOnConflictSet(params.materializedAt)
|
|
925
951
|
});
|
|
926
952
|
},
|
|
927
953
|
async ensureContributionMaterializationsTable() {
|
|
@@ -943,26 +969,26 @@ function createPostgresBackend(db, options = {}) {
|
|
|
943
969
|
const t = tables2.kindRemovals;
|
|
944
970
|
const rows = await db.select().from(t).where(drizzleOrm.and(drizzleOrm.eq(t.graphId, graphId), drizzleOrm.isNull(t.removedAt)));
|
|
945
971
|
return rows.map(
|
|
946
|
-
(row) =>
|
|
972
|
+
(row) => chunkXMY2SXOH_cjs.mapKindRemovalRow(row, chunkXMY2SXOH_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.decode)
|
|
947
973
|
);
|
|
948
974
|
},
|
|
949
975
|
async getAllKindRemovals(graphId) {
|
|
950
976
|
const t = tables2.kindRemovals;
|
|
951
977
|
const rows = await db.select().from(t).where(drizzleOrm.eq(t.graphId, graphId));
|
|
952
978
|
return rows.map(
|
|
953
|
-
(row) =>
|
|
979
|
+
(row) => chunkXMY2SXOH_cjs.mapKindRemovalRow(row, chunkXMY2SXOH_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.decode)
|
|
954
980
|
);
|
|
955
981
|
},
|
|
956
982
|
async recordKindRemoval(params) {
|
|
957
983
|
const t = tables2.kindRemovals;
|
|
958
984
|
await db.insert(t).values(
|
|
959
|
-
|
|
985
|
+
chunkXMY2SXOH_cjs.buildKindRemovalInsertValues(
|
|
960
986
|
params,
|
|
961
|
-
|
|
987
|
+
chunkXMY2SXOH_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.encode
|
|
962
988
|
)
|
|
963
989
|
).onConflictDoUpdate({
|
|
964
990
|
target: [t.graphId, t.kindName, t.entity, t.schemaVersion],
|
|
965
|
-
set:
|
|
991
|
+
set: chunkXMY2SXOH_cjs.buildKindRemovalOnConflictSet(t.removedAt, params.removedAt)
|
|
966
992
|
});
|
|
967
993
|
},
|
|
968
994
|
async ensureReconciliationMarkersTable() {
|
|
@@ -1041,8 +1067,8 @@ function createPostgresBackend(db, options = {}) {
|
|
|
1041
1067
|
const presentGuardedTables = tablePresence.filter((entry) => entry.exists).map((entry) => entry.tableName);
|
|
1042
1068
|
for (const tableName of presentGuardedTables) {
|
|
1043
1069
|
await db.execute(
|
|
1044
|
-
|
|
1045
|
-
|
|
1070
|
+
chunk45YZXI6X_cjs.toDrizzleSql(
|
|
1071
|
+
chunkOJHD3LXJ_cjs.sql`ANALYZE (SKIP_LOCKED) ${chunkOJHD3LXJ_cjs.sql.identifier(tableName)}`,
|
|
1046
1072
|
"postgres"
|
|
1047
1073
|
)
|
|
1048
1074
|
);
|
|
@@ -1057,7 +1083,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
1057
1083
|
async commitSchemaVersionIfKindsEmpty(params, probes) {
|
|
1058
1084
|
return runSchemaWriteTransaction(
|
|
1059
1085
|
params.graphId,
|
|
1060
|
-
(target) =>
|
|
1086
|
+
(target) => chunkXMY2SXOH_cjs.commitSchemaVersionIfKindsEmpty(target, params, probes)
|
|
1061
1087
|
);
|
|
1062
1088
|
},
|
|
1063
1089
|
async commitSchemaVersionWithPreflight(params, preflight) {
|
|
@@ -1079,9 +1105,9 @@ function createPostgresBackend(db, options = {}) {
|
|
|
1079
1105
|
return backend.transactionWithNative((tx) => fn(tx), options2);
|
|
1080
1106
|
},
|
|
1081
1107
|
async transactionWithNative(fn, options2) {
|
|
1082
|
-
const temporaryWrites = options2?.temporaryWrites ===
|
|
1108
|
+
const temporaryWrites = options2?.temporaryWrites === chunkGHZPZNFC_cjs.INTERNAL_TEMPORARY_WRITES;
|
|
1083
1109
|
if (temporaryWrites && options2.accessMode !== "read_only") {
|
|
1084
|
-
throw new
|
|
1110
|
+
throw new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
1085
1111
|
"Temporary-write transactions must be semantically read-only.",
|
|
1086
1112
|
{ dialect: "postgres" }
|
|
1087
1113
|
);
|
|
@@ -1105,7 +1131,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
1105
1131
|
},
|
|
1106
1132
|
adoptTransaction(externalTx) {
|
|
1107
1133
|
if (!capabilities.transactions) {
|
|
1108
|
-
throw new
|
|
1134
|
+
throw new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
1109
1135
|
"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.",
|
|
1110
1136
|
{
|
|
1111
1137
|
backend: "postgres",
|
|
@@ -1114,7 +1140,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
1114
1140
|
}
|
|
1115
1141
|
);
|
|
1116
1142
|
}
|
|
1117
|
-
|
|
1143
|
+
chunkXMY2SXOH_cjs.assertAdoptedDialect(
|
|
1118
1144
|
externalTx,
|
|
1119
1145
|
pgCore.PgTransaction,
|
|
1120
1146
|
"postgres"
|
|
@@ -1124,7 +1150,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
1124
1150
|
async close() {
|
|
1125
1151
|
}
|
|
1126
1152
|
};
|
|
1127
|
-
|
|
1153
|
+
chunkZBFZGLZE_cjs.auditBackendResource(backend, resourceAudit);
|
|
1128
1154
|
return backend;
|
|
1129
1155
|
}
|
|
1130
1156
|
function getSerializedPostgresClient(db) {
|
|
@@ -1231,10 +1257,10 @@ function createPostgresOperationBackend(options) {
|
|
|
1231
1257
|
}
|
|
1232
1258
|
async function vectorSearchGucOverrides(params) {
|
|
1233
1259
|
const overrides = [];
|
|
1234
|
-
const efSearchParameter =
|
|
1260
|
+
const efSearchParameter = chunkTEC24ZDA_cjs.resolveEfSearchOverride({
|
|
1235
1261
|
efSearch: params.efSearch,
|
|
1236
1262
|
indexType: params.indexType,
|
|
1237
|
-
tuning:
|
|
1263
|
+
tuning: chunkTEC24ZDA_cjs.vectorSearchFrontierTuning(vectorStrategy),
|
|
1238
1264
|
transactions: capabilities.transactions,
|
|
1239
1265
|
dialect: "PostgreSQL",
|
|
1240
1266
|
engine: vectorStrategy?.name ?? "this backend"
|
|
@@ -1259,7 +1285,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1259
1285
|
async function runVectorSearchGucGroup(overrides, query) {
|
|
1260
1286
|
const runExclusive = executionAdapter.runExclusive;
|
|
1261
1287
|
if (runExclusive === void 0) {
|
|
1262
|
-
throw new
|
|
1288
|
+
throw new chunkX4GDXBOP_cjs.CompilerInvariantError(
|
|
1263
1289
|
"A transaction-scoped Postgres backend must expose runExclusive; its execution adapter was not wrapped by createSerialExecutionAdapter."
|
|
1264
1290
|
);
|
|
1265
1291
|
}
|
|
@@ -1303,17 +1329,17 @@ function createPostgresOperationBackend(options) {
|
|
|
1303
1329
|
});
|
|
1304
1330
|
}
|
|
1305
1331
|
const batchConfig = computePostgresBatchChunkSizes(
|
|
1306
|
-
capabilities.maxBindParameters ??
|
|
1332
|
+
capabilities.maxBindParameters ?? chunkGHZPZNFC_cjs.POSTGRES_MAX_BIND_PARAMETERS
|
|
1307
1333
|
);
|
|
1308
|
-
const commonOperationMembers =
|
|
1334
|
+
const commonOperationMembers = chunkXMY2SXOH_cjs.createCommonOperationBackend({
|
|
1309
1335
|
batchConfig,
|
|
1310
1336
|
execution: {
|
|
1311
1337
|
execAll,
|
|
1312
1338
|
execGet,
|
|
1313
1339
|
execRun
|
|
1314
1340
|
},
|
|
1315
|
-
nowIso:
|
|
1316
|
-
maxBindParameters: capabilities.maxBindParameters ??
|
|
1341
|
+
nowIso: chunkEH3JZJUM_cjs.nowIso,
|
|
1342
|
+
maxBindParameters: capabilities.maxBindParameters ?? chunkGHZPZNFC_cjs.POSTGRES_MAX_BIND_PARAMETERS,
|
|
1317
1343
|
operationStrategy,
|
|
1318
1344
|
rowMappers: {
|
|
1319
1345
|
toEdgeRow,
|
|
@@ -1331,28 +1357,28 @@ function createPostgresOperationBackend(options) {
|
|
|
1331
1357
|
};
|
|
1332
1358
|
const vectorEmbeddingMethods = vectorStrategy === void 0 ? {} : {
|
|
1333
1359
|
async upsertEmbedding(params) {
|
|
1334
|
-
const slot =
|
|
1360
|
+
const slot = chunkXMY2SXOH_cjs.vectorSlotFromParams(params);
|
|
1335
1361
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1336
|
-
const statements = vectorStrategy.buildUpsert(slot, params,
|
|
1362
|
+
const statements = vectorStrategy.buildUpsert(slot, params, chunkEH3JZJUM_cjs.nowIso());
|
|
1337
1363
|
try {
|
|
1338
1364
|
for (const statement of statements) {
|
|
1339
1365
|
await execRun(statement);
|
|
1340
1366
|
}
|
|
1341
1367
|
} catch (error) {
|
|
1342
|
-
throw
|
|
1368
|
+
throw chunkXMY2SXOH_cjs.mapVectorWriteError(error, params);
|
|
1343
1369
|
}
|
|
1344
1370
|
},
|
|
1345
1371
|
async upsertEmbeddingBatch(params) {
|
|
1346
1372
|
if (params.rows.length === 0) return;
|
|
1347
|
-
const slot =
|
|
1373
|
+
const slot = chunkXMY2SXOH_cjs.vectorSlotFromParams(params);
|
|
1348
1374
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1349
1375
|
const rowsById = new Map(
|
|
1350
1376
|
params.rows.map((row) => [row.nodeId, row])
|
|
1351
1377
|
);
|
|
1352
1378
|
const rows = [...rowsById.values()];
|
|
1353
|
-
const timestamp =
|
|
1379
|
+
const timestamp = chunkEH3JZJUM_cjs.nowIso();
|
|
1354
1380
|
try {
|
|
1355
|
-
for (const chunk2 of
|
|
1381
|
+
for (const chunk2 of chunkZBFZGLZE_cjs.chunk(
|
|
1356
1382
|
rows,
|
|
1357
1383
|
batchConfig.embeddingUpsertBatchSize
|
|
1358
1384
|
)) {
|
|
@@ -1381,11 +1407,11 @@ function createPostgresOperationBackend(options) {
|
|
|
1381
1407
|
}
|
|
1382
1408
|
}
|
|
1383
1409
|
} catch (error) {
|
|
1384
|
-
throw
|
|
1410
|
+
throw chunkXMY2SXOH_cjs.mapVectorWriteError(error, params);
|
|
1385
1411
|
}
|
|
1386
1412
|
},
|
|
1387
1413
|
async deleteEmbedding(params) {
|
|
1388
|
-
const slot =
|
|
1414
|
+
const slot = chunkXMY2SXOH_cjs.vectorSlotFromParams(params);
|
|
1389
1415
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1390
1416
|
const statements = vectorStrategy.buildDelete(slot, params);
|
|
1391
1417
|
for (const statement of statements) {
|
|
@@ -1394,9 +1420,9 @@ function createPostgresOperationBackend(options) {
|
|
|
1394
1420
|
},
|
|
1395
1421
|
async deleteEmbeddingBatch(params) {
|
|
1396
1422
|
if (params.nodeIds.length === 0) return;
|
|
1397
|
-
const slot =
|
|
1423
|
+
const slot = chunkXMY2SXOH_cjs.vectorSlotFromParams(params);
|
|
1398
1424
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1399
|
-
for (const nodeIds of
|
|
1425
|
+
for (const nodeIds of chunkZBFZGLZE_cjs.chunk(
|
|
1400
1426
|
[...new Set(params.nodeIds)],
|
|
1401
1427
|
batchConfig.embeddingUpsertBatchSize
|
|
1402
1428
|
)) {
|
|
@@ -1408,19 +1434,19 @@ function createPostgresOperationBackend(options) {
|
|
|
1408
1434
|
}
|
|
1409
1435
|
},
|
|
1410
1436
|
async vectorSearch(params) {
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
const slot =
|
|
1437
|
+
chunkTEC24ZDA_cjs.assertVectorSearchLimit(params.limit);
|
|
1438
|
+
chunkHSEZ7X6Y_cjs.assertPgvectorEfSearch(params.efSearch);
|
|
1439
|
+
const slot = chunkXMY2SXOH_cjs.vectorSlotFromParams(params);
|
|
1414
1440
|
const query = vectorStrategy.buildSearch(
|
|
1415
1441
|
slot,
|
|
1416
1442
|
params,
|
|
1417
1443
|
// Store-compiled candidates (predicates + subclass + currency)
|
|
1418
1444
|
// take precedence; the live-node default covers direct backend use.
|
|
1419
|
-
params.candidates ??
|
|
1445
|
+
params.candidates ?? chunkXMY2SXOH_cjs.buildLiveNodeCandidates(
|
|
1420
1446
|
tableNames.nodes,
|
|
1421
1447
|
params.graphId,
|
|
1422
1448
|
params.nodeKind,
|
|
1423
|
-
|
|
1449
|
+
chunkEH3JZJUM_cjs.nowIso()
|
|
1424
1450
|
)
|
|
1425
1451
|
);
|
|
1426
1452
|
const gucOverrides = await vectorSearchGucOverrides(params);
|
|
@@ -1428,7 +1454,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1428
1454
|
try {
|
|
1429
1455
|
rows = await runVectorSearch(gucOverrides, query);
|
|
1430
1456
|
} catch (error) {
|
|
1431
|
-
throw
|
|
1457
|
+
throw chunkXMY2SXOH_cjs.mapVectorWriteError(error, params);
|
|
1432
1458
|
}
|
|
1433
1459
|
return rows.map((row) => ({
|
|
1434
1460
|
nodeId: row.node_id,
|
|
@@ -1440,10 +1466,10 @@ function createPostgresOperationBackend(options) {
|
|
|
1440
1466
|
// multi-statement fallback by simply not exposing the member.
|
|
1441
1467
|
...capabilities.windowFunctions ? {
|
|
1442
1468
|
async hybridSearch(params) {
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
const slot =
|
|
1469
|
+
chunkTEC24ZDA_cjs.assertVectorSearchLimit(params.limit);
|
|
1470
|
+
chunkTEC24ZDA_cjs.assertVectorSearchLimit(params.vector.k);
|
|
1471
|
+
chunkHSEZ7X6Y_cjs.assertPgvectorEfSearch(params.vector.efSearch);
|
|
1472
|
+
const slot = chunkXMY2SXOH_cjs.vectorSlotFromParams({
|
|
1447
1473
|
graphId: params.graphId,
|
|
1448
1474
|
nodeKind: params.nodeKind,
|
|
1449
1475
|
fieldPath: params.vector.fieldPath,
|
|
@@ -1451,11 +1477,11 @@ function createPostgresOperationBackend(options) {
|
|
|
1451
1477
|
metric: params.vector.metric,
|
|
1452
1478
|
indexType: params.vector.indexType
|
|
1453
1479
|
});
|
|
1454
|
-
const candidates = params.candidates ??
|
|
1480
|
+
const candidates = params.candidates ?? chunkXMY2SXOH_cjs.buildLiveNodeCandidates(
|
|
1455
1481
|
tableNames.nodes,
|
|
1456
1482
|
params.graphId,
|
|
1457
1483
|
params.nodeKind,
|
|
1458
|
-
|
|
1484
|
+
chunkEH3JZJUM_cjs.nowIso()
|
|
1459
1485
|
);
|
|
1460
1486
|
const vectorParams = {
|
|
1461
1487
|
graphId: params.graphId,
|
|
@@ -1471,11 +1497,11 @@ function createPostgresOperationBackend(options) {
|
|
|
1471
1497
|
const vectorSql = vectorStrategy.buildSearch(
|
|
1472
1498
|
slot,
|
|
1473
1499
|
vectorParams,
|
|
1474
|
-
|
|
1500
|
+
chunkOJHD3LXJ_cjs.sql.raw("SELECT node_id FROM tg_hybrid_cand")
|
|
1475
1501
|
);
|
|
1476
1502
|
const statement = operationStrategy.buildHybridSearch(
|
|
1477
1503
|
{ ...params, candidates },
|
|
1478
|
-
|
|
1504
|
+
chunk45YZXI6X_cjs.toDrizzleSql(vectorSql, "postgres"),
|
|
1479
1505
|
params.vector.metric === "cosine"
|
|
1480
1506
|
);
|
|
1481
1507
|
const gucOverrides = await vectorSearchGucOverrides({
|
|
@@ -1489,9 +1515,9 @@ function createPostgresOperationBackend(options) {
|
|
|
1489
1515
|
statement
|
|
1490
1516
|
);
|
|
1491
1517
|
} catch (error) {
|
|
1492
|
-
throw
|
|
1518
|
+
throw chunkXMY2SXOH_cjs.mapVectorWriteError(error, vectorParams);
|
|
1493
1519
|
}
|
|
1494
|
-
return raw.map((row) =>
|
|
1520
|
+
return raw.map((row) => chunkXMY2SXOH_cjs.mapHybridSearchRow(row, toNodeRow));
|
|
1495
1521
|
}
|
|
1496
1522
|
} : {}
|
|
1497
1523
|
};
|
|
@@ -1546,7 +1572,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1546
1572
|
tableNames,
|
|
1547
1573
|
async lockSchemaVersionForWrite(params) {
|
|
1548
1574
|
if (!transactionScoped) {
|
|
1549
|
-
throw new
|
|
1575
|
+
throw new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
1550
1576
|
"The schema write fence requires an explicit PostgreSQL transaction.",
|
|
1551
1577
|
{
|
|
1552
1578
|
code: "SCHEMA_WRITE_FENCE_TRANSACTION_REQUIRED",
|
|
@@ -1556,7 +1582,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1556
1582
|
}
|
|
1557
1583
|
const locked = await lockActiveSchemaVersion(params.graphId);
|
|
1558
1584
|
if (locked !== void 0) {
|
|
1559
|
-
|
|
1585
|
+
chunkXMY2SXOH_cjs.assertActiveSchemaVersion(
|
|
1560
1586
|
params.graphId,
|
|
1561
1587
|
params.expectedVersion,
|
|
1562
1588
|
locked
|
|
@@ -1566,7 +1592,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1566
1592
|
const settled = await commonOperationMembers.getActiveSchema(
|
|
1567
1593
|
params.graphId
|
|
1568
1594
|
);
|
|
1569
|
-
throw new
|
|
1595
|
+
throw new chunkX4GDXBOP_cjs.StaleVersionError({
|
|
1570
1596
|
graphId: params.graphId,
|
|
1571
1597
|
expected: params.expectedVersion,
|
|
1572
1598
|
actual: settled?.version ?? 0
|
|
@@ -1575,7 +1601,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1575
1601
|
// === Vector Index Operations ===
|
|
1576
1602
|
async createVectorIndex(params) {
|
|
1577
1603
|
if (vectorStrategy === void 0) return;
|
|
1578
|
-
const slot =
|
|
1604
|
+
const slot = chunkXMY2SXOH_cjs.vectorSlotFromCreateIndexParams(params);
|
|
1579
1605
|
await contributionMaterializer.ensureVectorSlot(slot);
|
|
1580
1606
|
const indexStatement = vectorStrategy.buildCreateIndex?.(slot, {
|
|
1581
1607
|
concurrent: params.concurrent === true
|
|
@@ -1597,7 +1623,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1597
1623
|
},
|
|
1598
1624
|
// === Fulltext Operations ===
|
|
1599
1625
|
async upsertFulltext(params) {
|
|
1600
|
-
const timestamp =
|
|
1626
|
+
const timestamp = chunkEH3JZJUM_cjs.nowIso();
|
|
1601
1627
|
const statements = operationStrategy.buildUpsertFulltext(
|
|
1602
1628
|
params,
|
|
1603
1629
|
timestamp
|
|
@@ -1614,8 +1640,8 @@ function createPostgresOperationBackend(options) {
|
|
|
1614
1640
|
},
|
|
1615
1641
|
async upsertFulltextBatch(params) {
|
|
1616
1642
|
if (params.rows.length === 0) return;
|
|
1617
|
-
const timestamp =
|
|
1618
|
-
for (const rows of
|
|
1643
|
+
const timestamp = chunkEH3JZJUM_cjs.nowIso();
|
|
1644
|
+
for (const rows of chunkZBFZGLZE_cjs.chunk(
|
|
1619
1645
|
params.rows,
|
|
1620
1646
|
batchConfig.fulltextUpsertBatchSize
|
|
1621
1647
|
)) {
|
|
@@ -1630,7 +1656,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1630
1656
|
},
|
|
1631
1657
|
async deleteFulltextBatch(params) {
|
|
1632
1658
|
if (params.nodeIds.length === 0) return;
|
|
1633
|
-
for (const nodeIds of
|
|
1659
|
+
for (const nodeIds of chunkZBFZGLZE_cjs.chunk(
|
|
1634
1660
|
params.nodeIds,
|
|
1635
1661
|
batchConfig.fulltextDeleteChunkSize
|
|
1636
1662
|
)) {
|
|
@@ -1648,25 +1674,25 @@ function createPostgresOperationBackend(options) {
|
|
|
1648
1674
|
const rows = await execAll(query);
|
|
1649
1675
|
return rows.map((row, index) => ({
|
|
1650
1676
|
nodeId: row.node_id,
|
|
1651
|
-
score:
|
|
1677
|
+
score: chunkEH3JZJUM_cjs.coerceNumericScore(row.score),
|
|
1652
1678
|
rank: index + 1,
|
|
1653
1679
|
...row.snippet === null ? {} : { snippet: row.snippet }
|
|
1654
1680
|
}));
|
|
1655
1681
|
},
|
|
1656
1682
|
async dropVectorIndex(params) {
|
|
1657
1683
|
if (vectorStrategy === void 0) return;
|
|
1658
|
-
const slot =
|
|
1684
|
+
const slot = chunkXMY2SXOH_cjs.vectorSlotFromDropIndexParams(params);
|
|
1659
1685
|
const dropStatement = vectorStrategy.buildDropIndex?.(slot);
|
|
1660
1686
|
if (dropStatement === void 0) return;
|
|
1661
1687
|
try {
|
|
1662
1688
|
await execRun(dropStatement);
|
|
1663
1689
|
} catch (error) {
|
|
1664
|
-
if (!
|
|
1690
|
+
if (!chunkZBFZGLZE_cjs.isMissingTableError(error)) throw error;
|
|
1665
1691
|
}
|
|
1666
1692
|
},
|
|
1667
1693
|
// === Query Execution ===
|
|
1668
1694
|
async execute(query) {
|
|
1669
|
-
const annTypes =
|
|
1695
|
+
const annTypes = chunkOJHD3LXJ_cjs.isSqlFragment(query) ? chunkOJHD3LXJ_cjs.annIndexScanTypes(query) : void 0;
|
|
1670
1696
|
if (annTypes !== void 0 && vectorStrategy !== void 0) {
|
|
1671
1697
|
const overrides = [];
|
|
1672
1698
|
for (const indexType of annTypes) {
|
|
@@ -1707,5 +1733,5 @@ function createTransactionBackend(options) {
|
|
|
1707
1733
|
}
|
|
1708
1734
|
|
|
1709
1735
|
exports.createPostgresBackend = createPostgresBackend;
|
|
1710
|
-
//# sourceMappingURL=chunk-
|
|
1711
|
-
//# sourceMappingURL=chunk-
|
|
1736
|
+
//# sourceMappingURL=chunk-TYGGUWMS.cjs.map
|
|
1737
|
+
//# sourceMappingURL=chunk-TYGGUWMS.cjs.map
|