@nicia-ai/typegraph 0.45.0 → 0.46.1
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 +11 -11
- 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 -7
- package/dist/backend/index.cjs +53 -54
- package/dist/backend/index.d.cts +3 -3
- package/dist/backend/index.d.ts +3 -3
- package/dist/backend/index.js +13 -14
- package/dist/backend/postgres/index.cjs +29 -30
- package/dist/backend/postgres/index.d.cts +7 -7
- package/dist/backend/postgres/index.d.ts +7 -7
- package/dist/backend/postgres/index.js +16 -17
- package/dist/backend/postgres/pglite-store.cjs +48 -42
- package/dist/backend/postgres/pglite-store.cjs.map +1 -1
- package/dist/backend/postgres/pglite-store.d.cts +15 -9
- package/dist/backend/postgres/pglite-store.d.ts +15 -9
- package/dist/backend/postgres/pglite-store.js +44 -38
- package/dist/backend/postgres/pglite-store.js.map +1 -1
- package/dist/backend/postgres/pglite.cjs +18 -19
- package/dist/backend/postgres/pglite.d.cts +4 -4
- package/dist/backend/postgres/pglite.d.ts +4 -4
- package/dist/backend/postgres/pglite.js +17 -18
- package/dist/backend/sqlite/index.cjs +26 -27
- package/dist/backend/sqlite/index.d.cts +6 -6
- package/dist/backend/sqlite/index.d.ts +6 -6
- package/dist/backend/sqlite/index.js +14 -15
- package/dist/backend/sqlite/libsql.cjs +21 -22
- package/dist/backend/sqlite/libsql.cjs.map +1 -1
- package/dist/backend/sqlite/libsql.d.cts +15 -8
- package/dist/backend/sqlite/libsql.d.ts +15 -8
- package/dist/backend/sqlite/libsql.js +17 -18
- package/dist/backend/sqlite/libsql.js.map +1 -1
- package/dist/backend/sqlite/local-store.cjs +49 -43
- package/dist/backend/sqlite/local-store.cjs.map +1 -1
- package/dist/backend/sqlite/local-store.d.cts +15 -10
- package/dist/backend/sqlite/local-store.d.ts +15 -10
- package/dist/backend/sqlite/local-store.js +45 -39
- package/dist/backend/sqlite/local-store.js.map +1 -1
- package/dist/backend/sqlite/local.cjs +19 -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 +17 -18
- package/dist/{chunk-S3ZRKJHY.js → chunk-2LG2XB2M.js} +3 -3
- package/dist/{chunk-S3ZRKJHY.js.map → chunk-2LG2XB2M.js.map} +1 -1
- package/dist/{chunk-7PF2L3H6.cjs → chunk-2NA5DYLO.cjs} +4 -4
- package/dist/{chunk-7PF2L3H6.cjs.map → chunk-2NA5DYLO.cjs.map} +1 -1
- package/dist/chunk-2Z2Z3ZD6.js +58 -0
- package/dist/chunk-2Z2Z3ZD6.js.map +1 -0
- package/dist/{chunk-VVQM4CZD.cjs → chunk-3DHZCOT7.cjs} +20 -20
- package/dist/{chunk-VVQM4CZD.cjs.map → chunk-3DHZCOT7.cjs.map} +1 -1
- package/dist/{chunk-JXUTCSXX.cjs → chunk-4UGOKMI5.cjs} +250 -158
- package/dist/chunk-4UGOKMI5.cjs.map +1 -0
- package/dist/{chunk-RFRM3Q5K.js → chunk-5262ZMTR.js} +14 -5
- package/dist/chunk-5262ZMTR.js.map +1 -0
- package/dist/{chunk-QRNYDV5Z.js → chunk-5763DULU.js} +214 -69
- package/dist/chunk-5763DULU.js.map +1 -0
- package/dist/{chunk-BGYJW37L.js → chunk-5UVRGXD3.js} +277 -7
- package/dist/chunk-5UVRGXD3.js.map +1 -0
- package/dist/{chunk-QR24DJDF.cjs → chunk-62ZP23AW.cjs} +15 -15
- package/dist/{chunk-QR24DJDF.cjs.map → chunk-62ZP23AW.cjs.map} +1 -1
- package/dist/{chunk-ZI6VQSZA.cjs → chunk-65E3XWGF.cjs} +724 -577
- package/dist/chunk-65E3XWGF.cjs.map +1 -0
- package/dist/{chunk-S4KQ5LV4.js → chunk-775A4ZMN.js} +40 -6
- package/dist/chunk-775A4ZMN.js.map +1 -0
- package/dist/{chunk-J2ICGNHO.cjs → chunk-7BQXPCGN.cjs} +830 -169
- package/dist/chunk-7BQXPCGN.cjs.map +1 -0
- package/dist/{chunk-FJMPR3OH.cjs → chunk-7EO3TCQB.cjs} +33 -7
- package/dist/chunk-7EO3TCQB.cjs.map +1 -0
- package/dist/{chunk-DXEEHSGN.js → chunk-7VQXLT5O.js} +436 -43
- package/dist/chunk-7VQXLT5O.js.map +1 -0
- package/dist/chunk-A4OC4DVN.cjs +12 -0
- package/dist/{chunk-4SZ6XPTG.cjs.map → chunk-A4OC4DVN.cjs.map} +1 -1
- package/dist/{chunk-TDXIBCGY.cjs → chunk-A7J2YDDI.cjs} +5 -3
- package/dist/chunk-A7J2YDDI.cjs.map +1 -0
- package/dist/{chunk-55ITBQJI.js → chunk-AKLS3BYZ.js} +56 -5
- package/dist/chunk-AKLS3BYZ.js.map +1 -0
- package/dist/{chunk-D7PG5D5K.js → chunk-AMKPPFUO.js} +32 -6
- package/dist/chunk-AMKPPFUO.js.map +1 -0
- package/dist/{chunk-WUFASQUO.js → chunk-ASTI57H3.js} +3 -3
- package/dist/{chunk-WUFASQUO.js.map → chunk-ASTI57H3.js.map} +1 -1
- package/dist/{chunk-4QIKLIGG.js → chunk-BKCUOV7A.js} +15 -5
- package/dist/chunk-BKCUOV7A.js.map +1 -0
- package/dist/{chunk-JQXSZHF2.cjs → chunk-BSFJMMV3.cjs} +134 -7
- package/dist/chunk-BSFJMMV3.cjs.map +1 -0
- package/dist/{chunk-4GUTQPVO.js → chunk-C23WSN5E.js} +185 -24
- package/dist/chunk-C23WSN5E.js.map +1 -0
- package/dist/{chunk-QLUXRWKL.js → chunk-CBTIUB76.js} +3 -3
- package/dist/{chunk-QLUXRWKL.js.map → chunk-CBTIUB76.js.map} +1 -1
- package/dist/chunk-CMWHLBVN.cjs +2082 -0
- package/dist/chunk-CMWHLBVN.cjs.map +1 -0
- package/dist/{chunk-QB6VMOJ2.cjs → chunk-CXBHOOIQ.cjs} +45 -10
- package/dist/chunk-CXBHOOIQ.cjs.map +1 -0
- package/dist/{chunk-FL5UQRES.js → chunk-DCQVHAYQ.js} +5 -5
- package/dist/{chunk-FL5UQRES.js.map → chunk-DCQVHAYQ.js.map} +1 -1
- package/dist/chunk-DTVWX77L.cjs +3432 -0
- package/dist/chunk-DTVWX77L.cjs.map +1 -0
- package/dist/chunk-DYATYRY4.js +47 -0
- package/dist/chunk-DYATYRY4.js.map +1 -0
- package/dist/chunk-E4WNQBEF.cjs +217 -0
- package/dist/chunk-E4WNQBEF.cjs.map +1 -0
- package/dist/{chunk-G6Q5UM7U.js → chunk-FWJKWH6U.js} +5 -3
- package/dist/chunk-FWJKWH6U.js.map +1 -0
- package/dist/chunk-GF3KXUTW.js +3393 -0
- package/dist/chunk-GF3KXUTW.js.map +1 -0
- package/dist/{chunk-VTN3C3CH.js → chunk-HFHTMECK.js} +7 -7
- package/dist/{chunk-VTN3C3CH.js.map → chunk-HFHTMECK.js.map} +1 -1
- package/dist/{chunk-FLEQ2HBK.js → chunk-I5MOXA4H.js} +20 -14
- package/dist/chunk-I5MOXA4H.js.map +1 -0
- package/dist/{chunk-4MB3AQAQ.js → chunk-J3WZ3FA2.js} +77 -3
- package/dist/chunk-J3WZ3FA2.js.map +1 -0
- package/dist/{chunk-UR7W5YQK.js → chunk-JBQQ7THH.js} +5 -3
- package/dist/chunk-JBQQ7THH.js.map +1 -0
- package/dist/{chunk-TKP5T34P.js → chunk-JXA2ZP2Q.js} +6 -16
- package/dist/chunk-JXA2ZP2Q.js.map +1 -0
- package/dist/{chunk-GYA4JRP5.js → chunk-JXXDZTMN.js} +2 -2
- package/dist/chunk-JXXDZTMN.js.map +1 -0
- package/dist/chunk-JZUR7ZWE.js +254 -0
- package/dist/chunk-JZUR7ZWE.js.map +1 -0
- package/dist/{chunk-42PYUGLS.js → chunk-K5ELX2GT.js} +108 -8
- package/dist/chunk-K5ELX2GT.js.map +1 -0
- package/dist/{chunk-Q6EDCUXV.js → chunk-L65OU2U3.js} +556 -204
- package/dist/chunk-L65OU2U3.js.map +1 -0
- package/dist/{chunk-D54WH24V.cjs → chunk-LBJKZXDE.cjs} +115 -13
- package/dist/chunk-LBJKZXDE.cjs.map +1 -0
- package/dist/{chunk-FQ7ZPOTZ.js → chunk-LGHCOKTT.js} +637 -493
- package/dist/chunk-LGHCOKTT.js.map +1 -0
- package/dist/chunk-M3WP7RQZ.js +736 -0
- package/dist/chunk-M3WP7RQZ.js.map +1 -0
- package/dist/{chunk-4MEWSUVM.cjs → chunk-M4BDU5RX.cjs} +12 -12
- package/dist/chunk-M4BDU5RX.cjs.map +1 -0
- package/dist/chunk-MCLYU6BN.cjs +332 -0
- package/dist/chunk-MCLYU6BN.cjs.map +1 -0
- package/dist/{chunk-MIJKEVV7.js → chunk-MSY7FSX4.js} +37 -4
- package/dist/chunk-MSY7FSX4.js.map +1 -0
- package/dist/{chunk-H7VE3FL4.cjs → chunk-MUK4BU7K.cjs} +519 -125
- package/dist/chunk-MUK4BU7K.cjs.map +1 -0
- package/dist/{chunk-D56XG4EI.cjs → chunk-MXJDTH5B.cjs} +56 -45
- package/dist/chunk-MXJDTH5B.cjs.map +1 -0
- package/dist/{chunk-5EKPX6QU.js → chunk-MZLPX2R7.js} +8 -9
- package/dist/chunk-MZLPX2R7.js.map +1 -0
- package/dist/chunk-N66HCGCY.cjs +57 -0
- package/dist/chunk-N66HCGCY.cjs.map +1 -0
- package/dist/{chunk-CPEL3YIR.cjs → chunk-NFCVHQ5P.cjs} +55 -22
- package/dist/chunk-NFCVHQ5P.cjs.map +1 -0
- package/dist/{chunk-C4F7VJ5D.cjs → chunk-NI72YOJB.cjs} +84 -2
- package/dist/chunk-NI72YOJB.cjs.map +1 -0
- package/dist/{chunk-BNS75YNF.cjs → chunk-NK5Q7UNE.cjs} +10 -20
- package/dist/chunk-NK5Q7UNE.cjs.map +1 -0
- package/dist/{chunk-TKORQCG4.js → chunk-NLI2AVEF.js} +386 -862
- package/dist/chunk-NLI2AVEF.js.map +1 -0
- package/dist/{chunk-YMTXMPV6.js → chunk-NMWDXFPH.js} +4 -4
- package/dist/{chunk-YMTXMPV6.js.map → chunk-NMWDXFPH.js.map} +1 -1
- package/dist/{chunk-J7LXTUTP.cjs → chunk-PF6F5NLJ.cjs} +604 -1094
- package/dist/chunk-PF6F5NLJ.cjs.map +1 -0
- package/dist/{chunk-NAAMUYMS.cjs → chunk-PNN7RHVR.cjs} +58 -48
- package/dist/chunk-PNN7RHVR.cjs.map +1 -0
- package/dist/{chunk-YOALGKRE.cjs → chunk-PNTCATDE.cjs} +3528 -1763
- package/dist/chunk-PNTCATDE.cjs.map +1 -0
- package/dist/{chunk-6DCB664D.js → chunk-PQBQG7IM.js} +3 -3
- package/dist/{chunk-6DCB664D.js.map → chunk-PQBQG7IM.js.map} +1 -1
- package/dist/{chunk-UCQ3BFSY.cjs → chunk-PT7RIRIZ.cjs} +684 -332
- package/dist/chunk-PT7RIRIZ.cjs.map +1 -0
- package/dist/{chunk-ACSVZPK7.cjs → chunk-PWLJ77UV.cjs} +5 -3
- package/dist/chunk-PWLJ77UV.cjs.map +1 -0
- package/dist/chunk-Q3G6A4I3.cjs +755 -0
- package/dist/chunk-Q3G6A4I3.cjs.map +1 -0
- package/dist/{chunk-Z3WO6MND.cjs → chunk-RMQLSPA2.cjs} +297 -27
- package/dist/chunk-RMQLSPA2.cjs.map +1 -0
- package/dist/{chunk-SJDMVITW.cjs → chunk-RT5ZY4XA.cjs} +6 -5
- package/dist/chunk-RT5ZY4XA.cjs.map +1 -0
- package/dist/{chunk-ID4WXTKL.js → chunk-S6PW7VV5.js} +2382 -617
- package/dist/chunk-S6PW7VV5.js.map +1 -0
- package/dist/{chunk-4GUBTVPV.js → chunk-T4XNKYXB.js} +780 -126
- package/dist/chunk-T4XNKYXB.js.map +1 -0
- package/dist/{chunk-YDWLUT5V.cjs → chunk-TQR4KBY2.cjs} +323 -178
- package/dist/chunk-TQR4KBY2.cjs.map +1 -0
- package/dist/{chunk-OOA273IJ.cjs → chunk-U5SON7R2.cjs} +27 -27
- package/dist/{chunk-OOA273IJ.cjs.map → chunk-U5SON7R2.cjs.map} +1 -1
- package/dist/{chunk-IX64T5OL.cjs → chunk-U63GDNRC.cjs} +32 -26
- package/dist/chunk-U63GDNRC.cjs.map +1 -0
- package/dist/{chunk-WDBXJOU5.cjs → chunk-UDISNXDL.cjs} +56 -47
- package/dist/chunk-UDISNXDL.cjs.map +1 -0
- package/dist/{chunk-EFEOOCJ3.js → chunk-UV3SN74I.js} +5 -5
- package/dist/{chunk-EFEOOCJ3.js.map → chunk-UV3SN74I.js.map} +1 -1
- package/dist/{chunk-U5W4LKZV.cjs → chunk-VCRRKBLN.cjs} +9 -9
- package/dist/{chunk-U5W4LKZV.cjs.map → chunk-VCRRKBLN.cjs.map} +1 -1
- package/dist/{chunk-ISLPNELU.js → chunk-VGTJPTIC.js} +16 -5
- package/dist/chunk-VGTJPTIC.js.map +1 -0
- package/dist/chunk-VLT6PEWR.cjs +60 -0
- package/dist/chunk-VLT6PEWR.cjs.map +1 -0
- package/dist/chunk-VQH4VAWD.cjs +12 -0
- package/dist/{chunk-B3F2D3SP.cjs.map → chunk-VQH4VAWD.cjs.map} +1 -1
- package/dist/{chunk-SNXVDZAJ.js → chunk-W6OG3HDG.js} +5 -4
- package/dist/chunk-W6OG3HDG.js.map +1 -0
- package/dist/chunk-WDGA7IYB.js +207 -0
- package/dist/chunk-WDGA7IYB.js.map +1 -0
- package/dist/chunk-WQZLUGVR.js +2057 -0
- package/dist/chunk-WQZLUGVR.js.map +1 -0
- package/dist/{chunk-EKFUG4G7.cjs → chunk-XBYVV3MP.cjs} +60 -5
- package/dist/chunk-XBYVV3MP.cjs.map +1 -0
- package/dist/{chunk-5GAONX5G.cjs → chunk-XCAGZAKP.cjs} +7 -7
- package/dist/{chunk-5GAONX5G.cjs.map → chunk-XCAGZAKP.cjs.map} +1 -1
- package/dist/chunk-XL7SLCXS.js +309 -0
- package/dist/chunk-XL7SLCXS.js.map +1 -0
- package/dist/{chunk-SVJ5GEXW.cjs → chunk-XUO3KQFO.cjs} +2 -2
- package/dist/chunk-XUO3KQFO.cjs.map +1 -0
- package/dist/{chunk-F4NHQHEZ.cjs → chunk-YAAM3M2S.cjs} +10 -10
- package/dist/{chunk-F4NHQHEZ.cjs.map → chunk-YAAM3M2S.cjs.map} +1 -1
- package/dist/{chunk-RUQS6M7G.js → chunk-YBFHZUXX.js} +6 -6
- package/dist/chunk-YBFHZUXX.js.map +1 -0
- package/dist/{chunk-KMXWZLQX.cjs → chunk-YBQOHKHN.cjs} +99 -100
- package/dist/chunk-YBQOHKHN.cjs.map +1 -0
- package/dist/{chunk-PVUI6KGR.js → chunk-YDFDBE6D.js} +93 -6
- package/dist/chunk-YDFDBE6D.js.map +1 -0
- package/dist/{chunk-P7GTYOLB.cjs → chunk-YVWGEQJE.cjs} +297 -135
- package/dist/chunk-YVWGEQJE.cjs.map +1 -0
- package/dist/{chunk-QT6V3YRH.js → chunk-YWGVVALJ.js} +3 -3
- package/dist/{chunk-QT6V3YRH.js.map → chunk-YWGVVALJ.js.map} +1 -1
- package/dist/core/index.cjs +40 -40
- package/dist/core/index.d.cts +4 -5
- package/dist/core/index.d.ts +4 -5
- package/dist/core/index.js +8 -8
- package/dist/{ddl-BG4J805L.d.cts → ddl-BJcOp4WZ.d.cts} +3 -3
- package/dist/{ddl-CgiS9QLj.d.ts → ddl-BXfGHbPN.d.ts} +3 -3
- package/dist/graph-extension/index.cjs +26 -22
- package/dist/graph-extension/index.d.cts +16 -6
- package/dist/graph-extension/index.d.ts +16 -6
- package/dist/graph-extension/index.js +7 -7
- package/dist/graph-merge/index.cjs +2459 -654
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +170 -33
- package/dist/graph-merge/index.d.ts +170 -33
- package/dist/graph-merge/index.js +2269 -467
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/{index-C3y_98iN.d.cts → index-BSHvKfok.d.ts} +221 -10
- package/dist/{index-BBxZCUdu.d.ts → index-DxaYCv8Y.d.cts} +221 -10
- package/dist/index.cjs +330 -268
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +590 -576
- package/dist/index.d.ts +590 -576
- package/dist/index.js +73 -49
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.cjs +17 -17
- package/dist/indexes/index.d.cts +4 -4
- package/dist/indexes/index.d.ts +4 -4
- package/dist/indexes/index.js +10 -10
- package/dist/interchange/index.cjs +165 -51
- package/dist/interchange/index.cjs.map +1 -1
- package/dist/interchange/index.d.cts +261 -16
- package/dist/interchange/index.d.ts +261 -16
- package/dist/interchange/index.js +128 -25
- package/dist/interchange/index.js.map +1 -1
- package/dist/{manager-YoLEfcc1.d.ts → manager-CfZAimti.d.ts} +36 -5
- package/dist/{manager-KS7CGQQT.d.cts → manager-HGk6E_HW.d.cts} +36 -5
- package/dist/{materialize-indexes-Bhhyb1B3.d.ts → materialize-indexes-6A7dWGtb.d.cts} +10 -2
- package/dist/{materialize-indexes-OHRWypW6.d.cts → materialize-indexes-BMJP6Tms.d.ts} +10 -2
- package/dist/{postgres-DpkW3R5Y.d.cts → postgres-DFYWENdR.d.cts} +1961 -439
- package/dist/{postgres-DwqyIniy.d.ts → postgres-e7a9TdvR.d.ts} +1961 -439
- package/dist/profiler/index.cjs +15 -15
- package/dist/profiler/index.d.cts +9 -10
- package/dist/profiler/index.d.ts +9 -10
- package/dist/profiler/index.js +4 -4
- package/dist/provenance/index.cjs +46 -48
- package/dist/provenance/index.cjs.map +1 -1
- package/dist/provenance/index.d.cts +7 -7
- package/dist/provenance/index.d.ts +7 -7
- package/dist/provenance/index.js +12 -14
- package/dist/provenance/index.js.map +1 -1
- package/dist/schema/index.cjs +50 -48
- package/dist/schema/index.d.cts +9 -16
- package/dist/schema/index.d.ts +9 -16
- package/dist/schema/index.js +23 -21
- package/dist/{searchable-DLWEfC4a.d.ts → searchable-9OQoPuRs.d.ts} +1 -2
- package/dist/{searchable-CIZL8Hyw.d.cts → searchable-CIje5XYD.d.cts} +1 -2
- package/dist/{sqlite-DY0WODUK.d.cts → sqlite-DerU5tc7.d.ts} +2029 -347
- package/dist/{sqlite-L-VIRzqA.d.ts → sqlite-DitnISa9.d.cts} +2029 -347
- package/dist/{store-view-A85FFRnk.d.cts → store-B0h6x7wo.d.cts} +1289 -767
- package/dist/{store-view-66p92IPi.d.ts → store-ClQ-MZQS.d.ts} +1289 -767
- package/dist/{temporal-BNbjXqer.d.cts → temporal-Bn-Fi8FJ.d.cts} +1 -1
- package/dist/{temporal-Bob6Nfbp.d.ts → temporal-BtM4UALv.d.ts} +1 -1
- package/dist/{types-DeORZhxn.d.cts → types-CoIx8HX5.d.cts} +1 -1
- package/dist/{types-Ch9a0Dx6.d.ts → types-HkveCCx0.d.cts} +726 -5
- package/dist/{types-Ch9a0Dx6.d.cts → types-HkveCCx0.d.ts} +726 -5
- package/dist/{types-ClCzT-dT.d.ts → types-KFfk-8Ah.d.ts} +1 -1
- package/dist/{where-DPw52ksb.d.cts → where--fk7_0kv.d.cts} +1 -1
- package/dist/{where-kWUZPvEA.d.ts → where-ws5hf-Ov.d.ts} +1 -1
- package/package.json +3 -3
- package/dist/chunk-2L54C2C2.js +0 -144
- package/dist/chunk-2L54C2C2.js.map +0 -1
- package/dist/chunk-35S6P5ZU.js +0 -27
- package/dist/chunk-35S6P5ZU.js.map +0 -1
- package/dist/chunk-42PYUGLS.js.map +0 -1
- package/dist/chunk-4GUBTVPV.js.map +0 -1
- package/dist/chunk-4GUTQPVO.js.map +0 -1
- package/dist/chunk-4MB3AQAQ.js.map +0 -1
- package/dist/chunk-4MEWSUVM.cjs.map +0 -1
- package/dist/chunk-4QIKLIGG.js.map +0 -1
- package/dist/chunk-4SZ6XPTG.cjs +0 -12
- package/dist/chunk-55ITBQJI.js.map +0 -1
- package/dist/chunk-5EKPX6QU.js.map +0 -1
- package/dist/chunk-6RYPD3NJ.cjs +0 -1282
- package/dist/chunk-6RYPD3NJ.cjs.map +0 -1
- package/dist/chunk-764JHTLT.cjs +0 -15
- package/dist/chunk-764JHTLT.cjs.map +0 -1
- package/dist/chunk-ACSVZPK7.cjs.map +0 -1
- package/dist/chunk-B3F2D3SP.cjs +0 -12
- package/dist/chunk-BGYJW37L.js.map +0 -1
- package/dist/chunk-BNS75YNF.cjs.map +0 -1
- package/dist/chunk-C4F7VJ5D.cjs.map +0 -1
- package/dist/chunk-CBKG6HEP.js +0 -1263
- package/dist/chunk-CBKG6HEP.js.map +0 -1
- package/dist/chunk-CPEL3YIR.cjs.map +0 -1
- package/dist/chunk-D54WH24V.cjs.map +0 -1
- package/dist/chunk-D56XG4EI.cjs.map +0 -1
- package/dist/chunk-D7PG5D5K.js.map +0 -1
- package/dist/chunk-DI74SMXS.cjs +0 -29
- package/dist/chunk-DI74SMXS.cjs.map +0 -1
- package/dist/chunk-DK2S42XB.js +0 -77
- package/dist/chunk-DK2S42XB.js.map +0 -1
- package/dist/chunk-DRACN6XG.js +0 -27
- package/dist/chunk-DRACN6XG.js.map +0 -1
- package/dist/chunk-DXEEHSGN.js.map +0 -1
- package/dist/chunk-EKFUG4G7.cjs.map +0 -1
- package/dist/chunk-EQ7JKLZO.cjs +0 -157
- package/dist/chunk-EQ7JKLZO.cjs.map +0 -1
- package/dist/chunk-FJMPR3OH.cjs.map +0 -1
- package/dist/chunk-FLEQ2HBK.js.map +0 -1
- package/dist/chunk-FQ7ZPOTZ.js.map +0 -1
- package/dist/chunk-G6Q5UM7U.js.map +0 -1
- package/dist/chunk-GYA4JRP5.js.map +0 -1
- package/dist/chunk-H7VE3FL4.cjs.map +0 -1
- package/dist/chunk-ID4WXTKL.js.map +0 -1
- package/dist/chunk-ISLPNELU.js.map +0 -1
- package/dist/chunk-ITE4IXAK.js +0 -25
- package/dist/chunk-ITE4IXAK.js.map +0 -1
- package/dist/chunk-IX64T5OL.cjs.map +0 -1
- package/dist/chunk-J2ICGNHO.cjs.map +0 -1
- package/dist/chunk-J7LXTUTP.cjs.map +0 -1
- package/dist/chunk-JQXSZHF2.cjs.map +0 -1
- package/dist/chunk-JXUTCSXX.cjs.map +0 -1
- package/dist/chunk-KCO5EFJU.js +0 -79
- package/dist/chunk-KCO5EFJU.js.map +0 -1
- package/dist/chunk-KKYELPZ2.cjs +0 -83
- package/dist/chunk-KKYELPZ2.cjs.map +0 -1
- package/dist/chunk-KMXWZLQX.cjs.map +0 -1
- package/dist/chunk-MIJKEVV7.js.map +0 -1
- package/dist/chunk-NAAMUYMS.cjs.map +0 -1
- package/dist/chunk-P7GTYOLB.cjs.map +0 -1
- package/dist/chunk-PVUI6KGR.js.map +0 -1
- package/dist/chunk-Q6EDCUXV.js.map +0 -1
- package/dist/chunk-QB6VMOJ2.cjs.map +0 -1
- package/dist/chunk-QC4MCOFV.cjs +0 -83
- package/dist/chunk-QC4MCOFV.cjs.map +0 -1
- package/dist/chunk-QMQLUA66.js +0 -12
- package/dist/chunk-QMQLUA66.js.map +0 -1
- package/dist/chunk-QRNYDV5Z.js.map +0 -1
- package/dist/chunk-RFRM3Q5K.js.map +0 -1
- package/dist/chunk-RUQS6M7G.js.map +0 -1
- package/dist/chunk-S4KQ5LV4.js.map +0 -1
- package/dist/chunk-SJDMVITW.cjs.map +0 -1
- package/dist/chunk-SNXVDZAJ.js.map +0 -1
- package/dist/chunk-SVJ5GEXW.cjs.map +0 -1
- package/dist/chunk-TDXIBCGY.cjs.map +0 -1
- package/dist/chunk-TKORQCG4.js.map +0 -1
- package/dist/chunk-TKP5T34P.js.map +0 -1
- package/dist/chunk-TRF4EBJT.cjs +0 -30
- package/dist/chunk-TRF4EBJT.cjs.map +0 -1
- package/dist/chunk-UCQ3BFSY.cjs.map +0 -1
- package/dist/chunk-UR7W5YQK.js.map +0 -1
- package/dist/chunk-V34A6R5V.js +0 -134
- package/dist/chunk-V34A6R5V.js.map +0 -1
- package/dist/chunk-WDAVPX46.js +0 -81
- package/dist/chunk-WDAVPX46.js.map +0 -1
- package/dist/chunk-WDBXJOU5.cjs.map +0 -1
- package/dist/chunk-YDWLUT5V.cjs.map +0 -1
- package/dist/chunk-YOALGKRE.cjs.map +0 -1
- package/dist/chunk-Z3WO6MND.cjs.map +0 -1
- package/dist/chunk-ZDH3DX3C.cjs +0 -30
- package/dist/chunk-ZDH3DX3C.cjs.map +0 -1
- package/dist/chunk-ZI6VQSZA.cjs.map +0 -1
- package/dist/chunk-ZTAJL4DT.cjs +0 -85
- package/dist/chunk-ZTAJL4DT.cjs.map +0 -1
- package/dist/define-graph-BGrJahvp.d.ts +0 -173
- package/dist/define-graph-alREY2wj.d.cts +0 -173
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var chunkC4F7VJ5D_cjs = require('./chunk-C4F7VJ5D.cjs');
|
|
3
|
+
var chunkMUK4BU7K_cjs = require('./chunk-MUK4BU7K.cjs');
|
|
4
|
+
var chunkYAAM3M2S_cjs = require('./chunk-YAAM3M2S.cjs');
|
|
5
|
+
var chunkRMQLSPA2_cjs = require('./chunk-RMQLSPA2.cjs');
|
|
6
|
+
var chunkU5SON7R2_cjs = require('./chunk-U5SON7R2.cjs');
|
|
7
|
+
var chunkBSFJMMV3_cjs = require('./chunk-BSFJMMV3.cjs');
|
|
8
|
+
var chunkXBYVV3MP_cjs = require('./chunk-XBYVV3MP.cjs');
|
|
9
|
+
var chunk4UGOKMI5_cjs = require('./chunk-4UGOKMI5.cjs');
|
|
10
|
+
var chunkVCRRKBLN_cjs = require('./chunk-VCRRKBLN.cjs');
|
|
11
|
+
var chunkNI72YOJB_cjs = require('./chunk-NI72YOJB.cjs');
|
|
12
|
+
var chunkN66HCGCY_cjs = require('./chunk-N66HCGCY.cjs');
|
|
14
13
|
var drizzleOrm = require('drizzle-orm');
|
|
15
14
|
var sqliteCore = require('drizzle-orm/sqlite-core');
|
|
16
15
|
|
|
@@ -101,14 +100,14 @@ function hasModernBindLimitByVersion(rows) {
|
|
|
101
100
|
}
|
|
102
101
|
function detectHardMaxBindParameters(transactionMode, hostedPlatform) {
|
|
103
102
|
if (hostedPlatform === "durable-object" || transactionMode === "do-sqlite") {
|
|
104
|
-
return
|
|
103
|
+
return chunkXBYVV3MP_cjs.DURABLE_OBJECT_MAX_BIND_PARAMETERS;
|
|
105
104
|
}
|
|
106
|
-
if (hostedPlatform === "d1") return
|
|
105
|
+
if (hostedPlatform === "d1") return chunkXBYVV3MP_cjs.D1_MAX_BIND_PARAMETERS;
|
|
107
106
|
return void 0;
|
|
108
107
|
}
|
|
109
108
|
function detectMaxBindParameters(sqliteClient, hardMaxBindParameters) {
|
|
110
109
|
if (hardMaxBindParameters !== void 0) return hardMaxBindParameters;
|
|
111
|
-
if (sqliteClient === void 0) return
|
|
110
|
+
if (sqliteClient === void 0) return chunkXBYVV3MP_cjs.SQLITE_MAX_BIND_PARAMETERS;
|
|
112
111
|
try {
|
|
113
112
|
const compiled = parseCompiledMaxVariableNumber(
|
|
114
113
|
sqliteClient.prepare("PRAGMA compile_options").all()
|
|
@@ -117,20 +116,39 @@ function detectMaxBindParameters(sqliteClient, hardMaxBindParameters) {
|
|
|
117
116
|
const isModern = hasModernBindLimitByVersion(
|
|
118
117
|
sqliteClient.prepare("SELECT sqlite_version() AS version").all()
|
|
119
118
|
);
|
|
120
|
-
return isModern ?
|
|
119
|
+
return isModern ? chunkXBYVV3MP_cjs.MODERN_SQLITE_MAX_BIND_PARAMETERS : chunkXBYVV3MP_cjs.SQLITE_MAX_BIND_PARAMETERS;
|
|
121
120
|
} catch {
|
|
122
|
-
return
|
|
121
|
+
return chunkXBYVV3MP_cjs.SQLITE_MAX_BIND_PARAMETERS;
|
|
123
122
|
}
|
|
124
123
|
}
|
|
124
|
+
function preparingClient(client) {
|
|
125
|
+
if (typeof client !== "object" || client === null) return void 0;
|
|
126
|
+
const candidate = client;
|
|
127
|
+
return typeof candidate["prepare"] === "function" ? candidate : void 0;
|
|
128
|
+
}
|
|
129
|
+
function hasMethods(client, methods) {
|
|
130
|
+
return methods.every((method) => typeof client[method] === "function");
|
|
131
|
+
}
|
|
132
|
+
function isBetterSqlite3Client(client) {
|
|
133
|
+
const candidate = preparingClient(client);
|
|
134
|
+
return candidate !== void 0 && hasMethods(candidate, ["pragma"]);
|
|
135
|
+
}
|
|
136
|
+
function isBunSqliteClient(client) {
|
|
137
|
+
const candidate = preparingClient(client);
|
|
138
|
+
return candidate !== void 0 && hasMethods(candidate, ["query", "run", "exec", "serialize"]) && typeof candidate["filename"] === "string";
|
|
139
|
+
}
|
|
140
|
+
function isSqlJsClient(client) {
|
|
141
|
+
const candidate = preparingClient(client);
|
|
142
|
+
return candidate !== void 0 && hasMethods(candidate, ["exec", "run", "export", "getRowsModified"]);
|
|
143
|
+
}
|
|
125
144
|
function resolveSqliteClient(db) {
|
|
126
145
|
const sqliteClient = db.$client;
|
|
127
|
-
if (
|
|
128
|
-
|
|
129
|
-
if (typeof candidate["prepare"] !== "function") return;
|
|
146
|
+
if (preparingClient(sqliteClient) === void 0) return;
|
|
147
|
+
if (isSqlJsClient(sqliteClient)) return;
|
|
130
148
|
return sqliteClient;
|
|
131
149
|
}
|
|
132
150
|
function getOrCreatePreparedStatement(cache, sqliteClient, sqlText, cacheMax) {
|
|
133
|
-
return
|
|
151
|
+
return chunkMUK4BU7K_cjs.getOrCreateLru(
|
|
134
152
|
cache,
|
|
135
153
|
sqlText,
|
|
136
154
|
cacheMax,
|
|
@@ -182,7 +200,7 @@ function createSqliteExecutionAdapter(db, statementCacheMaxOrOptions = {}) {
|
|
|
182
200
|
supportsCompiledExecution: sqliteClient !== void 0,
|
|
183
201
|
transactionMode
|
|
184
202
|
};
|
|
185
|
-
const compile = (query) =>
|
|
203
|
+
const compile = (query) => chunkU5SON7R2_cjs.compileQueryWithDialect(db, query, "SQLite");
|
|
186
204
|
if (sqliteClient !== void 0) {
|
|
187
205
|
let executeCompiled2 = function(compiledQuery) {
|
|
188
206
|
const preparedStatement = getOrCreatePreparedStatement(
|
|
@@ -255,7 +273,7 @@ function createSqliteExecutionAdapter(db, statementCacheMaxOrOptions = {}) {
|
|
|
255
273
|
execute(query) {
|
|
256
274
|
return executeDrizzleQuery(
|
|
257
275
|
db,
|
|
258
|
-
|
|
276
|
+
chunkVCRRKBLN_cjs.isSqlFragment(query) ? chunkU5SON7R2_cjs.toDrizzleSql(query, "sqlite") : query
|
|
259
277
|
);
|
|
260
278
|
},
|
|
261
279
|
profile
|
|
@@ -273,6 +291,12 @@ var FULLTEXT_DELETE_FIXED_PARAM_COUNT = 2;
|
|
|
273
291
|
var UNIQUE_DELETE_FIXED_PARAM_COUNT = 2;
|
|
274
292
|
var UNIQUE_INSERT_PARAM_COUNT = 6;
|
|
275
293
|
var SQLITE_ANALYZE_ROW_LIMIT = 1e3;
|
|
294
|
+
var IDENTITY_TABLE_LOGICAL_NAMES = /* @__PURE__ */ new Set([
|
|
295
|
+
"identityAssertions",
|
|
296
|
+
"recordedIdentityAssertions",
|
|
297
|
+
"identityClosure",
|
|
298
|
+
"identitySeparation"
|
|
299
|
+
]);
|
|
276
300
|
function computeSqliteBatchChunkSizes(maxBindParameters) {
|
|
277
301
|
return {
|
|
278
302
|
checkUniqueBatchChunkSize: Math.max(
|
|
@@ -281,7 +305,7 @@ function computeSqliteBatchChunkSizes(maxBindParameters) {
|
|
|
281
305
|
),
|
|
282
306
|
embeddingUpsertBatchSize: Math.max(
|
|
283
307
|
1,
|
|
284
|
-
Math.floor(maxBindParameters /
|
|
308
|
+
Math.floor(maxBindParameters / chunkMUK4BU7K_cjs.EMBEDDING_UPSERT_PARAM_COUNT)
|
|
285
309
|
),
|
|
286
310
|
fulltextUpsertBatchSize: Math.max(
|
|
287
311
|
1,
|
|
@@ -297,7 +321,7 @@ function computeSqliteBatchChunkSizes(maxBindParameters) {
|
|
|
297
321
|
),
|
|
298
322
|
findEdgesEndpointChunkSize: Math.max(
|
|
299
323
|
1,
|
|
300
|
-
maxBindParameters -
|
|
324
|
+
maxBindParameters - chunkMUK4BU7K_cjs.FIND_EDGES_ENDPOINT_FIXED_PARAM_COUNT
|
|
301
325
|
),
|
|
302
326
|
getEdgesChunkSize: Math.max(
|
|
303
327
|
1,
|
|
@@ -321,11 +345,11 @@ function computeSqliteBatchChunkSizes(maxBindParameters) {
|
|
|
321
345
|
)
|
|
322
346
|
};
|
|
323
347
|
}
|
|
324
|
-
var toNodeRow =
|
|
325
|
-
var toEdgeRow =
|
|
326
|
-
var toUniqueRow =
|
|
327
|
-
var toSchemaVersionRow =
|
|
328
|
-
|
|
348
|
+
var toNodeRow = chunkYAAM3M2S_cjs.createNodeRowMapper(chunkYAAM3M2S_cjs.SQLITE_ROW_MAPPER_CONFIG);
|
|
349
|
+
var toEdgeRow = chunkYAAM3M2S_cjs.createEdgeRowMapper(chunkYAAM3M2S_cjs.SQLITE_ROW_MAPPER_CONFIG);
|
|
350
|
+
var toUniqueRow = chunkYAAM3M2S_cjs.createUniqueRowMapper(chunkYAAM3M2S_cjs.SQLITE_ROW_MAPPER_CONFIG);
|
|
351
|
+
var toSchemaVersionRow = chunkYAAM3M2S_cjs.createSchemaVersionRowMapper(
|
|
352
|
+
chunkYAAM3M2S_cjs.SQLITE_ROW_MAPPER_CONFIG
|
|
329
353
|
);
|
|
330
354
|
var PENDING_FOREVER = new Promise(noop);
|
|
331
355
|
function pendingForever() {
|
|
@@ -344,7 +368,7 @@ async function loadQueueTaskContext() {
|
|
|
344
368
|
void loadQueueTaskContext();
|
|
345
369
|
function rejectReentrantQueueSubmission() {
|
|
346
370
|
return Promise.reject(
|
|
347
|
-
new
|
|
371
|
+
new chunkNI72YOJB_cjs.ConfigurationError(
|
|
348
372
|
"This operation was awaited from inside a transaction running on the same SQLite backend and would deadlock: the transaction holds the backend's serialized execution slot until it completes, so the operation could never run.",
|
|
349
373
|
{ backend: "sqlite", capability: "concurrentRootAccess" },
|
|
350
374
|
{
|
|
@@ -365,7 +389,7 @@ function createSerializedExecutionQueue() {
|
|
|
365
389
|
disposed = true;
|
|
366
390
|
},
|
|
367
391
|
runExclusive(task) {
|
|
368
|
-
if (isDisposed()) return Promise.reject(new
|
|
392
|
+
if (isDisposed()) return Promise.reject(new chunkNI72YOJB_cjs.BackendDisposedError());
|
|
369
393
|
if (queueTaskContext?.getStore() === taskMarker) {
|
|
370
394
|
return rejectReentrantQueueSubmission();
|
|
371
395
|
}
|
|
@@ -393,7 +417,7 @@ function runWithSerializedQueue(queue, task) {
|
|
|
393
417
|
return queue.runExclusive(task);
|
|
394
418
|
}
|
|
395
419
|
function throwSqliteTransactionsDisabled(message) {
|
|
396
|
-
throw new
|
|
420
|
+
throw new chunkNI72YOJB_cjs.ConfigurationError(message, {
|
|
397
421
|
backend: "sqlite",
|
|
398
422
|
capability: "transactions",
|
|
399
423
|
supportsTransactions: false
|
|
@@ -401,20 +425,20 @@ function throwSqliteTransactionsDisabled(message) {
|
|
|
401
425
|
}
|
|
402
426
|
function buildSqliteCapabilities(options) {
|
|
403
427
|
const base = options.transactionMode === "none" ? {
|
|
404
|
-
...
|
|
428
|
+
...chunkXBYVV3MP_cjs.SQLITE_CAPABILITIES,
|
|
405
429
|
transactions: false,
|
|
406
430
|
graphAnalytics: {
|
|
407
|
-
...
|
|
431
|
+
...chunkXBYVV3MP_cjs.SQLITE_CAPABILITIES.graphAnalytics ?? {
|
|
408
432
|
mathFunctions: false
|
|
409
433
|
},
|
|
410
434
|
supported: false
|
|
411
435
|
}
|
|
412
|
-
} :
|
|
436
|
+
} : chunkXBYVV3MP_cjs.SQLITE_CAPABILITIES;
|
|
413
437
|
return {
|
|
414
438
|
...base,
|
|
415
439
|
maxBindParameters: options.maxBindParameters,
|
|
416
|
-
fulltext:
|
|
417
|
-
...options.vectorStrategy === void 0 ? {} : { vector:
|
|
440
|
+
fulltext: chunk4UGOKMI5_cjs.buildFulltextCapabilities(options.fulltextStrategy),
|
|
441
|
+
...options.vectorStrategy === void 0 ? {} : { vector: chunk4UGOKMI5_cjs.buildVectorCapabilities(options.vectorStrategy) }
|
|
418
442
|
};
|
|
419
443
|
}
|
|
420
444
|
function resolveMaxBindParametersCapability(profile, override) {
|
|
@@ -422,7 +446,7 @@ function resolveMaxBindParametersCapability(profile, override) {
|
|
|
422
446
|
return profile.hardMaxBindParameters === void 0 ? requested : Math.min(requested, profile.hardMaxBindParameters);
|
|
423
447
|
}
|
|
424
448
|
function resolveSqliteGraphAnalyticsCapabilities(profile, override) {
|
|
425
|
-
const requested = override ??
|
|
449
|
+
const requested = override ?? chunkXBYVV3MP_cjs.SQLITE_CAPABILITIES.graphAnalytics ?? {
|
|
426
450
|
supported: false,
|
|
427
451
|
mathFunctions: false
|
|
428
452
|
};
|
|
@@ -468,7 +492,7 @@ function createSqliteOperationBackend(options) {
|
|
|
468
492
|
return runWithSerializedQueue(serializedQueue, async () => {
|
|
469
493
|
if (compiledRun === void 0) {
|
|
470
494
|
await db.run(
|
|
471
|
-
|
|
495
|
+
chunkVCRRKBLN_cjs.isSqlFragment(query) ? chunkU5SON7R2_cjs.toDrizzleSql(query, "sqlite") : query
|
|
472
496
|
);
|
|
473
497
|
return;
|
|
474
498
|
}
|
|
@@ -476,17 +500,17 @@ function createSqliteOperationBackend(options) {
|
|
|
476
500
|
});
|
|
477
501
|
}
|
|
478
502
|
const batchConfig = computeSqliteBatchChunkSizes(
|
|
479
|
-
capabilities.maxBindParameters ??
|
|
503
|
+
capabilities.maxBindParameters ?? chunkXBYVV3MP_cjs.SQLITE_MAX_BIND_PARAMETERS
|
|
480
504
|
);
|
|
481
|
-
const commonBackend =
|
|
505
|
+
const commonBackend = chunkMUK4BU7K_cjs.createCommonOperationBackend({
|
|
482
506
|
batchConfig,
|
|
483
507
|
execution: {
|
|
484
508
|
execAll,
|
|
485
509
|
execGet,
|
|
486
510
|
execRun
|
|
487
511
|
},
|
|
488
|
-
nowIso:
|
|
489
|
-
maxBindParameters: capabilities.maxBindParameters ??
|
|
512
|
+
nowIso: chunkYAAM3M2S_cjs.nowIso,
|
|
513
|
+
maxBindParameters: capabilities.maxBindParameters ?? chunkXBYVV3MP_cjs.SQLITE_MAX_BIND_PARAMETERS,
|
|
490
514
|
operationStrategy,
|
|
491
515
|
rowMappers: {
|
|
492
516
|
toEdgeRow,
|
|
@@ -506,28 +530,28 @@ function createSqliteOperationBackend(options) {
|
|
|
506
530
|
};
|
|
507
531
|
const vectorEmbeddingMethods = vectorStrategy === void 0 ? {} : {
|
|
508
532
|
async upsertEmbedding(params) {
|
|
509
|
-
const slot =
|
|
533
|
+
const slot = chunkMUK4BU7K_cjs.vectorSlotFromParams(params);
|
|
510
534
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
511
|
-
const statements = vectorStrategy.buildUpsert(slot, params,
|
|
535
|
+
const statements = vectorStrategy.buildUpsert(slot, params, chunkYAAM3M2S_cjs.nowIso());
|
|
512
536
|
try {
|
|
513
537
|
for (const statement of statements) {
|
|
514
538
|
await execRun(statement);
|
|
515
539
|
}
|
|
516
540
|
} catch (error) {
|
|
517
|
-
throw
|
|
541
|
+
throw chunkMUK4BU7K_cjs.mapVectorWriteError(error, params);
|
|
518
542
|
}
|
|
519
543
|
},
|
|
520
544
|
async upsertEmbeddingBatch(params) {
|
|
521
545
|
if (params.rows.length === 0) return;
|
|
522
|
-
const slot =
|
|
546
|
+
const slot = chunkMUK4BU7K_cjs.vectorSlotFromParams(params);
|
|
523
547
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
524
548
|
const rowsById = new Map(
|
|
525
549
|
params.rows.map((row) => [row.nodeId, row])
|
|
526
550
|
);
|
|
527
551
|
const rows = [...rowsById.values()];
|
|
528
|
-
const timestamp =
|
|
552
|
+
const timestamp = chunkYAAM3M2S_cjs.nowIso();
|
|
529
553
|
try {
|
|
530
|
-
for (const chunk2 of
|
|
554
|
+
for (const chunk2 of chunkBSFJMMV3_cjs.chunk(
|
|
531
555
|
rows,
|
|
532
556
|
batchConfig.embeddingUpsertBatchSize
|
|
533
557
|
)) {
|
|
@@ -556,11 +580,11 @@ function createSqliteOperationBackend(options) {
|
|
|
556
580
|
}
|
|
557
581
|
}
|
|
558
582
|
} catch (error) {
|
|
559
|
-
throw
|
|
583
|
+
throw chunkMUK4BU7K_cjs.mapVectorWriteError(error, params);
|
|
560
584
|
}
|
|
561
585
|
},
|
|
562
586
|
async deleteEmbedding(params) {
|
|
563
|
-
const slot =
|
|
587
|
+
const slot = chunkMUK4BU7K_cjs.vectorSlotFromParams(params);
|
|
564
588
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
565
589
|
const statements = vectorStrategy.buildDelete(slot, params);
|
|
566
590
|
for (const statement of statements) {
|
|
@@ -569,9 +593,9 @@ function createSqliteOperationBackend(options) {
|
|
|
569
593
|
},
|
|
570
594
|
async deleteEmbeddingBatch(params) {
|
|
571
595
|
if (params.nodeIds.length === 0) return;
|
|
572
|
-
const slot =
|
|
596
|
+
const slot = chunkMUK4BU7K_cjs.vectorSlotFromParams(params);
|
|
573
597
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
574
|
-
for (const nodeIds of
|
|
598
|
+
for (const nodeIds of chunkBSFJMMV3_cjs.chunk(
|
|
575
599
|
[...new Set(params.nodeIds)],
|
|
576
600
|
batchConfig.embeddingUpsertBatchSize
|
|
577
601
|
)) {
|
|
@@ -583,25 +607,33 @@ function createSqliteOperationBackend(options) {
|
|
|
583
607
|
}
|
|
584
608
|
},
|
|
585
609
|
async vectorSearch(params) {
|
|
586
|
-
|
|
587
|
-
|
|
610
|
+
chunk4UGOKMI5_cjs.assertVectorSearchLimit(params.limit);
|
|
611
|
+
chunk4UGOKMI5_cjs.resolveEfSearchOverride({
|
|
612
|
+
efSearch: params.efSearch,
|
|
613
|
+
indexType: params.indexType,
|
|
614
|
+
tuning: chunk4UGOKMI5_cjs.vectorSearchFrontierTuning(vectorStrategy),
|
|
615
|
+
transactions: capabilities.transactions,
|
|
616
|
+
dialect: "SQLite",
|
|
617
|
+
engine: vectorStrategy.name
|
|
618
|
+
});
|
|
619
|
+
const slot = chunkMUK4BU7K_cjs.vectorSlotFromParams(params);
|
|
588
620
|
const query = vectorStrategy.buildSearch(
|
|
589
621
|
slot,
|
|
590
622
|
params,
|
|
591
623
|
// Store-compiled candidates (predicates + subclass + currency)
|
|
592
624
|
// take precedence; the live-node default covers direct backend use.
|
|
593
|
-
params.candidates ??
|
|
625
|
+
params.candidates ?? chunkMUK4BU7K_cjs.buildLiveNodeCandidates(
|
|
594
626
|
tableNames.nodes,
|
|
595
627
|
params.graphId,
|
|
596
628
|
params.nodeKind,
|
|
597
|
-
|
|
629
|
+
chunkYAAM3M2S_cjs.nowIso()
|
|
598
630
|
)
|
|
599
631
|
);
|
|
600
632
|
let rows;
|
|
601
633
|
try {
|
|
602
634
|
rows = await execAll(query);
|
|
603
635
|
} catch (error) {
|
|
604
|
-
throw
|
|
636
|
+
throw chunkMUK4BU7K_cjs.mapVectorWriteError(error, params);
|
|
605
637
|
}
|
|
606
638
|
return rows.map((row) => ({
|
|
607
639
|
nodeId: row.node_id,
|
|
@@ -613,9 +645,17 @@ function createSqliteOperationBackend(options) {
|
|
|
613
645
|
// fallback by simply not exposing the member.
|
|
614
646
|
...capabilities.windowFunctions ? {
|
|
615
647
|
async hybridSearch(params) {
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
648
|
+
chunk4UGOKMI5_cjs.assertVectorSearchLimit(params.limit);
|
|
649
|
+
chunk4UGOKMI5_cjs.assertVectorSearchLimit(params.vector.k);
|
|
650
|
+
chunk4UGOKMI5_cjs.resolveEfSearchOverride({
|
|
651
|
+
efSearch: params.vector.efSearch,
|
|
652
|
+
indexType: params.vector.indexType,
|
|
653
|
+
tuning: chunk4UGOKMI5_cjs.vectorSearchFrontierTuning(vectorStrategy),
|
|
654
|
+
transactions: capabilities.transactions,
|
|
655
|
+
dialect: "SQLite",
|
|
656
|
+
engine: vectorStrategy.name
|
|
657
|
+
});
|
|
658
|
+
const slot = chunkMUK4BU7K_cjs.vectorSlotFromParams({
|
|
619
659
|
graphId: params.graphId,
|
|
620
660
|
nodeKind: params.nodeKind,
|
|
621
661
|
fieldPath: params.vector.fieldPath,
|
|
@@ -623,11 +663,11 @@ function createSqliteOperationBackend(options) {
|
|
|
623
663
|
metric: params.vector.metric,
|
|
624
664
|
indexType: params.vector.indexType
|
|
625
665
|
});
|
|
626
|
-
const candidates = params.candidates ??
|
|
666
|
+
const candidates = params.candidates ?? chunkMUK4BU7K_cjs.buildLiveNodeCandidates(
|
|
627
667
|
tableNames.nodes,
|
|
628
668
|
params.graphId,
|
|
629
669
|
params.nodeKind,
|
|
630
|
-
|
|
670
|
+
chunkYAAM3M2S_cjs.nowIso()
|
|
631
671
|
);
|
|
632
672
|
const vectorParams = {
|
|
633
673
|
graphId: params.graphId,
|
|
@@ -643,20 +683,20 @@ function createSqliteOperationBackend(options) {
|
|
|
643
683
|
const vectorSql = vectorStrategy.buildSearch(
|
|
644
684
|
slot,
|
|
645
685
|
vectorParams,
|
|
646
|
-
|
|
686
|
+
chunkVCRRKBLN_cjs.sql.raw("SELECT node_id FROM tg_hybrid_cand")
|
|
647
687
|
);
|
|
648
688
|
const statement = operationStrategy.buildHybridSearch(
|
|
649
689
|
{ ...params, candidates },
|
|
650
|
-
|
|
690
|
+
chunkU5SON7R2_cjs.toDrizzleSql(vectorSql, "sqlite"),
|
|
651
691
|
params.vector.metric === "cosine"
|
|
652
692
|
);
|
|
653
693
|
let raw;
|
|
654
694
|
try {
|
|
655
695
|
raw = await execAll(statement);
|
|
656
696
|
} catch (error) {
|
|
657
|
-
throw
|
|
697
|
+
throw chunkMUK4BU7K_cjs.mapVectorWriteError(error, vectorParams);
|
|
658
698
|
}
|
|
659
|
-
return raw.map((row) =>
|
|
699
|
+
return raw.map((row) => chunkMUK4BU7K_cjs.mapHybridSearchRow(row, toNodeRow));
|
|
660
700
|
}
|
|
661
701
|
} : {}
|
|
662
702
|
};
|
|
@@ -664,6 +704,22 @@ function createSqliteOperationBackend(options) {
|
|
|
664
704
|
...commonBackend,
|
|
665
705
|
...executeRawMethod,
|
|
666
706
|
...vectorEmbeddingMethods,
|
|
707
|
+
/**
|
|
708
|
+
* Transaction-scoped contribution marker stamp. Present so the
|
|
709
|
+
* destructive rebuild can commit its marker with the DDL that
|
|
710
|
+
* produced it; without it the stamp would land outside the
|
|
711
|
+
* transaction and could survive a rolled-back drop.
|
|
712
|
+
*
|
|
713
|
+
* States the row outright rather than reusing the top-level upsert,
|
|
714
|
+
* whose `materialized_at` COALESCE preserves an earlier success so a
|
|
715
|
+
* failed re-attempt cannot erase it. A completed rebuild replaced the
|
|
716
|
+
* storage, so the recorded timestamp must be the rebuild's.
|
|
717
|
+
*/
|
|
718
|
+
async recordContributionMaterialization(params) {
|
|
719
|
+
await execRun(
|
|
720
|
+
operationStrategy.buildInsertContributionMaterialization(params)
|
|
721
|
+
);
|
|
722
|
+
},
|
|
667
723
|
async deleteSchemaVectorSlotContribution(slot) {
|
|
668
724
|
if (vectorStrategy === void 0) return;
|
|
669
725
|
for (const contribution of vectorStrategy.ownedTables(slot)) {
|
|
@@ -685,7 +741,7 @@ function createSqliteOperationBackend(options) {
|
|
|
685
741
|
...vectorStrategy === void 0 ? {} : { vectorStrategy },
|
|
686
742
|
async lockSchemaVersionForWrite(params) {
|
|
687
743
|
if (!transactionScoped) {
|
|
688
|
-
throw new
|
|
744
|
+
throw new chunkNI72YOJB_cjs.ConfigurationError(
|
|
689
745
|
"The schema write fence requires an explicit SQLite transaction.",
|
|
690
746
|
{
|
|
691
747
|
code: "SCHEMA_WRITE_FENCE_TRANSACTION_REQUIRED",
|
|
@@ -694,7 +750,7 @@ function createSqliteOperationBackend(options) {
|
|
|
694
750
|
);
|
|
695
751
|
}
|
|
696
752
|
const active = await commonBackend.getActiveSchema(params.graphId);
|
|
697
|
-
|
|
753
|
+
chunkMUK4BU7K_cjs.assertActiveSchemaVersion(
|
|
698
754
|
params.graphId,
|
|
699
755
|
params.expectedVersion,
|
|
700
756
|
active?.version ?? 0
|
|
@@ -702,7 +758,7 @@ function createSqliteOperationBackend(options) {
|
|
|
702
758
|
},
|
|
703
759
|
async createVectorIndex(params) {
|
|
704
760
|
if (vectorStrategy === void 0) return;
|
|
705
|
-
const slot =
|
|
761
|
+
const slot = chunkMUK4BU7K_cjs.vectorSlotFromCreateIndexParams(params);
|
|
706
762
|
await contributionMaterializer.ensureVectorSlot(slot);
|
|
707
763
|
const indexStatement = vectorStrategy.buildCreateIndex?.(slot);
|
|
708
764
|
if (indexStatement !== void 0) {
|
|
@@ -711,18 +767,18 @@ function createSqliteOperationBackend(options) {
|
|
|
711
767
|
},
|
|
712
768
|
async dropVectorIndex(params) {
|
|
713
769
|
if (vectorStrategy === void 0) return;
|
|
714
|
-
const slot =
|
|
770
|
+
const slot = chunkMUK4BU7K_cjs.vectorSlotFromDropIndexParams(params);
|
|
715
771
|
const dropStatement = vectorStrategy.buildDropIndex?.(slot);
|
|
716
772
|
if (dropStatement === void 0) return;
|
|
717
773
|
try {
|
|
718
774
|
await execRun(dropStatement);
|
|
719
775
|
} catch (error) {
|
|
720
|
-
if (!
|
|
776
|
+
if (!chunkBSFJMMV3_cjs.isMissingTableError(error)) throw error;
|
|
721
777
|
}
|
|
722
778
|
},
|
|
723
779
|
// === Fulltext Operations ===
|
|
724
780
|
async upsertFulltext(params) {
|
|
725
|
-
const timestamp =
|
|
781
|
+
const timestamp = chunkYAAM3M2S_cjs.nowIso();
|
|
726
782
|
const statements = operationStrategy.buildUpsertFulltext(
|
|
727
783
|
params,
|
|
728
784
|
timestamp
|
|
@@ -739,8 +795,8 @@ function createSqliteOperationBackend(options) {
|
|
|
739
795
|
},
|
|
740
796
|
async upsertFulltextBatch(params) {
|
|
741
797
|
if (params.rows.length === 0) return;
|
|
742
|
-
const timestamp =
|
|
743
|
-
for (const rows of
|
|
798
|
+
const timestamp = chunkYAAM3M2S_cjs.nowIso();
|
|
799
|
+
for (const rows of chunkBSFJMMV3_cjs.chunk(
|
|
744
800
|
params.rows,
|
|
745
801
|
batchConfig.fulltextUpsertBatchSize
|
|
746
802
|
)) {
|
|
@@ -755,7 +811,7 @@ function createSqliteOperationBackend(options) {
|
|
|
755
811
|
},
|
|
756
812
|
async deleteFulltextBatch(params) {
|
|
757
813
|
if (params.nodeIds.length === 0) return;
|
|
758
|
-
for (const nodeIds of
|
|
814
|
+
for (const nodeIds of chunkBSFJMMV3_cjs.chunk(
|
|
759
815
|
params.nodeIds,
|
|
760
816
|
batchConfig.fulltextDeleteChunkSize
|
|
761
817
|
)) {
|
|
@@ -773,7 +829,7 @@ function createSqliteOperationBackend(options) {
|
|
|
773
829
|
const rows = await execAll(query);
|
|
774
830
|
return rows.map((row, index) => ({
|
|
775
831
|
nodeId: row.node_id,
|
|
776
|
-
score:
|
|
832
|
+
score: chunkYAAM3M2S_cjs.coerceNumericScore(row.score),
|
|
777
833
|
rank: index + 1,
|
|
778
834
|
...row.snippet === null ? {} : { snippet: row.snippet }
|
|
779
835
|
}));
|
|
@@ -791,15 +847,30 @@ function createSqliteOperationBackend(options) {
|
|
|
791
847
|
};
|
|
792
848
|
return operationBackend;
|
|
793
849
|
}
|
|
850
|
+
function isLocalLibsqlClient(client) {
|
|
851
|
+
if (typeof client !== "object" || client === null) return false;
|
|
852
|
+
const candidate = client;
|
|
853
|
+
return candidate["protocol"] === "file" && typeof candidate["execute"] === "function" && typeof candidate["batch"] === "function" && typeof candidate["executeMultiple"] === "function";
|
|
854
|
+
}
|
|
855
|
+
function getSerializedSqliteConnection(db) {
|
|
856
|
+
const client = db.$client;
|
|
857
|
+
if (isBetterSqlite3Client(client) || isBunSqliteClient(client) || isSqlJsClient(client)) {
|
|
858
|
+
return client;
|
|
859
|
+
}
|
|
860
|
+
const storageClient = getDurableObjectStorageClient(db);
|
|
861
|
+
if (storageClient !== void 0) return storageClient;
|
|
862
|
+
return isLocalLibsqlClient(client) ? client : void 0;
|
|
863
|
+
}
|
|
794
864
|
function createSqliteBackend(db, options = {}) {
|
|
795
|
-
const
|
|
796
|
-
const
|
|
865
|
+
const serializedConnection = getSerializedSqliteConnection(db);
|
|
866
|
+
const tables2 = options.tables ?? chunkRMQLSPA2_cjs.tables2;
|
|
867
|
+
const fulltextStrategy = options.fulltext ?? chunk4UGOKMI5_cjs.fts5Strategy;
|
|
797
868
|
const profileHints = options.executionProfile ?? {};
|
|
798
869
|
const executionAdapter = createSqliteExecutionAdapter(db, { profileHints });
|
|
799
870
|
const { isSync, transactionMode } = executionAdapter.profile;
|
|
800
871
|
const vectorStrategy = options.vector;
|
|
801
872
|
const capabilityOverrides = options.capabilities ?? {};
|
|
802
|
-
const
|
|
873
|
+
const declaredCapabilities = chunkXBYVV3MP_cjs.normalizeGraphAnalyticsCapabilities({
|
|
803
874
|
...buildSqliteCapabilities({
|
|
804
875
|
fulltextStrategy,
|
|
805
876
|
vectorStrategy,
|
|
@@ -816,6 +887,18 @@ function createSqliteBackend(db, options = {}) {
|
|
|
816
887
|
capabilityOverrides.graphAnalytics
|
|
817
888
|
)
|
|
818
889
|
});
|
|
890
|
+
const capabilities = {
|
|
891
|
+
...declaredCapabilities,
|
|
892
|
+
contributions: {
|
|
893
|
+
supported: true,
|
|
894
|
+
probe: true,
|
|
895
|
+
rebuild: chunkMUK4BU7K_cjs.contributionRebuildSupported(
|
|
896
|
+
fulltextStrategy,
|
|
897
|
+
tables2.fulltextTableName,
|
|
898
|
+
declaredCapabilities.transactions
|
|
899
|
+
)
|
|
900
|
+
}
|
|
901
|
+
};
|
|
819
902
|
const tableNames = {
|
|
820
903
|
nodes: drizzleOrm.getTableName(tables2.nodes),
|
|
821
904
|
edges: drizzleOrm.getTableName(tables2.edges),
|
|
@@ -823,6 +906,10 @@ function createSqliteBackend(db, options = {}) {
|
|
|
823
906
|
recordedEdges: drizzleOrm.getTableName(tables2.recordedEdges),
|
|
824
907
|
recordedClock: drizzleOrm.getTableName(tables2.recordedClock),
|
|
825
908
|
revisionOrigins: drizzleOrm.getTableName(tables2.revisionOrigins),
|
|
909
|
+
identityAssertions: drizzleOrm.getTableName(tables2.identityAssertions),
|
|
910
|
+
recordedIdentityAssertions: drizzleOrm.getTableName(tables2.recordedIdentityAssertions),
|
|
911
|
+
identityClosure: drizzleOrm.getTableName(tables2.identityClosure),
|
|
912
|
+
identitySeparation: drizzleOrm.getTableName(tables2.identitySeparation),
|
|
826
913
|
fulltext: tables2.fulltextTableName,
|
|
827
914
|
uniques: drizzleOrm.getTableName(tables2.uniques)
|
|
828
915
|
};
|
|
@@ -832,19 +919,23 @@ function createSqliteBackend(db, options = {}) {
|
|
|
832
919
|
tableNames.uniques,
|
|
833
920
|
tableNames.fulltext
|
|
834
921
|
];
|
|
835
|
-
const
|
|
922
|
+
const guardedAnalyzeTables = [
|
|
836
923
|
tableNames.recordedNodes,
|
|
837
924
|
tableNames.recordedEdges,
|
|
838
|
-
tableNames.recordedClock
|
|
925
|
+
tableNames.recordedClock,
|
|
926
|
+
tableNames.recordedIdentityAssertions,
|
|
927
|
+
tableNames.identityAssertions,
|
|
928
|
+
tableNames.identityClosure,
|
|
929
|
+
tableNames.identitySeparation
|
|
839
930
|
];
|
|
840
|
-
const operationStrategy =
|
|
931
|
+
const operationStrategy = chunkMUK4BU7K_cjs.createSqliteOperationStrategy(
|
|
841
932
|
tables2,
|
|
842
933
|
fulltextStrategy
|
|
843
934
|
);
|
|
844
935
|
const serializedQueue = transactionMode === "none" ? void 0 : createSerializedExecutionQueue();
|
|
845
936
|
const matTable = tables2.contributionMaterializations;
|
|
846
937
|
async function ensureContributionMaterializationsTableImpl() {
|
|
847
|
-
await db.run(drizzleOrm.sql.raw(
|
|
938
|
+
await db.run(drizzleOrm.sql.raw(chunkRMQLSPA2_cjs.generateSqliteCreateTableSQL(matTable)));
|
|
848
939
|
}
|
|
849
940
|
async function getContributionMaterializationRow(identity) {
|
|
850
941
|
const rows = await db.select().from(matTable).where(
|
|
@@ -857,25 +948,25 @@ function createSqliteBackend(db, options = {}) {
|
|
|
857
948
|
);
|
|
858
949
|
const row = rows[0];
|
|
859
950
|
if (row === void 0) return void 0;
|
|
860
|
-
return
|
|
951
|
+
return chunkMUK4BU7K_cjs.mapContributionMaterializationRow(
|
|
861
952
|
row,
|
|
862
|
-
|
|
953
|
+
chunkMUK4BU7K_cjs.SQLITE_CONTRIBUTION_MAT_TIMESTAMPS.decode
|
|
863
954
|
);
|
|
864
955
|
}
|
|
865
956
|
async function getContributionMaterializationRows(graphId) {
|
|
866
957
|
const rows = await db.select().from(matTable).where(drizzleOrm.eq(matTable.graphId, graphId));
|
|
867
958
|
return rows.map(
|
|
868
|
-
(row) =>
|
|
959
|
+
(row) => chunkMUK4BU7K_cjs.mapContributionMaterializationRow(
|
|
869
960
|
row,
|
|
870
|
-
|
|
961
|
+
chunkMUK4BU7K_cjs.SQLITE_CONTRIBUTION_MAT_TIMESTAMPS.decode
|
|
871
962
|
)
|
|
872
963
|
);
|
|
873
964
|
}
|
|
874
965
|
async function recordContributionMaterializationRow(params) {
|
|
875
966
|
await db.insert(matTable).values(
|
|
876
|
-
|
|
967
|
+
chunkMUK4BU7K_cjs.buildContributionInsertValues(
|
|
877
968
|
params,
|
|
878
|
-
|
|
969
|
+
chunkMUK4BU7K_cjs.SQLITE_CONTRIBUTION_MAT_TIMESTAMPS.encode
|
|
879
970
|
)
|
|
880
971
|
).onConflictDoUpdate({
|
|
881
972
|
target: [
|
|
@@ -884,7 +975,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
884
975
|
matTable.owner,
|
|
885
976
|
matTable.tableName
|
|
886
977
|
],
|
|
887
|
-
set:
|
|
978
|
+
set: chunkMUK4BU7K_cjs.buildContributionOnConflictSet(
|
|
888
979
|
matTable.materializedAt,
|
|
889
980
|
params.materializedAt
|
|
890
981
|
)
|
|
@@ -904,9 +995,20 @@ function createSqliteBackend(db, options = {}) {
|
|
|
904
995
|
const rows = await executionAdapter.execute(
|
|
905
996
|
operationStrategy.buildTableExists(tableName)
|
|
906
997
|
);
|
|
907
|
-
return
|
|
998
|
+
return chunkMUK4BU7K_cjs.tableExistsFromRow(rows[0]);
|
|
908
999
|
}
|
|
909
|
-
|
|
1000
|
+
function identityContributionsFor(identityTableNames) {
|
|
1001
|
+
const identityTables = chunkRMQLSPA2_cjs.createSqliteTables({
|
|
1002
|
+
identityAssertions: identityTableNames.identityAssertions,
|
|
1003
|
+
recordedIdentityAssertions: identityTableNames.recordedIdentityAssertions,
|
|
1004
|
+
identityClosure: identityTableNames.identityClosure,
|
|
1005
|
+
identitySeparation: identityTableNames.identitySeparation
|
|
1006
|
+
});
|
|
1007
|
+
return chunkRMQLSPA2_cjs.sqliteContributions(identityTables, fulltextStrategy).filter(
|
|
1008
|
+
(contribution) => IDENTITY_TABLE_LOGICAL_NAMES.has(contribution.logicalName)
|
|
1009
|
+
);
|
|
1010
|
+
}
|
|
1011
|
+
const contributionMaterializer = chunkMUK4BU7K_cjs.createContributionMaterializer({
|
|
910
1012
|
dialect: "sqlite",
|
|
911
1013
|
fulltextStrategy,
|
|
912
1014
|
fulltextTableName: tables2.fulltextTableName,
|
|
@@ -918,7 +1020,15 @@ function createSqliteBackend(db, options = {}) {
|
|
|
918
1020
|
getMarkers: getContributionMaterializationRows,
|
|
919
1021
|
recordMarker: recordContributionMaterializationRow,
|
|
920
1022
|
deleteMarker: deleteContributionMaterializationRow,
|
|
921
|
-
tableExists: contributionTableExists
|
|
1023
|
+
tableExists: contributionTableExists,
|
|
1024
|
+
// Withheld rather than wired-and-throwing when transactions are
|
|
1025
|
+
// disabled: the rebuild must refuse with its own typed error naming
|
|
1026
|
+
// the absent fence, matching `capabilities.contributions.rebuild`.
|
|
1027
|
+
// The graph id the materializer passes is unused — this backend's
|
|
1028
|
+
// schema lock is per connection, not per graph.
|
|
1029
|
+
...capabilities.transactions ? {
|
|
1030
|
+
schemaWriteTransaction: (_graphId, fn) => runSchemaWriteTransaction((target) => fn(target))
|
|
1031
|
+
} : {}
|
|
922
1032
|
});
|
|
923
1033
|
const operations = createSqliteOperationBackend({
|
|
924
1034
|
capabilities,
|
|
@@ -952,6 +1062,16 @@ function createSqliteBackend(db, options = {}) {
|
|
|
952
1062
|
}
|
|
953
1063
|
await compiledRun(executionAdapter.compile(query));
|
|
954
1064
|
}
|
|
1065
|
+
async function rollbackFrameQuietly() {
|
|
1066
|
+
try {
|
|
1067
|
+
await runFrameStatement(drizzleOrm.sql`ROLLBACK`);
|
|
1068
|
+
} catch (rollbackError) {
|
|
1069
|
+
console.warn(
|
|
1070
|
+
"typegraph: ROLLBACK failed while unwinding a failed SQLite transaction; the original failure is the one thrown. Either the frame was already closed (SQLite auto-rolls-back on SQLITE_FULL / SQLITE_IOERR / SQLITE_NOMEM) and nothing is leaked, or it is still open on this connection, in which case the next BEGIN here fails.",
|
|
1071
|
+
rollbackError
|
|
1072
|
+
);
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
955
1075
|
function runSchemaWriteTransaction(fn) {
|
|
956
1076
|
if (transactionMode === "none") {
|
|
957
1077
|
throwSqliteTransactionsDisabled(
|
|
@@ -977,7 +1097,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
977
1097
|
await runFrameStatement(drizzleOrm.sql`COMMIT`);
|
|
978
1098
|
return result;
|
|
979
1099
|
} catch (error) {
|
|
980
|
-
await
|
|
1100
|
+
await rollbackFrameQuietly();
|
|
981
1101
|
throw error;
|
|
982
1102
|
}
|
|
983
1103
|
});
|
|
@@ -1028,7 +1148,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1028
1148
|
vectorStrategy,
|
|
1029
1149
|
contributionMaterializer
|
|
1030
1150
|
});
|
|
1031
|
-
return
|
|
1151
|
+
return chunkMUK4BU7K_cjs.gateFulltext(txBackend, contributionMaterializer.assertInitialized);
|
|
1032
1152
|
}
|
|
1033
1153
|
const backend = {
|
|
1034
1154
|
...operations,
|
|
@@ -1036,33 +1156,55 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1036
1156
|
async trustedImport(fn, options_) {
|
|
1037
1157
|
return backend.transaction(async (tx) => {
|
|
1038
1158
|
if (options_?.schemaWrite !== void 0) {
|
|
1039
|
-
await
|
|
1159
|
+
await chunkN66HCGCY_cjs.requireDefined(tx.lockSchemaVersionForWrite)({
|
|
1040
1160
|
...options_.schemaWrite
|
|
1041
1161
|
});
|
|
1042
1162
|
}
|
|
1043
|
-
await
|
|
1044
|
-
const indexDefinitions = await
|
|
1163
|
+
await chunkMUK4BU7K_cjs.assertTrustedImportDatabaseEmpty(tx, tableNames);
|
|
1164
|
+
const indexDefinitions = await chunkMUK4BU7K_cjs.suspendSqliteSecondaryIndexes(
|
|
1045
1165
|
tx,
|
|
1046
1166
|
tableNames
|
|
1047
1167
|
);
|
|
1048
1168
|
const result = await fn(
|
|
1049
|
-
|
|
1169
|
+
chunkMUK4BU7K_cjs.createSqliteTrustedImportSession(executionAdapter, tableNames)
|
|
1050
1170
|
);
|
|
1051
|
-
await
|
|
1052
|
-
await
|
|
1171
|
+
await chunkMUK4BU7K_cjs.restoreSecondaryIndexes(tx, indexDefinitions);
|
|
1172
|
+
await chunkMUK4BU7K_cjs.analyzeImportedTables(tx, tableNames);
|
|
1053
1173
|
return result;
|
|
1054
1174
|
});
|
|
1055
1175
|
}
|
|
1056
1176
|
} : {},
|
|
1057
1177
|
async bootstrapTables() {
|
|
1058
|
-
const statements =
|
|
1178
|
+
const statements = chunkRMQLSPA2_cjs.generateSqliteDDL(tables2, fulltextStrategy);
|
|
1059
1179
|
for (const statement of statements) {
|
|
1060
1180
|
await db.run(drizzleOrm.sql.raw(statement));
|
|
1061
1181
|
}
|
|
1062
1182
|
},
|
|
1063
1183
|
async ensureRevisionOriginsTable() {
|
|
1064
1184
|
await db.run(
|
|
1065
|
-
drizzleOrm.sql.raw(
|
|
1185
|
+
drizzleOrm.sql.raw(chunkRMQLSPA2_cjs.generateSqliteCreateTableSQL(tables2.revisionOrigins))
|
|
1186
|
+
);
|
|
1187
|
+
},
|
|
1188
|
+
async ensureIdentityTables(identityTableNames, options2) {
|
|
1189
|
+
const identityContributions = identityContributionsFor(identityTableNames);
|
|
1190
|
+
const missing = [];
|
|
1191
|
+
for (const contribution of identityContributions) {
|
|
1192
|
+
if (!await contributionTableExists(contribution.tableName)) {
|
|
1193
|
+
missing.push(contribution.logicalName);
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
if (missing.length === 0 || options2.provisionMissing) {
|
|
1197
|
+
for (const contribution of identityContributions) {
|
|
1198
|
+
for (const ddl of contribution.createDdl) {
|
|
1199
|
+
await db.run(drizzleOrm.sql.raw(ddl));
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
return missing;
|
|
1204
|
+
},
|
|
1205
|
+
identityTableDdl(identityTableNames) {
|
|
1206
|
+
return identityContributionsFor(identityTableNames).flatMap(
|
|
1207
|
+
(contribution) => [...contribution.createDdl]
|
|
1066
1208
|
);
|
|
1067
1209
|
},
|
|
1068
1210
|
// Every fulltext-touching method asserts the durable marker instead
|
|
@@ -1070,7 +1212,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1070
1212
|
// uninitialized database throws `StoreNotInitializedError` rather
|
|
1071
1213
|
// than self-healing (#135). Shared verbatim with the tx-scoped gate
|
|
1072
1214
|
// via `gateFulltextMethods`.
|
|
1073
|
-
...
|
|
1215
|
+
...chunkMUK4BU7K_cjs.gateFulltextMethods(
|
|
1074
1216
|
operations,
|
|
1075
1217
|
contributionMaterializer.assertInitialized
|
|
1076
1218
|
),
|
|
@@ -1079,7 +1221,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1079
1221
|
},
|
|
1080
1222
|
async ensureIndexMaterializationsTable() {
|
|
1081
1223
|
await db.run(
|
|
1082
|
-
drizzleOrm.sql.raw(
|
|
1224
|
+
drizzleOrm.sql.raw(chunkRMQLSPA2_cjs.generateSqliteCreateTableSQL(tables2.indexMaterializations))
|
|
1083
1225
|
);
|
|
1084
1226
|
},
|
|
1085
1227
|
async getIndexMaterialization(indexName) {
|
|
@@ -1087,26 +1229,26 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1087
1229
|
const rows = await db.select().from(t).where(drizzleOrm.eq(t.indexName, indexName));
|
|
1088
1230
|
const row = rows[0];
|
|
1089
1231
|
if (row === void 0) return void 0;
|
|
1090
|
-
return
|
|
1232
|
+
return chunkMUK4BU7K_cjs.mapMaterializationRow(row, chunkMUK4BU7K_cjs.SQLITE_INDEX_MAT_TIMESTAMPS.decode);
|
|
1091
1233
|
},
|
|
1092
1234
|
async getIndexMaterializations(statusKeys) {
|
|
1093
1235
|
if (statusKeys.length === 0) return [];
|
|
1094
1236
|
const t = tables2.indexMaterializations;
|
|
1095
1237
|
const rows = await db.select().from(t).where(drizzleOrm.inArray(t.indexName, [...statusKeys]));
|
|
1096
1238
|
return rows.map(
|
|
1097
|
-
(row) =>
|
|
1239
|
+
(row) => chunkMUK4BU7K_cjs.mapMaterializationRow(row, chunkMUK4BU7K_cjs.SQLITE_INDEX_MAT_TIMESTAMPS.decode)
|
|
1098
1240
|
);
|
|
1099
1241
|
},
|
|
1100
1242
|
async recordIndexMaterialization(params) {
|
|
1101
1243
|
const t = tables2.indexMaterializations;
|
|
1102
1244
|
await db.insert(t).values(
|
|
1103
|
-
|
|
1245
|
+
chunkMUK4BU7K_cjs.buildMaterializationInsertValues(
|
|
1104
1246
|
params,
|
|
1105
|
-
|
|
1247
|
+
chunkMUK4BU7K_cjs.SQLITE_INDEX_MAT_TIMESTAMPS.encode
|
|
1106
1248
|
)
|
|
1107
1249
|
).onConflictDoUpdate({
|
|
1108
1250
|
target: t.indexName,
|
|
1109
|
-
set:
|
|
1251
|
+
set: chunkMUK4BU7K_cjs.buildMaterializationOnConflictSet(params.materializedAt)
|
|
1110
1252
|
});
|
|
1111
1253
|
},
|
|
1112
1254
|
async ensureContributionMaterializationsTable() {
|
|
@@ -1122,37 +1264,37 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1122
1264
|
await contributionMaterializer.assertInitialized(graphId);
|
|
1123
1265
|
},
|
|
1124
1266
|
async ensureKindRemovalsTable() {
|
|
1125
|
-
await db.run(drizzleOrm.sql.raw(
|
|
1267
|
+
await db.run(drizzleOrm.sql.raw(chunkRMQLSPA2_cjs.generateSqliteCreateTableSQL(tables2.kindRemovals)));
|
|
1126
1268
|
},
|
|
1127
1269
|
async getPendingKindRemovals(graphId) {
|
|
1128
1270
|
const t = tables2.kindRemovals;
|
|
1129
1271
|
const rows = await db.select().from(t).where(drizzleOrm.and(drizzleOrm.eq(t.graphId, graphId), drizzleOrm.isNull(t.removedAt)));
|
|
1130
1272
|
return rows.map(
|
|
1131
|
-
(row) =>
|
|
1273
|
+
(row) => chunkMUK4BU7K_cjs.mapKindRemovalRow(row, chunkMUK4BU7K_cjs.SQLITE_KIND_REMOVAL_TIMESTAMPS.decode)
|
|
1132
1274
|
);
|
|
1133
1275
|
},
|
|
1134
1276
|
async getAllKindRemovals(graphId) {
|
|
1135
1277
|
const t = tables2.kindRemovals;
|
|
1136
1278
|
const rows = await db.select().from(t).where(drizzleOrm.eq(t.graphId, graphId));
|
|
1137
1279
|
return rows.map(
|
|
1138
|
-
(row) =>
|
|
1280
|
+
(row) => chunkMUK4BU7K_cjs.mapKindRemovalRow(row, chunkMUK4BU7K_cjs.SQLITE_KIND_REMOVAL_TIMESTAMPS.decode)
|
|
1139
1281
|
);
|
|
1140
1282
|
},
|
|
1141
1283
|
async recordKindRemoval(params) {
|
|
1142
1284
|
const t = tables2.kindRemovals;
|
|
1143
1285
|
await db.insert(t).values(
|
|
1144
|
-
|
|
1286
|
+
chunkMUK4BU7K_cjs.buildKindRemovalInsertValues(
|
|
1145
1287
|
params,
|
|
1146
|
-
|
|
1288
|
+
chunkMUK4BU7K_cjs.SQLITE_KIND_REMOVAL_TIMESTAMPS.encode
|
|
1147
1289
|
)
|
|
1148
1290
|
).onConflictDoUpdate({
|
|
1149
1291
|
target: [t.graphId, t.kindName, t.entity, t.schemaVersion],
|
|
1150
|
-
set:
|
|
1292
|
+
set: chunkMUK4BU7K_cjs.buildKindRemovalOnConflictSet(t.removedAt, params.removedAt)
|
|
1151
1293
|
});
|
|
1152
1294
|
},
|
|
1153
1295
|
async ensureReconciliationMarkersTable() {
|
|
1154
1296
|
await db.run(
|
|
1155
|
-
drizzleOrm.sql.raw(
|
|
1297
|
+
drizzleOrm.sql.raw(chunkRMQLSPA2_cjs.generateSqliteCreateTableSQL(tables2.reconciliationMarkers))
|
|
1156
1298
|
);
|
|
1157
1299
|
},
|
|
1158
1300
|
async ensureRuntimeContributions(graphId) {
|
|
@@ -1172,6 +1314,16 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1172
1314
|
async repairContributions(graphId, vectorSlots) {
|
|
1173
1315
|
return contributionMaterializer.repairContributions(graphId, vectorSlots);
|
|
1174
1316
|
},
|
|
1317
|
+
async probeContributions(graphId, vectorSlots) {
|
|
1318
|
+
return contributionMaterializer.probeContributions(graphId, vectorSlots);
|
|
1319
|
+
},
|
|
1320
|
+
async rebuildContribution(graphId, scope, repopulate) {
|
|
1321
|
+
return contributionMaterializer.rebuildContribution(
|
|
1322
|
+
graphId,
|
|
1323
|
+
scope,
|
|
1324
|
+
repopulate
|
|
1325
|
+
);
|
|
1326
|
+
},
|
|
1175
1327
|
// Vector counterparts of the runtime-contribution methods. Present
|
|
1176
1328
|
// only when a vector strategy is wired (omitted on a plain SQLite
|
|
1177
1329
|
// connection with no vector extension), mirroring the embedding/
|
|
@@ -1208,32 +1360,32 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1208
1360
|
async refreshStatistics() {
|
|
1209
1361
|
try {
|
|
1210
1362
|
await db.run(
|
|
1211
|
-
|
|
1212
|
-
|
|
1363
|
+
chunkU5SON7R2_cjs.toDrizzleSql(
|
|
1364
|
+
chunkVCRRKBLN_cjs.sql`PRAGMA analysis_limit = ${chunkVCRRKBLN_cjs.sql.raw(String(SQLITE_ANALYZE_ROW_LIMIT))}`,
|
|
1213
1365
|
"sqlite"
|
|
1214
1366
|
)
|
|
1215
1367
|
);
|
|
1216
1368
|
} catch (error) {
|
|
1217
|
-
if (!
|
|
1369
|
+
if (!chunkBSFJMMV3_cjs.isSqliteNotAuthorizedError(error)) throw error;
|
|
1218
1370
|
}
|
|
1219
1371
|
for (const tableName of coreAnalyzeTables) {
|
|
1220
1372
|
await db.run(
|
|
1221
|
-
|
|
1222
|
-
|
|
1373
|
+
chunkU5SON7R2_cjs.toDrizzleSql(
|
|
1374
|
+
chunkVCRRKBLN_cjs.sql`ANALYZE ${chunkVCRRKBLN_cjs.sql.identifier(tableName)}`,
|
|
1223
1375
|
"sqlite"
|
|
1224
1376
|
)
|
|
1225
1377
|
);
|
|
1226
1378
|
}
|
|
1227
|
-
for (const tableName of
|
|
1379
|
+
for (const tableName of guardedAnalyzeTables) {
|
|
1228
1380
|
try {
|
|
1229
1381
|
await db.run(
|
|
1230
|
-
|
|
1231
|
-
|
|
1382
|
+
chunkU5SON7R2_cjs.toDrizzleSql(
|
|
1383
|
+
chunkVCRRKBLN_cjs.sql`ANALYZE ${chunkVCRRKBLN_cjs.sql.identifier(tableName)}`,
|
|
1232
1384
|
"sqlite"
|
|
1233
1385
|
)
|
|
1234
1386
|
);
|
|
1235
1387
|
} catch (error) {
|
|
1236
|
-
if (!
|
|
1388
|
+
if (!chunkBSFJMMV3_cjs.isMissingTableError(error)) throw error;
|
|
1237
1389
|
}
|
|
1238
1390
|
}
|
|
1239
1391
|
},
|
|
@@ -1244,9 +1396,15 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1244
1396
|
},
|
|
1245
1397
|
async commitSchemaVersionIfKindsEmpty(params, probes) {
|
|
1246
1398
|
return runSchemaWriteTransaction(
|
|
1247
|
-
(target) =>
|
|
1399
|
+
(target) => chunkMUK4BU7K_cjs.commitSchemaVersionIfKindsEmpty(target, params, probes)
|
|
1248
1400
|
);
|
|
1249
1401
|
},
|
|
1402
|
+
async commitSchemaVersionWithPreflight(params, preflight) {
|
|
1403
|
+
return runSchemaWriteTransaction(async (target) => {
|
|
1404
|
+
await preflight(target);
|
|
1405
|
+
return target.commitSchemaVersion(params);
|
|
1406
|
+
});
|
|
1407
|
+
},
|
|
1250
1408
|
async setActiveVersion(params) {
|
|
1251
1409
|
await runSchemaWriteTransaction(
|
|
1252
1410
|
(target) => target.setActiveVersion(params)
|
|
@@ -1259,9 +1417,9 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1259
1417
|
return backend.transactionWithNative((tx) => fn(tx), options2);
|
|
1260
1418
|
},
|
|
1261
1419
|
async transactionWithNative(fn, options2) {
|
|
1262
|
-
const temporaryWrites = options2?.temporaryWrites ===
|
|
1420
|
+
const temporaryWrites = options2?.temporaryWrites === chunkXBYVV3MP_cjs.INTERNAL_TEMPORARY_WRITES;
|
|
1263
1421
|
if (temporaryWrites && options2.accessMode !== "read_only") {
|
|
1264
|
-
throw new
|
|
1422
|
+
throw new chunkNI72YOJB_cjs.ConfigurationError(
|
|
1265
1423
|
"Temporary-write transactions must be semantically read-only.",
|
|
1266
1424
|
{ dialect: "sqlite" }
|
|
1267
1425
|
);
|
|
@@ -1289,7 +1447,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1289
1447
|
);
|
|
1290
1448
|
try {
|
|
1291
1449
|
const result = await fn(
|
|
1292
|
-
|
|
1450
|
+
chunkMUK4BU7K_cjs.gateFulltext(
|
|
1293
1451
|
txBackend,
|
|
1294
1452
|
contributionMaterializer.assertInitialized
|
|
1295
1453
|
),
|
|
@@ -1298,7 +1456,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1298
1456
|
await runFrameStatement(drizzleOrm.sql`COMMIT`);
|
|
1299
1457
|
return result;
|
|
1300
1458
|
} catch (error) {
|
|
1301
|
-
await
|
|
1459
|
+
await rollbackFrameQuietly();
|
|
1302
1460
|
throw error;
|
|
1303
1461
|
}
|
|
1304
1462
|
});
|
|
@@ -1321,7 +1479,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1321
1479
|
"Cross-store atomicity is unavailable on this SQLite backend: transactions are disabled (transactionMode: 'none'). Adopting an external transaction here would let the caller's relational write commit with no way to roll back the graph write. Configure a driver that supports transactions (better-sqlite3, libsql, bun:sqlite)."
|
|
1322
1480
|
);
|
|
1323
1481
|
}
|
|
1324
|
-
|
|
1482
|
+
chunkMUK4BU7K_cjs.assertAdoptedDialect(
|
|
1325
1483
|
externalTx,
|
|
1326
1484
|
sqliteCore.BaseSQLiteDatabase,
|
|
1327
1485
|
"sqlite"
|
|
@@ -1333,6 +1491,9 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1333
1491
|
return Promise.resolve();
|
|
1334
1492
|
}
|
|
1335
1493
|
};
|
|
1494
|
+
if (serializedConnection !== void 0) {
|
|
1495
|
+
chunkXBYVV3MP_cjs.markSerializedTransactionResource(backend, serializedConnection);
|
|
1496
|
+
}
|
|
1336
1497
|
return backend;
|
|
1337
1498
|
}
|
|
1338
1499
|
function createTransactionBackend(options) {
|
|
@@ -1353,5 +1514,6 @@ function createTransactionBackend(options) {
|
|
|
1353
1514
|
}
|
|
1354
1515
|
|
|
1355
1516
|
exports.createSqliteBackend = createSqliteBackend;
|
|
1356
|
-
|
|
1357
|
-
//# sourceMappingURL=chunk-
|
|
1517
|
+
exports.isLocalLibsqlClient = isLocalLibsqlClient;
|
|
1518
|
+
//# sourceMappingURL=chunk-YVWGEQJE.cjs.map
|
|
1519
|
+
//# sourceMappingURL=chunk-YVWGEQJE.cjs.map
|