@nicia-ai/typegraph 0.44.0 → 0.46.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 +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 -43
- 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 -39
- 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 -44
- 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 -40
- 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-XMYJY7NI.js → chunk-2LG2XB2M.js} +3 -3
- package/dist/{chunk-XMYJY7NI.js.map → chunk-2LG2XB2M.js.map} +1 -1
- package/dist/{chunk-QGKILWGZ.cjs → chunk-2NA5DYLO.cjs} +4 -4
- package/dist/{chunk-QGKILWGZ.cjs.map → chunk-2NA5DYLO.cjs.map} +1 -1
- package/dist/{chunk-5MUSU4ZP.cjs → chunk-3DHZCOT7.cjs} +20 -20
- package/dist/chunk-3DHZCOT7.cjs.map +1 -0
- package/dist/{chunk-OVUUTCPJ.cjs → chunk-4UGOKMI5.cjs} +268 -150
- package/dist/chunk-4UGOKMI5.cjs.map +1 -0
- package/dist/{chunk-FRHHDHKH.js → chunk-5262ZMTR.js} +26 -5
- package/dist/chunk-5262ZMTR.js.map +1 -0
- package/dist/{chunk-HOIFFY4M.js → chunk-5763DULU.js} +248 -76
- package/dist/chunk-5763DULU.js.map +1 -0
- package/dist/{chunk-7G32LIQM.js → chunk-5UVRGXD3.js} +277 -7
- package/dist/chunk-5UVRGXD3.js.map +1 -0
- package/dist/{chunk-IIT5K7SK.cjs → chunk-62ZP23AW.cjs} +15 -15
- package/dist/{chunk-IIT5K7SK.cjs.map → chunk-62ZP23AW.cjs.map} +1 -1
- package/dist/{chunk-S4KQ5LV4.js → chunk-775A4ZMN.js} +40 -6
- package/dist/chunk-775A4ZMN.js.map +1 -0
- package/dist/{chunk-QYWINYEA.cjs → chunk-7BQXPCGN.cjs} +830 -170
- 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-7GT72YHH.cjs +1979 -0
- package/dist/chunk-7GT72YHH.cjs.map +1 -0
- package/dist/{chunk-SQRD2CYF.js → chunk-7VQXLT5O.js} +717 -76
- package/dist/chunk-7VQXLT5O.js.map +1 -0
- package/dist/{chunk-BCP7LLOY.js → chunk-7Z5OR7KO.js} +2706 -625
- package/dist/chunk-7Z5OR7KO.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-FMMIX6N4.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-PAW2XUZN.js → chunk-ASTI57H3.js} +3 -3
- package/dist/{chunk-PAW2XUZN.js.map → chunk-ASTI57H3.js.map} +1 -1
- package/dist/{chunk-FMGEZBAQ.js → chunk-BKCUOV7A.js} +27 -5
- package/dist/chunk-BKCUOV7A.js.map +1 -0
- package/dist/chunk-BSFJMMV3.cjs +268 -0
- package/dist/chunk-BSFJMMV3.cjs.map +1 -0
- package/dist/{chunk-63KCKSSH.js → chunk-C23WSN5E.js} +209 -24
- package/dist/chunk-C23WSN5E.js.map +1 -0
- package/dist/{chunk-JRP3VGHS.js → chunk-CBTIUB76.js} +3 -3
- package/dist/{chunk-JRP3VGHS.js.map → chunk-CBTIUB76.js.map} +1 -1
- package/dist/chunk-CNV4TXJG.js +58 -0
- package/dist/chunk-CNV4TXJG.js.map +1 -0
- package/dist/{chunk-QB6VMOJ2.cjs → chunk-CXBHOOIQ.cjs} +45 -10
- package/dist/chunk-CXBHOOIQ.cjs.map +1 -0
- package/dist/{chunk-46GDII45.js → chunk-DCQVHAYQ.js} +5 -5
- package/dist/{chunk-46GDII45.js.map → chunk-DCQVHAYQ.js.map} +1 -1
- package/dist/chunk-DLNROMQ7.js +306 -0
- package/dist/chunk-DLNROMQ7.js.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-BNUFUFAU.js → chunk-HFHTMECK.js} +7 -7
- package/dist/chunk-HFHTMECK.js.map +1 -0
- package/dist/{chunk-TFMVL4QH.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-JIVMTW7W.js +3393 -0
- package/dist/chunk-JIVMTW7W.js.map +1 -0
- package/dist/{chunk-2Y4IFKW7.js → chunk-JXA2ZP2Q.js} +6 -17
- 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-K5ELX2GT.js +248 -0
- package/dist/chunk-K5ELX2GT.js.map +1 -0
- package/dist/chunk-LBJKZXDE.cjs +257 -0
- package/dist/chunk-LBJKZXDE.cjs.map +1 -0
- package/dist/{chunk-FGO5JFVJ.cjs → chunk-M4BDU5RX.cjs} +12 -12
- package/dist/{chunk-FGO5JFVJ.cjs.map → chunk-M4BDU5RX.cjs.map} +1 -1
- package/dist/{chunk-MIJKEVV7.js → chunk-MSY7FSX4.js} +37 -4
- package/dist/chunk-MSY7FSX4.js.map +1 -0
- package/dist/{chunk-ST3LPB2V.cjs → chunk-MUK4BU7K.cjs} +788 -146
- package/dist/chunk-MUK4BU7K.cjs.map +1 -0
- package/dist/{chunk-MCHP7RHZ.cjs → chunk-MXJDTH5B.cjs} +64 -41
- package/dist/chunk-MXJDTH5B.cjs.map +1 -0
- package/dist/{chunk-2VLBGQBY.cjs → chunk-N3257XE6.cjs} +724 -577
- package/dist/chunk-N3257XE6.cjs.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-EE7N5XXQ.cjs → chunk-NK5Q7UNE.cjs} +10 -21
- package/dist/chunk-NK5Q7UNE.cjs.map +1 -0
- package/dist/{chunk-PHXITZE4.js → chunk-NMWDXFPH.js} +4 -4
- package/dist/{chunk-PHXITZE4.js.map → chunk-NMWDXFPH.js.map} +1 -1
- package/dist/{chunk-FSXTPBRN.js → chunk-NQ6BRJBE.js} +416 -850
- package/dist/chunk-NQ6BRJBE.js.map +1 -0
- package/dist/chunk-OH5E5KIO.js +2057 -0
- package/dist/chunk-OH5E5KIO.js.map +1 -0
- package/dist/chunk-ONU3HIED.cjs +2082 -0
- package/dist/chunk-ONU3HIED.cjs.map +1 -0
- package/dist/{chunk-STQ3BSED.cjs → chunk-PNN7RHVR.cjs} +66 -44
- package/dist/chunk-PNN7RHVR.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-ACSVZPK7.cjs → chunk-PWLJ77UV.cjs} +5 -3
- package/dist/chunk-PWLJ77UV.cjs.map +1 -0
- package/dist/chunk-Q7Q4WSLJ.cjs +328 -0
- package/dist/chunk-Q7Q4WSLJ.cjs.map +1 -0
- package/dist/{chunk-BEFM74L2.js → chunk-QLRESYPU.js} +637 -493
- package/dist/chunk-QLRESYPU.js.map +1 -0
- package/dist/{chunk-SBPC5IP3.js → chunk-QWX5YA3K.js} +784 -202
- package/dist/chunk-QWX5YA3K.js.map +1 -0
- package/dist/{chunk-TCRIQMBU.js → chunk-RJS7DECT.js} +8 -9
- package/dist/chunk-RJS7DECT.js.map +1 -0
- package/dist/{chunk-6JZUSDY2.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-IJTLXNGJ.js → chunk-T4XNKYXB.js} +780 -127
- package/dist/chunk-T4XNKYXB.js.map +1 -0
- package/dist/{chunk-PDGEXGS6.cjs → chunk-TQR4KBY2.cjs} +354 -182
- package/dist/chunk-TQR4KBY2.cjs.map +1 -0
- package/dist/chunk-TTAITEPJ.cjs +755 -0
- package/dist/chunk-TTAITEPJ.cjs.map +1 -0
- package/dist/{chunk-NN3QSOVS.cjs → chunk-U5SON7R2.cjs} +27 -27
- package/dist/{chunk-NN3QSOVS.cjs.map → chunk-U5SON7R2.cjs.map} +1 -1
- package/dist/{chunk-A2I2XO52.cjs → chunk-U63GDNRC.cjs} +32 -26
- package/dist/chunk-U63GDNRC.cjs.map +1 -0
- package/dist/{chunk-YNULOIR5.cjs → chunk-UDISNXDL.cjs} +64 -43
- package/dist/chunk-UDISNXDL.cjs.map +1 -0
- package/dist/{chunk-GWEDD3DH.js → chunk-UV3SN74I.js} +5 -5
- package/dist/{chunk-GWEDD3DH.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-EFELJVLA.js → chunk-VGTJPTIC.js} +28 -5
- package/dist/chunk-VGTJPTIC.js.map +1 -0
- package/dist/chunk-VQH4VAWD.cjs +12 -0
- package/dist/{chunk-EPTSMFH7.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-WEVQJ5LH.js +736 -0
- package/dist/chunk-WEVQJ5LH.js.map +1 -0
- package/dist/{chunk-3PRKZW6D.cjs → chunk-XBYVV3MP.cjs} +60 -5
- package/dist/chunk-XBYVV3MP.cjs.map +1 -0
- package/dist/{chunk-GFRGG2US.cjs → chunk-XCAGZAKP.cjs} +7 -7
- package/dist/{chunk-GFRGG2US.cjs.map → chunk-XCAGZAKP.cjs.map} +1 -1
- package/dist/{chunk-XR4YZFKW.cjs → chunk-XDF2UPEQ.cjs} +3864 -1783
- package/dist/chunk-XDF2UPEQ.cjs.map +1 -0
- package/dist/{chunk-7V2FGGI2.cjs → chunk-XMQSEJCF.cjs} +632 -1080
- package/dist/chunk-XMQSEJCF.cjs.map +1 -0
- package/dist/chunk-XNLIZYRZ.cjs +3432 -0
- package/dist/chunk-XNLIZYRZ.cjs.map +1 -0
- package/dist/{chunk-66UVLHQA.cjs → chunk-XNSI2FJO.cjs} +99 -100
- package/dist/chunk-XNSI2FJO.cjs.map +1 -0
- package/dist/chunk-XQSCL77R.cjs +60 -0
- package/dist/chunk-XQSCL77R.cjs.map +1 -0
- package/dist/{chunk-SVJ5GEXW.cjs → chunk-XUO3KQFO.cjs} +2 -2
- package/dist/chunk-XUO3KQFO.cjs.map +1 -0
- package/dist/{chunk-HJH3RMXG.cjs → chunk-YAAM3M2S.cjs} +10 -10
- package/dist/{chunk-HJH3RMXG.cjs.map → chunk-YAAM3M2S.cjs.map} +1 -1
- package/dist/{chunk-ATLN63JA.js → chunk-YBFHZUXX.js} +6 -6
- package/dist/{chunk-ATLN63JA.js.map → chunk-YBFHZUXX.js.map} +1 -1
- package/dist/{chunk-K3BUWSFR.js → chunk-YDFDBE6D.js} +119 -6
- package/dist/chunk-YDFDBE6D.js.map +1 -0
- package/dist/{chunk-OSZPLZIV.cjs → chunk-YVWGEQJE.cjs} +318 -132
- 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 -41
- package/dist/core/index.d.cts +4 -5
- package/dist/core/index.d.ts +4 -5
- package/dist/core/index.js +8 -9
- package/dist/{ddl-eWg7hx6R.d.cts → ddl-BJcOp4WZ.d.cts} +3 -3
- package/dist/{ddl-D5369kOY.d.ts → ddl-BXfGHbPN.d.ts} +3 -3
- package/dist/graph-extension/index.cjs +26 -23
- 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 -8
- package/dist/graph-merge/index.cjs +2459 -655
- 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 -468
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/{index-By89Sezh.d.ts → index-BSHvKfok.d.ts} +221 -10
- package/dist/{index-DcQ3Sxs-.d.cts → index-DxaYCv8Y.d.cts} +221 -10
- package/dist/index.cjs +330 -269
- 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 -50
- 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 -50
- 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 -24
- package/dist/interchange/index.js.map +1 -1
- package/dist/{manager-B0KjKE93.d.ts → manager-CfZAimti.d.ts} +36 -5
- package/dist/{manager-Cn0NFIhN.d.cts → manager-HGk6E_HW.d.cts} +36 -5
- package/dist/{materialize-indexes-BD4V3svD.d.ts → materialize-indexes-6A7dWGtb.d.cts} +10 -2
- package/dist/{materialize-indexes-DVRhd5h4.d.cts → materialize-indexes-BMJP6Tms.d.ts} +10 -2
- package/dist/{postgres-DaEWvN4x.d.cts → postgres-DFYWENdR.d.cts} +1961 -439
- package/dist/{postgres-u0a0HN2D.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 -49
- package/dist/schema/index.d.cts +9 -16
- package/dist/schema/index.d.ts +9 -16
- package/dist/schema/index.js +23 -22
- package/dist/{searchable-CnYEancP.d.ts → searchable-9OQoPuRs.d.ts} +1 -2
- package/dist/{searchable-BT7j9_IK.d.cts → searchable-CIje5XYD.d.cts} +1 -2
- package/dist/{sqlite-BrMoSsI7.d.cts → sqlite-DerU5tc7.d.ts} +2029 -347
- package/dist/{sqlite-CHhZUyO5.d.ts → sqlite-DitnISa9.d.cts} +2029 -347
- package/dist/{store-view-Bvdku0Ht.d.ts → store-DawaWWjJ.d.ts} +3145 -2556
- package/dist/{store-view-w-md0nQ4.d.cts → store-RwTJx8LX.d.cts} +3145 -2556
- package/dist/{temporal-BCORwUau.d.cts → temporal-Bn-Fi8FJ.d.cts} +1 -1
- package/dist/{temporal--x9T8K4S.d.ts → temporal-BtM4UALv.d.ts} +1 -1
- package/dist/{types-6-WJmSD4.d.cts → types-CoIx8HX5.d.cts} +1 -1
- package/dist/{types-Cjvkj0jA.d.ts → types-HkveCCx0.d.cts} +866 -21
- package/dist/{types-Cjvkj0jA.d.cts → types-HkveCCx0.d.ts} +866 -21
- package/dist/{types-COODtTJU.d.ts → types-KFfk-8Ah.d.ts} +1 -1
- package/dist/{where-CUQmCR6d.d.cts → where--fk7_0kv.d.cts} +1 -1
- package/dist/{where-5xVawAwL.d.ts → where-ws5hf-Ov.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-2BIG7U6E.cjs +0 -83
- package/dist/chunk-2BIG7U6E.cjs.map +0 -1
- package/dist/chunk-2L54C2C2.js +0 -144
- package/dist/chunk-2L54C2C2.js.map +0 -1
- package/dist/chunk-2VLBGQBY.cjs.map +0 -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-35S6P5ZU.js +0 -27
- package/dist/chunk-35S6P5ZU.js.map +0 -1
- package/dist/chunk-3PRKZW6D.cjs.map +0 -1
- package/dist/chunk-4MB3AQAQ.js.map +0 -1
- package/dist/chunk-4SZ6XPTG.cjs +0 -12
- package/dist/chunk-5MUSU4ZP.cjs.map +0 -1
- package/dist/chunk-63KCKSSH.js.map +0 -1
- package/dist/chunk-66UVLHQA.cjs.map +0 -1
- package/dist/chunk-6JZUSDY2.cjs.map +0 -1
- package/dist/chunk-764JHTLT.cjs +0 -15
- package/dist/chunk-764JHTLT.cjs.map +0 -1
- package/dist/chunk-7G32LIQM.js.map +0 -1
- package/dist/chunk-7V2FGGI2.cjs.map +0 -1
- package/dist/chunk-A2I2XO52.cjs.map +0 -1
- package/dist/chunk-A4PBRX4C.cjs +0 -100
- package/dist/chunk-A4PBRX4C.cjs.map +0 -1
- package/dist/chunk-ACSVZPK7.cjs.map +0 -1
- package/dist/chunk-ALFUGRYB.cjs +0 -1282
- package/dist/chunk-ALFUGRYB.cjs.map +0 -1
- package/dist/chunk-B75XRV3O.js +0 -125
- package/dist/chunk-B75XRV3O.js.map +0 -1
- package/dist/chunk-BCP7LLOY.js.map +0 -1
- package/dist/chunk-BEFM74L2.js.map +0 -1
- package/dist/chunk-BNUFUFAU.js.map +0 -1
- package/dist/chunk-C4F7VJ5D.cjs.map +0 -1
- package/dist/chunk-CPEL3YIR.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-EE7N5XXQ.cjs.map +0 -1
- package/dist/chunk-EFELJVLA.js.map +0 -1
- package/dist/chunk-EPTSMFH7.cjs +0 -12
- 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-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-G6Q5UM7U.js.map +0 -1
- package/dist/chunk-GYA4JRP5.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-IIMQJYAM.js +0 -81
- package/dist/chunk-IIMQJYAM.js.map +0 -1
- package/dist/chunk-IJTLXNGJ.js.map +0 -1
- package/dist/chunk-ITE4IXAK.js +0 -25
- package/dist/chunk-ITE4IXAK.js.map +0 -1
- package/dist/chunk-K3BUWSFR.js.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-MCHP7RHZ.cjs.map +0 -1
- package/dist/chunk-MIJKEVV7.js.map +0 -1
- package/dist/chunk-NCX65HBY.cjs +0 -1396
- 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-QB6VMOJ2.cjs.map +0 -1
- package/dist/chunk-QMQLUA66.js +0 -12
- package/dist/chunk-QMQLUA66.js.map +0 -1
- package/dist/chunk-QYWINYEA.cjs.map +0 -1
- package/dist/chunk-S4KQ5LV4.js.map +0 -1
- package/dist/chunk-SBPC5IP3.js.map +0 -1
- package/dist/chunk-SJDMVITW.cjs.map +0 -1
- package/dist/chunk-SNXVDZAJ.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-SVJ5GEXW.cjs.map +0 -1
- package/dist/chunk-TCRIQMBU.js.map +0 -1
- package/dist/chunk-TDXIBCGY.cjs.map +0 -1
- package/dist/chunk-TFMVL4QH.js.map +0 -1
- package/dist/chunk-TRF4EBJT.cjs +0 -30
- package/dist/chunk-TRF4EBJT.cjs.map +0 -1
- package/dist/chunk-TVLKA4AY.js +0 -94
- package/dist/chunk-TVLKA4AY.js.map +0 -1
- package/dist/chunk-UR7W5YQK.js.map +0 -1
- package/dist/chunk-VITTKBWF.js +0 -1263
- package/dist/chunk-VITTKBWF.js.map +0 -1
- package/dist/chunk-WBUFJ7BS.cjs +0 -131
- package/dist/chunk-WBUFJ7BS.cjs.map +0 -1
- package/dist/chunk-XR4YZFKW.cjs.map +0 -1
- package/dist/chunk-YNULOIR5.cjs.map +0 -1
- package/dist/chunk-ZDH3DX3C.cjs +0 -30
- package/dist/chunk-ZDH3DX3C.cjs.map +0 -1
- package/dist/chunk-ZTAJL4DT.cjs +0 -85
- package/dist/chunk-ZTAJL4DT.cjs.map +0 -1
- package/dist/define-graph-DVF-oN1i.d.cts +0 -173
- package/dist/define-graph-SvYXOl78.d.ts +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
|
|
@@ -270,8 +288,15 @@ var GET_EDGES_FIXED_PARAM_COUNT = 1;
|
|
|
270
288
|
var CHECK_UNIQUE_BATCH_FIXED_PARAM_COUNT = 3;
|
|
271
289
|
var FULLTEXT_UPSERT_PARAM_COUNT = 6;
|
|
272
290
|
var FULLTEXT_DELETE_FIXED_PARAM_COUNT = 2;
|
|
291
|
+
var UNIQUE_DELETE_FIXED_PARAM_COUNT = 2;
|
|
273
292
|
var UNIQUE_INSERT_PARAM_COUNT = 6;
|
|
274
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
|
+
]);
|
|
275
300
|
function computeSqliteBatchChunkSizes(maxBindParameters) {
|
|
276
301
|
return {
|
|
277
302
|
checkUniqueBatchChunkSize: Math.max(
|
|
@@ -280,7 +305,7 @@ function computeSqliteBatchChunkSizes(maxBindParameters) {
|
|
|
280
305
|
),
|
|
281
306
|
embeddingUpsertBatchSize: Math.max(
|
|
282
307
|
1,
|
|
283
|
-
Math.floor(maxBindParameters /
|
|
308
|
+
Math.floor(maxBindParameters / chunkMUK4BU7K_cjs.EMBEDDING_UPSERT_PARAM_COUNT)
|
|
284
309
|
),
|
|
285
310
|
fulltextUpsertBatchSize: Math.max(
|
|
286
311
|
1,
|
|
@@ -296,7 +321,7 @@ function computeSqliteBatchChunkSizes(maxBindParameters) {
|
|
|
296
321
|
),
|
|
297
322
|
findEdgesEndpointChunkSize: Math.max(
|
|
298
323
|
1,
|
|
299
|
-
maxBindParameters -
|
|
324
|
+
maxBindParameters - chunkMUK4BU7K_cjs.FIND_EDGES_ENDPOINT_FIXED_PARAM_COUNT
|
|
300
325
|
),
|
|
301
326
|
getEdgesChunkSize: Math.max(
|
|
302
327
|
1,
|
|
@@ -310,17 +335,21 @@ function computeSqliteBatchChunkSizes(maxBindParameters) {
|
|
|
310
335
|
1,
|
|
311
336
|
Math.floor(maxBindParameters / NODE_INSERT_PARAM_COUNT)
|
|
312
337
|
),
|
|
338
|
+
uniqueDeleteChunkSize: Math.max(
|
|
339
|
+
1,
|
|
340
|
+
maxBindParameters - UNIQUE_DELETE_FIXED_PARAM_COUNT
|
|
341
|
+
),
|
|
313
342
|
uniqueInsertBatchSize: Math.max(
|
|
314
343
|
1,
|
|
315
344
|
Math.floor(maxBindParameters / UNIQUE_INSERT_PARAM_COUNT)
|
|
316
345
|
)
|
|
317
346
|
};
|
|
318
347
|
}
|
|
319
|
-
var toNodeRow =
|
|
320
|
-
var toEdgeRow =
|
|
321
|
-
var toUniqueRow =
|
|
322
|
-
var toSchemaVersionRow =
|
|
323
|
-
|
|
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
|
|
324
353
|
);
|
|
325
354
|
var PENDING_FOREVER = new Promise(noop);
|
|
326
355
|
function pendingForever() {
|
|
@@ -339,7 +368,7 @@ async function loadQueueTaskContext() {
|
|
|
339
368
|
void loadQueueTaskContext();
|
|
340
369
|
function rejectReentrantQueueSubmission() {
|
|
341
370
|
return Promise.reject(
|
|
342
|
-
new
|
|
371
|
+
new chunkNI72YOJB_cjs.ConfigurationError(
|
|
343
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.",
|
|
344
373
|
{ backend: "sqlite", capability: "concurrentRootAccess" },
|
|
345
374
|
{
|
|
@@ -360,7 +389,7 @@ function createSerializedExecutionQueue() {
|
|
|
360
389
|
disposed = true;
|
|
361
390
|
},
|
|
362
391
|
runExclusive(task) {
|
|
363
|
-
if (isDisposed()) return Promise.reject(new
|
|
392
|
+
if (isDisposed()) return Promise.reject(new chunkNI72YOJB_cjs.BackendDisposedError());
|
|
364
393
|
if (queueTaskContext?.getStore() === taskMarker) {
|
|
365
394
|
return rejectReentrantQueueSubmission();
|
|
366
395
|
}
|
|
@@ -388,7 +417,7 @@ function runWithSerializedQueue(queue, task) {
|
|
|
388
417
|
return queue.runExclusive(task);
|
|
389
418
|
}
|
|
390
419
|
function throwSqliteTransactionsDisabled(message) {
|
|
391
|
-
throw new
|
|
420
|
+
throw new chunkNI72YOJB_cjs.ConfigurationError(message, {
|
|
392
421
|
backend: "sqlite",
|
|
393
422
|
capability: "transactions",
|
|
394
423
|
supportsTransactions: false
|
|
@@ -396,20 +425,20 @@ function throwSqliteTransactionsDisabled(message) {
|
|
|
396
425
|
}
|
|
397
426
|
function buildSqliteCapabilities(options) {
|
|
398
427
|
const base = options.transactionMode === "none" ? {
|
|
399
|
-
...
|
|
428
|
+
...chunkXBYVV3MP_cjs.SQLITE_CAPABILITIES,
|
|
400
429
|
transactions: false,
|
|
401
430
|
graphAnalytics: {
|
|
402
|
-
...
|
|
431
|
+
...chunkXBYVV3MP_cjs.SQLITE_CAPABILITIES.graphAnalytics ?? {
|
|
403
432
|
mathFunctions: false
|
|
404
433
|
},
|
|
405
434
|
supported: false
|
|
406
435
|
}
|
|
407
|
-
} :
|
|
436
|
+
} : chunkXBYVV3MP_cjs.SQLITE_CAPABILITIES;
|
|
408
437
|
return {
|
|
409
438
|
...base,
|
|
410
439
|
maxBindParameters: options.maxBindParameters,
|
|
411
|
-
fulltext:
|
|
412
|
-
...options.vectorStrategy === void 0 ? {} : { vector:
|
|
440
|
+
fulltext: chunk4UGOKMI5_cjs.buildFulltextCapabilities(options.fulltextStrategy),
|
|
441
|
+
...options.vectorStrategy === void 0 ? {} : { vector: chunk4UGOKMI5_cjs.buildVectorCapabilities(options.vectorStrategy) }
|
|
413
442
|
};
|
|
414
443
|
}
|
|
415
444
|
function resolveMaxBindParametersCapability(profile, override) {
|
|
@@ -417,7 +446,7 @@ function resolveMaxBindParametersCapability(profile, override) {
|
|
|
417
446
|
return profile.hardMaxBindParameters === void 0 ? requested : Math.min(requested, profile.hardMaxBindParameters);
|
|
418
447
|
}
|
|
419
448
|
function resolveSqliteGraphAnalyticsCapabilities(profile, override) {
|
|
420
|
-
const requested = override ??
|
|
449
|
+
const requested = override ?? chunkXBYVV3MP_cjs.SQLITE_CAPABILITIES.graphAnalytics ?? {
|
|
421
450
|
supported: false,
|
|
422
451
|
mathFunctions: false
|
|
423
452
|
};
|
|
@@ -463,7 +492,7 @@ function createSqliteOperationBackend(options) {
|
|
|
463
492
|
return runWithSerializedQueue(serializedQueue, async () => {
|
|
464
493
|
if (compiledRun === void 0) {
|
|
465
494
|
await db.run(
|
|
466
|
-
|
|
495
|
+
chunkVCRRKBLN_cjs.isSqlFragment(query) ? chunkU5SON7R2_cjs.toDrizzleSql(query, "sqlite") : query
|
|
467
496
|
);
|
|
468
497
|
return;
|
|
469
498
|
}
|
|
@@ -471,16 +500,17 @@ function createSqliteOperationBackend(options) {
|
|
|
471
500
|
});
|
|
472
501
|
}
|
|
473
502
|
const batchConfig = computeSqliteBatchChunkSizes(
|
|
474
|
-
capabilities.maxBindParameters ??
|
|
503
|
+
capabilities.maxBindParameters ?? chunkXBYVV3MP_cjs.SQLITE_MAX_BIND_PARAMETERS
|
|
475
504
|
);
|
|
476
|
-
const commonBackend =
|
|
505
|
+
const commonBackend = chunkMUK4BU7K_cjs.createCommonOperationBackend({
|
|
477
506
|
batchConfig,
|
|
478
507
|
execution: {
|
|
479
508
|
execAll,
|
|
480
509
|
execGet,
|
|
481
510
|
execRun
|
|
482
511
|
},
|
|
483
|
-
nowIso:
|
|
512
|
+
nowIso: chunkYAAM3M2S_cjs.nowIso,
|
|
513
|
+
maxBindParameters: capabilities.maxBindParameters ?? chunkXBYVV3MP_cjs.SQLITE_MAX_BIND_PARAMETERS,
|
|
484
514
|
operationStrategy,
|
|
485
515
|
rowMappers: {
|
|
486
516
|
toEdgeRow,
|
|
@@ -500,28 +530,28 @@ function createSqliteOperationBackend(options) {
|
|
|
500
530
|
};
|
|
501
531
|
const vectorEmbeddingMethods = vectorStrategy === void 0 ? {} : {
|
|
502
532
|
async upsertEmbedding(params) {
|
|
503
|
-
const slot =
|
|
533
|
+
const slot = chunkMUK4BU7K_cjs.vectorSlotFromParams(params);
|
|
504
534
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
505
|
-
const statements = vectorStrategy.buildUpsert(slot, params,
|
|
535
|
+
const statements = vectorStrategy.buildUpsert(slot, params, chunkYAAM3M2S_cjs.nowIso());
|
|
506
536
|
try {
|
|
507
537
|
for (const statement of statements) {
|
|
508
538
|
await execRun(statement);
|
|
509
539
|
}
|
|
510
540
|
} catch (error) {
|
|
511
|
-
throw
|
|
541
|
+
throw chunkMUK4BU7K_cjs.mapVectorWriteError(error, params);
|
|
512
542
|
}
|
|
513
543
|
},
|
|
514
544
|
async upsertEmbeddingBatch(params) {
|
|
515
545
|
if (params.rows.length === 0) return;
|
|
516
|
-
const slot =
|
|
546
|
+
const slot = chunkMUK4BU7K_cjs.vectorSlotFromParams(params);
|
|
517
547
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
518
548
|
const rowsById = new Map(
|
|
519
549
|
params.rows.map((row) => [row.nodeId, row])
|
|
520
550
|
);
|
|
521
551
|
const rows = [...rowsById.values()];
|
|
522
|
-
const timestamp =
|
|
552
|
+
const timestamp = chunkYAAM3M2S_cjs.nowIso();
|
|
523
553
|
try {
|
|
524
|
-
for (const chunk2 of
|
|
554
|
+
for (const chunk2 of chunkBSFJMMV3_cjs.chunk(
|
|
525
555
|
rows,
|
|
526
556
|
batchConfig.embeddingUpsertBatchSize
|
|
527
557
|
)) {
|
|
@@ -550,37 +580,60 @@ function createSqliteOperationBackend(options) {
|
|
|
550
580
|
}
|
|
551
581
|
}
|
|
552
582
|
} catch (error) {
|
|
553
|
-
throw
|
|
583
|
+
throw chunkMUK4BU7K_cjs.mapVectorWriteError(error, params);
|
|
554
584
|
}
|
|
555
585
|
},
|
|
556
586
|
async deleteEmbedding(params) {
|
|
557
|
-
const slot =
|
|
587
|
+
const slot = chunkMUK4BU7K_cjs.vectorSlotFromParams(params);
|
|
558
588
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
559
589
|
const statements = vectorStrategy.buildDelete(slot, params);
|
|
560
590
|
for (const statement of statements) {
|
|
561
591
|
await execRun(statement);
|
|
562
592
|
}
|
|
563
593
|
},
|
|
594
|
+
async deleteEmbeddingBatch(params) {
|
|
595
|
+
if (params.nodeIds.length === 0) return;
|
|
596
|
+
const slot = chunkMUK4BU7K_cjs.vectorSlotFromParams(params);
|
|
597
|
+
await contributionMaterializer.assertVectorSlot(slot);
|
|
598
|
+
for (const nodeIds of chunkBSFJMMV3_cjs.chunk(
|
|
599
|
+
[...new Set(params.nodeIds)],
|
|
600
|
+
batchConfig.embeddingUpsertBatchSize
|
|
601
|
+
)) {
|
|
602
|
+
const statements = vectorStrategy.buildDeleteBatch(slot, {
|
|
603
|
+
...params,
|
|
604
|
+
nodeIds
|
|
605
|
+
});
|
|
606
|
+
for (const statement of statements) await execRun(statement);
|
|
607
|
+
}
|
|
608
|
+
},
|
|
564
609
|
async vectorSearch(params) {
|
|
565
|
-
|
|
566
|
-
|
|
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);
|
|
567
620
|
const query = vectorStrategy.buildSearch(
|
|
568
621
|
slot,
|
|
569
622
|
params,
|
|
570
623
|
// Store-compiled candidates (predicates + subclass + currency)
|
|
571
624
|
// take precedence; the live-node default covers direct backend use.
|
|
572
|
-
params.candidates ??
|
|
625
|
+
params.candidates ?? chunkMUK4BU7K_cjs.buildLiveNodeCandidates(
|
|
573
626
|
tableNames.nodes,
|
|
574
627
|
params.graphId,
|
|
575
628
|
params.nodeKind,
|
|
576
|
-
|
|
629
|
+
chunkYAAM3M2S_cjs.nowIso()
|
|
577
630
|
)
|
|
578
631
|
);
|
|
579
632
|
let rows;
|
|
580
633
|
try {
|
|
581
634
|
rows = await execAll(query);
|
|
582
635
|
} catch (error) {
|
|
583
|
-
throw
|
|
636
|
+
throw chunkMUK4BU7K_cjs.mapVectorWriteError(error, params);
|
|
584
637
|
}
|
|
585
638
|
return rows.map((row) => ({
|
|
586
639
|
nodeId: row.node_id,
|
|
@@ -592,9 +645,17 @@ function createSqliteOperationBackend(options) {
|
|
|
592
645
|
// fallback by simply not exposing the member.
|
|
593
646
|
...capabilities.windowFunctions ? {
|
|
594
647
|
async hybridSearch(params) {
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
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({
|
|
598
659
|
graphId: params.graphId,
|
|
599
660
|
nodeKind: params.nodeKind,
|
|
600
661
|
fieldPath: params.vector.fieldPath,
|
|
@@ -602,11 +663,11 @@ function createSqliteOperationBackend(options) {
|
|
|
602
663
|
metric: params.vector.metric,
|
|
603
664
|
indexType: params.vector.indexType
|
|
604
665
|
});
|
|
605
|
-
const candidates = params.candidates ??
|
|
666
|
+
const candidates = params.candidates ?? chunkMUK4BU7K_cjs.buildLiveNodeCandidates(
|
|
606
667
|
tableNames.nodes,
|
|
607
668
|
params.graphId,
|
|
608
669
|
params.nodeKind,
|
|
609
|
-
|
|
670
|
+
chunkYAAM3M2S_cjs.nowIso()
|
|
610
671
|
);
|
|
611
672
|
const vectorParams = {
|
|
612
673
|
graphId: params.graphId,
|
|
@@ -622,20 +683,20 @@ function createSqliteOperationBackend(options) {
|
|
|
622
683
|
const vectorSql = vectorStrategy.buildSearch(
|
|
623
684
|
slot,
|
|
624
685
|
vectorParams,
|
|
625
|
-
|
|
686
|
+
chunkVCRRKBLN_cjs.sql.raw("SELECT node_id FROM tg_hybrid_cand")
|
|
626
687
|
);
|
|
627
688
|
const statement = operationStrategy.buildHybridSearch(
|
|
628
689
|
{ ...params, candidates },
|
|
629
|
-
|
|
690
|
+
chunkU5SON7R2_cjs.toDrizzleSql(vectorSql, "sqlite"),
|
|
630
691
|
params.vector.metric === "cosine"
|
|
631
692
|
);
|
|
632
693
|
let raw;
|
|
633
694
|
try {
|
|
634
695
|
raw = await execAll(statement);
|
|
635
696
|
} catch (error) {
|
|
636
|
-
throw
|
|
697
|
+
throw chunkMUK4BU7K_cjs.mapVectorWriteError(error, vectorParams);
|
|
637
698
|
}
|
|
638
|
-
return raw.map((row) =>
|
|
699
|
+
return raw.map((row) => chunkMUK4BU7K_cjs.mapHybridSearchRow(row, toNodeRow));
|
|
639
700
|
}
|
|
640
701
|
} : {}
|
|
641
702
|
};
|
|
@@ -643,6 +704,22 @@ function createSqliteOperationBackend(options) {
|
|
|
643
704
|
...commonBackend,
|
|
644
705
|
...executeRawMethod,
|
|
645
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
|
+
},
|
|
646
723
|
async deleteSchemaVectorSlotContribution(slot) {
|
|
647
724
|
if (vectorStrategy === void 0) return;
|
|
648
725
|
for (const contribution of vectorStrategy.ownedTables(slot)) {
|
|
@@ -664,7 +741,7 @@ function createSqliteOperationBackend(options) {
|
|
|
664
741
|
...vectorStrategy === void 0 ? {} : { vectorStrategy },
|
|
665
742
|
async lockSchemaVersionForWrite(params) {
|
|
666
743
|
if (!transactionScoped) {
|
|
667
|
-
throw new
|
|
744
|
+
throw new chunkNI72YOJB_cjs.ConfigurationError(
|
|
668
745
|
"The schema write fence requires an explicit SQLite transaction.",
|
|
669
746
|
{
|
|
670
747
|
code: "SCHEMA_WRITE_FENCE_TRANSACTION_REQUIRED",
|
|
@@ -673,7 +750,7 @@ function createSqliteOperationBackend(options) {
|
|
|
673
750
|
);
|
|
674
751
|
}
|
|
675
752
|
const active = await commonBackend.getActiveSchema(params.graphId);
|
|
676
|
-
|
|
753
|
+
chunkMUK4BU7K_cjs.assertActiveSchemaVersion(
|
|
677
754
|
params.graphId,
|
|
678
755
|
params.expectedVersion,
|
|
679
756
|
active?.version ?? 0
|
|
@@ -681,7 +758,7 @@ function createSqliteOperationBackend(options) {
|
|
|
681
758
|
},
|
|
682
759
|
async createVectorIndex(params) {
|
|
683
760
|
if (vectorStrategy === void 0) return;
|
|
684
|
-
const slot =
|
|
761
|
+
const slot = chunkMUK4BU7K_cjs.vectorSlotFromCreateIndexParams(params);
|
|
685
762
|
await contributionMaterializer.ensureVectorSlot(slot);
|
|
686
763
|
const indexStatement = vectorStrategy.buildCreateIndex?.(slot);
|
|
687
764
|
if (indexStatement !== void 0) {
|
|
@@ -690,18 +767,18 @@ function createSqliteOperationBackend(options) {
|
|
|
690
767
|
},
|
|
691
768
|
async dropVectorIndex(params) {
|
|
692
769
|
if (vectorStrategy === void 0) return;
|
|
693
|
-
const slot =
|
|
770
|
+
const slot = chunkMUK4BU7K_cjs.vectorSlotFromDropIndexParams(params);
|
|
694
771
|
const dropStatement = vectorStrategy.buildDropIndex?.(slot);
|
|
695
772
|
if (dropStatement === void 0) return;
|
|
696
773
|
try {
|
|
697
774
|
await execRun(dropStatement);
|
|
698
775
|
} catch (error) {
|
|
699
|
-
if (!
|
|
776
|
+
if (!chunkBSFJMMV3_cjs.isMissingTableError(error)) throw error;
|
|
700
777
|
}
|
|
701
778
|
},
|
|
702
779
|
// === Fulltext Operations ===
|
|
703
780
|
async upsertFulltext(params) {
|
|
704
|
-
const timestamp =
|
|
781
|
+
const timestamp = chunkYAAM3M2S_cjs.nowIso();
|
|
705
782
|
const statements = operationStrategy.buildUpsertFulltext(
|
|
706
783
|
params,
|
|
707
784
|
timestamp
|
|
@@ -718,8 +795,8 @@ function createSqliteOperationBackend(options) {
|
|
|
718
795
|
},
|
|
719
796
|
async upsertFulltextBatch(params) {
|
|
720
797
|
if (params.rows.length === 0) return;
|
|
721
|
-
const timestamp =
|
|
722
|
-
for (const rows of
|
|
798
|
+
const timestamp = chunkYAAM3M2S_cjs.nowIso();
|
|
799
|
+
for (const rows of chunkBSFJMMV3_cjs.chunk(
|
|
723
800
|
params.rows,
|
|
724
801
|
batchConfig.fulltextUpsertBatchSize
|
|
725
802
|
)) {
|
|
@@ -734,7 +811,7 @@ function createSqliteOperationBackend(options) {
|
|
|
734
811
|
},
|
|
735
812
|
async deleteFulltextBatch(params) {
|
|
736
813
|
if (params.nodeIds.length === 0) return;
|
|
737
|
-
for (const nodeIds of
|
|
814
|
+
for (const nodeIds of chunkBSFJMMV3_cjs.chunk(
|
|
738
815
|
params.nodeIds,
|
|
739
816
|
batchConfig.fulltextDeleteChunkSize
|
|
740
817
|
)) {
|
|
@@ -752,7 +829,7 @@ function createSqliteOperationBackend(options) {
|
|
|
752
829
|
const rows = await execAll(query);
|
|
753
830
|
return rows.map((row, index) => ({
|
|
754
831
|
nodeId: row.node_id,
|
|
755
|
-
score:
|
|
832
|
+
score: chunkYAAM3M2S_cjs.coerceNumericScore(row.score),
|
|
756
833
|
rank: index + 1,
|
|
757
834
|
...row.snippet === null ? {} : { snippet: row.snippet }
|
|
758
835
|
}));
|
|
@@ -770,15 +847,30 @@ function createSqliteOperationBackend(options) {
|
|
|
770
847
|
};
|
|
771
848
|
return operationBackend;
|
|
772
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
|
+
}
|
|
773
864
|
function createSqliteBackend(db, options = {}) {
|
|
774
|
-
const
|
|
775
|
-
const
|
|
865
|
+
const serializedConnection = getSerializedSqliteConnection(db);
|
|
866
|
+
const tables2 = options.tables ?? chunkRMQLSPA2_cjs.tables2;
|
|
867
|
+
const fulltextStrategy = options.fulltext ?? chunk4UGOKMI5_cjs.fts5Strategy;
|
|
776
868
|
const profileHints = options.executionProfile ?? {};
|
|
777
869
|
const executionAdapter = createSqliteExecutionAdapter(db, { profileHints });
|
|
778
870
|
const { isSync, transactionMode } = executionAdapter.profile;
|
|
779
871
|
const vectorStrategy = options.vector;
|
|
780
872
|
const capabilityOverrides = options.capabilities ?? {};
|
|
781
|
-
const
|
|
873
|
+
const declaredCapabilities = chunkXBYVV3MP_cjs.normalizeGraphAnalyticsCapabilities({
|
|
782
874
|
...buildSqliteCapabilities({
|
|
783
875
|
fulltextStrategy,
|
|
784
876
|
vectorStrategy,
|
|
@@ -795,6 +887,18 @@ function createSqliteBackend(db, options = {}) {
|
|
|
795
887
|
capabilityOverrides.graphAnalytics
|
|
796
888
|
)
|
|
797
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
|
+
};
|
|
798
902
|
const tableNames = {
|
|
799
903
|
nodes: drizzleOrm.getTableName(tables2.nodes),
|
|
800
904
|
edges: drizzleOrm.getTableName(tables2.edges),
|
|
@@ -802,6 +906,10 @@ function createSqliteBackend(db, options = {}) {
|
|
|
802
906
|
recordedEdges: drizzleOrm.getTableName(tables2.recordedEdges),
|
|
803
907
|
recordedClock: drizzleOrm.getTableName(tables2.recordedClock),
|
|
804
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),
|
|
805
913
|
fulltext: tables2.fulltextTableName,
|
|
806
914
|
uniques: drizzleOrm.getTableName(tables2.uniques)
|
|
807
915
|
};
|
|
@@ -811,19 +919,23 @@ function createSqliteBackend(db, options = {}) {
|
|
|
811
919
|
tableNames.uniques,
|
|
812
920
|
tableNames.fulltext
|
|
813
921
|
];
|
|
814
|
-
const
|
|
922
|
+
const guardedAnalyzeTables = [
|
|
815
923
|
tableNames.recordedNodes,
|
|
816
924
|
tableNames.recordedEdges,
|
|
817
|
-
tableNames.recordedClock
|
|
925
|
+
tableNames.recordedClock,
|
|
926
|
+
tableNames.recordedIdentityAssertions,
|
|
927
|
+
tableNames.identityAssertions,
|
|
928
|
+
tableNames.identityClosure,
|
|
929
|
+
tableNames.identitySeparation
|
|
818
930
|
];
|
|
819
|
-
const operationStrategy =
|
|
931
|
+
const operationStrategy = chunkMUK4BU7K_cjs.createSqliteOperationStrategy(
|
|
820
932
|
tables2,
|
|
821
933
|
fulltextStrategy
|
|
822
934
|
);
|
|
823
935
|
const serializedQueue = transactionMode === "none" ? void 0 : createSerializedExecutionQueue();
|
|
824
936
|
const matTable = tables2.contributionMaterializations;
|
|
825
937
|
async function ensureContributionMaterializationsTableImpl() {
|
|
826
|
-
await db.run(drizzleOrm.sql.raw(
|
|
938
|
+
await db.run(drizzleOrm.sql.raw(chunkRMQLSPA2_cjs.generateSqliteCreateTableSQL(matTable)));
|
|
827
939
|
}
|
|
828
940
|
async function getContributionMaterializationRow(identity) {
|
|
829
941
|
const rows = await db.select().from(matTable).where(
|
|
@@ -836,25 +948,25 @@ function createSqliteBackend(db, options = {}) {
|
|
|
836
948
|
);
|
|
837
949
|
const row = rows[0];
|
|
838
950
|
if (row === void 0) return void 0;
|
|
839
|
-
return
|
|
951
|
+
return chunkMUK4BU7K_cjs.mapContributionMaterializationRow(
|
|
840
952
|
row,
|
|
841
|
-
|
|
953
|
+
chunkMUK4BU7K_cjs.SQLITE_CONTRIBUTION_MAT_TIMESTAMPS.decode
|
|
842
954
|
);
|
|
843
955
|
}
|
|
844
956
|
async function getContributionMaterializationRows(graphId) {
|
|
845
957
|
const rows = await db.select().from(matTable).where(drizzleOrm.eq(matTable.graphId, graphId));
|
|
846
958
|
return rows.map(
|
|
847
|
-
(row) =>
|
|
959
|
+
(row) => chunkMUK4BU7K_cjs.mapContributionMaterializationRow(
|
|
848
960
|
row,
|
|
849
|
-
|
|
961
|
+
chunkMUK4BU7K_cjs.SQLITE_CONTRIBUTION_MAT_TIMESTAMPS.decode
|
|
850
962
|
)
|
|
851
963
|
);
|
|
852
964
|
}
|
|
853
965
|
async function recordContributionMaterializationRow(params) {
|
|
854
966
|
await db.insert(matTable).values(
|
|
855
|
-
|
|
967
|
+
chunkMUK4BU7K_cjs.buildContributionInsertValues(
|
|
856
968
|
params,
|
|
857
|
-
|
|
969
|
+
chunkMUK4BU7K_cjs.SQLITE_CONTRIBUTION_MAT_TIMESTAMPS.encode
|
|
858
970
|
)
|
|
859
971
|
).onConflictDoUpdate({
|
|
860
972
|
target: [
|
|
@@ -863,7 +975,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
863
975
|
matTable.owner,
|
|
864
976
|
matTable.tableName
|
|
865
977
|
],
|
|
866
|
-
set:
|
|
978
|
+
set: chunkMUK4BU7K_cjs.buildContributionOnConflictSet(
|
|
867
979
|
matTable.materializedAt,
|
|
868
980
|
params.materializedAt
|
|
869
981
|
)
|
|
@@ -883,9 +995,20 @@ function createSqliteBackend(db, options = {}) {
|
|
|
883
995
|
const rows = await executionAdapter.execute(
|
|
884
996
|
operationStrategy.buildTableExists(tableName)
|
|
885
997
|
);
|
|
886
|
-
return
|
|
998
|
+
return chunkMUK4BU7K_cjs.tableExistsFromRow(rows[0]);
|
|
999
|
+
}
|
|
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
|
+
);
|
|
887
1010
|
}
|
|
888
|
-
const contributionMaterializer =
|
|
1011
|
+
const contributionMaterializer = chunkMUK4BU7K_cjs.createContributionMaterializer({
|
|
889
1012
|
dialect: "sqlite",
|
|
890
1013
|
fulltextStrategy,
|
|
891
1014
|
fulltextTableName: tables2.fulltextTableName,
|
|
@@ -897,7 +1020,15 @@ function createSqliteBackend(db, options = {}) {
|
|
|
897
1020
|
getMarkers: getContributionMaterializationRows,
|
|
898
1021
|
recordMarker: recordContributionMaterializationRow,
|
|
899
1022
|
deleteMarker: deleteContributionMaterializationRow,
|
|
900
|
-
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
|
+
} : {}
|
|
901
1032
|
});
|
|
902
1033
|
const operations = createSqliteOperationBackend({
|
|
903
1034
|
capabilities,
|
|
@@ -931,6 +1062,16 @@ function createSqliteBackend(db, options = {}) {
|
|
|
931
1062
|
}
|
|
932
1063
|
await compiledRun(executionAdapter.compile(query));
|
|
933
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
|
+
}
|
|
934
1075
|
function runSchemaWriteTransaction(fn) {
|
|
935
1076
|
if (transactionMode === "none") {
|
|
936
1077
|
throwSqliteTransactionsDisabled(
|
|
@@ -956,7 +1097,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
956
1097
|
await runFrameStatement(drizzleOrm.sql`COMMIT`);
|
|
957
1098
|
return result;
|
|
958
1099
|
} catch (error) {
|
|
959
|
-
await
|
|
1100
|
+
await rollbackFrameQuietly();
|
|
960
1101
|
throw error;
|
|
961
1102
|
}
|
|
962
1103
|
});
|
|
@@ -1007,7 +1148,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1007
1148
|
vectorStrategy,
|
|
1008
1149
|
contributionMaterializer
|
|
1009
1150
|
});
|
|
1010
|
-
return
|
|
1151
|
+
return chunkMUK4BU7K_cjs.gateFulltext(txBackend, contributionMaterializer.assertInitialized);
|
|
1011
1152
|
}
|
|
1012
1153
|
const backend = {
|
|
1013
1154
|
...operations,
|
|
@@ -1015,33 +1156,55 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1015
1156
|
async trustedImport(fn, options_) {
|
|
1016
1157
|
return backend.transaction(async (tx) => {
|
|
1017
1158
|
if (options_?.schemaWrite !== void 0) {
|
|
1018
|
-
await
|
|
1159
|
+
await chunkN66HCGCY_cjs.requireDefined(tx.lockSchemaVersionForWrite)({
|
|
1019
1160
|
...options_.schemaWrite
|
|
1020
1161
|
});
|
|
1021
1162
|
}
|
|
1022
|
-
await
|
|
1023
|
-
const indexDefinitions = await
|
|
1163
|
+
await chunkMUK4BU7K_cjs.assertTrustedImportDatabaseEmpty(tx, tableNames);
|
|
1164
|
+
const indexDefinitions = await chunkMUK4BU7K_cjs.suspendSqliteSecondaryIndexes(
|
|
1024
1165
|
tx,
|
|
1025
1166
|
tableNames
|
|
1026
1167
|
);
|
|
1027
1168
|
const result = await fn(
|
|
1028
|
-
|
|
1169
|
+
chunkMUK4BU7K_cjs.createSqliteTrustedImportSession(executionAdapter, tableNames)
|
|
1029
1170
|
);
|
|
1030
|
-
await
|
|
1031
|
-
await
|
|
1171
|
+
await chunkMUK4BU7K_cjs.restoreSecondaryIndexes(tx, indexDefinitions);
|
|
1172
|
+
await chunkMUK4BU7K_cjs.analyzeImportedTables(tx, tableNames);
|
|
1032
1173
|
return result;
|
|
1033
1174
|
});
|
|
1034
1175
|
}
|
|
1035
1176
|
} : {},
|
|
1036
1177
|
async bootstrapTables() {
|
|
1037
|
-
const statements =
|
|
1178
|
+
const statements = chunkRMQLSPA2_cjs.generateSqliteDDL(tables2, fulltextStrategy);
|
|
1038
1179
|
for (const statement of statements) {
|
|
1039
1180
|
await db.run(drizzleOrm.sql.raw(statement));
|
|
1040
1181
|
}
|
|
1041
1182
|
},
|
|
1042
1183
|
async ensureRevisionOriginsTable() {
|
|
1043
1184
|
await db.run(
|
|
1044
|
-
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]
|
|
1045
1208
|
);
|
|
1046
1209
|
},
|
|
1047
1210
|
// Every fulltext-touching method asserts the durable marker instead
|
|
@@ -1049,7 +1212,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1049
1212
|
// uninitialized database throws `StoreNotInitializedError` rather
|
|
1050
1213
|
// than self-healing (#135). Shared verbatim with the tx-scoped gate
|
|
1051
1214
|
// via `gateFulltextMethods`.
|
|
1052
|
-
...
|
|
1215
|
+
...chunkMUK4BU7K_cjs.gateFulltextMethods(
|
|
1053
1216
|
operations,
|
|
1054
1217
|
contributionMaterializer.assertInitialized
|
|
1055
1218
|
),
|
|
@@ -1058,7 +1221,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1058
1221
|
},
|
|
1059
1222
|
async ensureIndexMaterializationsTable() {
|
|
1060
1223
|
await db.run(
|
|
1061
|
-
drizzleOrm.sql.raw(
|
|
1224
|
+
drizzleOrm.sql.raw(chunkRMQLSPA2_cjs.generateSqliteCreateTableSQL(tables2.indexMaterializations))
|
|
1062
1225
|
);
|
|
1063
1226
|
},
|
|
1064
1227
|
async getIndexMaterialization(indexName) {
|
|
@@ -1066,26 +1229,26 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1066
1229
|
const rows = await db.select().from(t).where(drizzleOrm.eq(t.indexName, indexName));
|
|
1067
1230
|
const row = rows[0];
|
|
1068
1231
|
if (row === void 0) return void 0;
|
|
1069
|
-
return
|
|
1232
|
+
return chunkMUK4BU7K_cjs.mapMaterializationRow(row, chunkMUK4BU7K_cjs.SQLITE_INDEX_MAT_TIMESTAMPS.decode);
|
|
1070
1233
|
},
|
|
1071
1234
|
async getIndexMaterializations(statusKeys) {
|
|
1072
1235
|
if (statusKeys.length === 0) return [];
|
|
1073
1236
|
const t = tables2.indexMaterializations;
|
|
1074
1237
|
const rows = await db.select().from(t).where(drizzleOrm.inArray(t.indexName, [...statusKeys]));
|
|
1075
1238
|
return rows.map(
|
|
1076
|
-
(row) =>
|
|
1239
|
+
(row) => chunkMUK4BU7K_cjs.mapMaterializationRow(row, chunkMUK4BU7K_cjs.SQLITE_INDEX_MAT_TIMESTAMPS.decode)
|
|
1077
1240
|
);
|
|
1078
1241
|
},
|
|
1079
1242
|
async recordIndexMaterialization(params) {
|
|
1080
1243
|
const t = tables2.indexMaterializations;
|
|
1081
1244
|
await db.insert(t).values(
|
|
1082
|
-
|
|
1245
|
+
chunkMUK4BU7K_cjs.buildMaterializationInsertValues(
|
|
1083
1246
|
params,
|
|
1084
|
-
|
|
1247
|
+
chunkMUK4BU7K_cjs.SQLITE_INDEX_MAT_TIMESTAMPS.encode
|
|
1085
1248
|
)
|
|
1086
1249
|
).onConflictDoUpdate({
|
|
1087
1250
|
target: t.indexName,
|
|
1088
|
-
set:
|
|
1251
|
+
set: chunkMUK4BU7K_cjs.buildMaterializationOnConflictSet(params.materializedAt)
|
|
1089
1252
|
});
|
|
1090
1253
|
},
|
|
1091
1254
|
async ensureContributionMaterializationsTable() {
|
|
@@ -1101,37 +1264,37 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1101
1264
|
await contributionMaterializer.assertInitialized(graphId);
|
|
1102
1265
|
},
|
|
1103
1266
|
async ensureKindRemovalsTable() {
|
|
1104
|
-
await db.run(drizzleOrm.sql.raw(
|
|
1267
|
+
await db.run(drizzleOrm.sql.raw(chunkRMQLSPA2_cjs.generateSqliteCreateTableSQL(tables2.kindRemovals)));
|
|
1105
1268
|
},
|
|
1106
1269
|
async getPendingKindRemovals(graphId) {
|
|
1107
1270
|
const t = tables2.kindRemovals;
|
|
1108
1271
|
const rows = await db.select().from(t).where(drizzleOrm.and(drizzleOrm.eq(t.graphId, graphId), drizzleOrm.isNull(t.removedAt)));
|
|
1109
1272
|
return rows.map(
|
|
1110
|
-
(row) =>
|
|
1273
|
+
(row) => chunkMUK4BU7K_cjs.mapKindRemovalRow(row, chunkMUK4BU7K_cjs.SQLITE_KIND_REMOVAL_TIMESTAMPS.decode)
|
|
1111
1274
|
);
|
|
1112
1275
|
},
|
|
1113
1276
|
async getAllKindRemovals(graphId) {
|
|
1114
1277
|
const t = tables2.kindRemovals;
|
|
1115
1278
|
const rows = await db.select().from(t).where(drizzleOrm.eq(t.graphId, graphId));
|
|
1116
1279
|
return rows.map(
|
|
1117
|
-
(row) =>
|
|
1280
|
+
(row) => chunkMUK4BU7K_cjs.mapKindRemovalRow(row, chunkMUK4BU7K_cjs.SQLITE_KIND_REMOVAL_TIMESTAMPS.decode)
|
|
1118
1281
|
);
|
|
1119
1282
|
},
|
|
1120
1283
|
async recordKindRemoval(params) {
|
|
1121
1284
|
const t = tables2.kindRemovals;
|
|
1122
1285
|
await db.insert(t).values(
|
|
1123
|
-
|
|
1286
|
+
chunkMUK4BU7K_cjs.buildKindRemovalInsertValues(
|
|
1124
1287
|
params,
|
|
1125
|
-
|
|
1288
|
+
chunkMUK4BU7K_cjs.SQLITE_KIND_REMOVAL_TIMESTAMPS.encode
|
|
1126
1289
|
)
|
|
1127
1290
|
).onConflictDoUpdate({
|
|
1128
1291
|
target: [t.graphId, t.kindName, t.entity, t.schemaVersion],
|
|
1129
|
-
set:
|
|
1292
|
+
set: chunkMUK4BU7K_cjs.buildKindRemovalOnConflictSet(t.removedAt, params.removedAt)
|
|
1130
1293
|
});
|
|
1131
1294
|
},
|
|
1132
1295
|
async ensureReconciliationMarkersTable() {
|
|
1133
1296
|
await db.run(
|
|
1134
|
-
drizzleOrm.sql.raw(
|
|
1297
|
+
drizzleOrm.sql.raw(chunkRMQLSPA2_cjs.generateSqliteCreateTableSQL(tables2.reconciliationMarkers))
|
|
1135
1298
|
);
|
|
1136
1299
|
},
|
|
1137
1300
|
async ensureRuntimeContributions(graphId) {
|
|
@@ -1148,6 +1311,19 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1148
1311
|
async verifyContributions(graphId, vectorSlots) {
|
|
1149
1312
|
return contributionMaterializer.verifyContributions(graphId, vectorSlots);
|
|
1150
1313
|
},
|
|
1314
|
+
async repairContributions(graphId, vectorSlots) {
|
|
1315
|
+
return contributionMaterializer.repairContributions(graphId, vectorSlots);
|
|
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
|
+
},
|
|
1151
1327
|
// Vector counterparts of the runtime-contribution methods. Present
|
|
1152
1328
|
// only when a vector strategy is wired (omitted on a plain SQLite
|
|
1153
1329
|
// connection with no vector extension), mirroring the embedding/
|
|
@@ -1184,32 +1360,32 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1184
1360
|
async refreshStatistics() {
|
|
1185
1361
|
try {
|
|
1186
1362
|
await db.run(
|
|
1187
|
-
|
|
1188
|
-
|
|
1363
|
+
chunkU5SON7R2_cjs.toDrizzleSql(
|
|
1364
|
+
chunkVCRRKBLN_cjs.sql`PRAGMA analysis_limit = ${chunkVCRRKBLN_cjs.sql.raw(String(SQLITE_ANALYZE_ROW_LIMIT))}`,
|
|
1189
1365
|
"sqlite"
|
|
1190
1366
|
)
|
|
1191
1367
|
);
|
|
1192
1368
|
} catch (error) {
|
|
1193
|
-
if (!
|
|
1369
|
+
if (!chunkBSFJMMV3_cjs.isSqliteNotAuthorizedError(error)) throw error;
|
|
1194
1370
|
}
|
|
1195
1371
|
for (const tableName of coreAnalyzeTables) {
|
|
1196
1372
|
await db.run(
|
|
1197
|
-
|
|
1198
|
-
|
|
1373
|
+
chunkU5SON7R2_cjs.toDrizzleSql(
|
|
1374
|
+
chunkVCRRKBLN_cjs.sql`ANALYZE ${chunkVCRRKBLN_cjs.sql.identifier(tableName)}`,
|
|
1199
1375
|
"sqlite"
|
|
1200
1376
|
)
|
|
1201
1377
|
);
|
|
1202
1378
|
}
|
|
1203
|
-
for (const tableName of
|
|
1379
|
+
for (const tableName of guardedAnalyzeTables) {
|
|
1204
1380
|
try {
|
|
1205
1381
|
await db.run(
|
|
1206
|
-
|
|
1207
|
-
|
|
1382
|
+
chunkU5SON7R2_cjs.toDrizzleSql(
|
|
1383
|
+
chunkVCRRKBLN_cjs.sql`ANALYZE ${chunkVCRRKBLN_cjs.sql.identifier(tableName)}`,
|
|
1208
1384
|
"sqlite"
|
|
1209
1385
|
)
|
|
1210
1386
|
);
|
|
1211
1387
|
} catch (error) {
|
|
1212
|
-
if (!
|
|
1388
|
+
if (!chunkBSFJMMV3_cjs.isMissingTableError(error)) throw error;
|
|
1213
1389
|
}
|
|
1214
1390
|
}
|
|
1215
1391
|
},
|
|
@@ -1220,9 +1396,15 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1220
1396
|
},
|
|
1221
1397
|
async commitSchemaVersionIfKindsEmpty(params, probes) {
|
|
1222
1398
|
return runSchemaWriteTransaction(
|
|
1223
|
-
(target) =>
|
|
1399
|
+
(target) => chunkMUK4BU7K_cjs.commitSchemaVersionIfKindsEmpty(target, params, probes)
|
|
1224
1400
|
);
|
|
1225
1401
|
},
|
|
1402
|
+
async commitSchemaVersionWithPreflight(params, preflight) {
|
|
1403
|
+
return runSchemaWriteTransaction(async (target) => {
|
|
1404
|
+
await preflight(target);
|
|
1405
|
+
return target.commitSchemaVersion(params);
|
|
1406
|
+
});
|
|
1407
|
+
},
|
|
1226
1408
|
async setActiveVersion(params) {
|
|
1227
1409
|
await runSchemaWriteTransaction(
|
|
1228
1410
|
(target) => target.setActiveVersion(params)
|
|
@@ -1235,9 +1417,9 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1235
1417
|
return backend.transactionWithNative((tx) => fn(tx), options2);
|
|
1236
1418
|
},
|
|
1237
1419
|
async transactionWithNative(fn, options2) {
|
|
1238
|
-
const temporaryWrites = options2?.temporaryWrites ===
|
|
1420
|
+
const temporaryWrites = options2?.temporaryWrites === chunkXBYVV3MP_cjs.INTERNAL_TEMPORARY_WRITES;
|
|
1239
1421
|
if (temporaryWrites && options2.accessMode !== "read_only") {
|
|
1240
|
-
throw new
|
|
1422
|
+
throw new chunkNI72YOJB_cjs.ConfigurationError(
|
|
1241
1423
|
"Temporary-write transactions must be semantically read-only.",
|
|
1242
1424
|
{ dialect: "sqlite" }
|
|
1243
1425
|
);
|
|
@@ -1265,7 +1447,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1265
1447
|
);
|
|
1266
1448
|
try {
|
|
1267
1449
|
const result = await fn(
|
|
1268
|
-
|
|
1450
|
+
chunkMUK4BU7K_cjs.gateFulltext(
|
|
1269
1451
|
txBackend,
|
|
1270
1452
|
contributionMaterializer.assertInitialized
|
|
1271
1453
|
),
|
|
@@ -1274,7 +1456,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1274
1456
|
await runFrameStatement(drizzleOrm.sql`COMMIT`);
|
|
1275
1457
|
return result;
|
|
1276
1458
|
} catch (error) {
|
|
1277
|
-
await
|
|
1459
|
+
await rollbackFrameQuietly();
|
|
1278
1460
|
throw error;
|
|
1279
1461
|
}
|
|
1280
1462
|
});
|
|
@@ -1297,7 +1479,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1297
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)."
|
|
1298
1480
|
);
|
|
1299
1481
|
}
|
|
1300
|
-
|
|
1482
|
+
chunkMUK4BU7K_cjs.assertAdoptedDialect(
|
|
1301
1483
|
externalTx,
|
|
1302
1484
|
sqliteCore.BaseSQLiteDatabase,
|
|
1303
1485
|
"sqlite"
|
|
@@ -1309,6 +1491,9 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1309
1491
|
return Promise.resolve();
|
|
1310
1492
|
}
|
|
1311
1493
|
};
|
|
1494
|
+
if (serializedConnection !== void 0) {
|
|
1495
|
+
chunkXBYVV3MP_cjs.markSerializedTransactionResource(backend, serializedConnection);
|
|
1496
|
+
}
|
|
1312
1497
|
return backend;
|
|
1313
1498
|
}
|
|
1314
1499
|
function createTransactionBackend(options) {
|
|
@@ -1329,5 +1514,6 @@ function createTransactionBackend(options) {
|
|
|
1329
1514
|
}
|
|
1330
1515
|
|
|
1331
1516
|
exports.createSqliteBackend = createSqliteBackend;
|
|
1332
|
-
|
|
1333
|
-
//# sourceMappingURL=chunk-
|
|
1517
|
+
exports.isLocalLibsqlClient = isLocalLibsqlClient;
|
|
1518
|
+
//# sourceMappingURL=chunk-YVWGEQJE.cjs.map
|
|
1519
|
+
//# sourceMappingURL=chunk-YVWGEQJE.cjs.map
|