@nicia-ai/typegraph 0.49.0 → 0.51.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 +12 -0
- package/dist/backend/drizzle/indexes.cjs +11 -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 +7 -5
- package/dist/backend/index.cjs +190 -53
- package/dist/backend/index.d.cts +90 -4
- package/dist/backend/index.d.ts +90 -4
- package/dist/backend/index.js +9 -12
- package/dist/backend/postgres/index.cjs +36 -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 +19 -15
- package/dist/backend/postgres/pglite-store.cjs +7 -62
- 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 +7 -62
- package/dist/backend/postgres/pglite-store.js.map +1 -1
- package/dist/backend/postgres/pglite.cjs +21 -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 +20 -16
- package/dist/backend/sqlite/index.cjs +33 -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 +17 -13
- package/dist/backend/sqlite/libsql.cjs +24 -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 +19 -15
- package/dist/backend/sqlite/libsql.js.map +1 -1
- package/dist/backend/sqlite/local-store.cjs +9 -64
- 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 +8 -64
- package/dist/backend/sqlite/local-store.js.map +1 -1
- package/dist/backend/sqlite/local.cjs +25 -20
- package/dist/backend/sqlite/local.d.cts +3 -3
- package/dist/backend/sqlite/local.d.ts +3 -3
- package/dist/backend/sqlite/local.js +21 -16
- package/dist/chunk-2CVDZCXH.cjs +1278 -0
- package/dist/chunk-2CVDZCXH.cjs.map +1 -0
- package/dist/{chunk-MYKHJI2J.js → chunk-2DWTBNSH.js} +3 -3
- package/dist/{chunk-MYKHJI2J.js.map → chunk-2DWTBNSH.js.map} +1 -1
- package/dist/{chunk-JB6T4GLL.cjs → chunk-2KCTP3U2.cjs} +870 -528
- package/dist/chunk-2KCTP3U2.cjs.map +1 -0
- package/dist/{chunk-OORXGFL5.cjs → chunk-322TBTOQ.cjs} +48 -48
- package/dist/{chunk-OORXGFL5.cjs.map → chunk-322TBTOQ.cjs.map} +1 -1
- package/dist/{chunk-FA2AFWLP.cjs → chunk-36SX6QXP.cjs} +31 -12
- package/dist/chunk-36SX6QXP.cjs.map +1 -0
- package/dist/{chunk-SDBBMD4N.js → chunk-36VYWVQU.js} +3 -3
- package/dist/{chunk-SDBBMD4N.js.map → chunk-36VYWVQU.js.map} +1 -1
- package/dist/chunk-4DKY6RIU.js +1253 -0
- package/dist/chunk-4DKY6RIU.js.map +1 -0
- package/dist/chunk-4QKOZYMV.js +9 -0
- package/dist/chunk-4QKOZYMV.js.map +1 -0
- package/dist/{chunk-WIC7DRXW.js → chunk-57JM6NW3.js} +9 -19
- package/dist/chunk-57JM6NW3.js.map +1 -0
- package/dist/chunk-5WWEYV4H.cjs +5113 -0
- package/dist/chunk-5WWEYV4H.cjs.map +1 -0
- package/dist/chunk-6KQEICJ6.cjs +12 -0
- package/dist/{chunk-MKJ4KXL5.cjs.map → chunk-6KQEICJ6.cjs.map} +1 -1
- 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-KKBDXCLQ.js → chunk-6NLYIMJO.js} +4 -4
- package/dist/{chunk-KKBDXCLQ.js.map → chunk-6NLYIMJO.js.map} +1 -1
- package/dist/{chunk-BFUOME67.cjs → chunk-7B7I7YAW.cjs} +20 -11
- package/dist/chunk-7B7I7YAW.cjs.map +1 -0
- package/dist/{chunk-ZDKTPBGV.js → chunk-7G5IYROL.js} +6 -548
- package/dist/chunk-7G5IYROL.js.map +1 -0
- package/dist/{chunk-3DMMGT6S.js → chunk-7QFRK6PU.js} +4 -8
- package/dist/chunk-7QFRK6PU.js.map +1 -0
- package/dist/chunk-A4C4NJ5U.cjs +12 -0
- package/dist/chunk-A4C4NJ5U.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-UGHQV7MP.cjs → chunk-B3MN7EJR.cjs} +228 -162
- package/dist/chunk-B3MN7EJR.cjs.map +1 -0
- package/dist/{chunk-TZEGUG6D.cjs → chunk-BZ5MVITP.cjs} +4 -4
- package/dist/{chunk-TZEGUG6D.cjs.map → chunk-BZ5MVITP.cjs.map} +1 -1
- package/dist/{chunk-YVF2EM7B.js → chunk-CAI6SMP6.js} +3 -3
- package/dist/{chunk-YVF2EM7B.js.map → chunk-CAI6SMP6.js.map} +1 -1
- package/dist/{chunk-JONXFAPO.js → chunk-CBOD7TXH.js} +5 -5
- package/dist/{chunk-JONXFAPO.js.map → chunk-CBOD7TXH.js.map} +1 -1
- package/dist/{chunk-FQPEMEWX.cjs → chunk-CRZ56SZU.cjs} +81 -32
- package/dist/chunk-CRZ56SZU.cjs.map +1 -0
- package/dist/{chunk-DO7SAMEK.cjs → chunk-D3GWARN7.cjs} +47 -47
- package/dist/{chunk-DO7SAMEK.cjs.map → chunk-D3GWARN7.cjs.map} +1 -1
- package/dist/{chunk-QTD6HX4O.js → chunk-D3OUDFU7.js} +5 -5
- package/dist/{chunk-QTD6HX4O.js.map → chunk-D3OUDFU7.js.map} +1 -1
- 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-EKG2UXNX.cjs +23 -0
- package/dist/chunk-EKG2UXNX.cjs.map +1 -0
- package/dist/chunk-FMMW3KX7.cjs +148 -0
- package/dist/chunk-FMMW3KX7.cjs.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-H2VWDQWC.cjs +571 -0
- package/dist/chunk-H2VWDQWC.cjs.map +1 -0
- package/dist/chunk-H4FY6OZK.js +13 -0
- package/dist/chunk-H4FY6OZK.js.map +1 -0
- package/dist/{chunk-EDN4Y4ZG.cjs → chunk-H5IJSROF.cjs} +9 -15
- package/dist/chunk-H5IJSROF.cjs.map +1 -0
- package/dist/chunk-HZUB5CON.js +27 -0
- package/dist/chunk-HZUB5CON.js.map +1 -0
- package/dist/{chunk-NACVVDWB.js → chunk-I5IOSA27.js} +103 -105
- package/dist/chunk-I5IOSA27.js.map +1 -0
- package/dist/{chunk-OI2GQ25X.cjs → chunk-I7YAY2VQ.cjs} +7 -7
- package/dist/{chunk-OI2GQ25X.cjs.map → chunk-I7YAY2VQ.cjs.map} +1 -1
- package/dist/chunk-IRCWIA3R.js +20 -0
- package/dist/chunk-IRCWIA3R.js.map +1 -0
- package/dist/chunk-IVQBLXBK.cjs +55 -0
- package/dist/chunk-IVQBLXBK.cjs.map +1 -0
- package/dist/{chunk-7SQSZN2J.js → chunk-IZD4HTCP.js} +5 -5
- package/dist/{chunk-7SQSZN2J.js.map → chunk-IZD4HTCP.js.map} +1 -1
- package/dist/{chunk-3FPR224C.cjs → chunk-JHRUZ73O.cjs} +116 -107
- package/dist/chunk-JHRUZ73O.cjs.map +1 -0
- package/dist/{chunk-EZEEWCFJ.cjs → chunk-JQKMEKKW.cjs} +525 -298
- package/dist/chunk-JQKMEKKW.cjs.map +1 -0
- package/dist/chunk-JVA3KDEA.cjs +691 -0
- package/dist/chunk-JVA3KDEA.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-7LZJNLA5.js → chunk-K67P5DLL.js} +108 -42
- package/dist/chunk-K67P5DLL.js.map +1 -0
- package/dist/{chunk-3G5W2U2L.cjs → chunk-KACEYDYV.cjs} +335 -258
- package/dist/chunk-KACEYDYV.cjs.map +1 -0
- package/dist/{chunk-JFRT7S3B.cjs → chunk-L6EVYIID.cjs} +318 -478
- package/dist/chunk-L6EVYIID.cjs.map +1 -0
- package/dist/{chunk-SHFBB23Q.js → chunk-LI4K2KEJ.js} +6 -4
- package/dist/chunk-LI4K2KEJ.js.map +1 -0
- package/dist/chunk-LKZDQ2B4.js +1581 -0
- package/dist/chunk-LKZDQ2B4.js.map +1 -0
- package/dist/{chunk-WODMN3Q2.cjs → chunk-LLFPQOBA.cjs} +27 -27
- package/dist/{chunk-WODMN3Q2.cjs.map → chunk-LLFPQOBA.cjs.map} +1 -1
- package/dist/{chunk-P6YLZTRE.js → chunk-LZMQ3SFK.js} +3 -3
- package/dist/{chunk-P6YLZTRE.js.map → chunk-LZMQ3SFK.js.map} +1 -1
- package/dist/{chunk-HEV35TGT.js → chunk-M3VTS3F6.js} +13 -4
- package/dist/chunk-M3VTS3F6.js.map +1 -0
- package/dist/{chunk-TQHGE7UC.cjs → chunk-M5MSP3BI.cjs} +18 -10
- package/dist/chunk-M5MSP3BI.cjs.map +1 -0
- package/dist/{chunk-D4QLTJSM.js → chunk-NBOS7BY3.js} +63 -23
- package/dist/chunk-NBOS7BY3.js.map +1 -0
- package/dist/chunk-NGQDGL5X.js +140 -0
- package/dist/chunk-NGQDGL5X.js.map +1 -0
- package/dist/{chunk-SIT26LAZ.cjs → chunk-NLX5OWK7.cjs} +33 -5
- package/dist/chunk-NLX5OWK7.cjs.map +1 -0
- package/dist/chunk-NUQ2YFFH.cjs +1637 -0
- package/dist/chunk-NUQ2YFFH.cjs.map +1 -0
- package/dist/{chunk-UMGZDVOA.cjs → chunk-OGL4X4PH.cjs} +206 -208
- package/dist/chunk-OGL4X4PH.cjs.map +1 -0
- package/dist/{chunk-LRQKXRXO.cjs → chunk-OTNTGEXR.cjs} +4 -4
- package/dist/{chunk-LRQKXRXO.cjs.map → chunk-OTNTGEXR.cjs.map} +1 -1
- package/dist/chunk-OTWE63BW.js +53 -0
- package/dist/chunk-OTWE63BW.js.map +1 -0
- package/dist/chunk-PC5NGH5A.js +549 -0
- package/dist/chunk-PC5NGH5A.js.map +1 -0
- package/dist/{chunk-26YKDNUD.cjs → chunk-PS3TUWJM.cjs} +12 -10
- package/dist/chunk-PS3TUWJM.cjs.map +1 -0
- package/dist/{chunk-OMZ37BM2.js → chunk-PVFFH7TL.js} +5 -5
- package/dist/{chunk-OMZ37BM2.js.map → chunk-PVFFH7TL.js.map} +1 -1
- package/dist/chunk-QCD5JKU4.cjs +15 -0
- package/dist/chunk-QCD5JKU4.cjs.map +1 -0
- package/dist/{chunk-UGHG7PGX.js → chunk-QG5VEOKX.js} +30 -4
- package/dist/chunk-QG5VEOKX.js.map +1 -0
- package/dist/{chunk-TUNPBZY3.cjs → chunk-QLLZM5I3.cjs} +4 -4
- package/dist/{chunk-TUNPBZY3.cjs.map → chunk-QLLZM5I3.cjs.map} +1 -1
- package/dist/{chunk-BRRP76WO.js → chunk-RCBG6YMT.js} +781 -375
- package/dist/chunk-RCBG6YMT.js.map +1 -0
- package/dist/{chunk-LTXQOEIC.js → chunk-RI7RJH4G.js} +281 -204
- package/dist/chunk-RI7RJH4G.js.map +1 -0
- package/dist/{chunk-GYEG3ZLZ.cjs → chunk-RJMHU2MG.cjs} +121 -18
- package/dist/chunk-RJMHU2MG.cjs.map +1 -0
- package/dist/{chunk-GLHXM7C4.js → chunk-RVUL2HXY.js} +61 -23
- package/dist/chunk-RVUL2HXY.js.map +1 -0
- package/dist/chunk-RWUWTJQY.cjs +30 -0
- package/dist/chunk-RWUWTJQY.cjs.map +1 -0
- package/dist/{chunk-2O4PCIZ6.cjs → chunk-S5GU4LUN.cjs} +13 -13
- package/dist/{chunk-2O4PCIZ6.cjs.map → chunk-S5GU4LUN.cjs.map} +1 -1
- package/dist/{chunk-JPD2CTC3.js → chunk-SDPWO2Z5.js} +7 -7
- package/dist/{chunk-JPD2CTC3.js.map → chunk-SDPWO2Z5.js.map} +1 -1
- package/dist/{chunk-OVI7IXYX.js → chunk-SLGGT2XD.js} +3 -3
- package/dist/{chunk-OVI7IXYX.js.map → chunk-SLGGT2XD.js.map} +1 -1
- package/dist/{chunk-ROR5ZR6A.cjs → chunk-TIJUA4I6.cjs} +45 -45
- package/dist/{chunk-ROR5ZR6A.cjs.map → chunk-TIJUA4I6.cjs.map} +1 -1
- package/dist/{chunk-AOSSQDVO.cjs → chunk-TM54OBHX.cjs} +13 -13
- package/dist/{chunk-AOSSQDVO.cjs.map → chunk-TM54OBHX.cjs.map} +1 -1
- package/dist/{chunk-KF6K7TGH.js → chunk-TYEYRCXL.js} +766 -433
- package/dist/chunk-TYEYRCXL.js.map +1 -0
- package/dist/{chunk-Z2JCLZFJ.js → chunk-UKOVGCRN.js} +2151 -570
- package/dist/chunk-UKOVGCRN.js.map +1 -0
- package/dist/chunk-UYKDYE5D.cjs +12 -0
- package/dist/{chunk-CICO5GXD.cjs.map → chunk-UYKDYE5D.cjs.map} +1 -1
- package/dist/{chunk-S5TERQVW.js → chunk-VAAC7L57.js} +284 -66
- package/dist/chunk-VAAC7L57.js.map +1 -0
- package/dist/{chunk-7UOLHNWC.cjs → chunk-VKHXYVN7.cjs} +22 -33
- package/dist/chunk-VKHXYVN7.cjs.map +1 -0
- 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-YIURNGXI.js → chunk-VUQZNUHU.js} +22 -6
- package/dist/chunk-VUQZNUHU.js.map +1 -0
- package/dist/{chunk-YYUHLYM2.cjs → chunk-WDM5WQK4.cjs} +183 -143
- package/dist/chunk-WDM5WQK4.cjs.map +1 -0
- package/dist/{chunk-ZFMCDJGB.js → chunk-WFSYYU4W.js} +70 -220
- package/dist/chunk-WFSYYU4W.js.map +1 -0
- package/dist/{chunk-SR725PWF.cjs → chunk-WRBV2FNH.cjs} +2065 -1659
- package/dist/chunk-WRBV2FNH.cjs.map +1 -0
- package/dist/{chunk-MRDBBHIZ.cjs → chunk-X4GDXBOP.cjs} +2 -2
- package/dist/chunk-X4GDXBOP.cjs.map +1 -0
- package/dist/chunk-XORONCV3.js +202 -0
- package/dist/chunk-XORONCV3.js.map +1 -0
- package/dist/{chunk-D5R42W5D.js → chunk-XZW2CTNO.js} +115 -12
- package/dist/chunk-XZW2CTNO.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-2TYSSBU5.js → chunk-YT2IVFAI.js} +30 -21
- package/dist/chunk-YT2IVFAI.js.map +1 -0
- package/dist/chunk-ZGVTNKTX.cjs +217 -0
- package/dist/chunk-ZGVTNKTX.cjs.map +1 -0
- 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-BvcbgzHo.d.ts} +3 -3
- package/dist/{ddl-BL1NZLMY.d.cts → ddl-Ufebz5q5.d.cts} +3 -3
- package/dist/graph-extension/index.cjs +21 -20
- package/dist/graph-extension/index.d.cts +2 -4
- package/dist/graph-extension/index.d.ts +2 -4
- package/dist/graph-extension/index.js +5 -4
- package/dist/graph-merge/index.cjs +324 -307
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +8 -9
- package/dist/graph-merge/index.d.ts +8 -9
- package/dist/graph-merge/index.js +51 -34
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/index.cjs +224 -222
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -12
- package/dist/index.d.ts +11 -12
- package/dist/index.js +38 -36
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.cjs +15 -13
- package/dist/indexes/index.d.cts +4 -4
- package/dist/indexes/index.d.ts +4 -4
- package/dist/indexes/index.js +8 -6
- package/dist/{ingestion-import-target-dNeL7iAv.d.ts → ingestion-import-target-CAs1OX-l.d.cts} +1 -1
- package/dist/{ingestion-import-target-XPxZYw89.d.cts → ingestion-import-target-DCQSPfNx.d.ts} +1 -1
- package/dist/interchange/index.cjs +57 -54
- package/dist/interchange/index.cjs.map +1 -1
- package/dist/interchange/index.d.cts +19 -8
- package/dist/interchange/index.d.ts +19 -8
- package/dist/interchange/index.js +21 -18
- package/dist/interchange/index.js.map +1 -1
- package/dist/local-store-impl-6DDTFM32.cjs +77 -0
- package/dist/local-store-impl-6DDTFM32.cjs.map +1 -0
- package/dist/local-store-impl-OXTOVU2J.js +75 -0
- package/dist/local-store-impl-OXTOVU2J.js.map +1 -0
- package/dist/{manager-CYaff3n3.d.cts → manager-B68OrPR2.d.ts} +29 -2
- package/dist/{manager-D9eRT_ns.d.ts → manager-D_t7oK69.d.cts} +29 -2
- package/dist/pglite-store-impl-6EMZGL7K.js +73 -0
- package/dist/pglite-store-impl-6EMZGL7K.js.map +1 -0
- package/dist/pglite-store-impl-GJG3Y7RP.cjs +75 -0
- package/dist/pglite-store-impl-GJG3Y7RP.cjs.map +1 -0
- package/dist/{postgres-CcL4bAHS.d.ts → postgres-BPLSVyHM.d.ts} +279 -2
- package/dist/{postgres-DMj39MEu.d.cts → postgres-CqvtFC2y.d.cts} +279 -2
- package/dist/profiler/index.d.cts +9 -9
- package/dist/profiler/index.d.ts +9 -9
- package/dist/provenance/index.cjs +59 -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 +28 -13
- package/dist/provenance/index.js.map +1 -1
- package/dist/{repair-validity-windows-BFNZvd_H.d.cts → repair-validity-windows-DEzCKAdy.d.cts} +7 -3
- package/dist/{repair-validity-windows-DlUSqwCg.d.ts → repair-validity-windows-GMdaS2AH.d.ts} +7 -3
- package/dist/resolve-D_H8MHtq.d.ts +1805 -0
- package/dist/resolve-WEW8gWws.d.cts +1805 -0
- package/dist/schema/index.cjs +48 -46
- package/dist/schema/index.d.cts +4 -6
- package/dist/schema/index.d.ts +4 -6
- package/dist/schema/index.js +21 -19
- package/dist/{searchable-bpE1bBfc.d.ts → searchable-C_UREI9K.d.ts} +1 -1
- package/dist/{searchable-DHJMh_nj.d.cts → searchable-ClgET_i7.d.cts} +1 -1
- package/dist/{sqlite-YppHrNFb.d.cts → sqlite-D1mXO9Kp.d.cts} +310 -2
- package/dist/{sqlite-D7Oz0SQh.d.ts → sqlite-MZA3oZNB.d.ts} +310 -2
- package/dist/{store-bphCSo7z.d.cts → store-CuFX7fCx.d.cts} +117 -31
- package/dist/{store-DRrFCx5x.d.ts → store-D-ZjXQpW.d.ts} +117 -31
- package/dist/{temporal-CbnLzTmM.d.ts → temporal-CpyEiRY8.d.cts} +1 -1
- package/dist/{temporal-5GqpYCk2.d.cts → temporal-y0Aep9Su.d.ts} +1 -1
- package/dist/{types-BqFZTQmV.d.cts → types-6yf0Vv-_.d.cts} +2016 -94
- package/dist/{types-BqFZTQmV.d.ts → types-6yf0Vv-_.d.ts} +2016 -94
- package/dist/{types-Bx74kaTt.d.ts → types-DzJ4dlzk.d.cts} +1 -1
- package/dist/{types-CXAhpW-c.d.cts → types-_vVSB9k-.d.ts} +1 -1
- package/dist/{where-O-k2wgYm.d.ts → where-DuG2LCLe.d.ts} +1 -1
- package/dist/{where-DI_Fqz-X.d.cts → where-Mhf_yyKX.d.cts} +1 -1
- package/package.json +7 -2
- package/dist/chunk-26YKDNUD.cjs.map +0 -1
- package/dist/chunk-2TYSSBU5.js.map +0 -1
- package/dist/chunk-3DMMGT6S.js.map +0 -1
- package/dist/chunk-3FPR224C.cjs.map +0 -1
- package/dist/chunk-3G5W2U2L.cjs.map +0 -1
- package/dist/chunk-3KOY4FH3.cjs +0 -934
- package/dist/chunk-3KOY4FH3.cjs.map +0 -1
- package/dist/chunk-3QNZ5SAJ.cjs +0 -3502
- package/dist/chunk-3QNZ5SAJ.cjs.map +0 -1
- package/dist/chunk-3U5ABFDW.cjs +0 -259
- package/dist/chunk-3U5ABFDW.cjs.map +0 -1
- package/dist/chunk-5K2BKEBD.js.map +0 -1
- package/dist/chunk-5PRKMB24.cjs +0 -124
- package/dist/chunk-5PRKMB24.cjs.map +0 -1
- package/dist/chunk-6LN7FIVU.js +0 -107
- package/dist/chunk-6LN7FIVU.js.map +0 -1
- package/dist/chunk-6SWPJEYN.js +0 -1126
- package/dist/chunk-6SWPJEYN.js.map +0 -1
- package/dist/chunk-7LZJNLA5.js.map +0 -1
- package/dist/chunk-7UOLHNWC.cjs.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-D4QLTJSM.js.map +0 -1
- package/dist/chunk-D5R42W5D.js.map +0 -1
- package/dist/chunk-EDN4Y4ZG.cjs.map +0 -1
- package/dist/chunk-EZEEWCFJ.cjs.map +0 -1
- 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 +0 -1156
- 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-L3LQNR34.cjs +0 -1254
- package/dist/chunk-L3LQNR34.cjs.map +0 -1
- package/dist/chunk-LTXQOEIC.js.map +0 -1
- package/dist/chunk-MKJ4KXL5.cjs +0 -12
- package/dist/chunk-MRDBBHIZ.cjs.map +0 -1
- package/dist/chunk-NACVVDWB.js.map +0 -1
- package/dist/chunk-NVY5CJFP.js +0 -244
- package/dist/chunk-NVY5CJFP.js.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-UGHQV7MP.cjs.map +0 -1
- package/dist/chunk-UMGZDVOA.cjs.map +0 -1
- package/dist/chunk-WIC7DRXW.js.map +0 -1
- package/dist/chunk-YIURNGXI.js.map +0 -1
- package/dist/chunk-YYUHLYM2.cjs.map +0 -1
- package/dist/chunk-Z2JCLZFJ.js.map +0 -1
- package/dist/chunk-ZDKTPBGV.js.map +0 -1
- package/dist/chunk-ZFMCDJGB.js.map +0 -1
- package/dist/chunk-ZLONH2UD.js.map +0 -1
- package/dist/index-COs_z6nV.d.cts +0 -1132
- package/dist/index-D7d1u2gr.d.ts +0 -1132
- package/dist/materialize-indexes-DJ3ykH59.d.ts +0 -266
- package/dist/materialize-indexes-DTtAnvfY.d.cts +0 -266
|
@@ -1,15 +1,14 @@
|
|
|
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 chunkMRDBBHIZ_cjs = require('./chunk-MRDBBHIZ.cjs');
|
|
3
|
+
var chunk5WWEYV4H_cjs = require('./chunk-5WWEYV4H.cjs');
|
|
4
|
+
var chunkLLFPQOBA_cjs = require('./chunk-LLFPQOBA.cjs');
|
|
5
|
+
var chunkTIJUA4I6_cjs = require('./chunk-TIJUA4I6.cjs');
|
|
6
|
+
var chunk36SX6QXP_cjs = require('./chunk-36SX6QXP.cjs');
|
|
7
|
+
var chunkNLX5OWK7_cjs = require('./chunk-NLX5OWK7.cjs');
|
|
8
|
+
var chunkNUQ2YFFH_cjs = require('./chunk-NUQ2YFFH.cjs');
|
|
9
|
+
var chunkH2VWDQWC_cjs = require('./chunk-H2VWDQWC.cjs');
|
|
10
|
+
var chunkH5IJSROF_cjs = require('./chunk-H5IJSROF.cjs');
|
|
11
|
+
var chunkX4GDXBOP_cjs = require('./chunk-X4GDXBOP.cjs');
|
|
13
12
|
var chunkN66HCGCY_cjs = require('./chunk-N66HCGCY.cjs');
|
|
14
13
|
var drizzleOrm = require('drizzle-orm');
|
|
15
14
|
var pgCore = require('drizzle-orm/pg-core');
|
|
@@ -53,7 +52,7 @@ var DEFAULT_POSTGRES_STATEMENT_CACHE_MAX = 256;
|
|
|
53
52
|
var STATEMENT_NAME_CACHE = /* @__PURE__ */ new Map();
|
|
54
53
|
var nextStatementId = 0;
|
|
55
54
|
function statementNameFor(sqlText, cacheMax) {
|
|
56
|
-
return
|
|
55
|
+
return chunk5WWEYV4H_cjs.getOrCreateLru(STATEMENT_NAME_CACHE, sqlText, cacheMax, () => {
|
|
57
56
|
const name = `tg_${nextStatementId}`;
|
|
58
57
|
nextStatementId += 1;
|
|
59
58
|
return name;
|
|
@@ -167,7 +166,7 @@ function createPostgresExecutionAdapter(db, options = {}) {
|
|
|
167
166
|
options.useTransactionClient ?? false
|
|
168
167
|
);
|
|
169
168
|
function compile(query) {
|
|
170
|
-
return
|
|
169
|
+
return chunkLLFPQOBA_cjs.compileQueryWithDialect(db, query, "PostgreSQL");
|
|
171
170
|
}
|
|
172
171
|
function assertCompiledWithinBindParameterLimit(compiledQuery) {
|
|
173
172
|
assertWithinBindParameterLimit(
|
|
@@ -182,7 +181,7 @@ function createPostgresExecutionAdapter(db, options = {}) {
|
|
|
182
181
|
assertCompiledWithinBindParameterLimit(compile(query));
|
|
183
182
|
return executeDrizzleQuery(
|
|
184
183
|
db,
|
|
185
|
-
|
|
184
|
+
chunkH5IJSROF_cjs.isSqlFragment(query) ? chunkLLFPQOBA_cjs.toDrizzleSql(query, "postgres") : query
|
|
186
185
|
);
|
|
187
186
|
}
|
|
188
187
|
};
|
|
@@ -201,7 +200,7 @@ function createPostgresExecutionAdapter(db, options = {}) {
|
|
|
201
200
|
async execute(query) {
|
|
202
201
|
const compiled = compile(query);
|
|
203
202
|
assertCompiledWithinBindParameterLimit(compiled);
|
|
204
|
-
if (
|
|
203
|
+
if (chunkH5IJSROF_cjs.isSqlFragment(query) && chunkH5IJSROF_cjs.shouldForceCustomPlan(query)) {
|
|
205
204
|
const result = await pgQueryClient.queryUnnamed(
|
|
206
205
|
compiled.sql,
|
|
207
206
|
compiled.params
|
|
@@ -224,7 +223,7 @@ function assertWithinBindParameterLimit(parameterCount, maxBindParameters) {
|
|
|
224
223
|
if (maxBindParameters === void 0 || parameterCount <= maxBindParameters) {
|
|
225
224
|
return;
|
|
226
225
|
}
|
|
227
|
-
throw new
|
|
226
|
+
throw new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
228
227
|
`PostgreSQL statement uses ${parameterCount} bound parameters, exceeding this backend's limit of ${maxBindParameters}.`,
|
|
229
228
|
{
|
|
230
229
|
capability: "maxBindParameters",
|
|
@@ -245,7 +244,7 @@ function createStatementQueue() {
|
|
|
245
244
|
let closed = false;
|
|
246
245
|
return {
|
|
247
246
|
enqueue(task) {
|
|
248
|
-
if (closed) return Promise.reject(new
|
|
247
|
+
if (closed) return Promise.reject(new chunkX4GDXBOP_cjs.TransactionClosedError());
|
|
249
248
|
const result = tail.then(() => task());
|
|
250
249
|
tail = result.then(ignoreOutcome, ignoreOutcome);
|
|
251
250
|
return result;
|
|
@@ -310,11 +309,11 @@ function computePostgresBatchChunkSizes(maxBindParameters) {
|
|
|
310
309
|
),
|
|
311
310
|
embeddingUpsertBatchSize: Math.max(
|
|
312
311
|
1,
|
|
313
|
-
Math.floor(maxBindParameters /
|
|
312
|
+
Math.floor(maxBindParameters / chunk5WWEYV4H_cjs.EMBEDDING_UPSERT_PARAM_COUNT)
|
|
314
313
|
),
|
|
315
314
|
findEdgesEndpointChunkSize: Math.max(
|
|
316
315
|
1,
|
|
317
|
-
maxBindParameters -
|
|
316
|
+
maxBindParameters - chunk5WWEYV4H_cjs.FIND_EDGES_ENDPOINT_FIXED_PARAM_COUNT
|
|
318
317
|
),
|
|
319
318
|
fulltextDeleteChunkSize: Math.max(
|
|
320
319
|
1,
|
|
@@ -352,8 +351,22 @@ var IDENTITY_TABLE_LOGICAL_NAMES = /* @__PURE__ */ new Set([
|
|
|
352
351
|
"identityClosure",
|
|
353
352
|
"identitySeparation"
|
|
354
353
|
]);
|
|
355
|
-
var
|
|
356
|
-
|
|
354
|
+
var RECORDED_TABLE_LOGICAL_NAMES = /* @__PURE__ */ new Set([
|
|
355
|
+
"recordedNodes",
|
|
356
|
+
"recordedEdges",
|
|
357
|
+
"recordedClock"
|
|
358
|
+
]);
|
|
359
|
+
async function withConcurrentCreateRetry(run) {
|
|
360
|
+
try {
|
|
361
|
+
return await run();
|
|
362
|
+
} catch (error) {
|
|
363
|
+
if (!chunkNLX5OWK7_cjs.isPostgresConcurrentDdlRaceError(error)) throw error;
|
|
364
|
+
return await run();
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
function extensionDdlLockKey(extension) {
|
|
368
|
+
return `typegraph:extension-ddl:${extension}`;
|
|
369
|
+
}
|
|
357
370
|
function parallelWorkerResetSql(tableName) {
|
|
358
371
|
return `ALTER TABLE "${tableName.replaceAll('"', '""')}" RESET (parallel_workers);`;
|
|
359
372
|
}
|
|
@@ -388,7 +401,7 @@ function reportParallelWorkerResetFailure(tableName, resetError) {
|
|
|
388
401
|
async function resetVectorParallelWorkers(execute, tableName) {
|
|
389
402
|
try {
|
|
390
403
|
await execute(
|
|
391
|
-
|
|
404
|
+
chunkH5IJSROF_cjs.sql`ALTER TABLE ${chunkH5IJSROF_cjs.sql.identifier(tableName)} RESET (parallel_workers)`
|
|
392
405
|
);
|
|
393
406
|
} catch (resetError) {
|
|
394
407
|
throw parallelWorkerResetError(tableName, resetError);
|
|
@@ -399,7 +412,7 @@ async function runVectorIndexBuildWithSerialFallback(execute, tableName, indexSt
|
|
|
399
412
|
try {
|
|
400
413
|
await execute(indexStatement);
|
|
401
414
|
} catch (error) {
|
|
402
|
-
if (!
|
|
415
|
+
if (!chunkNLX5OWK7_cjs.isInsufficientResourcesError(error)) throw error;
|
|
403
416
|
if (dropStatement !== void 0) {
|
|
404
417
|
try {
|
|
405
418
|
await execute(dropStatement);
|
|
@@ -420,7 +433,7 @@ async function runVectorIndexBuildWithSerialFallback(execute, tableName, indexSt
|
|
|
420
433
|
}
|
|
421
434
|
}
|
|
422
435
|
async function runPostgresVectorIndexBuild(vectorStrategy, execute, tableName, indexStatement, dropStatement) {
|
|
423
|
-
if (vectorStrategy !==
|
|
436
|
+
if (vectorStrategy !== chunkTIJUA4I6_cjs.pgvectorStrategy) {
|
|
424
437
|
await execute(indexStatement);
|
|
425
438
|
return;
|
|
426
439
|
}
|
|
@@ -432,9 +445,9 @@ async function runPostgresVectorIndexBuild(vectorStrategy, execute, tableName, i
|
|
|
432
445
|
);
|
|
433
446
|
}
|
|
434
447
|
async function runSerialVectorIndexBuild(execute, tableName, indexStatement, parallelBuildError) {
|
|
435
|
-
const table =
|
|
448
|
+
const table = chunkH5IJSROF_cjs.sql.identifier(tableName);
|
|
436
449
|
try {
|
|
437
|
-
await execute(
|
|
450
|
+
await execute(chunkH5IJSROF_cjs.sql`ALTER TABLE ${table} SET (parallel_workers = 0)`);
|
|
438
451
|
} catch (setError) {
|
|
439
452
|
if (parallelBuildError === void 0) throw setError;
|
|
440
453
|
throw vectorSerialFallbackPreparationError(
|
|
@@ -450,7 +463,7 @@ async function runSerialVectorIndexBuild(execute, tableName, indexStatement, par
|
|
|
450
463
|
buildFailure = { error };
|
|
451
464
|
}
|
|
452
465
|
try {
|
|
453
|
-
await execute(
|
|
466
|
+
await execute(chunkH5IJSROF_cjs.sql`ALTER TABLE ${table} RESET (parallel_workers)`);
|
|
454
467
|
} catch (resetError) {
|
|
455
468
|
if (buildFailure === void 0) {
|
|
456
469
|
throw parallelWorkerResetError(tableName, resetError);
|
|
@@ -459,27 +472,27 @@ async function runSerialVectorIndexBuild(execute, tableName, indexStatement, par
|
|
|
459
472
|
}
|
|
460
473
|
if (buildFailure !== void 0) throw buildFailure.error;
|
|
461
474
|
}
|
|
462
|
-
var toNodeRow =
|
|
463
|
-
var toEdgeRow =
|
|
464
|
-
var toUniqueRow =
|
|
465
|
-
var toSchemaVersionRow =
|
|
466
|
-
|
|
475
|
+
var toNodeRow = chunk36SX6QXP_cjs.createNodeRowMapper(chunk36SX6QXP_cjs.POSTGRES_ROW_MAPPER_CONFIG);
|
|
476
|
+
var toEdgeRow = chunk36SX6QXP_cjs.createEdgeRowMapper(chunk36SX6QXP_cjs.POSTGRES_ROW_MAPPER_CONFIG);
|
|
477
|
+
var toUniqueRow = chunk36SX6QXP_cjs.createUniqueRowMapper(chunk36SX6QXP_cjs.POSTGRES_ROW_MAPPER_CONFIG);
|
|
478
|
+
var toSchemaVersionRow = chunk36SX6QXP_cjs.createSchemaVersionRowMapper(
|
|
479
|
+
chunk36SX6QXP_cjs.POSTGRES_ROW_MAPPER_CONFIG
|
|
467
480
|
);
|
|
468
481
|
function buildPostgresCapabilities(fulltextStrategy, vectorStrategy) {
|
|
469
482
|
return {
|
|
470
|
-
...
|
|
471
|
-
...vectorStrategy === void 0 ? {} : { vector:
|
|
472
|
-
fulltext:
|
|
483
|
+
...chunkNUQ2YFFH_cjs.POSTGRES_CAPABILITIES,
|
|
484
|
+
...vectorStrategy === void 0 ? {} : { vector: chunkH2VWDQWC_cjs.buildVectorCapabilities(vectorStrategy) },
|
|
485
|
+
fulltext: chunkH2VWDQWC_cjs.buildFulltextCapabilities(fulltextStrategy)
|
|
473
486
|
};
|
|
474
487
|
}
|
|
475
488
|
function createPostgresBackend(db, options = {}) {
|
|
476
|
-
const resourceAudit =
|
|
489
|
+
const resourceAudit = chunkNLX5OWK7_cjs.resolveDeclaredBackendResource(
|
|
477
490
|
getSerializedPostgresClient(db),
|
|
478
491
|
options.serializedResource
|
|
479
492
|
);
|
|
480
|
-
const tables2 = options.tables ??
|
|
481
|
-
const fulltextStrategy = options.fulltext ??
|
|
482
|
-
const vectorStrategy = options.vector === false ? void 0 : options.vector ??
|
|
493
|
+
const tables2 = options.tables ?? chunk5WWEYV4H_cjs.tables;
|
|
494
|
+
const fulltextStrategy = options.fulltext ?? chunkH2VWDQWC_cjs.tsvectorStrategy;
|
|
495
|
+
const vectorStrategy = options.vector === false ? void 0 : options.vector ?? chunkTIJUA4I6_cjs.pgvectorStrategy;
|
|
483
496
|
const iterativeScanProbe = createIterativeScanProbe();
|
|
484
497
|
const baseCapabilities = buildPostgresCapabilities(
|
|
485
498
|
fulltextStrategy,
|
|
@@ -492,35 +505,37 @@ function createPostgresBackend(db, options = {}) {
|
|
|
492
505
|
supported: false
|
|
493
506
|
}
|
|
494
507
|
} : {};
|
|
495
|
-
const configuredMaxBindParameters = options.capabilities?.maxBindParameters ??
|
|
508
|
+
const configuredMaxBindParameters = options.capabilities?.maxBindParameters ?? chunkNUQ2YFFH_cjs.POSTGRES_MAX_BIND_PARAMETERS;
|
|
496
509
|
const driverBindParameterOverrides = isPgliteDatabase(db) ? {
|
|
497
510
|
maxBindParameters: Math.min(
|
|
498
511
|
configuredMaxBindParameters,
|
|
499
512
|
PGLITE_MAX_BIND_PARAMETERS
|
|
500
513
|
)
|
|
501
514
|
} : {};
|
|
502
|
-
const declaredCapabilities =
|
|
515
|
+
const declaredCapabilities = chunkNUQ2YFFH_cjs.normalizeGraphAnalyticsCapabilities({
|
|
503
516
|
...baseCapabilities,
|
|
504
517
|
...httpOnlyOverrides,
|
|
505
518
|
...options.capabilities,
|
|
506
519
|
...driverBindParameterOverrides
|
|
507
520
|
});
|
|
508
|
-
const capabilities =
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
521
|
+
const capabilities = chunk5WWEYV4H_cjs.assertBundledCapabilityDeclarations(
|
|
522
|
+
{
|
|
523
|
+
...declaredCapabilities,
|
|
524
|
+
contributions: {
|
|
525
|
+
supported: true,
|
|
526
|
+
probe: true,
|
|
527
|
+
rebuild: chunk5WWEYV4H_cjs.contributionRebuildSupported(
|
|
528
|
+
fulltextStrategy,
|
|
529
|
+
tables2.fulltextTableName,
|
|
530
|
+
declaredCapabilities.transactions
|
|
531
|
+
)
|
|
532
|
+
}
|
|
518
533
|
}
|
|
519
|
-
|
|
534
|
+
);
|
|
520
535
|
const adapterOptions = {
|
|
521
536
|
...options.prepareStatements === void 0 ? {} : { prepareStatements: options.prepareStatements },
|
|
522
537
|
...options.preparedStatementCacheMax === void 0 ? {} : { preparedStatementCacheMax: options.preparedStatementCacheMax },
|
|
523
|
-
maxBindParameters: capabilities.maxBindParameters ??
|
|
538
|
+
maxBindParameters: capabilities.maxBindParameters ?? chunkNUQ2YFFH_cjs.POSTGRES_MAX_BIND_PARAMETERS
|
|
524
539
|
};
|
|
525
540
|
const executionAdapter = createPostgresExecutionAdapter(db, adapterOptions);
|
|
526
541
|
const tableNames = {
|
|
@@ -535,7 +550,8 @@ function createPostgresBackend(db, options = {}) {
|
|
|
535
550
|
identityClosure: drizzleOrm.getTableName(tables2.identityClosure),
|
|
536
551
|
identitySeparation: drizzleOrm.getTableName(tables2.identitySeparation),
|
|
537
552
|
fulltext: tables2.fulltextTableName,
|
|
538
|
-
uniques: drizzleOrm.getTableName(tables2.uniques)
|
|
553
|
+
uniques: drizzleOrm.getTableName(tables2.uniques),
|
|
554
|
+
edgeClaims: drizzleOrm.getTableName(tables2.edgeClaims)
|
|
539
555
|
};
|
|
540
556
|
const coreAnalyzeStatements = [
|
|
541
557
|
tableNames.nodes,
|
|
@@ -543,8 +559,8 @@ function createPostgresBackend(db, options = {}) {
|
|
|
543
559
|
drizzleOrm.getTableName(tables2.uniques),
|
|
544
560
|
tableNames.fulltext
|
|
545
561
|
].map(
|
|
546
|
-
(name) =>
|
|
547
|
-
|
|
562
|
+
(name) => chunkLLFPQOBA_cjs.toDrizzleSql(
|
|
563
|
+
chunkH5IJSROF_cjs.sql`ANALYZE (SKIP_LOCKED) ${chunkH5IJSROF_cjs.sql.identifier(name)}`,
|
|
548
564
|
"postgres"
|
|
549
565
|
)
|
|
550
566
|
);
|
|
@@ -557,11 +573,11 @@ function createPostgresBackend(db, options = {}) {
|
|
|
557
573
|
tableNames.identityClosure,
|
|
558
574
|
tableNames.identitySeparation
|
|
559
575
|
];
|
|
560
|
-
const operationStrategy =
|
|
576
|
+
const operationStrategy = chunk5WWEYV4H_cjs.createPostgresOperationStrategy(
|
|
561
577
|
tables2,
|
|
562
578
|
fulltextStrategy
|
|
563
579
|
);
|
|
564
|
-
const guardedTableExists =
|
|
580
|
+
const guardedTableExists = chunk5WWEYV4H_cjs.createCachedTableExistence(
|
|
565
581
|
async (tableName) => {
|
|
566
582
|
const rows = await executionAdapter.execute(
|
|
567
583
|
operationStrategy.buildTableExists(tableName)
|
|
@@ -573,30 +589,64 @@ function createPostgresBackend(db, options = {}) {
|
|
|
573
589
|
const matTable = tables2.contributionMaterializations;
|
|
574
590
|
async function executeConcurrentCreateDdl(ddl) {
|
|
575
591
|
const statement = drizzleOrm.sql.raw(ddl);
|
|
576
|
-
|
|
577
|
-
await db.execute(statement);
|
|
578
|
-
} catch (error) {
|
|
579
|
-
if (!chunkSIT26LAZ_cjs.isPostgresConcurrentDdlRaceError(error)) throw error;
|
|
592
|
+
await withConcurrentCreateRetry(async () => {
|
|
580
593
|
await db.execute(statement);
|
|
581
|
-
}
|
|
594
|
+
});
|
|
582
595
|
}
|
|
583
596
|
async function ensureTableWithConcurrentCreateRetry(table) {
|
|
584
|
-
await executeConcurrentCreateDdl(
|
|
597
|
+
await executeConcurrentCreateDdl(chunk5WWEYV4H_cjs.generatePgCreateTableSQL(table));
|
|
598
|
+
}
|
|
599
|
+
async function ensureDatabaseExtension(name) {
|
|
600
|
+
const validated = chunkNUQ2YFFH_cjs.DATABASE_EXTENSION_NAMES.find(
|
|
601
|
+
(candidate) => candidate === name
|
|
602
|
+
);
|
|
603
|
+
if (validated === void 0) {
|
|
604
|
+
throw new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
605
|
+
`Unsupported database extension "${name}".`,
|
|
606
|
+
{ extension: name, supported: chunkNUQ2YFFH_cjs.DATABASE_EXTENSION_NAMES },
|
|
607
|
+
{
|
|
608
|
+
suggestion: `Request one of: ${chunkNUQ2YFFH_cjs.DATABASE_EXTENSION_NAMES.join(", ")}.`
|
|
609
|
+
}
|
|
610
|
+
);
|
|
611
|
+
}
|
|
612
|
+
const ddl = `CREATE EXTENSION IF NOT EXISTS "${validated}";`;
|
|
613
|
+
if (!capabilities.transactions) {
|
|
614
|
+
await executeConcurrentCreateDdl(ddl);
|
|
615
|
+
return;
|
|
616
|
+
}
|
|
617
|
+
await withConcurrentCreateRetry(async () => {
|
|
618
|
+
await db.transaction(async (tx) => {
|
|
619
|
+
await tx.execute(
|
|
620
|
+
drizzleOrm.sql`SELECT pg_advisory_xact_lock(hashtext(${extensionDdlLockKey(validated)}), 0)`
|
|
621
|
+
);
|
|
622
|
+
await tx.execute(drizzleOrm.sql.raw(ddl));
|
|
623
|
+
});
|
|
624
|
+
});
|
|
585
625
|
}
|
|
586
626
|
async function ensureContributionMaterializationsTableImpl() {
|
|
587
627
|
await ensureTableWithConcurrentCreateRetry(matTable);
|
|
588
628
|
}
|
|
589
629
|
function identityContributionsFor(identityTableNames) {
|
|
590
|
-
const identityTables =
|
|
630
|
+
const identityTables = chunk5WWEYV4H_cjs.createPostgresTables({
|
|
591
631
|
identityAssertions: identityTableNames.identityAssertions,
|
|
592
632
|
recordedIdentityAssertions: identityTableNames.recordedIdentityAssertions,
|
|
593
633
|
identityClosure: identityTableNames.identityClosure,
|
|
594
634
|
identitySeparation: identityTableNames.identitySeparation
|
|
595
635
|
});
|
|
596
|
-
return
|
|
636
|
+
return chunk5WWEYV4H_cjs.postgresContributions(identityTables, fulltextStrategy).filter(
|
|
597
637
|
(contribution) => IDENTITY_TABLE_LOGICAL_NAMES.has(contribution.logicalName)
|
|
598
638
|
);
|
|
599
639
|
}
|
|
640
|
+
function recordedContributionsFor(recordedTableNames) {
|
|
641
|
+
const recordedTables = chunk5WWEYV4H_cjs.createPostgresTables({
|
|
642
|
+
recordedNodes: recordedTableNames.recordedNodes,
|
|
643
|
+
recordedEdges: recordedTableNames.recordedEdges,
|
|
644
|
+
recordedClock: recordedTableNames.recordedClock
|
|
645
|
+
});
|
|
646
|
+
return chunk5WWEYV4H_cjs.postgresContributions(recordedTables, fulltextStrategy).filter(
|
|
647
|
+
(contribution) => RECORDED_TABLE_LOGICAL_NAMES.has(contribution.logicalName)
|
|
648
|
+
);
|
|
649
|
+
}
|
|
600
650
|
async function getContributionMaterializationRow(identity) {
|
|
601
651
|
const rows = await db.select().from(matTable).where(
|
|
602
652
|
drizzleOrm.and(
|
|
@@ -608,25 +658,25 @@ function createPostgresBackend(db, options = {}) {
|
|
|
608
658
|
);
|
|
609
659
|
const row = rows[0];
|
|
610
660
|
if (row === void 0) return void 0;
|
|
611
|
-
return
|
|
661
|
+
return chunk5WWEYV4H_cjs.mapContributionMaterializationRow(
|
|
612
662
|
row,
|
|
613
|
-
|
|
663
|
+
chunk5WWEYV4H_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.decode
|
|
614
664
|
);
|
|
615
665
|
}
|
|
616
666
|
async function getContributionMaterializationRows(graphId) {
|
|
617
667
|
const rows = await db.select().from(matTable).where(drizzleOrm.eq(matTable.graphId, graphId));
|
|
618
668
|
return rows.map(
|
|
619
|
-
(row) =>
|
|
669
|
+
(row) => chunk5WWEYV4H_cjs.mapContributionMaterializationRow(
|
|
620
670
|
row,
|
|
621
|
-
|
|
671
|
+
chunk5WWEYV4H_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.decode
|
|
622
672
|
)
|
|
623
673
|
);
|
|
624
674
|
}
|
|
625
675
|
async function recordContributionMaterializationRow(params) {
|
|
626
676
|
await db.insert(matTable).values(
|
|
627
|
-
|
|
677
|
+
chunk5WWEYV4H_cjs.buildContributionInsertValues(
|
|
628
678
|
params,
|
|
629
|
-
|
|
679
|
+
chunk5WWEYV4H_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.encode
|
|
630
680
|
)
|
|
631
681
|
).onConflictDoUpdate({
|
|
632
682
|
target: [
|
|
@@ -635,7 +685,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
635
685
|
matTable.owner,
|
|
636
686
|
matTable.tableName
|
|
637
687
|
],
|
|
638
|
-
set:
|
|
688
|
+
set: chunk5WWEYV4H_cjs.buildContributionOnConflictSet(
|
|
639
689
|
matTable.materializedAt,
|
|
640
690
|
params.materializedAt
|
|
641
691
|
)
|
|
@@ -655,10 +705,11 @@ function createPostgresBackend(db, options = {}) {
|
|
|
655
705
|
const rows = await executionAdapter.execute(
|
|
656
706
|
operationStrategy.buildTableExists(tableName)
|
|
657
707
|
);
|
|
658
|
-
return
|
|
708
|
+
return chunk5WWEYV4H_cjs.tableExistsFromRow(rows[0]);
|
|
659
709
|
}
|
|
660
|
-
const contributionMaterializer =
|
|
710
|
+
const contributionMaterializer = chunk5WWEYV4H_cjs.createContributionMaterializer({
|
|
661
711
|
dialect: "postgres",
|
|
712
|
+
fenceTarget: chunkNUQ2YFFH_cjs.markFirstPartyFactory({ dialect: "postgres", capabilities }),
|
|
662
713
|
fulltextStrategy,
|
|
663
714
|
fulltextTableName: tables2.fulltextTableName,
|
|
664
715
|
vectorStrategy,
|
|
@@ -698,7 +749,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
698
749
|
});
|
|
699
750
|
function runSchemaWriteTransaction(graphId, fn) {
|
|
700
751
|
if (!capabilities.transactions) {
|
|
701
|
-
throw new
|
|
752
|
+
throw new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
702
753
|
"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
754
|
{
|
|
704
755
|
backend: "postgres",
|
|
@@ -749,7 +800,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
749
800
|
schemaVersionsTable: tables2.schemaVersions
|
|
750
801
|
});
|
|
751
802
|
return {
|
|
752
|
-
backend:
|
|
803
|
+
backend: chunk5WWEYV4H_cjs.gateFulltext(
|
|
753
804
|
backend2,
|
|
754
805
|
contributionMaterializer.assertInitialized,
|
|
755
806
|
contributionMaterializer.refuseUnavailableFulltext
|
|
@@ -773,33 +824,33 @@ function createPostgresBackend(db, options = {}) {
|
|
|
773
824
|
);
|
|
774
825
|
const executeCompiled = trustedExecutionAdapter.executeCompiled;
|
|
775
826
|
if (executeCompiled === void 0) {
|
|
776
|
-
throw new
|
|
827
|
+
throw new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
777
828
|
"Trusted import could not bind raw execution to the PostgreSQL transaction.",
|
|
778
829
|
{ capability: "trustedImport", dialect: "postgres" }
|
|
779
830
|
);
|
|
780
831
|
}
|
|
781
|
-
const trustedTx =
|
|
832
|
+
const trustedTx = chunkNLX5OWK7_cjs.deriveBackend(tx, {
|
|
782
833
|
executeRaw(sqlText, params) {
|
|
783
834
|
return executeCompiled({ params, sql: sqlText });
|
|
784
835
|
}
|
|
785
836
|
});
|
|
786
|
-
await
|
|
787
|
-
await
|
|
788
|
-
const indexDefinitions = await
|
|
837
|
+
await chunk5WWEYV4H_cjs.lockPostgresTrustedImportTables(trustedTx, tableNames);
|
|
838
|
+
await chunk5WWEYV4H_cjs.assertTrustedImportDatabaseEmpty(trustedTx, tableNames);
|
|
839
|
+
const indexDefinitions = await chunk5WWEYV4H_cjs.suspendPostgresSecondaryIndexes(
|
|
789
840
|
trustedTx,
|
|
790
841
|
tableNames
|
|
791
842
|
);
|
|
792
843
|
const result = await fn(
|
|
793
|
-
|
|
844
|
+
chunk5WWEYV4H_cjs.createPostgresTrustedImportSession(trustedTx, tableNames)
|
|
794
845
|
);
|
|
795
|
-
await
|
|
796
|
-
await
|
|
846
|
+
await chunk5WWEYV4H_cjs.restoreSecondaryIndexes(trustedTx, indexDefinitions);
|
|
847
|
+
await chunk5WWEYV4H_cjs.analyzeImportedTables(trustedTx, tableNames);
|
|
797
848
|
return result;
|
|
798
849
|
});
|
|
799
850
|
}
|
|
800
851
|
} : {},
|
|
801
852
|
async bootstrapTables() {
|
|
802
|
-
const statements =
|
|
853
|
+
const statements = chunk5WWEYV4H_cjs.generatePostgresDDL(tables2, fulltextStrategy);
|
|
803
854
|
for (const statement of statements) {
|
|
804
855
|
await executeConcurrentCreateDdl(statement);
|
|
805
856
|
}
|
|
@@ -829,12 +880,34 @@ function createPostgresBackend(db, options = {}) {
|
|
|
829
880
|
(contribution) => [...contribution.createDdl]
|
|
830
881
|
);
|
|
831
882
|
},
|
|
883
|
+
recordedTableDdl(recordedTableNames) {
|
|
884
|
+
const contributions = recordedContributionsFor(recordedTableNames);
|
|
885
|
+
function ddlFor(logicalName) {
|
|
886
|
+
const contribution = chunkN66HCGCY_cjs.requireDefined(
|
|
887
|
+
contributions.find((entry) => entry.logicalName === logicalName),
|
|
888
|
+
`recordedTableDdl: no contribution for ${logicalName}.`
|
|
889
|
+
);
|
|
890
|
+
return {
|
|
891
|
+
createTable: chunkN66HCGCY_cjs.requireDefined(
|
|
892
|
+
contribution.createDdl[0],
|
|
893
|
+
`recordedTableDdl: empty DDL for ${logicalName}.`
|
|
894
|
+
),
|
|
895
|
+
indexes: contribution.createDdl.slice(1),
|
|
896
|
+
primaryKeyConstraintName: `${contribution.tableName}_pkey`
|
|
897
|
+
};
|
|
898
|
+
}
|
|
899
|
+
return {
|
|
900
|
+
recordedClock: ddlFor("recordedClock"),
|
|
901
|
+
recordedEdges: ddlFor("recordedEdges"),
|
|
902
|
+
recordedNodes: ddlFor("recordedNodes")
|
|
903
|
+
};
|
|
904
|
+
},
|
|
832
905
|
// Every fulltext-touching method asserts the durable marker instead
|
|
833
906
|
// of lazily emitting DDL. Steady state performs zero ensure; an
|
|
834
907
|
// uninitialized database throws `StoreNotInitializedError` loudly
|
|
835
908
|
// rather than self-healing on a read/write path (#135). Shared
|
|
836
909
|
// verbatim with the tx-scoped gate via `gateFulltextMethods`.
|
|
837
|
-
...
|
|
910
|
+
...chunk5WWEYV4H_cjs.gateFulltextMethods(
|
|
838
911
|
operations,
|
|
839
912
|
contributionMaterializer.assertInitialized,
|
|
840
913
|
contributionMaterializer.refuseUnavailableFulltext
|
|
@@ -842,6 +915,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
842
915
|
async executeDdl(ddl) {
|
|
843
916
|
await db.execute(drizzleOrm.sql.raw(ddl));
|
|
844
917
|
},
|
|
918
|
+
ensureExtension: ensureDatabaseExtension,
|
|
845
919
|
async ensureIndexMaterializationsTable() {
|
|
846
920
|
await ensureTableWithConcurrentCreateRetry(tables2.indexMaterializations);
|
|
847
921
|
const tableName = drizzleOrm.getTableName(tables2.indexMaterializations);
|
|
@@ -852,17 +926,8 @@ function createPostgresBackend(db, options = {}) {
|
|
|
852
926
|
`ALTER TABLE "${tableName}" ADD COLUMN IF NOT EXISTS "claim_token" text;`
|
|
853
927
|
);
|
|
854
928
|
},
|
|
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
|
-
});
|
|
929
|
+
ensureTrigramExtension() {
|
|
930
|
+
return ensureDatabaseExtension("pg_trgm");
|
|
866
931
|
},
|
|
867
932
|
async claimIndexMaterialization(params) {
|
|
868
933
|
const t = tables2.indexMaterializations;
|
|
@@ -902,26 +967,26 @@ function createPostgresBackend(db, options = {}) {
|
|
|
902
967
|
const rows = await db.select().from(t).where(drizzleOrm.eq(t.indexName, indexName));
|
|
903
968
|
const row = rows[0];
|
|
904
969
|
if (row === void 0) return void 0;
|
|
905
|
-
return
|
|
970
|
+
return chunk5WWEYV4H_cjs.mapMaterializationRow(row, chunk5WWEYV4H_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.decode);
|
|
906
971
|
},
|
|
907
972
|
async getIndexMaterializations(statusKeys) {
|
|
908
973
|
if (statusKeys.length === 0) return [];
|
|
909
974
|
const t = tables2.indexMaterializations;
|
|
910
975
|
const rows = await db.select().from(t).where(drizzleOrm.inArray(t.indexName, [...statusKeys]));
|
|
911
976
|
return rows.map(
|
|
912
|
-
(row) =>
|
|
977
|
+
(row) => chunk5WWEYV4H_cjs.mapMaterializationRow(row, chunk5WWEYV4H_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.decode)
|
|
913
978
|
);
|
|
914
979
|
},
|
|
915
980
|
async recordIndexMaterialization(params) {
|
|
916
981
|
const t = tables2.indexMaterializations;
|
|
917
982
|
await db.insert(t).values(
|
|
918
|
-
|
|
983
|
+
chunk5WWEYV4H_cjs.buildMaterializationInsertValues(
|
|
919
984
|
params,
|
|
920
|
-
|
|
985
|
+
chunk5WWEYV4H_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.encode
|
|
921
986
|
)
|
|
922
987
|
).onConflictDoUpdate({
|
|
923
988
|
target: t.indexName,
|
|
924
|
-
set:
|
|
989
|
+
set: chunk5WWEYV4H_cjs.buildMaterializationOnConflictSet(params.materializedAt)
|
|
925
990
|
});
|
|
926
991
|
},
|
|
927
992
|
async ensureContributionMaterializationsTable() {
|
|
@@ -943,26 +1008,26 @@ function createPostgresBackend(db, options = {}) {
|
|
|
943
1008
|
const t = tables2.kindRemovals;
|
|
944
1009
|
const rows = await db.select().from(t).where(drizzleOrm.and(drizzleOrm.eq(t.graphId, graphId), drizzleOrm.isNull(t.removedAt)));
|
|
945
1010
|
return rows.map(
|
|
946
|
-
(row) =>
|
|
1011
|
+
(row) => chunk5WWEYV4H_cjs.mapKindRemovalRow(row, chunk5WWEYV4H_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.decode)
|
|
947
1012
|
);
|
|
948
1013
|
},
|
|
949
1014
|
async getAllKindRemovals(graphId) {
|
|
950
1015
|
const t = tables2.kindRemovals;
|
|
951
1016
|
const rows = await db.select().from(t).where(drizzleOrm.eq(t.graphId, graphId));
|
|
952
1017
|
return rows.map(
|
|
953
|
-
(row) =>
|
|
1018
|
+
(row) => chunk5WWEYV4H_cjs.mapKindRemovalRow(row, chunk5WWEYV4H_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.decode)
|
|
954
1019
|
);
|
|
955
1020
|
},
|
|
956
1021
|
async recordKindRemoval(params) {
|
|
957
1022
|
const t = tables2.kindRemovals;
|
|
958
1023
|
await db.insert(t).values(
|
|
959
|
-
|
|
1024
|
+
chunk5WWEYV4H_cjs.buildKindRemovalInsertValues(
|
|
960
1025
|
params,
|
|
961
|
-
|
|
1026
|
+
chunk5WWEYV4H_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.encode
|
|
962
1027
|
)
|
|
963
1028
|
).onConflictDoUpdate({
|
|
964
1029
|
target: [t.graphId, t.kindName, t.entity, t.schemaVersion],
|
|
965
|
-
set:
|
|
1030
|
+
set: chunk5WWEYV4H_cjs.buildKindRemovalOnConflictSet(t.removedAt, params.removedAt)
|
|
966
1031
|
});
|
|
967
1032
|
},
|
|
968
1033
|
async ensureReconciliationMarkersTable() {
|
|
@@ -1041,8 +1106,8 @@ function createPostgresBackend(db, options = {}) {
|
|
|
1041
1106
|
const presentGuardedTables = tablePresence.filter((entry) => entry.exists).map((entry) => entry.tableName);
|
|
1042
1107
|
for (const tableName of presentGuardedTables) {
|
|
1043
1108
|
await db.execute(
|
|
1044
|
-
|
|
1045
|
-
|
|
1109
|
+
chunkLLFPQOBA_cjs.toDrizzleSql(
|
|
1110
|
+
chunkH5IJSROF_cjs.sql`ANALYZE (SKIP_LOCKED) ${chunkH5IJSROF_cjs.sql.identifier(tableName)}`,
|
|
1046
1111
|
"postgres"
|
|
1047
1112
|
)
|
|
1048
1113
|
);
|
|
@@ -1057,7 +1122,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
1057
1122
|
async commitSchemaVersionIfKindsEmpty(params, probes) {
|
|
1058
1123
|
return runSchemaWriteTransaction(
|
|
1059
1124
|
params.graphId,
|
|
1060
|
-
(target) =>
|
|
1125
|
+
(target) => chunk5WWEYV4H_cjs.commitSchemaVersionIfKindsEmpty(target, params, probes)
|
|
1061
1126
|
);
|
|
1062
1127
|
},
|
|
1063
1128
|
async commitSchemaVersionWithPreflight(params, preflight) {
|
|
@@ -1079,9 +1144,9 @@ function createPostgresBackend(db, options = {}) {
|
|
|
1079
1144
|
return backend.transactionWithNative((tx) => fn(tx), options2);
|
|
1080
1145
|
},
|
|
1081
1146
|
async transactionWithNative(fn, options2) {
|
|
1082
|
-
const temporaryWrites = options2?.temporaryWrites ===
|
|
1147
|
+
const temporaryWrites = options2?.temporaryWrites === chunkNUQ2YFFH_cjs.INTERNAL_TEMPORARY_WRITES;
|
|
1083
1148
|
if (temporaryWrites && options2.accessMode !== "read_only") {
|
|
1084
|
-
throw new
|
|
1149
|
+
throw new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
1085
1150
|
"Temporary-write transactions must be semantically read-only.",
|
|
1086
1151
|
{ dialect: "postgres" }
|
|
1087
1152
|
);
|
|
@@ -1105,7 +1170,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
1105
1170
|
},
|
|
1106
1171
|
adoptTransaction(externalTx) {
|
|
1107
1172
|
if (!capabilities.transactions) {
|
|
1108
|
-
throw new
|
|
1173
|
+
throw new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
1109
1174
|
"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
1175
|
{
|
|
1111
1176
|
backend: "postgres",
|
|
@@ -1114,7 +1179,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
1114
1179
|
}
|
|
1115
1180
|
);
|
|
1116
1181
|
}
|
|
1117
|
-
|
|
1182
|
+
chunk5WWEYV4H_cjs.assertAdoptedDialect(
|
|
1118
1183
|
externalTx,
|
|
1119
1184
|
pgCore.PgTransaction,
|
|
1120
1185
|
"postgres"
|
|
@@ -1124,7 +1189,8 @@ function createPostgresBackend(db, options = {}) {
|
|
|
1124
1189
|
async close() {
|
|
1125
1190
|
}
|
|
1126
1191
|
};
|
|
1127
|
-
|
|
1192
|
+
chunkNLX5OWK7_cjs.auditBackendResource(backend, resourceAudit);
|
|
1193
|
+
chunkNUQ2YFFH_cjs.markFirstPartyFactory(backend);
|
|
1128
1194
|
return backend;
|
|
1129
1195
|
}
|
|
1130
1196
|
function getSerializedPostgresClient(db) {
|
|
@@ -1231,10 +1297,10 @@ function createPostgresOperationBackend(options) {
|
|
|
1231
1297
|
}
|
|
1232
1298
|
async function vectorSearchGucOverrides(params) {
|
|
1233
1299
|
const overrides = [];
|
|
1234
|
-
const efSearchParameter =
|
|
1300
|
+
const efSearchParameter = chunkH2VWDQWC_cjs.resolveEfSearchOverride({
|
|
1235
1301
|
efSearch: params.efSearch,
|
|
1236
1302
|
indexType: params.indexType,
|
|
1237
|
-
tuning:
|
|
1303
|
+
tuning: chunkH2VWDQWC_cjs.vectorSearchFrontierTuning(vectorStrategy),
|
|
1238
1304
|
transactions: capabilities.transactions,
|
|
1239
1305
|
dialect: "PostgreSQL",
|
|
1240
1306
|
engine: vectorStrategy?.name ?? "this backend"
|
|
@@ -1259,7 +1325,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1259
1325
|
async function runVectorSearchGucGroup(overrides, query) {
|
|
1260
1326
|
const runExclusive = executionAdapter.runExclusive;
|
|
1261
1327
|
if (runExclusive === void 0) {
|
|
1262
|
-
throw new
|
|
1328
|
+
throw new chunkX4GDXBOP_cjs.CompilerInvariantError(
|
|
1263
1329
|
"A transaction-scoped Postgres backend must expose runExclusive; its execution adapter was not wrapped by createSerialExecutionAdapter."
|
|
1264
1330
|
);
|
|
1265
1331
|
}
|
|
@@ -1303,17 +1369,17 @@ function createPostgresOperationBackend(options) {
|
|
|
1303
1369
|
});
|
|
1304
1370
|
}
|
|
1305
1371
|
const batchConfig = computePostgresBatchChunkSizes(
|
|
1306
|
-
capabilities.maxBindParameters ??
|
|
1372
|
+
capabilities.maxBindParameters ?? chunkNUQ2YFFH_cjs.POSTGRES_MAX_BIND_PARAMETERS
|
|
1307
1373
|
);
|
|
1308
|
-
const commonOperationMembers =
|
|
1374
|
+
const commonOperationMembers = chunk5WWEYV4H_cjs.createCommonOperationBackend({
|
|
1309
1375
|
batchConfig,
|
|
1310
1376
|
execution: {
|
|
1311
1377
|
execAll,
|
|
1312
1378
|
execGet,
|
|
1313
1379
|
execRun
|
|
1314
1380
|
},
|
|
1315
|
-
nowIso:
|
|
1316
|
-
maxBindParameters: capabilities.maxBindParameters ??
|
|
1381
|
+
nowIso: chunk36SX6QXP_cjs.nowIso,
|
|
1382
|
+
maxBindParameters: capabilities.maxBindParameters ?? chunkNUQ2YFFH_cjs.POSTGRES_MAX_BIND_PARAMETERS,
|
|
1317
1383
|
operationStrategy,
|
|
1318
1384
|
rowMappers: {
|
|
1319
1385
|
toEdgeRow,
|
|
@@ -1331,28 +1397,28 @@ function createPostgresOperationBackend(options) {
|
|
|
1331
1397
|
};
|
|
1332
1398
|
const vectorEmbeddingMethods = vectorStrategy === void 0 ? {} : {
|
|
1333
1399
|
async upsertEmbedding(params) {
|
|
1334
|
-
const slot =
|
|
1400
|
+
const slot = chunk5WWEYV4H_cjs.vectorSlotFromParams(params);
|
|
1335
1401
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1336
|
-
const statements = vectorStrategy.buildUpsert(slot, params,
|
|
1402
|
+
const statements = vectorStrategy.buildUpsert(slot, params, chunk36SX6QXP_cjs.nowIso());
|
|
1337
1403
|
try {
|
|
1338
1404
|
for (const statement of statements) {
|
|
1339
1405
|
await execRun(statement);
|
|
1340
1406
|
}
|
|
1341
1407
|
} catch (error) {
|
|
1342
|
-
throw
|
|
1408
|
+
throw chunk5WWEYV4H_cjs.mapVectorWriteError(error, params);
|
|
1343
1409
|
}
|
|
1344
1410
|
},
|
|
1345
1411
|
async upsertEmbeddingBatch(params) {
|
|
1346
1412
|
if (params.rows.length === 0) return;
|
|
1347
|
-
const slot =
|
|
1413
|
+
const slot = chunk5WWEYV4H_cjs.vectorSlotFromParams(params);
|
|
1348
1414
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1349
1415
|
const rowsById = new Map(
|
|
1350
1416
|
params.rows.map((row) => [row.nodeId, row])
|
|
1351
1417
|
);
|
|
1352
1418
|
const rows = [...rowsById.values()];
|
|
1353
|
-
const timestamp =
|
|
1419
|
+
const timestamp = chunk36SX6QXP_cjs.nowIso();
|
|
1354
1420
|
try {
|
|
1355
|
-
for (const chunk2 of
|
|
1421
|
+
for (const chunk2 of chunkNLX5OWK7_cjs.chunk(
|
|
1356
1422
|
rows,
|
|
1357
1423
|
batchConfig.embeddingUpsertBatchSize
|
|
1358
1424
|
)) {
|
|
@@ -1381,11 +1447,11 @@ function createPostgresOperationBackend(options) {
|
|
|
1381
1447
|
}
|
|
1382
1448
|
}
|
|
1383
1449
|
} catch (error) {
|
|
1384
|
-
throw
|
|
1450
|
+
throw chunk5WWEYV4H_cjs.mapVectorWriteError(error, params);
|
|
1385
1451
|
}
|
|
1386
1452
|
},
|
|
1387
1453
|
async deleteEmbedding(params) {
|
|
1388
|
-
const slot =
|
|
1454
|
+
const slot = chunk5WWEYV4H_cjs.vectorSlotFromParams(params);
|
|
1389
1455
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1390
1456
|
const statements = vectorStrategy.buildDelete(slot, params);
|
|
1391
1457
|
for (const statement of statements) {
|
|
@@ -1394,9 +1460,9 @@ function createPostgresOperationBackend(options) {
|
|
|
1394
1460
|
},
|
|
1395
1461
|
async deleteEmbeddingBatch(params) {
|
|
1396
1462
|
if (params.nodeIds.length === 0) return;
|
|
1397
|
-
const slot =
|
|
1463
|
+
const slot = chunk5WWEYV4H_cjs.vectorSlotFromParams(params);
|
|
1398
1464
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1399
|
-
for (const nodeIds of
|
|
1465
|
+
for (const nodeIds of chunkNLX5OWK7_cjs.chunk(
|
|
1400
1466
|
[...new Set(params.nodeIds)],
|
|
1401
1467
|
batchConfig.embeddingUpsertBatchSize
|
|
1402
1468
|
)) {
|
|
@@ -1408,19 +1474,19 @@ function createPostgresOperationBackend(options) {
|
|
|
1408
1474
|
}
|
|
1409
1475
|
},
|
|
1410
1476
|
async vectorSearch(params) {
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
const slot =
|
|
1477
|
+
chunkH2VWDQWC_cjs.assertVectorSearchLimit(params.limit);
|
|
1478
|
+
chunkTIJUA4I6_cjs.assertPgvectorEfSearch(params.efSearch);
|
|
1479
|
+
const slot = chunk5WWEYV4H_cjs.vectorSlotFromParams(params);
|
|
1414
1480
|
const query = vectorStrategy.buildSearch(
|
|
1415
1481
|
slot,
|
|
1416
1482
|
params,
|
|
1417
1483
|
// Store-compiled candidates (predicates + subclass + currency)
|
|
1418
1484
|
// take precedence; the live-node default covers direct backend use.
|
|
1419
|
-
params.candidates ??
|
|
1485
|
+
params.candidates ?? chunk5WWEYV4H_cjs.buildLiveNodeCandidates(
|
|
1420
1486
|
tableNames.nodes,
|
|
1421
1487
|
params.graphId,
|
|
1422
1488
|
params.nodeKind,
|
|
1423
|
-
|
|
1489
|
+
chunk36SX6QXP_cjs.nowIso()
|
|
1424
1490
|
)
|
|
1425
1491
|
);
|
|
1426
1492
|
const gucOverrides = await vectorSearchGucOverrides(params);
|
|
@@ -1428,7 +1494,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1428
1494
|
try {
|
|
1429
1495
|
rows = await runVectorSearch(gucOverrides, query);
|
|
1430
1496
|
} catch (error) {
|
|
1431
|
-
throw
|
|
1497
|
+
throw chunk5WWEYV4H_cjs.mapVectorWriteError(error, params);
|
|
1432
1498
|
}
|
|
1433
1499
|
return rows.map((row) => ({
|
|
1434
1500
|
nodeId: row.node_id,
|
|
@@ -1440,10 +1506,10 @@ function createPostgresOperationBackend(options) {
|
|
|
1440
1506
|
// multi-statement fallback by simply not exposing the member.
|
|
1441
1507
|
...capabilities.windowFunctions ? {
|
|
1442
1508
|
async hybridSearch(params) {
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
const slot =
|
|
1509
|
+
chunkH2VWDQWC_cjs.assertVectorSearchLimit(params.limit);
|
|
1510
|
+
chunkH2VWDQWC_cjs.assertVectorSearchLimit(params.vector.k);
|
|
1511
|
+
chunkTIJUA4I6_cjs.assertPgvectorEfSearch(params.vector.efSearch);
|
|
1512
|
+
const slot = chunk5WWEYV4H_cjs.vectorSlotFromParams({
|
|
1447
1513
|
graphId: params.graphId,
|
|
1448
1514
|
nodeKind: params.nodeKind,
|
|
1449
1515
|
fieldPath: params.vector.fieldPath,
|
|
@@ -1451,11 +1517,11 @@ function createPostgresOperationBackend(options) {
|
|
|
1451
1517
|
metric: params.vector.metric,
|
|
1452
1518
|
indexType: params.vector.indexType
|
|
1453
1519
|
});
|
|
1454
|
-
const candidates = params.candidates ??
|
|
1520
|
+
const candidates = params.candidates ?? chunk5WWEYV4H_cjs.buildLiveNodeCandidates(
|
|
1455
1521
|
tableNames.nodes,
|
|
1456
1522
|
params.graphId,
|
|
1457
1523
|
params.nodeKind,
|
|
1458
|
-
|
|
1524
|
+
chunk36SX6QXP_cjs.nowIso()
|
|
1459
1525
|
);
|
|
1460
1526
|
const vectorParams = {
|
|
1461
1527
|
graphId: params.graphId,
|
|
@@ -1471,11 +1537,11 @@ function createPostgresOperationBackend(options) {
|
|
|
1471
1537
|
const vectorSql = vectorStrategy.buildSearch(
|
|
1472
1538
|
slot,
|
|
1473
1539
|
vectorParams,
|
|
1474
|
-
|
|
1540
|
+
chunkH5IJSROF_cjs.sql.raw("SELECT node_id FROM tg_hybrid_cand")
|
|
1475
1541
|
);
|
|
1476
1542
|
const statement = operationStrategy.buildHybridSearch(
|
|
1477
1543
|
{ ...params, candidates },
|
|
1478
|
-
|
|
1544
|
+
chunkLLFPQOBA_cjs.toDrizzleSql(vectorSql, "postgres"),
|
|
1479
1545
|
params.vector.metric === "cosine"
|
|
1480
1546
|
);
|
|
1481
1547
|
const gucOverrides = await vectorSearchGucOverrides({
|
|
@@ -1489,9 +1555,9 @@ function createPostgresOperationBackend(options) {
|
|
|
1489
1555
|
statement
|
|
1490
1556
|
);
|
|
1491
1557
|
} catch (error) {
|
|
1492
|
-
throw
|
|
1558
|
+
throw chunk5WWEYV4H_cjs.mapVectorWriteError(error, vectorParams);
|
|
1493
1559
|
}
|
|
1494
|
-
return raw.map((row) =>
|
|
1560
|
+
return raw.map((row) => chunk5WWEYV4H_cjs.mapHybridSearchRow(row, toNodeRow));
|
|
1495
1561
|
}
|
|
1496
1562
|
} : {}
|
|
1497
1563
|
};
|
|
@@ -1546,7 +1612,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1546
1612
|
tableNames,
|
|
1547
1613
|
async lockSchemaVersionForWrite(params) {
|
|
1548
1614
|
if (!transactionScoped) {
|
|
1549
|
-
throw new
|
|
1615
|
+
throw new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
1550
1616
|
"The schema write fence requires an explicit PostgreSQL transaction.",
|
|
1551
1617
|
{
|
|
1552
1618
|
code: "SCHEMA_WRITE_FENCE_TRANSACTION_REQUIRED",
|
|
@@ -1556,7 +1622,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1556
1622
|
}
|
|
1557
1623
|
const locked = await lockActiveSchemaVersion(params.graphId);
|
|
1558
1624
|
if (locked !== void 0) {
|
|
1559
|
-
|
|
1625
|
+
chunk5WWEYV4H_cjs.assertActiveSchemaVersion(
|
|
1560
1626
|
params.graphId,
|
|
1561
1627
|
params.expectedVersion,
|
|
1562
1628
|
locked
|
|
@@ -1566,7 +1632,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1566
1632
|
const settled = await commonOperationMembers.getActiveSchema(
|
|
1567
1633
|
params.graphId
|
|
1568
1634
|
);
|
|
1569
|
-
throw new
|
|
1635
|
+
throw new chunkX4GDXBOP_cjs.StaleVersionError({
|
|
1570
1636
|
graphId: params.graphId,
|
|
1571
1637
|
expected: params.expectedVersion,
|
|
1572
1638
|
actual: settled?.version ?? 0
|
|
@@ -1575,7 +1641,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1575
1641
|
// === Vector Index Operations ===
|
|
1576
1642
|
async createVectorIndex(params) {
|
|
1577
1643
|
if (vectorStrategy === void 0) return;
|
|
1578
|
-
const slot =
|
|
1644
|
+
const slot = chunk5WWEYV4H_cjs.vectorSlotFromCreateIndexParams(params);
|
|
1579
1645
|
await contributionMaterializer.ensureVectorSlot(slot);
|
|
1580
1646
|
const indexStatement = vectorStrategy.buildCreateIndex?.(slot, {
|
|
1581
1647
|
concurrent: params.concurrent === true
|
|
@@ -1597,7 +1663,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1597
1663
|
},
|
|
1598
1664
|
// === Fulltext Operations ===
|
|
1599
1665
|
async upsertFulltext(params) {
|
|
1600
|
-
const timestamp =
|
|
1666
|
+
const timestamp = chunk36SX6QXP_cjs.nowIso();
|
|
1601
1667
|
const statements = operationStrategy.buildUpsertFulltext(
|
|
1602
1668
|
params,
|
|
1603
1669
|
timestamp
|
|
@@ -1614,8 +1680,8 @@ function createPostgresOperationBackend(options) {
|
|
|
1614
1680
|
},
|
|
1615
1681
|
async upsertFulltextBatch(params) {
|
|
1616
1682
|
if (params.rows.length === 0) return;
|
|
1617
|
-
const timestamp =
|
|
1618
|
-
for (const rows of
|
|
1683
|
+
const timestamp = chunk36SX6QXP_cjs.nowIso();
|
|
1684
|
+
for (const rows of chunkNLX5OWK7_cjs.chunk(
|
|
1619
1685
|
params.rows,
|
|
1620
1686
|
batchConfig.fulltextUpsertBatchSize
|
|
1621
1687
|
)) {
|
|
@@ -1630,7 +1696,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1630
1696
|
},
|
|
1631
1697
|
async deleteFulltextBatch(params) {
|
|
1632
1698
|
if (params.nodeIds.length === 0) return;
|
|
1633
|
-
for (const nodeIds of
|
|
1699
|
+
for (const nodeIds of chunkNLX5OWK7_cjs.chunk(
|
|
1634
1700
|
params.nodeIds,
|
|
1635
1701
|
batchConfig.fulltextDeleteChunkSize
|
|
1636
1702
|
)) {
|
|
@@ -1648,25 +1714,25 @@ function createPostgresOperationBackend(options) {
|
|
|
1648
1714
|
const rows = await execAll(query);
|
|
1649
1715
|
return rows.map((row, index) => ({
|
|
1650
1716
|
nodeId: row.node_id,
|
|
1651
|
-
score:
|
|
1717
|
+
score: chunk36SX6QXP_cjs.coerceNumericScore(row.score),
|
|
1652
1718
|
rank: index + 1,
|
|
1653
1719
|
...row.snippet === null ? {} : { snippet: row.snippet }
|
|
1654
1720
|
}));
|
|
1655
1721
|
},
|
|
1656
1722
|
async dropVectorIndex(params) {
|
|
1657
1723
|
if (vectorStrategy === void 0) return;
|
|
1658
|
-
const slot =
|
|
1724
|
+
const slot = chunk5WWEYV4H_cjs.vectorSlotFromDropIndexParams(params);
|
|
1659
1725
|
const dropStatement = vectorStrategy.buildDropIndex?.(slot);
|
|
1660
1726
|
if (dropStatement === void 0) return;
|
|
1661
1727
|
try {
|
|
1662
1728
|
await execRun(dropStatement);
|
|
1663
1729
|
} catch (error) {
|
|
1664
|
-
if (!
|
|
1730
|
+
if (!chunkNLX5OWK7_cjs.isMissingTableError(error)) throw error;
|
|
1665
1731
|
}
|
|
1666
1732
|
},
|
|
1667
1733
|
// === Query Execution ===
|
|
1668
1734
|
async execute(query) {
|
|
1669
|
-
const annTypes =
|
|
1735
|
+
const annTypes = chunkH5IJSROF_cjs.isSqlFragment(query) ? chunkH5IJSROF_cjs.annIndexScanTypes(query) : void 0;
|
|
1670
1736
|
if (annTypes !== void 0 && vectorStrategy !== void 0) {
|
|
1671
1737
|
const overrides = [];
|
|
1672
1738
|
for (const indexType of annTypes) {
|
|
@@ -1707,5 +1773,5 @@ function createTransactionBackend(options) {
|
|
|
1707
1773
|
}
|
|
1708
1774
|
|
|
1709
1775
|
exports.createPostgresBackend = createPostgresBackend;
|
|
1710
|
-
//# sourceMappingURL=chunk-
|
|
1711
|
-
//# sourceMappingURL=chunk-
|
|
1776
|
+
//# sourceMappingURL=chunk-B3MN7EJR.cjs.map
|
|
1777
|
+
//# sourceMappingURL=chunk-B3MN7EJR.cjs.map
|