@nicia-ai/typegraph 0.44.0 → 0.45.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 +7 -7
- package/dist/backend/drizzle/indexes.d.cts +1 -1
- package/dist/backend/drizzle/indexes.d.ts +1 -1
- package/dist/backend/drizzle/indexes.js +3 -3
- package/dist/backend/index.cjs +37 -37
- package/dist/backend/index.d.cts +3 -3
- package/dist/backend/index.d.ts +3 -3
- package/dist/backend/index.js +6 -6
- package/dist/backend/postgres/index.cjs +23 -23
- package/dist/backend/postgres/index.d.cts +6 -6
- package/dist/backend/postgres/index.d.ts +6 -6
- package/dist/backend/postgres/index.js +10 -10
- package/dist/backend/postgres/pglite-store.cjs +24 -25
- package/dist/backend/postgres/pglite-store.cjs.map +1 -1
- package/dist/backend/postgres/pglite-store.d.cts +7 -7
- package/dist/backend/postgres/pglite-store.d.ts +7 -7
- package/dist/backend/postgres/pglite-store.js +20 -21
- package/dist/backend/postgres/pglite-store.js.map +1 -1
- package/dist/backend/postgres/pglite.cjs +12 -12
- package/dist/backend/postgres/pglite.d.cts +3 -3
- package/dist/backend/postgres/pglite.d.ts +3 -3
- package/dist/backend/postgres/pglite.js +11 -11
- package/dist/backend/sqlite/index.cjs +21 -21
- package/dist/backend/sqlite/index.d.cts +6 -6
- package/dist/backend/sqlite/index.d.ts +6 -6
- package/dist/backend/sqlite/index.js +9 -9
- package/dist/backend/sqlite/libsql.cjs +14 -14
- 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 +10 -10
- package/dist/backend/sqlite/libsql.js.map +1 -1
- package/dist/backend/sqlite/local-store.cjs +25 -26
- 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 +21 -22
- package/dist/backend/sqlite/local-store.js.map +1 -1
- package/dist/backend/sqlite/local.cjs +13 -13
- package/dist/backend/sqlite/local.d.cts +3 -3
- package/dist/backend/sqlite/local.d.ts +3 -3
- package/dist/backend/sqlite/local.js +11 -11
- package/dist/{chunk-TVLKA4AY.js → chunk-42PYUGLS.js} +57 -3
- package/dist/chunk-42PYUGLS.js.map +1 -0
- package/dist/{chunk-IJTLXNGJ.js → chunk-4GUBTVPV.js} +3 -4
- package/dist/chunk-4GUBTVPV.js.map +1 -0
- package/dist/{chunk-63KCKSSH.js → chunk-4GUTQPVO.js} +33 -9
- package/dist/chunk-4GUTQPVO.js.map +1 -0
- package/dist/{chunk-FGO5JFVJ.cjs → chunk-4MEWSUVM.cjs} +10 -10
- package/dist/chunk-4MEWSUVM.cjs.map +1 -0
- package/dist/{chunk-FMGEZBAQ.js → chunk-4QIKLIGG.js} +15 -3
- package/dist/chunk-4QIKLIGG.js.map +1 -0
- package/dist/{chunk-FMMIX6N4.js → chunk-55ITBQJI.js} +2 -2
- package/dist/chunk-55ITBQJI.js.map +1 -0
- package/dist/{chunk-TCRIQMBU.js → chunk-5EKPX6QU.js} +4 -4
- package/dist/{chunk-TCRIQMBU.js.map → chunk-5EKPX6QU.js.map} +1 -1
- package/dist/{chunk-GFRGG2US.cjs → chunk-5GAONX5G.cjs} +7 -7
- package/dist/{chunk-GFRGG2US.cjs.map → chunk-5GAONX5G.cjs.map} +1 -1
- package/dist/{chunk-ALFUGRYB.cjs → chunk-6RYPD3NJ.cjs} +29 -29
- package/dist/{chunk-ALFUGRYB.cjs.map → chunk-6RYPD3NJ.cjs.map} +1 -1
- package/dist/{chunk-QGKILWGZ.cjs → chunk-7PF2L3H6.cjs} +4 -4
- package/dist/{chunk-QGKILWGZ.cjs.map → chunk-7PF2L3H6.cjs.map} +1 -1
- package/dist/chunk-B3F2D3SP.cjs +12 -0
- package/dist/{chunk-EPTSMFH7.cjs.map → chunk-B3F2D3SP.cjs.map} +1 -1
- package/dist/{chunk-7G32LIQM.js → chunk-BGYJW37L.js} +5 -5
- package/dist/{chunk-7G32LIQM.js.map → chunk-BGYJW37L.js.map} +1 -1
- package/dist/{chunk-EE7N5XXQ.cjs → chunk-BNS75YNF.cjs} +9 -10
- package/dist/chunk-BNS75YNF.cjs.map +1 -0
- package/dist/{chunk-VITTKBWF.js → chunk-CBKG6HEP.js} +5 -5
- package/dist/{chunk-VITTKBWF.js.map → chunk-CBKG6HEP.js.map} +1 -1
- package/dist/{chunk-A4PBRX4C.cjs → chunk-D54WH24V.cjs} +57 -2
- package/dist/chunk-D54WH24V.cjs.map +1 -0
- package/dist/{chunk-MCHP7RHZ.cjs → chunk-D56XG4EI.cjs} +26 -14
- package/dist/chunk-D56XG4EI.cjs.map +1 -0
- package/dist/{chunk-SQRD2CYF.js → chunk-DXEEHSGN.js} +293 -45
- package/dist/chunk-DXEEHSGN.js.map +1 -0
- package/dist/{chunk-GWEDD3DH.js → chunk-EFEOOCJ3.js} +4 -4
- package/dist/{chunk-GWEDD3DH.js.map → chunk-EFEOOCJ3.js.map} +1 -1
- package/dist/{chunk-3PRKZW6D.cjs → chunk-EKFUG4G7.cjs} +2 -2
- package/dist/chunk-EKFUG4G7.cjs.map +1 -0
- package/dist/{chunk-HJH3RMXG.cjs → chunk-F4NHQHEZ.cjs} +4 -4
- package/dist/{chunk-HJH3RMXG.cjs.map → chunk-F4NHQHEZ.cjs.map} +1 -1
- package/dist/{chunk-46GDII45.js → chunk-FL5UQRES.js} +3 -3
- package/dist/{chunk-46GDII45.js.map → chunk-FL5UQRES.js.map} +1 -1
- package/dist/{chunk-TFMVL4QH.js → chunk-FLEQ2HBK.js} +3 -3
- package/dist/{chunk-TFMVL4QH.js.map → chunk-FLEQ2HBK.js.map} +1 -1
- package/dist/{chunk-BEFM74L2.js → chunk-FQ7ZPOTZ.js} +6 -6
- package/dist/{chunk-BEFM74L2.js.map → chunk-FQ7ZPOTZ.js.map} +1 -1
- package/dist/{chunk-ST3LPB2V.cjs → chunk-H7VE3FL4.cjs} +318 -70
- package/dist/chunk-H7VE3FL4.cjs.map +1 -0
- package/dist/{chunk-BCP7LLOY.js → chunk-ID4WXTKL.js} +367 -41
- package/dist/{chunk-BCP7LLOY.js.map → chunk-ID4WXTKL.js.map} +1 -1
- package/dist/{chunk-EFELJVLA.js → chunk-ISLPNELU.js} +15 -3
- package/dist/chunk-ISLPNELU.js.map +1 -0
- package/dist/{chunk-A2I2XO52.cjs → chunk-IX64T5OL.cjs} +4 -4
- package/dist/{chunk-A2I2XO52.cjs.map → chunk-IX64T5OL.cjs.map} +1 -1
- package/dist/{chunk-QYWINYEA.cjs → chunk-J2ICGNHO.cjs} +5 -6
- package/dist/chunk-J2ICGNHO.cjs.map +1 -0
- package/dist/{chunk-7V2FGGI2.cjs → chunk-J7LXTUTP.cjs} +54 -12
- package/dist/chunk-J7LXTUTP.cjs.map +1 -0
- package/dist/{chunk-WBUFJ7BS.cjs → chunk-JQXSZHF2.cjs} +12 -2
- package/dist/chunk-JQXSZHF2.cjs.map +1 -0
- package/dist/{chunk-OVUUTCPJ.cjs → chunk-JXUTCSXX.cjs} +28 -2
- package/dist/chunk-JXUTCSXX.cjs.map +1 -0
- package/dist/{chunk-66UVLHQA.cjs → chunk-KMXWZLQX.cjs} +14 -14
- package/dist/{chunk-66UVLHQA.cjs.map → chunk-KMXWZLQX.cjs.map} +1 -1
- package/dist/{chunk-STQ3BSED.cjs → chunk-NAAMUYMS.cjs} +23 -11
- package/dist/chunk-NAAMUYMS.cjs.map +1 -0
- package/dist/{chunk-NN3QSOVS.cjs → chunk-OOA273IJ.cjs} +14 -14
- package/dist/{chunk-NN3QSOVS.cjs.map → chunk-OOA273IJ.cjs.map} +1 -1
- package/dist/{chunk-OSZPLZIV.cjs → chunk-P7GTYOLB.cjs} +130 -106
- package/dist/chunk-P7GTYOLB.cjs.map +1 -0
- package/dist/{chunk-K3BUWSFR.js → chunk-PVUI6KGR.js} +28 -2
- package/dist/chunk-PVUI6KGR.js.map +1 -0
- package/dist/{chunk-SBPC5IP3.js → chunk-Q6EDCUXV.js} +242 -10
- package/dist/chunk-Q6EDCUXV.js.map +1 -0
- package/dist/{chunk-2BIG7U6E.cjs → chunk-QC4MCOFV.cjs} +5 -5
- package/dist/{chunk-2BIG7U6E.cjs.map → chunk-QC4MCOFV.cjs.map} +1 -1
- package/dist/{chunk-JRP3VGHS.js → chunk-QLUXRWKL.js} +3 -3
- package/dist/{chunk-JRP3VGHS.js.map → chunk-QLUXRWKL.js.map} +1 -1
- package/dist/{chunk-IIT5K7SK.cjs → chunk-QR24DJDF.cjs} +6 -6
- package/dist/{chunk-IIT5K7SK.cjs.map → chunk-QR24DJDF.cjs.map} +1 -1
- package/dist/{chunk-HOIFFY4M.js → chunk-QRNYDV5Z.js} +48 -21
- package/dist/chunk-QRNYDV5Z.js.map +1 -0
- package/dist/{chunk-FRHHDHKH.js → chunk-RFRM3Q5K.js} +15 -3
- package/dist/chunk-RFRM3Q5K.js.map +1 -0
- package/dist/{chunk-ATLN63JA.js → chunk-RUQS6M7G.js} +5 -5
- package/dist/chunk-RUQS6M7G.js.map +1 -0
- package/dist/{chunk-XMYJY7NI.js → chunk-S3ZRKJHY.js} +3 -3
- package/dist/{chunk-XMYJY7NI.js.map → chunk-S3ZRKJHY.js.map} +1 -1
- package/dist/{chunk-FSXTPBRN.js → chunk-TKORQCG4.js} +49 -7
- package/dist/chunk-TKORQCG4.js.map +1 -0
- package/dist/{chunk-2Y4IFKW7.js → chunk-TKP5T34P.js} +3 -4
- package/dist/chunk-TKP5T34P.js.map +1 -0
- package/dist/{chunk-NCX65HBY.cjs → chunk-UCQ3BFSY.cjs} +301 -68
- package/dist/chunk-UCQ3BFSY.cjs.map +1 -0
- package/dist/{chunk-B75XRV3O.js → chunk-V34A6R5V.js} +12 -3
- package/dist/chunk-V34A6R5V.js.map +1 -0
- package/dist/{chunk-BNUFUFAU.js → chunk-VTN3C3CH.js} +6 -6
- package/dist/chunk-VTN3C3CH.js.map +1 -0
- package/dist/{chunk-5MUSU4ZP.cjs → chunk-VVQM4CZD.cjs} +12 -12
- package/dist/chunk-VVQM4CZD.cjs.map +1 -0
- package/dist/{chunk-IIMQJYAM.js → chunk-WDAVPX46.js} +3 -3
- package/dist/{chunk-IIMQJYAM.js.map → chunk-WDAVPX46.js.map} +1 -1
- package/dist/{chunk-YNULOIR5.cjs → chunk-WDBXJOU5.cjs} +28 -16
- package/dist/chunk-WDBXJOU5.cjs.map +1 -0
- package/dist/{chunk-PAW2XUZN.js → chunk-WUFASQUO.js} +3 -3
- package/dist/{chunk-PAW2XUZN.js.map → chunk-WUFASQUO.js.map} +1 -1
- package/dist/{chunk-PDGEXGS6.cjs → chunk-YDWLUT5V.cjs} +136 -109
- package/dist/chunk-YDWLUT5V.cjs.map +1 -0
- package/dist/{chunk-PHXITZE4.js → chunk-YMTXMPV6.js} +3 -3
- package/dist/{chunk-PHXITZE4.js.map → chunk-YMTXMPV6.js.map} +1 -1
- package/dist/{chunk-XR4YZFKW.cjs → chunk-YOALGKRE.cjs} +690 -364
- package/dist/chunk-YOALGKRE.cjs.map +1 -0
- package/dist/{chunk-6JZUSDY2.cjs → chunk-Z3WO6MND.cjs} +27 -27
- package/dist/{chunk-6JZUSDY2.cjs.map → chunk-Z3WO6MND.cjs.map} +1 -1
- package/dist/{chunk-2VLBGQBY.cjs → chunk-ZI6VQSZA.cjs} +37 -37
- package/dist/{chunk-2VLBGQBY.cjs.map → chunk-ZI6VQSZA.cjs.map} +1 -1
- package/dist/core/index.cjs +10 -11
- package/dist/core/index.d.cts +5 -5
- package/dist/core/index.d.ts +5 -5
- package/dist/core/index.js +3 -4
- package/dist/{ddl-eWg7hx6R.d.cts → ddl-BG4J805L.d.cts} +3 -3
- package/dist/{ddl-D5369kOY.d.ts → ddl-CgiS9QLj.d.ts} +3 -3
- package/dist/{define-graph-SvYXOl78.d.ts → define-graph-BGrJahvp.d.ts} +1 -1
- package/dist/{define-graph-DVF-oN1i.d.cts → define-graph-alREY2wj.d.cts} +1 -1
- package/dist/graph-extension/index.cjs +18 -19
- package/dist/graph-extension/index.d.cts +4 -4
- package/dist/graph-extension/index.d.ts +4 -4
- package/dist/graph-extension/index.js +3 -4
- package/dist/graph-merge/index.cjs +89 -90
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +9 -9
- package/dist/graph-merge/index.d.ts +9 -9
- package/dist/graph-merge/index.js +16 -17
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/{index-By89Sezh.d.ts → index-BBxZCUdu.d.ts} +2 -2
- package/dist/{index-DcQ3Sxs-.d.cts → index-C3y_98iN.d.cts} +2 -2
- package/dist/index.cjs +124 -125
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/index.js +23 -24
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.cjs +11 -11
- package/dist/indexes/index.d.cts +4 -4
- package/dist/indexes/index.d.ts +4 -4
- package/dist/indexes/index.js +4 -4
- package/dist/interchange/index.cjs +27 -26
- package/dist/interchange/index.cjs.map +1 -1
- package/dist/interchange/index.d.cts +7 -7
- package/dist/interchange/index.d.ts +7 -7
- package/dist/interchange/index.js +8 -7
- package/dist/interchange/index.js.map +1 -1
- package/dist/{manager-Cn0NFIhN.d.cts → manager-KS7CGQQT.d.cts} +3 -3
- package/dist/{manager-B0KjKE93.d.ts → manager-YoLEfcc1.d.ts} +3 -3
- package/dist/{materialize-indexes-BD4V3svD.d.ts → materialize-indexes-Bhhyb1B3.d.ts} +1 -1
- package/dist/{materialize-indexes-DVRhd5h4.d.cts → materialize-indexes-OHRWypW6.d.cts} +1 -1
- package/dist/{postgres-DaEWvN4x.d.cts → postgres-DpkW3R5Y.d.cts} +1 -1
- package/dist/{postgres-u0a0HN2D.d.ts → postgres-DwqyIniy.d.ts} +1 -1
- package/dist/profiler/index.d.cts +10 -10
- package/dist/profiler/index.d.ts +10 -10
- package/dist/provenance/index.cjs +15 -15
- 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 +3 -3
- package/dist/provenance/index.js.map +1 -1
- package/dist/schema/index.cjs +30 -31
- package/dist/schema/index.d.cts +7 -7
- package/dist/schema/index.d.ts +7 -7
- package/dist/schema/index.js +8 -9
- package/dist/{searchable-BT7j9_IK.d.cts → searchable-CIZL8Hyw.d.cts} +2 -2
- package/dist/{searchable-CnYEancP.d.ts → searchable-DLWEfC4a.d.ts} +2 -2
- package/dist/{sqlite-BrMoSsI7.d.cts → sqlite-DY0WODUK.d.cts} +1 -1
- package/dist/{sqlite-CHhZUyO5.d.ts → sqlite-L-VIRzqA.d.ts} +1 -1
- package/dist/{store-view-Bvdku0Ht.d.ts → store-view-66p92IPi.d.ts} +1887 -1811
- package/dist/{store-view-w-md0nQ4.d.cts → store-view-A85FFRnk.d.cts} +1887 -1811
- package/dist/{temporal-BCORwUau.d.cts → temporal-BNbjXqer.d.cts} +1 -1
- package/dist/{temporal--x9T8K4S.d.ts → temporal-Bob6Nfbp.d.ts} +1 -1
- package/dist/{types-Cjvkj0jA.d.ts → types-Ch9a0Dx6.d.cts} +141 -17
- package/dist/{types-Cjvkj0jA.d.cts → types-Ch9a0Dx6.d.ts} +141 -17
- package/dist/{types-COODtTJU.d.ts → types-ClCzT-dT.d.ts} +1 -1
- package/dist/{types-6-WJmSD4.d.cts → types-DeORZhxn.d.cts} +1 -1
- package/dist/{where-CUQmCR6d.d.cts → where-DPw52ksb.d.cts} +1 -1
- package/dist/{where-5xVawAwL.d.ts → where-kWUZPvEA.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-2WDD2NO3.js +0 -59
- package/dist/chunk-2WDD2NO3.js.map +0 -1
- package/dist/chunk-2Y4IFKW7.js.map +0 -1
- package/dist/chunk-3PRKZW6D.cjs.map +0 -1
- package/dist/chunk-5MUSU4ZP.cjs.map +0 -1
- package/dist/chunk-63KCKSSH.js.map +0 -1
- package/dist/chunk-7V2FGGI2.cjs.map +0 -1
- package/dist/chunk-A4PBRX4C.cjs.map +0 -1
- package/dist/chunk-ATLN63JA.js.map +0 -1
- package/dist/chunk-B75XRV3O.js.map +0 -1
- package/dist/chunk-BNUFUFAU.js.map +0 -1
- package/dist/chunk-EE7N5XXQ.cjs.map +0 -1
- package/dist/chunk-EFELJVLA.js.map +0 -1
- package/dist/chunk-EPTSMFH7.cjs +0 -12
- package/dist/chunk-FGO5JFVJ.cjs.map +0 -1
- package/dist/chunk-FMGEZBAQ.js.map +0 -1
- package/dist/chunk-FMMIX6N4.js.map +0 -1
- package/dist/chunk-FRHHDHKH.js.map +0 -1
- package/dist/chunk-FSXTPBRN.js.map +0 -1
- package/dist/chunk-HOHAJ2NR.cjs +0 -61
- package/dist/chunk-HOHAJ2NR.cjs.map +0 -1
- package/dist/chunk-HOIFFY4M.js.map +0 -1
- package/dist/chunk-IJTLXNGJ.js.map +0 -1
- package/dist/chunk-K3BUWSFR.js.map +0 -1
- package/dist/chunk-MCHP7RHZ.cjs.map +0 -1
- package/dist/chunk-NCX65HBY.cjs.map +0 -1
- package/dist/chunk-OSZPLZIV.cjs.map +0 -1
- package/dist/chunk-OVUUTCPJ.cjs.map +0 -1
- package/dist/chunk-PDGEXGS6.cjs.map +0 -1
- package/dist/chunk-QYWINYEA.cjs.map +0 -1
- package/dist/chunk-SBPC5IP3.js.map +0 -1
- package/dist/chunk-SQRD2CYF.js.map +0 -1
- package/dist/chunk-ST3LPB2V.cjs.map +0 -1
- package/dist/chunk-STQ3BSED.cjs.map +0 -1
- package/dist/chunk-TVLKA4AY.js.map +0 -1
- package/dist/chunk-WBUFJ7BS.cjs.map +0 -1
- package/dist/chunk-XR4YZFKW.cjs.map +0 -1
- package/dist/chunk-YNULOIR5.cjs.map +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
3
|
+
var chunkH7VE3FL4_cjs = require('./chunk-H7VE3FL4.cjs');
|
|
4
|
+
var chunkD56XG4EI_cjs = require('./chunk-D56XG4EI.cjs');
|
|
5
|
+
var chunkF4NHQHEZ_cjs = require('./chunk-F4NHQHEZ.cjs');
|
|
6
|
+
var chunkZ3WO6MND_cjs = require('./chunk-Z3WO6MND.cjs');
|
|
7
|
+
var chunkOOA273IJ_cjs = require('./chunk-OOA273IJ.cjs');
|
|
8
8
|
var chunkZDH3DX3C_cjs = require('./chunk-ZDH3DX3C.cjs');
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
9
|
+
var chunkEKFUG4G7_cjs = require('./chunk-EKFUG4G7.cjs');
|
|
10
|
+
var chunkJQXSZHF2_cjs = require('./chunk-JQXSZHF2.cjs');
|
|
11
|
+
var chunkJXUTCSXX_cjs = require('./chunk-JXUTCSXX.cjs');
|
|
12
12
|
var chunkU5W4LKZV_cjs = require('./chunk-U5W4LKZV.cjs');
|
|
13
13
|
var chunk764JHTLT_cjs = require('./chunk-764JHTLT.cjs');
|
|
14
14
|
var chunkC4F7VJ5D_cjs = require('./chunk-C4F7VJ5D.cjs');
|
|
@@ -50,7 +50,7 @@ var DEFAULT_POSTGRES_STATEMENT_CACHE_MAX = 256;
|
|
|
50
50
|
var STATEMENT_NAME_CACHE = /* @__PURE__ */ new Map();
|
|
51
51
|
var nextStatementId = 0;
|
|
52
52
|
function statementNameFor(sqlText, cacheMax) {
|
|
53
|
-
return
|
|
53
|
+
return chunkH7VE3FL4_cjs.getOrCreateLru(STATEMENT_NAME_CACHE, sqlText, cacheMax, () => {
|
|
54
54
|
const name = `tg_${nextStatementId}`;
|
|
55
55
|
nextStatementId += 1;
|
|
56
56
|
return name;
|
|
@@ -164,7 +164,7 @@ function createPostgresExecutionAdapter(db, options = {}) {
|
|
|
164
164
|
options.useTransactionClient ?? false
|
|
165
165
|
);
|
|
166
166
|
function compile(query) {
|
|
167
|
-
return
|
|
167
|
+
return chunkOOA273IJ_cjs.compileQueryWithDialect(db, query, "PostgreSQL");
|
|
168
168
|
}
|
|
169
169
|
function assertCompiledWithinBindParameterLimit(compiledQuery) {
|
|
170
170
|
assertWithinBindParameterLimit(
|
|
@@ -179,7 +179,7 @@ function createPostgresExecutionAdapter(db, options = {}) {
|
|
|
179
179
|
assertCompiledWithinBindParameterLimit(compile(query));
|
|
180
180
|
return executeDrizzleQuery(
|
|
181
181
|
db,
|
|
182
|
-
chunkU5W4LKZV_cjs.isSqlFragment(query) ?
|
|
182
|
+
chunkU5W4LKZV_cjs.isSqlFragment(query) ? chunkOOA273IJ_cjs.toDrizzleSql(query, "postgres") : query
|
|
183
183
|
);
|
|
184
184
|
}
|
|
185
185
|
};
|
|
@@ -293,6 +293,7 @@ var GET_EDGES_FIXED_PARAM_COUNT = 1;
|
|
|
293
293
|
var FULLTEXT_UPSERT_PARAM_COUNT = 6;
|
|
294
294
|
var FULLTEXT_DELETE_FIXED_PARAM_COUNT = 2;
|
|
295
295
|
var CHECK_UNIQUE_BATCH_FIXED_PARAM_COUNT = 3;
|
|
296
|
+
var UNIQUE_DELETE_FIXED_PARAM_COUNT = 2;
|
|
296
297
|
var UNIQUE_INSERT_PARAM_COUNT = 6;
|
|
297
298
|
function computePostgresBatchChunkSizes(maxBindParameters) {
|
|
298
299
|
return {
|
|
@@ -306,11 +307,11 @@ function computePostgresBatchChunkSizes(maxBindParameters) {
|
|
|
306
307
|
),
|
|
307
308
|
embeddingUpsertBatchSize: Math.max(
|
|
308
309
|
1,
|
|
309
|
-
Math.floor(maxBindParameters /
|
|
310
|
+
Math.floor(maxBindParameters / chunkH7VE3FL4_cjs.EMBEDDING_UPSERT_PARAM_COUNT)
|
|
310
311
|
),
|
|
311
312
|
findEdgesEndpointChunkSize: Math.max(
|
|
312
313
|
1,
|
|
313
|
-
maxBindParameters -
|
|
314
|
+
maxBindParameters - chunkH7VE3FL4_cjs.FIND_EDGES_ENDPOINT_FIXED_PARAM_COUNT
|
|
314
315
|
),
|
|
315
316
|
fulltextDeleteChunkSize: Math.max(
|
|
316
317
|
1,
|
|
@@ -332,29 +333,33 @@ function computePostgresBatchChunkSizes(maxBindParameters) {
|
|
|
332
333
|
1,
|
|
333
334
|
Math.floor(maxBindParameters / NODE_INSERT_PARAM_COUNT)
|
|
334
335
|
),
|
|
336
|
+
uniqueDeleteChunkSize: Math.max(
|
|
337
|
+
1,
|
|
338
|
+
maxBindParameters - UNIQUE_DELETE_FIXED_PARAM_COUNT
|
|
339
|
+
),
|
|
335
340
|
uniqueInsertBatchSize: Math.max(
|
|
336
341
|
1,
|
|
337
342
|
Math.floor(maxBindParameters / UNIQUE_INSERT_PARAM_COUNT)
|
|
338
343
|
)
|
|
339
344
|
};
|
|
340
345
|
}
|
|
341
|
-
var toNodeRow =
|
|
342
|
-
var toEdgeRow =
|
|
343
|
-
var toUniqueRow =
|
|
344
|
-
var toSchemaVersionRow =
|
|
345
|
-
|
|
346
|
+
var toNodeRow = chunkF4NHQHEZ_cjs.createNodeRowMapper(chunkF4NHQHEZ_cjs.POSTGRES_ROW_MAPPER_CONFIG);
|
|
347
|
+
var toEdgeRow = chunkF4NHQHEZ_cjs.createEdgeRowMapper(chunkF4NHQHEZ_cjs.POSTGRES_ROW_MAPPER_CONFIG);
|
|
348
|
+
var toUniqueRow = chunkF4NHQHEZ_cjs.createUniqueRowMapper(chunkF4NHQHEZ_cjs.POSTGRES_ROW_MAPPER_CONFIG);
|
|
349
|
+
var toSchemaVersionRow = chunkF4NHQHEZ_cjs.createSchemaVersionRowMapper(
|
|
350
|
+
chunkF4NHQHEZ_cjs.POSTGRES_ROW_MAPPER_CONFIG
|
|
346
351
|
);
|
|
347
352
|
function buildPostgresCapabilities(fulltextStrategy, vectorStrategy) {
|
|
348
353
|
return {
|
|
349
|
-
...
|
|
350
|
-
...vectorStrategy === void 0 ? {} : { vector:
|
|
351
|
-
fulltext:
|
|
354
|
+
...chunkEKFUG4G7_cjs.POSTGRES_CAPABILITIES,
|
|
355
|
+
...vectorStrategy === void 0 ? {} : { vector: chunkJXUTCSXX_cjs.buildVectorCapabilities(vectorStrategy) },
|
|
356
|
+
fulltext: chunkJXUTCSXX_cjs.buildFulltextCapabilities(fulltextStrategy)
|
|
352
357
|
};
|
|
353
358
|
}
|
|
354
359
|
function createPostgresBackend(db, options = {}) {
|
|
355
|
-
const tables2 = options.tables ??
|
|
356
|
-
const fulltextStrategy = options.fulltext ??
|
|
357
|
-
const vectorStrategy = options.vector === false ? void 0 : options.vector ??
|
|
360
|
+
const tables2 = options.tables ?? chunkZ3WO6MND_cjs.tables;
|
|
361
|
+
const fulltextStrategy = options.fulltext ?? chunkJXUTCSXX_cjs.tsvectorStrategy;
|
|
362
|
+
const vectorStrategy = options.vector === false ? void 0 : options.vector ?? chunkD56XG4EI_cjs.pgvectorStrategy;
|
|
358
363
|
const iterativeScanProbe = createIterativeScanProbe();
|
|
359
364
|
const baseCapabilities = buildPostgresCapabilities(
|
|
360
365
|
fulltextStrategy,
|
|
@@ -367,14 +372,14 @@ function createPostgresBackend(db, options = {}) {
|
|
|
367
372
|
supported: false
|
|
368
373
|
}
|
|
369
374
|
} : {};
|
|
370
|
-
const configuredMaxBindParameters = options.capabilities?.maxBindParameters ??
|
|
375
|
+
const configuredMaxBindParameters = options.capabilities?.maxBindParameters ?? chunkEKFUG4G7_cjs.POSTGRES_MAX_BIND_PARAMETERS;
|
|
371
376
|
const driverBindParameterOverrides = isPgliteDatabase(db) ? {
|
|
372
377
|
maxBindParameters: Math.min(
|
|
373
378
|
configuredMaxBindParameters,
|
|
374
379
|
PGLITE_MAX_BIND_PARAMETERS
|
|
375
380
|
)
|
|
376
381
|
} : {};
|
|
377
|
-
const capabilities =
|
|
382
|
+
const capabilities = chunkEKFUG4G7_cjs.normalizeGraphAnalyticsCapabilities({
|
|
378
383
|
...baseCapabilities,
|
|
379
384
|
...httpOnlyOverrides,
|
|
380
385
|
...options.capabilities,
|
|
@@ -383,7 +388,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
383
388
|
const adapterOptions = {
|
|
384
389
|
...options.prepareStatements === void 0 ? {} : { prepareStatements: options.prepareStatements },
|
|
385
390
|
...options.preparedStatementCacheMax === void 0 ? {} : { preparedStatementCacheMax: options.preparedStatementCacheMax },
|
|
386
|
-
maxBindParameters: capabilities.maxBindParameters ??
|
|
391
|
+
maxBindParameters: capabilities.maxBindParameters ?? chunkEKFUG4G7_cjs.POSTGRES_MAX_BIND_PARAMETERS
|
|
387
392
|
};
|
|
388
393
|
const executionAdapter = createPostgresExecutionAdapter(db, adapterOptions);
|
|
389
394
|
const tableNames = {
|
|
@@ -402,7 +407,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
402
407
|
drizzleOrm.getTableName(tables2.uniques),
|
|
403
408
|
tableNames.fulltext
|
|
404
409
|
].map(
|
|
405
|
-
(name) =>
|
|
410
|
+
(name) => chunkOOA273IJ_cjs.toDrizzleSql(
|
|
406
411
|
chunkU5W4LKZV_cjs.sql`ANALYZE (SKIP_LOCKED) ${chunkU5W4LKZV_cjs.sql.identifier(name)}`,
|
|
407
412
|
"postgres"
|
|
408
413
|
)
|
|
@@ -412,11 +417,11 @@ function createPostgresBackend(db, options = {}) {
|
|
|
412
417
|
tableNames.recordedEdges,
|
|
413
418
|
tableNames.recordedClock
|
|
414
419
|
];
|
|
415
|
-
const operationStrategy =
|
|
420
|
+
const operationStrategy = chunkH7VE3FL4_cjs.createPostgresOperationStrategy(
|
|
416
421
|
tables2,
|
|
417
422
|
fulltextStrategy
|
|
418
423
|
);
|
|
419
|
-
const recordedTableExists =
|
|
424
|
+
const recordedTableExists = chunkH7VE3FL4_cjs.createCachedTableExistence(
|
|
420
425
|
async (tableName) => {
|
|
421
426
|
const rows = await executionAdapter.execute(
|
|
422
427
|
operationStrategy.buildTableExists(tableName)
|
|
@@ -426,8 +431,17 @@ function createPostgresBackend(db, options = {}) {
|
|
|
426
431
|
{ cacheExisting: false }
|
|
427
432
|
);
|
|
428
433
|
const matTable = tables2.contributionMaterializations;
|
|
434
|
+
async function ensureTableWithConcurrentCreateRetry(table) {
|
|
435
|
+
const statement = drizzleOrm.sql.raw(chunkZ3WO6MND_cjs.generatePgCreateTableSQL(table));
|
|
436
|
+
try {
|
|
437
|
+
await db.execute(statement);
|
|
438
|
+
} catch (error) {
|
|
439
|
+
if (!chunkJQXSZHF2_cjs.isPostgresUniqueViolationError(error)) throw error;
|
|
440
|
+
await db.execute(statement);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
429
443
|
async function ensureContributionMaterializationsTableImpl() {
|
|
430
|
-
await
|
|
444
|
+
await ensureTableWithConcurrentCreateRetry(matTable);
|
|
431
445
|
}
|
|
432
446
|
async function getContributionMaterializationRow(identity) {
|
|
433
447
|
const rows = await db.select().from(matTable).where(
|
|
@@ -440,25 +454,25 @@ function createPostgresBackend(db, options = {}) {
|
|
|
440
454
|
);
|
|
441
455
|
const row = rows[0];
|
|
442
456
|
if (row === void 0) return void 0;
|
|
443
|
-
return
|
|
457
|
+
return chunkH7VE3FL4_cjs.mapContributionMaterializationRow(
|
|
444
458
|
row,
|
|
445
|
-
|
|
459
|
+
chunkH7VE3FL4_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.decode
|
|
446
460
|
);
|
|
447
461
|
}
|
|
448
462
|
async function getContributionMaterializationRows(graphId) {
|
|
449
463
|
const rows = await db.select().from(matTable).where(drizzleOrm.eq(matTable.graphId, graphId));
|
|
450
464
|
return rows.map(
|
|
451
|
-
(row) =>
|
|
465
|
+
(row) => chunkH7VE3FL4_cjs.mapContributionMaterializationRow(
|
|
452
466
|
row,
|
|
453
|
-
|
|
467
|
+
chunkH7VE3FL4_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.decode
|
|
454
468
|
)
|
|
455
469
|
);
|
|
456
470
|
}
|
|
457
471
|
async function recordContributionMaterializationRow(params) {
|
|
458
472
|
await db.insert(matTable).values(
|
|
459
|
-
|
|
473
|
+
chunkH7VE3FL4_cjs.buildContributionInsertValues(
|
|
460
474
|
params,
|
|
461
|
-
|
|
475
|
+
chunkH7VE3FL4_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.encode
|
|
462
476
|
)
|
|
463
477
|
).onConflictDoUpdate({
|
|
464
478
|
target: [
|
|
@@ -467,7 +481,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
467
481
|
matTable.owner,
|
|
468
482
|
matTable.tableName
|
|
469
483
|
],
|
|
470
|
-
set:
|
|
484
|
+
set: chunkH7VE3FL4_cjs.buildContributionOnConflictSet(
|
|
471
485
|
matTable.materializedAt,
|
|
472
486
|
params.materializedAt
|
|
473
487
|
)
|
|
@@ -487,9 +501,9 @@ function createPostgresBackend(db, options = {}) {
|
|
|
487
501
|
const rows = await executionAdapter.execute(
|
|
488
502
|
operationStrategy.buildTableExists(tableName)
|
|
489
503
|
);
|
|
490
|
-
return
|
|
504
|
+
return chunkH7VE3FL4_cjs.tableExistsFromRow(rows[0]);
|
|
491
505
|
}
|
|
492
|
-
const contributionMaterializer =
|
|
506
|
+
const contributionMaterializer = chunkH7VE3FL4_cjs.createContributionMaterializer({
|
|
493
507
|
dialect: "postgres",
|
|
494
508
|
fulltextStrategy,
|
|
495
509
|
fulltextTableName: tables2.fulltextTableName,
|
|
@@ -570,7 +584,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
570
584
|
schemaVersionsTable: tables2.schemaVersions
|
|
571
585
|
});
|
|
572
586
|
return {
|
|
573
|
-
backend:
|
|
587
|
+
backend: chunkH7VE3FL4_cjs.gateFulltext(
|
|
574
588
|
backend2,
|
|
575
589
|
contributionMaterializer.assertInitialized
|
|
576
590
|
),
|
|
@@ -598,43 +612,41 @@ function createPostgresBackend(db, options = {}) {
|
|
|
598
612
|
{ capability: "trustedImport", dialect: "postgres" }
|
|
599
613
|
);
|
|
600
614
|
}
|
|
601
|
-
const trustedTx =
|
|
615
|
+
const trustedTx = chunkEKFUG4G7_cjs.createBackendOverlay(tx, {
|
|
602
616
|
executeRaw(sqlText, params) {
|
|
603
617
|
return executeCompiled({ params, sql: sqlText });
|
|
604
618
|
}
|
|
605
619
|
});
|
|
606
|
-
await
|
|
607
|
-
await
|
|
608
|
-
const indexDefinitions = await
|
|
620
|
+
await chunkH7VE3FL4_cjs.lockPostgresTrustedImportTables(trustedTx, tableNames);
|
|
621
|
+
await chunkH7VE3FL4_cjs.assertTrustedImportDatabaseEmpty(trustedTx, tableNames);
|
|
622
|
+
const indexDefinitions = await chunkH7VE3FL4_cjs.suspendPostgresSecondaryIndexes(
|
|
609
623
|
trustedTx,
|
|
610
624
|
tableNames
|
|
611
625
|
);
|
|
612
626
|
const result = await fn(
|
|
613
|
-
|
|
627
|
+
chunkH7VE3FL4_cjs.createPostgresTrustedImportSession(trustedTx, tableNames)
|
|
614
628
|
);
|
|
615
|
-
await
|
|
616
|
-
await
|
|
629
|
+
await chunkH7VE3FL4_cjs.restoreSecondaryIndexes(trustedTx, indexDefinitions);
|
|
630
|
+
await chunkH7VE3FL4_cjs.analyzeImportedTables(trustedTx, tableNames);
|
|
617
631
|
return result;
|
|
618
632
|
});
|
|
619
633
|
}
|
|
620
634
|
} : {},
|
|
621
635
|
async bootstrapTables() {
|
|
622
|
-
const statements =
|
|
636
|
+
const statements = chunkZ3WO6MND_cjs.generatePostgresDDL(tables2, fulltextStrategy);
|
|
623
637
|
for (const statement of statements) {
|
|
624
638
|
await db.execute(drizzleOrm.sql.raw(statement));
|
|
625
639
|
}
|
|
626
640
|
},
|
|
627
641
|
async ensureRevisionOriginsTable() {
|
|
628
|
-
await
|
|
629
|
-
drizzleOrm.sql.raw(chunk6JZUSDY2_cjs.generatePgCreateTableSQL(tables2.revisionOrigins))
|
|
630
|
-
);
|
|
642
|
+
await ensureTableWithConcurrentCreateRetry(tables2.revisionOrigins);
|
|
631
643
|
},
|
|
632
644
|
// Every fulltext-touching method asserts the durable marker instead
|
|
633
645
|
// of lazily emitting DDL. Steady state performs zero ensure; an
|
|
634
646
|
// uninitialized database throws `StoreNotInitializedError` loudly
|
|
635
647
|
// rather than self-healing on a read/write path (#135). Shared
|
|
636
648
|
// verbatim with the tx-scoped gate via `gateFulltextMethods`.
|
|
637
|
-
...
|
|
649
|
+
...chunkH7VE3FL4_cjs.gateFulltextMethods(
|
|
638
650
|
operations,
|
|
639
651
|
contributionMaterializer.assertInitialized
|
|
640
652
|
),
|
|
@@ -642,9 +654,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
642
654
|
await db.execute(drizzleOrm.sql.raw(ddl));
|
|
643
655
|
},
|
|
644
656
|
async ensureIndexMaterializationsTable() {
|
|
645
|
-
await
|
|
646
|
-
drizzleOrm.sql.raw(chunk6JZUSDY2_cjs.generatePgCreateTableSQL(tables2.indexMaterializations))
|
|
647
|
-
);
|
|
657
|
+
await ensureTableWithConcurrentCreateRetry(tables2.indexMaterializations);
|
|
648
658
|
const tableName = drizzleOrm.getTableName(tables2.indexMaterializations);
|
|
649
659
|
await db.execute(
|
|
650
660
|
drizzleOrm.sql.raw(
|
|
@@ -695,26 +705,26 @@ function createPostgresBackend(db, options = {}) {
|
|
|
695
705
|
const rows = await db.select().from(t).where(drizzleOrm.eq(t.indexName, indexName));
|
|
696
706
|
const row = rows[0];
|
|
697
707
|
if (row === void 0) return void 0;
|
|
698
|
-
return
|
|
708
|
+
return chunkH7VE3FL4_cjs.mapMaterializationRow(row, chunkH7VE3FL4_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.decode);
|
|
699
709
|
},
|
|
700
710
|
async getIndexMaterializations(statusKeys) {
|
|
701
711
|
if (statusKeys.length === 0) return [];
|
|
702
712
|
const t = tables2.indexMaterializations;
|
|
703
713
|
const rows = await db.select().from(t).where(drizzleOrm.inArray(t.indexName, [...statusKeys]));
|
|
704
714
|
return rows.map(
|
|
705
|
-
(row) =>
|
|
715
|
+
(row) => chunkH7VE3FL4_cjs.mapMaterializationRow(row, chunkH7VE3FL4_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.decode)
|
|
706
716
|
);
|
|
707
717
|
},
|
|
708
718
|
async recordIndexMaterialization(params) {
|
|
709
719
|
const t = tables2.indexMaterializations;
|
|
710
720
|
await db.insert(t).values(
|
|
711
|
-
|
|
721
|
+
chunkH7VE3FL4_cjs.buildMaterializationInsertValues(
|
|
712
722
|
params,
|
|
713
|
-
|
|
723
|
+
chunkH7VE3FL4_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.encode
|
|
714
724
|
)
|
|
715
725
|
).onConflictDoUpdate({
|
|
716
726
|
target: t.indexName,
|
|
717
|
-
set:
|
|
727
|
+
set: chunkH7VE3FL4_cjs.buildMaterializationOnConflictSet(params.materializedAt)
|
|
718
728
|
});
|
|
719
729
|
},
|
|
720
730
|
async ensureContributionMaterializationsTable() {
|
|
@@ -730,38 +740,36 @@ function createPostgresBackend(db, options = {}) {
|
|
|
730
740
|
await contributionMaterializer.assertInitialized(graphId);
|
|
731
741
|
},
|
|
732
742
|
async ensureKindRemovalsTable() {
|
|
733
|
-
await
|
|
743
|
+
await ensureTableWithConcurrentCreateRetry(tables2.kindRemovals);
|
|
734
744
|
},
|
|
735
745
|
async getPendingKindRemovals(graphId) {
|
|
736
746
|
const t = tables2.kindRemovals;
|
|
737
747
|
const rows = await db.select().from(t).where(drizzleOrm.and(drizzleOrm.eq(t.graphId, graphId), drizzleOrm.isNull(t.removedAt)));
|
|
738
748
|
return rows.map(
|
|
739
|
-
(row) =>
|
|
749
|
+
(row) => chunkH7VE3FL4_cjs.mapKindRemovalRow(row, chunkH7VE3FL4_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.decode)
|
|
740
750
|
);
|
|
741
751
|
},
|
|
742
752
|
async getAllKindRemovals(graphId) {
|
|
743
753
|
const t = tables2.kindRemovals;
|
|
744
754
|
const rows = await db.select().from(t).where(drizzleOrm.eq(t.graphId, graphId));
|
|
745
755
|
return rows.map(
|
|
746
|
-
(row) =>
|
|
756
|
+
(row) => chunkH7VE3FL4_cjs.mapKindRemovalRow(row, chunkH7VE3FL4_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.decode)
|
|
747
757
|
);
|
|
748
758
|
},
|
|
749
759
|
async recordKindRemoval(params) {
|
|
750
760
|
const t = tables2.kindRemovals;
|
|
751
761
|
await db.insert(t).values(
|
|
752
|
-
|
|
762
|
+
chunkH7VE3FL4_cjs.buildKindRemovalInsertValues(
|
|
753
763
|
params,
|
|
754
|
-
|
|
764
|
+
chunkH7VE3FL4_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.encode
|
|
755
765
|
)
|
|
756
766
|
).onConflictDoUpdate({
|
|
757
767
|
target: [t.graphId, t.kindName, t.entity, t.schemaVersion],
|
|
758
|
-
set:
|
|
768
|
+
set: chunkH7VE3FL4_cjs.buildKindRemovalOnConflictSet(t.removedAt, params.removedAt)
|
|
759
769
|
});
|
|
760
770
|
},
|
|
761
771
|
async ensureReconciliationMarkersTable() {
|
|
762
|
-
await
|
|
763
|
-
drizzleOrm.sql.raw(chunk6JZUSDY2_cjs.generatePgCreateTableSQL(tables2.reconciliationMarkers))
|
|
764
|
-
);
|
|
772
|
+
await ensureTableWithConcurrentCreateRetry(tables2.reconciliationMarkers);
|
|
765
773
|
},
|
|
766
774
|
async ensureRuntimeContributions(graphId) {
|
|
767
775
|
await contributionMaterializer.ensureRuntimeContributions(graphId);
|
|
@@ -777,6 +785,9 @@ function createPostgresBackend(db, options = {}) {
|
|
|
777
785
|
async verifyContributions(graphId, vectorSlots) {
|
|
778
786
|
return contributionMaterializer.verifyContributions(graphId, vectorSlots);
|
|
779
787
|
},
|
|
788
|
+
async repairContributions(graphId, vectorSlots) {
|
|
789
|
+
return contributionMaterializer.repairContributions(graphId, vectorSlots);
|
|
790
|
+
},
|
|
780
791
|
// Vector counterparts of the runtime-contribution methods. Present
|
|
781
792
|
// only when a vector strategy is wired (omitted under `vector: false`,
|
|
782
793
|
// mirroring the embedding/search methods), so a no-vector backend
|
|
@@ -823,7 +834,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
823
834
|
const presentRecordedTables = tablePresence.filter((entry) => entry.exists).map((entry) => entry.tableName);
|
|
824
835
|
for (const tableName of presentRecordedTables) {
|
|
825
836
|
await db.execute(
|
|
826
|
-
|
|
837
|
+
chunkOOA273IJ_cjs.toDrizzleSql(
|
|
827
838
|
chunkU5W4LKZV_cjs.sql`ANALYZE (SKIP_LOCKED) ${chunkU5W4LKZV_cjs.sql.identifier(tableName)}`,
|
|
828
839
|
"postgres"
|
|
829
840
|
)
|
|
@@ -839,7 +850,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
839
850
|
async commitSchemaVersionIfKindsEmpty(params, probes) {
|
|
840
851
|
return runSchemaWriteTransaction(
|
|
841
852
|
params.graphId,
|
|
842
|
-
(target) =>
|
|
853
|
+
(target) => chunkH7VE3FL4_cjs.commitSchemaVersionIfKindsEmpty(target, params, probes)
|
|
843
854
|
);
|
|
844
855
|
},
|
|
845
856
|
async setActiveVersion(params) {
|
|
@@ -855,7 +866,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
855
866
|
return backend.transactionWithNative((tx) => fn(tx), options2);
|
|
856
867
|
},
|
|
857
868
|
async transactionWithNative(fn, options2) {
|
|
858
|
-
const temporaryWrites = options2?.temporaryWrites ===
|
|
869
|
+
const temporaryWrites = options2?.temporaryWrites === chunkEKFUG4G7_cjs.INTERNAL_TEMPORARY_WRITES;
|
|
859
870
|
if (temporaryWrites && options2.accessMode !== "read_only") {
|
|
860
871
|
throw new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
861
872
|
"Temporary-write transactions must be semantically read-only.",
|
|
@@ -890,7 +901,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
890
901
|
}
|
|
891
902
|
);
|
|
892
903
|
}
|
|
893
|
-
|
|
904
|
+
chunkH7VE3FL4_cjs.assertAdoptedDialect(
|
|
894
905
|
externalTx,
|
|
895
906
|
pgCore.PgTransaction,
|
|
896
907
|
"postgres"
|
|
@@ -1044,16 +1055,17 @@ function createPostgresOperationBackend(options) {
|
|
|
1044
1055
|
});
|
|
1045
1056
|
}
|
|
1046
1057
|
const batchConfig = computePostgresBatchChunkSizes(
|
|
1047
|
-
capabilities.maxBindParameters ??
|
|
1058
|
+
capabilities.maxBindParameters ?? chunkEKFUG4G7_cjs.POSTGRES_MAX_BIND_PARAMETERS
|
|
1048
1059
|
);
|
|
1049
|
-
const commonBackend =
|
|
1060
|
+
const commonBackend = chunkH7VE3FL4_cjs.createCommonOperationBackend({
|
|
1050
1061
|
batchConfig,
|
|
1051
1062
|
execution: {
|
|
1052
1063
|
execAll,
|
|
1053
1064
|
execGet,
|
|
1054
1065
|
execRun
|
|
1055
1066
|
},
|
|
1056
|
-
nowIso:
|
|
1067
|
+
nowIso: chunkF4NHQHEZ_cjs.nowIso,
|
|
1068
|
+
maxBindParameters: capabilities.maxBindParameters ?? chunkEKFUG4G7_cjs.POSTGRES_MAX_BIND_PARAMETERS,
|
|
1057
1069
|
operationStrategy,
|
|
1058
1070
|
rowMappers: {
|
|
1059
1071
|
toEdgeRow,
|
|
@@ -1071,26 +1083,26 @@ function createPostgresOperationBackend(options) {
|
|
|
1071
1083
|
};
|
|
1072
1084
|
const vectorEmbeddingMethods = vectorStrategy === void 0 ? {} : {
|
|
1073
1085
|
async upsertEmbedding(params) {
|
|
1074
|
-
const slot =
|
|
1086
|
+
const slot = chunkH7VE3FL4_cjs.vectorSlotFromParams(params);
|
|
1075
1087
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1076
|
-
const statements = vectorStrategy.buildUpsert(slot, params,
|
|
1088
|
+
const statements = vectorStrategy.buildUpsert(slot, params, chunkF4NHQHEZ_cjs.nowIso());
|
|
1077
1089
|
try {
|
|
1078
1090
|
for (const statement of statements) {
|
|
1079
1091
|
await execRun(statement);
|
|
1080
1092
|
}
|
|
1081
1093
|
} catch (error) {
|
|
1082
|
-
throw
|
|
1094
|
+
throw chunkH7VE3FL4_cjs.mapVectorWriteError(error, params);
|
|
1083
1095
|
}
|
|
1084
1096
|
},
|
|
1085
1097
|
async upsertEmbeddingBatch(params) {
|
|
1086
1098
|
if (params.rows.length === 0) return;
|
|
1087
|
-
const slot =
|
|
1099
|
+
const slot = chunkH7VE3FL4_cjs.vectorSlotFromParams(params);
|
|
1088
1100
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1089
1101
|
const rowsById = new Map(
|
|
1090
1102
|
params.rows.map((row) => [row.nodeId, row])
|
|
1091
1103
|
);
|
|
1092
1104
|
const rows = [...rowsById.values()];
|
|
1093
|
-
const timestamp =
|
|
1105
|
+
const timestamp = chunkF4NHQHEZ_cjs.nowIso();
|
|
1094
1106
|
try {
|
|
1095
1107
|
for (const chunk2 of chunkZDH3DX3C_cjs.chunk(
|
|
1096
1108
|
rows,
|
|
@@ -1121,31 +1133,46 @@ function createPostgresOperationBackend(options) {
|
|
|
1121
1133
|
}
|
|
1122
1134
|
}
|
|
1123
1135
|
} catch (error) {
|
|
1124
|
-
throw
|
|
1136
|
+
throw chunkH7VE3FL4_cjs.mapVectorWriteError(error, params);
|
|
1125
1137
|
}
|
|
1126
1138
|
},
|
|
1127
1139
|
async deleteEmbedding(params) {
|
|
1128
|
-
const slot =
|
|
1140
|
+
const slot = chunkH7VE3FL4_cjs.vectorSlotFromParams(params);
|
|
1129
1141
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1130
1142
|
const statements = vectorStrategy.buildDelete(slot, params);
|
|
1131
1143
|
for (const statement of statements) {
|
|
1132
1144
|
await execRun(statement);
|
|
1133
1145
|
}
|
|
1134
1146
|
},
|
|
1147
|
+
async deleteEmbeddingBatch(params) {
|
|
1148
|
+
if (params.nodeIds.length === 0) return;
|
|
1149
|
+
const slot = chunkH7VE3FL4_cjs.vectorSlotFromParams(params);
|
|
1150
|
+
await contributionMaterializer.assertVectorSlot(slot);
|
|
1151
|
+
for (const nodeIds of chunkZDH3DX3C_cjs.chunk(
|
|
1152
|
+
[...new Set(params.nodeIds)],
|
|
1153
|
+
batchConfig.embeddingUpsertBatchSize
|
|
1154
|
+
)) {
|
|
1155
|
+
const statements = vectorStrategy.buildDeleteBatch(slot, {
|
|
1156
|
+
...params,
|
|
1157
|
+
nodeIds
|
|
1158
|
+
});
|
|
1159
|
+
for (const statement of statements) await execRun(statement);
|
|
1160
|
+
}
|
|
1161
|
+
},
|
|
1135
1162
|
async vectorSearch(params) {
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
const slot =
|
|
1163
|
+
chunkJXUTCSXX_cjs.assertVectorSearchLimit(params.limit);
|
|
1164
|
+
chunkD56XG4EI_cjs.assertPgvectorEfSearch(params.efSearch);
|
|
1165
|
+
const slot = chunkH7VE3FL4_cjs.vectorSlotFromParams(params);
|
|
1139
1166
|
const query = vectorStrategy.buildSearch(
|
|
1140
1167
|
slot,
|
|
1141
1168
|
params,
|
|
1142
1169
|
// Store-compiled candidates (predicates + subclass + currency)
|
|
1143
1170
|
// take precedence; the live-node default covers direct backend use.
|
|
1144
|
-
params.candidates ??
|
|
1171
|
+
params.candidates ?? chunkH7VE3FL4_cjs.buildLiveNodeCandidates(
|
|
1145
1172
|
tableNames.nodes,
|
|
1146
1173
|
params.graphId,
|
|
1147
1174
|
params.nodeKind,
|
|
1148
|
-
|
|
1175
|
+
chunkF4NHQHEZ_cjs.nowIso()
|
|
1149
1176
|
)
|
|
1150
1177
|
);
|
|
1151
1178
|
const gucOverrides = await vectorSearchGucOverrides(params);
|
|
@@ -1153,7 +1180,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1153
1180
|
try {
|
|
1154
1181
|
rows = await runVectorSearch(gucOverrides, query);
|
|
1155
1182
|
} catch (error) {
|
|
1156
|
-
throw
|
|
1183
|
+
throw chunkH7VE3FL4_cjs.mapVectorWriteError(error, params);
|
|
1157
1184
|
}
|
|
1158
1185
|
return rows.map((row) => ({
|
|
1159
1186
|
nodeId: row.node_id,
|
|
@@ -1165,10 +1192,10 @@ function createPostgresOperationBackend(options) {
|
|
|
1165
1192
|
// multi-statement fallback by simply not exposing the member.
|
|
1166
1193
|
...capabilities.windowFunctions ? {
|
|
1167
1194
|
async hybridSearch(params) {
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
const slot =
|
|
1195
|
+
chunkJXUTCSXX_cjs.assertVectorSearchLimit(params.limit);
|
|
1196
|
+
chunkJXUTCSXX_cjs.assertVectorSearchLimit(params.vector.k);
|
|
1197
|
+
chunkD56XG4EI_cjs.assertPgvectorEfSearch(params.vector.efSearch);
|
|
1198
|
+
const slot = chunkH7VE3FL4_cjs.vectorSlotFromParams({
|
|
1172
1199
|
graphId: params.graphId,
|
|
1173
1200
|
nodeKind: params.nodeKind,
|
|
1174
1201
|
fieldPath: params.vector.fieldPath,
|
|
@@ -1176,11 +1203,11 @@ function createPostgresOperationBackend(options) {
|
|
|
1176
1203
|
metric: params.vector.metric,
|
|
1177
1204
|
indexType: params.vector.indexType
|
|
1178
1205
|
});
|
|
1179
|
-
const candidates = params.candidates ??
|
|
1206
|
+
const candidates = params.candidates ?? chunkH7VE3FL4_cjs.buildLiveNodeCandidates(
|
|
1180
1207
|
tableNames.nodes,
|
|
1181
1208
|
params.graphId,
|
|
1182
1209
|
params.nodeKind,
|
|
1183
|
-
|
|
1210
|
+
chunkF4NHQHEZ_cjs.nowIso()
|
|
1184
1211
|
);
|
|
1185
1212
|
const vectorParams = {
|
|
1186
1213
|
graphId: params.graphId,
|
|
@@ -1200,7 +1227,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1200
1227
|
);
|
|
1201
1228
|
const statement = operationStrategy.buildHybridSearch(
|
|
1202
1229
|
{ ...params, candidates },
|
|
1203
|
-
|
|
1230
|
+
chunkOOA273IJ_cjs.toDrizzleSql(vectorSql, "postgres"),
|
|
1204
1231
|
params.vector.metric === "cosine"
|
|
1205
1232
|
);
|
|
1206
1233
|
const gucOverrides = await vectorSearchGucOverrides({
|
|
@@ -1214,9 +1241,9 @@ function createPostgresOperationBackend(options) {
|
|
|
1214
1241
|
statement
|
|
1215
1242
|
);
|
|
1216
1243
|
} catch (error) {
|
|
1217
|
-
throw
|
|
1244
|
+
throw chunkH7VE3FL4_cjs.mapVectorWriteError(error, vectorParams);
|
|
1218
1245
|
}
|
|
1219
|
-
return raw.map((row) =>
|
|
1246
|
+
return raw.map((row) => chunkH7VE3FL4_cjs.mapHybridSearchRow(row, toNodeRow));
|
|
1220
1247
|
}
|
|
1221
1248
|
} : {}
|
|
1222
1249
|
};
|
|
@@ -1260,7 +1287,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1260
1287
|
AND ${schemaVersionsTable.isActive} = TRUE
|
|
1261
1288
|
FOR SHARE
|
|
1262
1289
|
`);
|
|
1263
|
-
|
|
1290
|
+
chunkH7VE3FL4_cjs.assertActiveSchemaVersion(
|
|
1264
1291
|
params.graphId,
|
|
1265
1292
|
params.expectedVersion,
|
|
1266
1293
|
active?.version ?? 0
|
|
@@ -1269,7 +1296,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1269
1296
|
// === Vector Index Operations ===
|
|
1270
1297
|
async createVectorIndex(params) {
|
|
1271
1298
|
if (vectorStrategy === void 0) return;
|
|
1272
|
-
const slot =
|
|
1299
|
+
const slot = chunkH7VE3FL4_cjs.vectorSlotFromCreateIndexParams(params);
|
|
1273
1300
|
await contributionMaterializer.ensureVectorSlot(slot);
|
|
1274
1301
|
const indexStatement = vectorStrategy.buildCreateIndex?.(slot, {
|
|
1275
1302
|
concurrent: params.concurrent === true
|
|
@@ -1278,7 +1305,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1278
1305
|
try {
|
|
1279
1306
|
await execRun(indexStatement);
|
|
1280
1307
|
} catch (error) {
|
|
1281
|
-
if (!
|
|
1308
|
+
if (!chunkJQXSZHF2_cjs.isInsufficientResourcesError(error)) throw error;
|
|
1282
1309
|
const dropStatement = vectorStrategy.buildDropIndex?.(slot);
|
|
1283
1310
|
if (dropStatement !== void 0) {
|
|
1284
1311
|
await execRun(dropStatement);
|
|
@@ -1305,7 +1332,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1305
1332
|
},
|
|
1306
1333
|
// === Fulltext Operations ===
|
|
1307
1334
|
async upsertFulltext(params) {
|
|
1308
|
-
const timestamp =
|
|
1335
|
+
const timestamp = chunkF4NHQHEZ_cjs.nowIso();
|
|
1309
1336
|
const statements = operationStrategy.buildUpsertFulltext(
|
|
1310
1337
|
params,
|
|
1311
1338
|
timestamp
|
|
@@ -1322,7 +1349,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1322
1349
|
},
|
|
1323
1350
|
async upsertFulltextBatch(params) {
|
|
1324
1351
|
if (params.rows.length === 0) return;
|
|
1325
|
-
const timestamp =
|
|
1352
|
+
const timestamp = chunkF4NHQHEZ_cjs.nowIso();
|
|
1326
1353
|
for (const rows of chunkZDH3DX3C_cjs.chunk(
|
|
1327
1354
|
params.rows,
|
|
1328
1355
|
batchConfig.fulltextUpsertBatchSize
|
|
@@ -1356,20 +1383,20 @@ function createPostgresOperationBackend(options) {
|
|
|
1356
1383
|
const rows = await execAll(query);
|
|
1357
1384
|
return rows.map((row, index) => ({
|
|
1358
1385
|
nodeId: row.node_id,
|
|
1359
|
-
score:
|
|
1386
|
+
score: chunkF4NHQHEZ_cjs.coerceNumericScore(row.score),
|
|
1360
1387
|
rank: index + 1,
|
|
1361
1388
|
...row.snippet === null ? {} : { snippet: row.snippet }
|
|
1362
1389
|
}));
|
|
1363
1390
|
},
|
|
1364
1391
|
async dropVectorIndex(params) {
|
|
1365
1392
|
if (vectorStrategy === void 0) return;
|
|
1366
|
-
const slot =
|
|
1393
|
+
const slot = chunkH7VE3FL4_cjs.vectorSlotFromDropIndexParams(params);
|
|
1367
1394
|
const dropStatement = vectorStrategy.buildDropIndex?.(slot);
|
|
1368
1395
|
if (dropStatement === void 0) return;
|
|
1369
1396
|
try {
|
|
1370
1397
|
await execRun(dropStatement);
|
|
1371
1398
|
} catch (error) {
|
|
1372
|
-
if (!
|
|
1399
|
+
if (!chunkJQXSZHF2_cjs.isMissingTableError(error)) throw error;
|
|
1373
1400
|
}
|
|
1374
1401
|
},
|
|
1375
1402
|
// === Query Execution ===
|
|
@@ -1415,5 +1442,5 @@ function createTransactionBackend(options) {
|
|
|
1415
1442
|
}
|
|
1416
1443
|
|
|
1417
1444
|
exports.createPostgresBackend = createPostgresBackend;
|
|
1418
|
-
//# sourceMappingURL=chunk-
|
|
1419
|
-
//# sourceMappingURL=chunk-
|
|
1445
|
+
//# sourceMappingURL=chunk-YDWLUT5V.cjs.map
|
|
1446
|
+
//# sourceMappingURL=chunk-YDWLUT5V.cjs.map
|