@nicia-ai/typegraph 0.37.0 → 0.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -10
- package/dist/backend/drizzle/indexes.cjs +32 -0
- package/dist/backend/drizzle/indexes.cjs.map +1 -0
- package/dist/backend/drizzle/indexes.d.cts +43 -0
- package/dist/backend/drizzle/indexes.d.ts +43 -0
- package/dist/backend/drizzle/indexes.js +11 -0
- package/dist/backend/drizzle/indexes.js.map +1 -0
- package/dist/backend/index.cjs +161 -0
- package/dist/backend/index.cjs.map +1 -0
- package/dist/backend/index.d.cts +3 -0
- package/dist/backend/index.d.ts +3 -0
- package/dist/backend/index.js +8 -0
- package/dist/backend/index.js.map +1 -0
- package/dist/backend/postgres/index.cjs +32 -28
- package/dist/backend/postgres/index.d.cts +13 -12
- package/dist/backend/postgres/index.d.ts +13 -12
- package/dist/backend/postgres/index.js +19 -15
- package/dist/backend/postgres/pglite-store.cjs +67 -0
- package/dist/backend/postgres/pglite-store.cjs.map +1 -0
- package/dist/backend/postgres/pglite-store.d.cts +38 -0
- package/dist/backend/postgres/pglite-store.d.ts +38 -0
- package/dist/backend/postgres/pglite-store.js +65 -0
- package/dist/backend/postgres/pglite-store.js.map +1 -0
- package/dist/backend/postgres/pglite.cjs +25 -50
- package/dist/backend/postgres/pglite.cjs.map +1 -1
- package/dist/backend/postgres/pglite.d.cts +10 -9
- package/dist/backend/postgres/pglite.d.ts +10 -9
- package/dist/backend/postgres/pglite.js +20 -52
- package/dist/backend/postgres/pglite.js.map +1 -1
- package/dist/backend/sqlite/index.cjs +29 -25
- package/dist/backend/sqlite/index.d.cts +11 -11
- package/dist/backend/sqlite/index.d.ts +11 -11
- package/dist/backend/sqlite/index.js +17 -13
- package/dist/backend/sqlite/libsql.cjs +23 -19
- package/dist/backend/sqlite/libsql.cjs.map +1 -1
- package/dist/backend/sqlite/libsql.d.cts +9 -10
- package/dist/backend/sqlite/libsql.d.ts +9 -10
- package/dist/backend/sqlite/libsql.js +19 -15
- package/dist/backend/sqlite/libsql.js.map +1 -1
- package/dist/backend/sqlite/local-store.cjs +72 -0
- package/dist/backend/sqlite/local-store.cjs.map +1 -0
- package/dist/backend/sqlite/local-store.d.cts +42 -0
- package/dist/backend/sqlite/local-store.d.ts +42 -0
- package/dist/backend/sqlite/local-store.js +67 -0
- package/dist/backend/sqlite/local-store.js.map +1 -0
- package/dist/backend/sqlite/local.cjs +28 -183
- package/dist/backend/sqlite/local.cjs.map +1 -1
- package/dist/backend/sqlite/local.d.cts +8 -81
- package/dist/backend/sqlite/local.d.ts +8 -81
- package/dist/backend/sqlite/local.js +20 -180
- package/dist/backend/sqlite/local.js.map +1 -1
- package/dist/chunk-2EBMPJBO.js +16 -0
- package/dist/chunk-2EBMPJBO.js.map +1 -0
- package/dist/{chunk-NBP2WTJW.cjs → chunk-2SL7OGPR.cjs} +2900 -1597
- package/dist/chunk-2SL7OGPR.cjs.map +1 -0
- package/dist/chunk-35S6P5ZU.js +27 -0
- package/dist/chunk-35S6P5ZU.js.map +1 -0
- package/dist/chunk-3LKL3S6X.js +50 -0
- package/dist/chunk-3LKL3S6X.js.map +1 -0
- package/dist/chunk-6G5CQ6JX.js +47 -0
- package/dist/chunk-6G5CQ6JX.js.map +1 -0
- package/dist/chunk-6XDBRDZE.js +312 -0
- package/dist/chunk-6XDBRDZE.js.map +1 -0
- package/dist/chunk-764JHTLT.cjs +15 -0
- package/dist/chunk-764JHTLT.cjs.map +1 -0
- package/dist/chunk-76HE7DJP.js +68 -0
- package/dist/chunk-76HE7DJP.js.map +1 -0
- package/dist/{chunk-VGDDG3XJ.cjs → chunk-7M3NACL3.cjs} +12 -12
- package/dist/{chunk-VGDDG3XJ.cjs.map → chunk-7M3NACL3.cjs.map} +1 -1
- package/dist/{chunk-NXQFATMF.cjs → chunk-7VLCN3JB.cjs} +153 -123
- package/dist/chunk-7VLCN3JB.cjs.map +1 -0
- package/dist/{chunk-552KNYQJ.js → chunk-A2FGSWMQ.js} +1907 -607
- package/dist/chunk-A2FGSWMQ.js.map +1 -0
- package/dist/chunk-AOL64O4Z.js +165 -0
- package/dist/chunk-AOL64O4Z.js.map +1 -0
- package/dist/{chunk-27SSDCEP.cjs → chunk-B63IFHXR.cjs} +53 -74
- package/dist/chunk-B63IFHXR.cjs.map +1 -0
- package/dist/{chunk-3XXGYU62.cjs → chunk-BKAKAVRW.cjs} +56 -53
- package/dist/chunk-BKAKAVRW.cjs.map +1 -0
- package/dist/{chunk-YTSN73ND.js → chunk-BQITNFQJ.js} +3 -3
- package/dist/{chunk-YTSN73ND.js.map → chunk-BQITNFQJ.js.map} +1 -1
- package/dist/{chunk-NUIG3BCV.cjs → chunk-CQC6VBAF.cjs} +93 -155
- package/dist/chunk-CQC6VBAF.cjs.map +1 -0
- package/dist/{chunk-6EEO3OVU.cjs → chunk-CWX77JB4.cjs} +22 -59
- package/dist/chunk-CWX77JB4.cjs.map +1 -0
- package/dist/{chunk-UGZUAYAR.js → chunk-D7PG5D5K.js} +4 -3
- package/dist/chunk-D7PG5D5K.js.map +1 -0
- package/dist/chunk-DDCIXXOO.js +9 -0
- package/dist/chunk-DDCIXXOO.js.map +1 -0
- package/dist/chunk-DDCYVIVV.cjs +44 -0
- package/dist/chunk-DDCYVIVV.cjs.map +1 -0
- package/dist/{chunk-XPCZADMT.cjs → chunk-DOVMTPKE.cjs} +89 -27
- package/dist/chunk-DOVMTPKE.cjs.map +1 -0
- package/dist/{chunk-5PNMDJ7J.js → chunk-DPNA466P.js} +14 -9
- package/dist/chunk-DPNA466P.js.map +1 -0
- package/dist/{chunk-BYPOGQWK.js → chunk-DRACN6XG.js} +6 -4
- package/dist/chunk-DRACN6XG.js.map +1 -0
- package/dist/chunk-E6TXEISH.cjs +175 -0
- package/dist/chunk-E6TXEISH.cjs.map +1 -0
- package/dist/{chunk-TKT2XHED.js → chunk-E6YZRKMM.js} +13 -12
- package/dist/chunk-E6YZRKMM.js.map +1 -0
- package/dist/{chunk-3C2RYI6L.cjs → chunk-EOJFGECD.cjs} +11 -11
- package/dist/chunk-EOJFGECD.cjs.map +1 -0
- package/dist/{chunk-XWV4JT34.js → chunk-ERZ4QPQX.js} +27 -22
- package/dist/chunk-ERZ4QPQX.js.map +1 -0
- package/dist/{chunk-DFVLCOP6.js → chunk-EZH7FNUS.js} +3 -3
- package/dist/{chunk-DFVLCOP6.js.map → chunk-EZH7FNUS.js.map} +1 -1
- package/dist/{chunk-WWFHO375.cjs → chunk-FJMPR3OH.cjs} +4 -3
- package/dist/chunk-FJMPR3OH.cjs.map +1 -0
- package/dist/chunk-FMNUSGZ4.cjs +12 -0
- package/dist/chunk-FMNUSGZ4.cjs.map +1 -0
- package/dist/{chunk-K3Q3LJY3.js → chunk-G32AO634.js} +201 -100
- package/dist/chunk-G32AO634.js.map +1 -0
- package/dist/{chunk-EXU3RASM.js → chunk-G3CSQLLT.js} +20 -474
- package/dist/chunk-G3CSQLLT.js.map +1 -0
- package/dist/chunk-GNPGGLAE.cjs +212 -0
- package/dist/chunk-GNPGGLAE.cjs.map +1 -0
- package/dist/{chunk-QARBLBXT.cjs → chunk-GUUWKPTK.cjs} +7 -7
- package/dist/{chunk-QARBLBXT.cjs.map → chunk-GUUWKPTK.cjs.map} +1 -1
- package/dist/chunk-GYA4JRP5.js +31 -0
- package/dist/chunk-GYA4JRP5.js.map +1 -0
- package/dist/chunk-I6FX7AAG.js +39 -0
- package/dist/chunk-I6FX7AAG.js.map +1 -0
- package/dist/chunk-IMQKXL4E.cjs +12 -0
- package/dist/{chunk-QSXTWU4U.cjs.map → chunk-IMQKXL4E.cjs.map} +1 -1
- package/dist/chunk-J6IJARLG.js +94 -0
- package/dist/chunk-J6IJARLG.js.map +1 -0
- package/dist/{chunk-W63OVYY4.js → chunk-K34OPSJK.js} +3 -3
- package/dist/{chunk-W63OVYY4.js.map → chunk-K34OPSJK.js.map} +1 -1
- package/dist/{chunk-TGOMW4MB.cjs → chunk-KCLZHYPU.cjs} +110 -109
- package/dist/chunk-KCLZHYPU.cjs.map +1 -0
- package/dist/{chunk-XGPUQ56G.js → chunk-KFLXWVUJ.js} +4 -38
- package/dist/chunk-KFLXWVUJ.js.map +1 -0
- package/dist/{chunk-3DS7Z4T4.cjs → chunk-LZ3TVJY4.cjs} +44 -43
- package/dist/chunk-LZ3TVJY4.cjs.map +1 -0
- package/dist/{chunk-UXLSNRYL.js → chunk-MTNEGGM2.js} +4 -4
- package/dist/chunk-MTNEGGM2.js.map +1 -0
- package/dist/{chunk-IP3CGGPA.cjs → chunk-N2V3HJFV.cjs} +92 -185
- package/dist/chunk-N2V3HJFV.cjs.map +1 -0
- package/dist/chunk-NAUA4PW5.cjs +28 -0
- package/dist/chunk-NAUA4PW5.cjs.map +1 -0
- package/dist/chunk-NMQ6C6TS.cjs +61 -0
- package/dist/chunk-NMQ6C6TS.cjs.map +1 -0
- package/dist/{chunk-2N6EOBTH.cjs → chunk-NPWACFQJ.cjs} +58 -53
- package/dist/chunk-NPWACFQJ.cjs.map +1 -0
- package/dist/{chunk-5KEQ74YU.cjs → chunk-NT6ILURI.cjs} +9 -86
- package/dist/chunk-NT6ILURI.cjs.map +1 -0
- package/dist/chunk-NU23DUSJ.cjs +192 -0
- package/dist/chunk-NU23DUSJ.cjs.map +1 -0
- package/dist/{chunk-WOJMKB3N.cjs → chunk-NWYCOFEZ.cjs} +1677 -308
- package/dist/chunk-NWYCOFEZ.cjs.map +1 -0
- package/dist/{chunk-3GH67G4Z.cjs → chunk-O5H62ZWJ.cjs} +4 -42
- package/dist/chunk-O5H62ZWJ.cjs.map +1 -0
- package/dist/{chunk-3SLPDKHQ.js → chunk-PH4IJ3V5.js} +5 -77
- package/dist/chunk-PH4IJ3V5.js.map +1 -0
- package/dist/chunk-PWXGB77L.cjs +56 -0
- package/dist/chunk-PWXGB77L.cjs.map +1 -0
- package/dist/chunk-PZHC5GCD.js +193 -0
- package/dist/chunk-PZHC5GCD.js.map +1 -0
- package/dist/chunk-QMQLUA66.js +12 -0
- package/dist/chunk-QMQLUA66.js.map +1 -0
- package/dist/{chunk-5WWVZMVX.js → chunk-QZ7A6HBM.js} +2 -2
- package/dist/{chunk-5WWVZMVX.js.map → chunk-QZ7A6HBM.js.map} +1 -1
- package/dist/{chunk-VKGKDOKR.js → chunk-RQPRCEIO.js} +1539 -206
- package/dist/chunk-RQPRCEIO.js.map +1 -0
- package/dist/chunk-RW24SAHI.cjs +74 -0
- package/dist/chunk-RW24SAHI.cjs.map +1 -0
- package/dist/{chunk-BVRDGYXQ.cjs → chunk-SAFZ6JTI.cjs} +14 -9
- package/dist/chunk-SAFZ6JTI.cjs.map +1 -0
- package/dist/{chunk-L7HQ2OSI.js → chunk-SCTZRFW5.js} +87 -166
- package/dist/chunk-SCTZRFW5.js.map +1 -0
- package/dist/{chunk-5KPNWT6X.js → chunk-SDHV2MWU.js} +24 -45
- package/dist/chunk-SDHV2MWU.js.map +1 -0
- package/dist/chunk-SVJ5GEXW.cjs +45 -0
- package/dist/chunk-SVJ5GEXW.cjs.map +1 -0
- package/dist/chunk-SVUKGWSN.cjs +102 -0
- package/dist/chunk-SVUKGWSN.cjs.map +1 -0
- package/dist/chunk-TAUGGLNQ.js +59 -0
- package/dist/chunk-TAUGGLNQ.js.map +1 -0
- package/dist/{chunk-J4IUSYFF.js → chunk-TE5ZA4VX.js} +69 -27
- package/dist/chunk-TE5ZA4VX.js.map +1 -0
- package/dist/{chunk-A42GCBGX.cjs → chunk-TRF4EBJT.cjs} +6 -4
- package/dist/chunk-TRF4EBJT.cjs.map +1 -0
- package/dist/{chunk-KQJ54OG5.js → chunk-U4JDJKPD.js} +19 -56
- package/dist/chunk-U4JDJKPD.js.map +1 -0
- package/dist/chunk-UH2USOMG.cjs +627 -0
- package/dist/chunk-UH2USOMG.cjs.map +1 -0
- package/dist/{chunk-RCVLFTCT.js → chunk-UPXDVI3T.js} +13 -12
- package/dist/chunk-UPXDVI3T.js.map +1 -0
- package/dist/{chunk-5VQM6VWP.cjs → chunk-UWG5GX6E.cjs} +2 -2
- package/dist/{chunk-5VQM6VWP.cjs.map → chunk-UWG5GX6E.cjs.map} +1 -1
- package/dist/{chunk-3RWZPJKV.js → chunk-VBH7ZXSZ.js} +21 -78
- package/dist/chunk-VBH7ZXSZ.js.map +1 -0
- package/dist/{chunk-K5UBVGJN.js → chunk-VDYA2HMS.js} +6 -6
- package/dist/{chunk-K5UBVGJN.js.map → chunk-VDYA2HMS.js.map} +1 -1
- package/dist/chunk-X4PVHAZ6.cjs +83 -0
- package/dist/chunk-X4PVHAZ6.cjs.map +1 -0
- package/dist/{chunk-UYQMBBWJ.js → chunk-X6CNEA32.js} +23 -20
- package/dist/chunk-X6CNEA32.js.map +1 -0
- package/dist/chunk-X6RDQ5NB.cjs +335 -0
- package/dist/chunk-X6RDQ5NB.cjs.map +1 -0
- package/dist/chunk-XD6X7O5R.js +184 -0
- package/dist/chunk-XD6X7O5R.js.map +1 -0
- package/dist/{chunk-DIQ3AV5W.cjs → chunk-XFY73JWD.cjs} +324 -224
- package/dist/chunk-XFY73JWD.cjs.map +1 -0
- package/dist/{chunk-DEFQM7JU.cjs → chunk-XRU7V7FF.cjs} +7 -7
- package/dist/{chunk-DEFQM7JU.cjs.map → chunk-XRU7V7FF.cjs.map} +1 -1
- package/dist/{chunk-TPF25IG6.js → chunk-XZA3Y4YH.js} +3 -3
- package/dist/{chunk-TPF25IG6.js.map → chunk-XZA3Y4YH.js.map} +1 -1
- package/dist/chunk-Y7M44XEK.js +462 -0
- package/dist/chunk-Y7M44XEK.js.map +1 -0
- package/dist/{chunk-RRSNR3TP.js → chunk-YIRLBUNN.js} +3 -3
- package/dist/{chunk-RRSNR3TP.js.map → chunk-YIRLBUNN.js.map} +1 -1
- package/dist/{chunk-IXGYRP2P.js → chunk-YJDSPA5E.js} +79 -49
- package/dist/chunk-YJDSPA5E.js.map +1 -0
- package/dist/{chunk-JBNOGRKW.cjs → chunk-YLINFV7Z.cjs} +157 -115
- package/dist/chunk-YLINFV7Z.cjs.map +1 -0
- package/dist/{chunk-QERAIDRJ.js → chunk-Z2PPIVOO.js} +82 -22
- package/dist/chunk-Z2PPIVOO.js.map +1 -0
- package/dist/chunk-Z5QHVL5U.cjs +12 -0
- package/dist/chunk-Z5QHVL5U.cjs.map +1 -0
- package/dist/chunk-ZDH3DX3C.cjs +30 -0
- package/dist/chunk-ZDH3DX3C.cjs.map +1 -0
- package/dist/chunk-ZE6NVENI.js +77 -0
- package/dist/chunk-ZE6NVENI.js.map +1 -0
- package/dist/chunk-ZHX4KEM7.cjs +49 -0
- package/dist/chunk-ZHX4KEM7.cjs.map +1 -0
- package/dist/chunk-ZKZAIX42.cjs +479 -0
- package/dist/chunk-ZKZAIX42.cjs.map +1 -0
- package/dist/{chunk-TEDRJXOG.cjs → chunk-ZY4GXIVN.cjs} +5 -5
- package/dist/{chunk-TEDRJXOG.cjs.map → chunk-ZY4GXIVN.cjs.map} +1 -1
- package/dist/core/index.cjs +117 -0
- package/dist/core/index.cjs.map +1 -0
- package/dist/core/index.d.cts +225 -0
- package/dist/core/index.d.ts +225 -0
- package/dist/core/index.js +12 -0
- package/dist/core/index.js.map +1 -0
- package/dist/{ddl-CS0KUVwB.d.ts → ddl-Dx3Z0_WC.d.ts} +3 -3
- package/dist/{ddl-BD-ZfKeX.d.cts → ddl-J6sDyABg.d.cts} +3 -3
- package/dist/define-graph-CzEvA_8F.d.cts +174 -0
- package/dist/define-graph-DRo9xpYN.d.ts +174 -0
- package/dist/{extension-types-BM2ACfYO.d.cts → extension-types-BLEVH4SG.d.cts} +1 -1
- package/dist/{extension-types-BM2ACfYO.d.ts → extension-types-BLEVH4SG.d.ts} +1 -1
- package/dist/graph-extension/index.cjs +21 -19
- package/dist/graph-extension/index.d.cts +4 -4
- package/dist/graph-extension/index.d.ts +4 -4
- package/dist/graph-extension/index.js +6 -4
- package/dist/graph-merge/index.cjs +265 -214
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +8 -89
- package/dist/graph-merge/index.d.ts +8 -89
- package/dist/graph-merge/index.js +141 -90
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/{index-BeacbPoe.d.ts → index-BD_3TCgh.d.ts} +6 -4
- package/dist/{index-BPM59vsg.d.cts → index-BihFPsPu.d.cts} +6 -4
- package/dist/{fulltext-strategy-C27vXaeB.d.cts → index-Bq7vSPHy.d.ts} +3195 -2646
- package/dist/{fulltext-strategy-DebsMrqg.d.ts → index-CrFL_ENI.d.cts} +3195 -2646
- package/dist/index.cjs +326 -315
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +59 -240
- package/dist/index.d.ts +59 -240
- package/dist/index.js +46 -79
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.cjs +26 -38
- package/dist/indexes/index.d.cts +6 -41
- package/dist/indexes/index.d.ts +6 -41
- package/dist/indexes/index.js +14 -10
- package/dist/interchange/index.cjs +48 -39
- package/dist/interchange/index.cjs.map +1 -1
- package/dist/interchange/index.d.cts +7 -8
- package/dist/interchange/index.d.ts +7 -8
- package/dist/interchange/index.js +23 -14
- package/dist/interchange/index.js.map +1 -1
- package/dist/local-options-CZ1BnIoF.d.cts +29 -0
- package/dist/local-options-CZ1BnIoF.d.ts +29 -0
- package/dist/{manager-D00_NXvT.d.ts → manager-CASfhmzV.d.ts} +4 -173
- package/dist/{manager-nU1vTJLy.d.cts → manager-nCEJiYBb.d.cts} +4 -173
- package/dist/{materialize-indexes-zK2J_flP.d.ts → materialize-indexes-D4iei4Kp.d.ts} +1 -1
- package/dist/{materialize-indexes-CuR3gAZb.d.cts → materialize-indexes-ExQ6OrAh.d.cts} +1 -1
- package/dist/{postgres-IaBA4RgE.d.ts → postgres-Cl1ZAN1G.d.ts} +1 -1
- package/dist/{postgres-YrYmPlaU.d.cts → postgres-DMgIKQU-.d.cts} +1 -1
- package/dist/postgres-execution-fKW0qRiN.d.cts +14 -0
- package/dist/postgres-execution-fKW0qRiN.d.ts +14 -0
- package/dist/profiler/index.cjs +9 -8
- package/dist/profiler/index.cjs.map +1 -1
- package/dist/profiler/index.d.cts +9 -17
- package/dist/profiler/index.d.ts +9 -17
- package/dist/profiler/index.js +8 -7
- package/dist/profiler/index.js.map +1 -1
- package/dist/provenance/index.cjs +61 -55
- package/dist/provenance/index.cjs.map +1 -1
- package/dist/provenance/index.d.cts +7 -8
- package/dist/provenance/index.d.ts +7 -8
- package/dist/provenance/index.js +34 -28
- package/dist/provenance/index.js.map +1 -1
- package/dist/schema/index.cjs +46 -37
- package/dist/schema/index.cjs.map +1 -1
- package/dist/schema/index.d.cts +8 -10
- package/dist/schema/index.d.ts +8 -10
- package/dist/schema/index.js +22 -13
- package/dist/schema/index.js.map +1 -1
- package/dist/{sqlite-BUOHPx7p.d.ts → sqlite-BDkW39aa.d.cts} +1 -1
- package/dist/{sqlite-Pp8O19WE.d.cts → sqlite-CYfhvESj.d.ts} +1 -1
- package/dist/sqlite-execution-DwbE2a9y.d.cts +32 -0
- package/dist/sqlite-execution-DwbE2a9y.d.ts +32 -0
- package/dist/{store-view-X96Rd00T.d.cts → store-view-BoHqdHjB.d.cts} +394 -1393
- package/dist/{store-view-ANL6mTph.d.ts → store-view-Ctq-3OHy.d.ts} +394 -1393
- package/dist/temporal-BC_NQV5Y.d.cts +281 -0
- package/dist/temporal-DqtOEo_B.d.ts +281 -0
- package/dist/{types-r-Zyq2Hz.d.cts → types-COq3-vMC.d.cts} +2 -2
- package/dist/{types-wsvuBgPK.d.ts → types-CUevi_D1.d.ts} +2 -2
- package/dist/{where-CJOpJj3a.d.ts → where-BdE_cYtx.d.ts} +5 -5
- package/dist/{where-K3uBP33l.d.cts → where-C92TXCzT.d.cts} +5 -5
- package/package.json +37 -6
- package/dist/chunk-27SSDCEP.cjs.map +0 -1
- package/dist/chunk-2N6EOBTH.cjs.map +0 -1
- package/dist/chunk-3C2RYI6L.cjs.map +0 -1
- package/dist/chunk-3DS7Z4T4.cjs.map +0 -1
- package/dist/chunk-3GH67G4Z.cjs.map +0 -1
- package/dist/chunk-3RWZPJKV.js.map +0 -1
- package/dist/chunk-3SLPDKHQ.js.map +0 -1
- package/dist/chunk-3XXGYU62.cjs.map +0 -1
- package/dist/chunk-44TA22QT.js +0 -1478
- package/dist/chunk-44TA22QT.js.map +0 -1
- package/dist/chunk-552KNYQJ.js.map +0 -1
- package/dist/chunk-5KEQ74YU.cjs.map +0 -1
- package/dist/chunk-5KPNWT6X.js.map +0 -1
- package/dist/chunk-5PNMDJ7J.js.map +0 -1
- package/dist/chunk-6EEO3OVU.cjs.map +0 -1
- package/dist/chunk-7YSP4V4R.cjs +0 -69
- package/dist/chunk-7YSP4V4R.cjs.map +0 -1
- package/dist/chunk-A42GCBGX.cjs.map +0 -1
- package/dist/chunk-BVRDGYXQ.cjs.map +0 -1
- package/dist/chunk-BYPOGQWK.js.map +0 -1
- package/dist/chunk-CUHM5CWJ.cjs +0 -12
- package/dist/chunk-CUHM5CWJ.cjs.map +0 -1
- package/dist/chunk-DIQ3AV5W.cjs.map +0 -1
- package/dist/chunk-EXU3RASM.js.map +0 -1
- package/dist/chunk-IP3CGGPA.cjs.map +0 -1
- package/dist/chunk-IPSVVTWT.cjs +0 -1540
- package/dist/chunk-IPSVVTWT.cjs.map +0 -1
- package/dist/chunk-IXGYRP2P.js.map +0 -1
- package/dist/chunk-J4IUSYFF.js.map +0 -1
- package/dist/chunk-JBNOGRKW.cjs.map +0 -1
- package/dist/chunk-K3Q3LJY3.js.map +0 -1
- package/dist/chunk-KQJ54OG5.js.map +0 -1
- package/dist/chunk-L7HQ2OSI.js.map +0 -1
- package/dist/chunk-M6VES7V6.js +0 -239
- package/dist/chunk-M6VES7V6.js.map +0 -1
- package/dist/chunk-NBP2WTJW.cjs.map +0 -1
- package/dist/chunk-NUIG3BCV.cjs.map +0 -1
- package/dist/chunk-NXQFATMF.cjs.map +0 -1
- package/dist/chunk-OHMP6N2J.js +0 -47
- package/dist/chunk-OHMP6N2J.js.map +0 -1
- package/dist/chunk-QERAIDRJ.js.map +0 -1
- package/dist/chunk-QSXTWU4U.cjs +0 -12
- package/dist/chunk-RCVLFTCT.js.map +0 -1
- package/dist/chunk-TGOMW4MB.cjs.map +0 -1
- package/dist/chunk-TKT2XHED.js.map +0 -1
- package/dist/chunk-UGZUAYAR.js.map +0 -1
- package/dist/chunk-UXLSNRYL.js.map +0 -1
- package/dist/chunk-UYQMBBWJ.js.map +0 -1
- package/dist/chunk-VKGKDOKR.js.map +0 -1
- package/dist/chunk-VL2V6PEN.cjs +0 -261
- package/dist/chunk-VL2V6PEN.cjs.map +0 -1
- package/dist/chunk-WOJMKB3N.cjs.map +0 -1
- package/dist/chunk-WWFHO375.cjs.map +0 -1
- package/dist/chunk-XGPUQ56G.js.map +0 -1
- package/dist/chunk-XGU7DZDA.cjs +0 -1095
- package/dist/chunk-XGU7DZDA.cjs.map +0 -1
- package/dist/chunk-XPCZADMT.cjs.map +0 -1
- package/dist/chunk-XWV4JT34.js.map +0 -1
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { tables } from './chunk-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { tables } from './chunk-MTNEGGM2.js';
|
|
2
|
+
import { formatPostgresTimestamp, coerceNumericScore, nowIso } from './chunk-AOL64O4Z.js';
|
|
3
|
+
import { buildPostgresSystemIndexBuilders, buildPostgresNodeIndexBuilders, buildPostgresEdgeIndexBuilders, toDrizzleSql } from './chunk-Z2PPIVOO.js';
|
|
4
|
+
import { chunk } from './chunk-35S6P5ZU.js';
|
|
5
|
+
import { createBackendOverlay } from './chunk-PZHC5GCD.js';
|
|
4
6
|
import { sortedReplacer } from './chunk-UR7W5YQK.js';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { EmbeddingDimensionChangedError, ConfigurationError, MigrationError, SchemaContentConflictError, DatabaseOperationError, UniquenessError, TrustedImportError, StaleVersionError, StoreNotInitializedError } from './chunk-
|
|
7
|
+
import { parseDimensionMismatch, isMissingTableError } from './chunk-KFLXWVUJ.js';
|
|
8
|
+
import { assertNoSystemIndexNameCollision } from './chunk-BQITNFQJ.js';
|
|
9
|
+
import { sha256Hex } from './chunk-K34OPSJK.js';
|
|
10
|
+
import { tsvectorStrategy, fts5Strategy, BASE_CONTRIBUTION_OWNER } from './chunk-Y7M44XEK.js';
|
|
11
|
+
import { sql as sql$1, asCompiledStatementSql, isSqlFragment } from './chunk-6XDBRDZE.js';
|
|
12
|
+
import { isPresent } from './chunk-QMQLUA66.js';
|
|
13
|
+
import { EmbeddingDimensionChangedError, ConfigurationError, MigrationError, SchemaContentConflictError, DatabaseOperationError, UniquenessError, TrustedImportError, StaleVersionError, StoreNotInitializedError } from './chunk-DPNA466P.js';
|
|
12
14
|
import { sql, is, getTableName } from 'drizzle-orm';
|
|
13
15
|
import { customType, pgTable, timestamp, integer, jsonb, text, primaryKey, index, boolean, uniqueIndex, getTableConfig as getTableConfig$1, PgTable } from 'drizzle-orm/pg-core';
|
|
14
16
|
import { getTableConfig, SQLiteTable } from 'drizzle-orm/sqlite-core';
|
|
@@ -99,7 +101,9 @@ function createPostgresTables(names = {}, options = {}) {
|
|
|
99
101
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull(),
|
|
100
102
|
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull(),
|
|
101
103
|
deletedAt: timestamp("deleted_at", { withTimezone: true }),
|
|
102
|
-
recordedFrom: timestamp("recorded_from", {
|
|
104
|
+
recordedFrom: timestamp("recorded_from", {
|
|
105
|
+
withTimezone: true
|
|
106
|
+
}).notNull(),
|
|
103
107
|
recordedTo: timestamp("recorded_to", { withTimezone: true }).notNull(),
|
|
104
108
|
op: text("op").notNull(),
|
|
105
109
|
schemaVersion: integer("schema_version"),
|
|
@@ -128,7 +132,9 @@ function createPostgresTables(names = {}, options = {}) {
|
|
|
128
132
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull(),
|
|
129
133
|
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull(),
|
|
130
134
|
deletedAt: timestamp("deleted_at", { withTimezone: true }),
|
|
131
|
-
recordedFrom: timestamp("recorded_from", {
|
|
135
|
+
recordedFrom: timestamp("recorded_from", {
|
|
136
|
+
withTimezone: true
|
|
137
|
+
}).notNull(),
|
|
132
138
|
recordedTo: timestamp("recorded_to", { withTimezone: true }).notNull(),
|
|
133
139
|
op: text("op").notNull(),
|
|
134
140
|
schemaVersion: integer("schema_version"),
|
|
@@ -366,9 +372,9 @@ function renderIndexColumn(col) {
|
|
|
366
372
|
if (col && typeof col === "object" && "name" in col) {
|
|
367
373
|
return `"${col.name}"`;
|
|
368
374
|
}
|
|
369
|
-
const
|
|
370
|
-
if (
|
|
371
|
-
return
|
|
375
|
+
const sql16 = tryInlineSql(col);
|
|
376
|
+
if (sql16 !== void 0) {
|
|
377
|
+
return sql16;
|
|
372
378
|
}
|
|
373
379
|
return "unknown";
|
|
374
380
|
}
|
|
@@ -589,6 +595,20 @@ function generatePostgresMigrationSQL(tables3 = tables2, fulltextStrategy = tsve
|
|
|
589
595
|
${ddlSql}`;
|
|
590
596
|
}
|
|
591
597
|
|
|
598
|
+
// src/backend/live-node-candidates.ts
|
|
599
|
+
function buildLiveNodeCandidates(nodesTableName, graphId, nodeKind, now) {
|
|
600
|
+
const nodes2 = sql$1.identifier(nodesTableName);
|
|
601
|
+
return sql$1`
|
|
602
|
+
SELECT "id" AS node_id
|
|
603
|
+
FROM ${nodes2}
|
|
604
|
+
WHERE "graph_id" = ${graphId}
|
|
605
|
+
AND "kind" = ${nodeKind}
|
|
606
|
+
AND "deleted_at" IS NULL
|
|
607
|
+
AND ("valid_from" IS NULL OR "valid_from" <= ${now})
|
|
608
|
+
AND ("valid_to" IS NULL OR "valid_to" > ${now})
|
|
609
|
+
`;
|
|
610
|
+
}
|
|
611
|
+
|
|
592
612
|
// src/backend/drizzle/vector-runtime.ts
|
|
593
613
|
var VECTOR_SLOT_PLACEHOLDER_DIMENSIONS = 1;
|
|
594
614
|
var EMBEDDING_UPSERT_PARAM_COUNT = 5;
|
|
@@ -708,21 +728,21 @@ function identityOf(graphId, contribution) {
|
|
|
708
728
|
function gateFulltextMethods(source, assert) {
|
|
709
729
|
const gated = {};
|
|
710
730
|
if (source.upsertFulltext) {
|
|
711
|
-
const raw = source.upsertFulltext
|
|
731
|
+
const raw = source.upsertFulltext;
|
|
712
732
|
gated.upsertFulltext = async (params) => {
|
|
713
733
|
await assert(params.graphId);
|
|
714
734
|
await raw(params);
|
|
715
735
|
};
|
|
716
736
|
}
|
|
717
737
|
if (source.deleteFulltext) {
|
|
718
|
-
const raw = source.deleteFulltext
|
|
738
|
+
const raw = source.deleteFulltext;
|
|
719
739
|
gated.deleteFulltext = async (params) => {
|
|
720
740
|
await assert(params.graphId);
|
|
721
741
|
await raw(params);
|
|
722
742
|
};
|
|
723
743
|
}
|
|
724
744
|
if (source.upsertFulltextBatch) {
|
|
725
|
-
const raw = source.upsertFulltextBatch
|
|
745
|
+
const raw = source.upsertFulltextBatch;
|
|
726
746
|
gated.upsertFulltextBatch = async (params) => {
|
|
727
747
|
if (params.rows.length === 0) return;
|
|
728
748
|
await assert(params.graphId);
|
|
@@ -730,7 +750,7 @@ function gateFulltextMethods(source, assert) {
|
|
|
730
750
|
};
|
|
731
751
|
}
|
|
732
752
|
if (source.deleteFulltextBatch) {
|
|
733
|
-
const raw = source.deleteFulltextBatch
|
|
753
|
+
const raw = source.deleteFulltextBatch;
|
|
734
754
|
gated.deleteFulltextBatch = async (params) => {
|
|
735
755
|
if (params.nodeIds.length === 0) return;
|
|
736
756
|
await assert(params.graphId);
|
|
@@ -738,13 +758,13 @@ function gateFulltextMethods(source, assert) {
|
|
|
738
758
|
};
|
|
739
759
|
}
|
|
740
760
|
if (source.fulltextSearch) {
|
|
741
|
-
const raw = source.fulltextSearch
|
|
761
|
+
const raw = source.fulltextSearch;
|
|
742
762
|
gated.fulltextSearch = async (params) => {
|
|
743
763
|
await assert(params.graphId);
|
|
744
764
|
return raw(params);
|
|
745
765
|
};
|
|
746
766
|
}
|
|
747
|
-
const rawHardDelete = source.hardDeleteNode
|
|
767
|
+
const rawHardDelete = source.hardDeleteNode;
|
|
748
768
|
gated.hardDeleteNode = async (params) => {
|
|
749
769
|
await assert(params.graphId);
|
|
750
770
|
await rawHardDelete(params);
|
|
@@ -1107,6 +1127,41 @@ function buildKindRemovalOnConflictSet(removedAtColumn, paramsRemovedAt) {
|
|
|
1107
1127
|
lastError: sql`excluded.${sql.identifier("last_error")}`
|
|
1108
1128
|
};
|
|
1109
1129
|
}
|
|
1130
|
+
function sqlNull(value) {
|
|
1131
|
+
return value ?? sql.raw("NULL");
|
|
1132
|
+
}
|
|
1133
|
+
function resolveValidFrom(validFrom, timestamp2) {
|
|
1134
|
+
if (validFrom === null) return void 0;
|
|
1135
|
+
return validFrom ?? timestamp2;
|
|
1136
|
+
}
|
|
1137
|
+
function quotedColumn(column) {
|
|
1138
|
+
return sql.raw(`"${column.name.replaceAll('"', '""')}"`);
|
|
1139
|
+
}
|
|
1140
|
+
function quotedTableName(tableName) {
|
|
1141
|
+
return sql.raw(`"${tableName.replaceAll('"', '""')}"`);
|
|
1142
|
+
}
|
|
1143
|
+
var CODE_POINT_ORDER_BUILDERS = {
|
|
1144
|
+
postgres: (value) => sql`${value} COLLATE "C"`,
|
|
1145
|
+
sqlite: (value) => value
|
|
1146
|
+
};
|
|
1147
|
+
function codePointOrderKey(column, dialect) {
|
|
1148
|
+
return CODE_POINT_ORDER_BUILDERS[dialect](column);
|
|
1149
|
+
}
|
|
1150
|
+
function liveNodeIdsSubquery(nodes2, graphId, nodeKind, nowIso2) {
|
|
1151
|
+
return sql`SELECT ${nodes2.id} AS node_id FROM ${nodes2} WHERE ${nodes2.graphId} = ${graphId} AND ${nodes2.kind} = ${nodeKind} AND ${nodes2.deletedAt} IS NULL AND (${nodes2.validFrom} IS NULL OR ${nodes2.validFrom} <= ${nowIso2}) AND (${nodes2.validTo} IS NULL OR ${nodes2.validTo} > ${nowIso2})`;
|
|
1152
|
+
}
|
|
1153
|
+
function nodeColumnList(nodes2) {
|
|
1154
|
+
return sql.raw(
|
|
1155
|
+
`"${nodes2.graphId.name}", "${nodes2.kind.name}", "${nodes2.id.name}", "${nodes2.props.name}", "${nodes2.version.name}", "${nodes2.validFrom.name}", "${nodes2.validTo.name}", "${nodes2.createdAt.name}", "${nodes2.updatedAt.name}"`
|
|
1156
|
+
);
|
|
1157
|
+
}
|
|
1158
|
+
function edgeColumnList(edges2) {
|
|
1159
|
+
return sql.raw(
|
|
1160
|
+
`"${edges2.graphId.name}", "${edges2.id.name}", "${edges2.kind.name}", "${edges2.fromKind.name}", "${edges2.fromId.name}", "${edges2.toKind.name}", "${edges2.toId.name}", "${edges2.props.name}", "${edges2.validFrom.name}", "${edges2.validTo.name}", "${edges2.createdAt.name}", "${edges2.updatedAt.name}"`
|
|
1161
|
+
);
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
// src/backend/drizzle/operations/hybrid.ts
|
|
1110
1165
|
function nodeIdOrderKey(dialect) {
|
|
1111
1166
|
return codePointOrderKey(sql.raw("node_id"), dialect);
|
|
1112
1167
|
}
|
|
@@ -1198,16 +1253,16 @@ function present(value) {
|
|
|
1198
1253
|
function mapHybridSearchRow(row, toNodeRow) {
|
|
1199
1254
|
return {
|
|
1200
1255
|
node: toNodeRow(row),
|
|
1201
|
-
fusedScore: coerceNumericScore(row
|
|
1202
|
-
...present(row
|
|
1203
|
-
...present(row
|
|
1204
|
-
...present(row
|
|
1205
|
-
...present(row
|
|
1256
|
+
fusedScore: coerceNumericScore(row["fused_score"]),
|
|
1257
|
+
...present(row["vector_rank"]) ? { vectorRank: Number(row["vector_rank"]) } : {},
|
|
1258
|
+
...present(row["vector_score"]) ? { vectorScore: coerceNumericScore(row["vector_score"]) } : {},
|
|
1259
|
+
...present(row["fulltext_rank"]) ? { fulltextRank: Number(row["fulltext_rank"]) } : {},
|
|
1260
|
+
...present(row["fulltext_score"]) ? {
|
|
1206
1261
|
fulltextScore: coerceNumericScore(
|
|
1207
|
-
row
|
|
1262
|
+
row["fulltext_score"]
|
|
1208
1263
|
)
|
|
1209
1264
|
} : {},
|
|
1210
|
-
...present(row
|
|
1265
|
+
...present(row["snippet"]) ? { snippet: String(row["snippet"]) } : {}
|
|
1211
1266
|
};
|
|
1212
1267
|
}
|
|
1213
1268
|
function buildClearGraph(tables3, graphId) {
|
|
@@ -1261,9 +1316,7 @@ function buildTemporalConditions(table, params) {
|
|
|
1261
1316
|
}
|
|
1262
1317
|
if (mode === "current" || mode === "asOf") {
|
|
1263
1318
|
if (params.asOf === void 0) {
|
|
1264
|
-
throw new Error(
|
|
1265
|
-
`asOf timestamp is required for temporal mode "${mode}"`
|
|
1266
|
-
);
|
|
1319
|
+
throw new Error(`asOf timestamp is required for temporal mode "${mode}"`);
|
|
1267
1320
|
}
|
|
1268
1321
|
conditions.push(
|
|
1269
1322
|
sql`(${table.validFrom} IS NULL OR ${table.validFrom} <= ${params.asOf})`,
|
|
@@ -1457,7 +1510,10 @@ function buildGetEdges(tables3, graphId, ids) {
|
|
|
1457
1510
|
return sql`
|
|
1458
1511
|
SELECT * FROM ${edges2}
|
|
1459
1512
|
WHERE ${edges2.graphId} = ${graphId}
|
|
1460
|
-
AND ${edges2.id} IN (${
|
|
1513
|
+
AND ${edges2.id} IN (${sql.join(
|
|
1514
|
+
ids.map((id) => sql`${id}`),
|
|
1515
|
+
sql`, `
|
|
1516
|
+
)})
|
|
1461
1517
|
`;
|
|
1462
1518
|
}
|
|
1463
1519
|
function buildUpdateEdge(tables3, params, timestamp2) {
|
|
@@ -1508,7 +1564,10 @@ function buildDeleteEdgesBatch(tables3, params, timestamp2) {
|
|
|
1508
1564
|
UPDATE ${edges2}
|
|
1509
1565
|
SET ${quotedColumn(edges2.deletedAt)} = ${timestamp2}
|
|
1510
1566
|
WHERE ${edges2.graphId} = ${params.graphId}
|
|
1511
|
-
AND ${edges2.id} IN (${
|
|
1567
|
+
AND ${edges2.id} IN (${sql.join(
|
|
1568
|
+
params.ids.map((id) => sql`${id}`),
|
|
1569
|
+
sql`, `
|
|
1570
|
+
)})
|
|
1512
1571
|
AND ${edges2.deletedAt} IS NULL
|
|
1513
1572
|
`;
|
|
1514
1573
|
}
|
|
@@ -1517,7 +1576,10 @@ function buildHardDeleteEdgesBatch(tables3, params) {
|
|
|
1517
1576
|
return sql`
|
|
1518
1577
|
DELETE FROM ${edges2}
|
|
1519
1578
|
WHERE ${edges2.graphId} = ${params.graphId}
|
|
1520
|
-
AND ${edges2.id} IN (${
|
|
1579
|
+
AND ${edges2.id} IN (${sql.join(
|
|
1580
|
+
params.ids.map((id) => sql`${id}`),
|
|
1581
|
+
sql`, `
|
|
1582
|
+
)})
|
|
1521
1583
|
`;
|
|
1522
1584
|
}
|
|
1523
1585
|
function buildHardDeleteEdge(tables3, params) {
|
|
@@ -1602,17 +1664,13 @@ function buildFulltextSearch(tableName, params, strategy, dialect, candidates) {
|
|
|
1602
1664
|
assertValidSearchParams(params);
|
|
1603
1665
|
const mode = resolveMode(params.mode);
|
|
1604
1666
|
const table = quotedTableName(tableName);
|
|
1605
|
-
const matchCondition =
|
|
1606
|
-
tableName,
|
|
1607
|
-
|
|
1608
|
-
mode,
|
|
1609
|
-
params.language
|
|
1667
|
+
const matchCondition = toDrizzleSql(
|
|
1668
|
+
strategy.matchCondition(tableName, params.query, mode, params.language),
|
|
1669
|
+
dialect
|
|
1610
1670
|
);
|
|
1611
|
-
const rankExpression =
|
|
1612
|
-
tableName,
|
|
1613
|
-
|
|
1614
|
-
mode,
|
|
1615
|
-
params.language
|
|
1671
|
+
const rankExpression = toDrizzleSql(
|
|
1672
|
+
strategy.rankExpression(tableName, params.query, mode, params.language),
|
|
1673
|
+
dialect
|
|
1616
1674
|
);
|
|
1617
1675
|
const conditions = [
|
|
1618
1676
|
matchCondition,
|
|
@@ -1623,13 +1681,17 @@ function buildFulltextSearch(tableName, params, strategy, dialect, candidates) {
|
|
|
1623
1681
|
conditions.push(sql`${rankExpression} >= ${params.minScore}`);
|
|
1624
1682
|
}
|
|
1625
1683
|
if (candidates !== void 0) {
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1684
|
+
const candidateSql = isSqlFragment(candidates) ? toDrizzleSql(candidates, dialect) : candidates;
|
|
1685
|
+
conditions.push(sql`"node_id" IN (${candidateSql})`);
|
|
1686
|
+
}
|
|
1687
|
+
const snippetExpr = params.includeSnippets === true && strategy.supportsSnippets ? toDrizzleSql(
|
|
1688
|
+
strategy.snippetExpression(
|
|
1689
|
+
tableName,
|
|
1690
|
+
params.query,
|
|
1691
|
+
mode,
|
|
1692
|
+
params.language
|
|
1693
|
+
),
|
|
1694
|
+
dialect
|
|
1633
1695
|
) : sql`NULL`;
|
|
1634
1696
|
const pageClause = params.offset === void 0 || params.offset === 0 ? sql`LIMIT ${params.limit}` : sql`LIMIT ${params.limit} OFFSET ${params.offset}`;
|
|
1635
1697
|
return sql`
|
|
@@ -1720,7 +1782,10 @@ function buildGetNodes(tables3, graphId, kind, ids) {
|
|
|
1720
1782
|
SELECT * FROM ${nodes2}
|
|
1721
1783
|
WHERE ${nodes2.graphId} = ${graphId}
|
|
1722
1784
|
AND ${nodes2.kind} = ${kind}
|
|
1723
|
-
AND ${nodes2.id} IN (${
|
|
1785
|
+
AND ${nodes2.id} IN (${sql.join(
|
|
1786
|
+
ids.map((id) => sql`${id}`),
|
|
1787
|
+
sql`, `
|
|
1788
|
+
)})
|
|
1724
1789
|
`;
|
|
1725
1790
|
}
|
|
1726
1791
|
function buildUpdateNode(tables3, params, timestamp2) {
|
|
@@ -1783,8 +1848,13 @@ function buildHardDeleteNode(tables3, params) {
|
|
|
1783
1848
|
`;
|
|
1784
1849
|
}
|
|
1785
1850
|
function createSchemaDialectStrategy(dialect) {
|
|
1786
|
-
const
|
|
1787
|
-
|
|
1851
|
+
const literals = {
|
|
1852
|
+
postgres: { false: "FALSE", true: "TRUE" },
|
|
1853
|
+
sqlite: { false: "0", true: "1" }
|
|
1854
|
+
};
|
|
1855
|
+
const dialectLiterals = literals[dialect];
|
|
1856
|
+
const trueLiteral = sql.raw(dialectLiterals.true);
|
|
1857
|
+
const falseLiteral = sql.raw(dialectLiterals.false);
|
|
1788
1858
|
return {
|
|
1789
1859
|
booleanLiteral(value) {
|
|
1790
1860
|
return value ? trueLiteral : falseLiteral;
|
|
@@ -1800,7 +1870,9 @@ function buildInsertSchema(tables3, params, timestamp2, dialect = "sqlite") {
|
|
|
1800
1870
|
const strategy = SCHEMA_DIALECT_STRATEGIES[dialect];
|
|
1801
1871
|
const schemaDocumentJson = JSON.stringify(params.schemaDoc);
|
|
1802
1872
|
const isActiveValue = strategy.booleanLiteral(params.isActive);
|
|
1803
|
-
const columns = sql.raw(
|
|
1873
|
+
const columns = sql.raw(
|
|
1874
|
+
`"${schemaVersions2.graphId.name}", "${schemaVersions2.version.name}", "${schemaVersions2.schemaHash.name}", "${schemaVersions2.schemaDoc.name}", "${schemaVersions2.createdAt.name}", "${schemaVersions2.isActive.name}"`
|
|
1875
|
+
);
|
|
1804
1876
|
return sql`
|
|
1805
1877
|
INSERT INTO ${schemaVersions2} (${columns})
|
|
1806
1878
|
VALUES (
|
|
@@ -1846,8 +1918,12 @@ function buildSetActiveSchema(tables3, graphId, version, dialect = "sqlite") {
|
|
|
1846
1918
|
}
|
|
1847
1919
|
function buildInsertUniqueSqlite(tables3, params) {
|
|
1848
1920
|
const { uniques: uniques2 } = tables3;
|
|
1849
|
-
const columns = sql.raw(
|
|
1850
|
-
|
|
1921
|
+
const columns = sql.raw(
|
|
1922
|
+
`"${uniques2.graphId.name}", "${uniques2.nodeKind.name}", "${uniques2.constraintName.name}", "${uniques2.key.name}", "${uniques2.nodeId.name}", "${uniques2.concreteKind.name}", "${uniques2.deletedAt.name}"`
|
|
1923
|
+
);
|
|
1924
|
+
const conflictColumns = sql.raw(
|
|
1925
|
+
`"${uniques2.graphId.name}", "${uniques2.nodeKind.name}", "${uniques2.constraintName.name}", "${uniques2.key.name}"`
|
|
1926
|
+
);
|
|
1851
1927
|
return sql`
|
|
1852
1928
|
INSERT INTO ${uniques2} (${columns})
|
|
1853
1929
|
VALUES (
|
|
@@ -1876,8 +1952,12 @@ function buildInsertUniqueSqlite(tables3, params) {
|
|
|
1876
1952
|
}
|
|
1877
1953
|
function buildInsertUniquePostgres(tables3, params) {
|
|
1878
1954
|
const { uniques: uniques2 } = tables3;
|
|
1879
|
-
const columns = sql.raw(
|
|
1880
|
-
|
|
1955
|
+
const columns = sql.raw(
|
|
1956
|
+
`"${uniques2.graphId.name}", "${uniques2.nodeKind.name}", "${uniques2.constraintName.name}", "${uniques2.key.name}", "${uniques2.nodeId.name}", "${uniques2.concreteKind.name}", "${uniques2.deletedAt.name}"`
|
|
1957
|
+
);
|
|
1958
|
+
const conflictColumns = sql.raw(
|
|
1959
|
+
`"${uniques2.graphId.name}", "${uniques2.nodeKind.name}", "${uniques2.constraintName.name}", "${uniques2.key.name}"`
|
|
1960
|
+
);
|
|
1881
1961
|
const tableName = getTableName(uniques2);
|
|
1882
1962
|
const existingColumn = (column) => sql.raw(`"${tableName}"."${column.name}"`);
|
|
1883
1963
|
return sql`
|
|
@@ -1923,7 +2003,19 @@ function buildInsertUniqueBatch(tables3, dialect, entries) {
|
|
|
1923
2003
|
`"${uniques2.graphId.name}", "${uniques2.nodeKind.name}", "${uniques2.constraintName.name}", "${uniques2.key.name}"`
|
|
1924
2004
|
);
|
|
1925
2005
|
const tableName = getTableName(uniques2);
|
|
1926
|
-
const existingColumn = (column) =>
|
|
2006
|
+
const existingColumn = (column) => {
|
|
2007
|
+
switch (dialect) {
|
|
2008
|
+
case "postgres": {
|
|
2009
|
+
return sql.raw(`"${tableName}"."${column.name}"`);
|
|
2010
|
+
}
|
|
2011
|
+
case "sqlite": {
|
|
2012
|
+
return sql.raw(`"${column.name}"`);
|
|
2013
|
+
}
|
|
2014
|
+
default: {
|
|
2015
|
+
return dialect;
|
|
2016
|
+
}
|
|
2017
|
+
}
|
|
2018
|
+
};
|
|
1927
2019
|
const excludedColumn = (column) => sql.raw(`excluded."${column.name}"`);
|
|
1928
2020
|
const valueRows = sql.join(
|
|
1929
2021
|
entries.map(
|
|
@@ -2031,7 +2123,9 @@ function bindTableOperationBuilders(tables3, builders) {
|
|
|
2031
2123
|
}
|
|
2032
2124
|
return [name, boundBuilder];
|
|
2033
2125
|
});
|
|
2034
|
-
return Object.fromEntries(
|
|
2126
|
+
return Object.fromEntries(
|
|
2127
|
+
boundEntries
|
|
2128
|
+
);
|
|
2035
2129
|
}
|
|
2036
2130
|
var COMMON_TABLE_OPERATION_BUILDERS = {
|
|
2037
2131
|
buildInsertNode,
|
|
@@ -2075,15 +2169,15 @@ function createCommonOperationStrategy(tables3, dialect, fulltextStrategy) {
|
|
|
2075
2169
|
);
|
|
2076
2170
|
const fulltextTable = tables3.fulltextTableName;
|
|
2077
2171
|
const fulltextBuilders = {
|
|
2078
|
-
buildUpsertFulltext: (params, timestamp2) => fulltextStrategy.buildUpsert(fulltextTable, params, timestamp2),
|
|
2079
|
-
buildDeleteFulltext: (params) => fulltextStrategy.buildDelete(fulltextTable, params),
|
|
2172
|
+
buildUpsertFulltext: (params, timestamp2) => fulltextStrategy.buildUpsert(fulltextTable, params, timestamp2).map((statement) => toDrizzleSql(statement, dialect)),
|
|
2173
|
+
buildDeleteFulltext: (params) => fulltextStrategy.buildDelete(fulltextTable, params).map((statement) => toDrizzleSql(statement, dialect)),
|
|
2080
2174
|
buildDeleteFulltextByNode: (graphId, nodeKind, nodeId) => fulltextStrategy.buildDelete(fulltextTable, {
|
|
2081
2175
|
graphId,
|
|
2082
2176
|
nodeKind,
|
|
2083
2177
|
nodeId
|
|
2084
|
-
}),
|
|
2085
|
-
buildUpsertFulltextBatch: (params, timestamp2) => fulltextStrategy.buildBatchUpsert(fulltextTable, params, timestamp2),
|
|
2086
|
-
buildDeleteFulltextBatch: (params) => fulltextStrategy.buildBatchDelete(fulltextTable, params),
|
|
2178
|
+
}).map((statement) => toDrizzleSql(statement, dialect)),
|
|
2179
|
+
buildUpsertFulltextBatch: (params, timestamp2) => fulltextStrategy.buildBatchUpsert(fulltextTable, params, timestamp2).map((statement) => toDrizzleSql(statement, dialect)),
|
|
2180
|
+
buildDeleteFulltextBatch: (params) => fulltextStrategy.buildBatchDelete(fulltextTable, params).map((statement) => toDrizzleSql(statement, dialect)),
|
|
2087
2181
|
buildFulltextSearch: (params) => buildFulltextSearch(
|
|
2088
2182
|
fulltextTable,
|
|
2089
2183
|
params,
|
|
@@ -2091,9 +2185,13 @@ function createCommonOperationStrategy(tables3, dialect, fulltextStrategy) {
|
|
|
2091
2185
|
dialect,
|
|
2092
2186
|
// Store-compiled candidates (predicates + subclass + currency)
|
|
2093
2187
|
// take precedence; the live-node default covers direct backend use.
|
|
2094
|
-
params.candidates ?? liveNodeIdsSubquery(
|
|
2188
|
+
params.candidates ?? liveNodeIdsSubquery(
|
|
2189
|
+
tables3.nodes,
|
|
2190
|
+
params.graphId,
|
|
2191
|
+
params.nodeKind,
|
|
2192
|
+
nowIso()
|
|
2193
|
+
)
|
|
2095
2194
|
),
|
|
2096
|
-
buildLiveNodeIds: (graphId, nodeKind) => liveNodeIdsSubquery(tables3.nodes, graphId, nodeKind, nowIso()),
|
|
2097
2195
|
buildHybridSearch: (params, vectorSql, vectorScoreDescending) => {
|
|
2098
2196
|
const candidates = params.candidates ?? liveNodeIdsSubquery(
|
|
2099
2197
|
tables3.nodes,
|
|
@@ -2120,7 +2218,7 @@ function createCommonOperationStrategy(tables3, dialect, fulltextStrategy) {
|
|
|
2120
2218
|
hybridCandidatesRef()
|
|
2121
2219
|
);
|
|
2122
2220
|
return buildHybridSearchStatement({
|
|
2123
|
-
candidatesSql: candidates,
|
|
2221
|
+
candidatesSql: isSqlFragment(candidates) ? toDrizzleSql(candidates, dialect) : candidates,
|
|
2124
2222
|
vectorSql,
|
|
2125
2223
|
vectorScoreDescending,
|
|
2126
2224
|
fulltextSql,
|
|
@@ -2155,17 +2253,24 @@ function createCommonOperationStrategy(tables3, dialect, fulltextStrategy) {
|
|
|
2155
2253
|
return buildSetActiveSchema(tables3, graphId, version, dialect);
|
|
2156
2254
|
},
|
|
2157
2255
|
buildTableExists(tableName) {
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2256
|
+
switch (dialect) {
|
|
2257
|
+
case "postgres": {
|
|
2258
|
+
return sql`
|
|
2259
|
+
SELECT c.relname AS table_name
|
|
2260
|
+
FROM pg_catalog.pg_class AS c
|
|
2261
|
+
WHERE c.relname = ${tableName}
|
|
2262
|
+
AND c.relkind IN ('r', 'p', 'v', 'm', 'f')
|
|
2263
|
+
AND pg_catalog.pg_table_is_visible(c.oid)
|
|
2264
|
+
LIMIT 1
|
|
2265
|
+
`;
|
|
2266
|
+
}
|
|
2267
|
+
case "sqlite": {
|
|
2268
|
+
return sql`SELECT name AS table_name FROM sqlite_master WHERE type IN ('table', 'view') AND name = ${tableName}`;
|
|
2269
|
+
}
|
|
2270
|
+
default: {
|
|
2271
|
+
return dialect;
|
|
2272
|
+
}
|
|
2167
2273
|
}
|
|
2168
|
-
return sql`SELECT name AS table_name FROM sqlite_master WHERE type IN ('table', 'view') AND name = ${tableName}`;
|
|
2169
2274
|
},
|
|
2170
2275
|
buildClearGraph(graphId) {
|
|
2171
2276
|
return buildClearGraph(tables3, graphId);
|
|
@@ -2200,9 +2305,13 @@ function createSqliteOperationStrategy(tables3, fulltextStrategy) {
|
|
|
2200
2305
|
function createPostgresOperationStrategy(tables3, fulltextStrategy) {
|
|
2201
2306
|
return createCommonOperationStrategy(tables3, "postgres", fulltextStrategy);
|
|
2202
2307
|
}
|
|
2308
|
+
var DRIZZLE_DIALECT_LABELS = {
|
|
2309
|
+
postgres: "Postgres",
|
|
2310
|
+
sqlite: "SQLite"
|
|
2311
|
+
};
|
|
2203
2312
|
function assertAdoptedDialect(externalTx, brand, backend) {
|
|
2204
2313
|
if (is(externalTx, brand)) return;
|
|
2205
|
-
const label = backend
|
|
2314
|
+
const label = DRIZZLE_DIALECT_LABELS[backend];
|
|
2206
2315
|
throw new ConfigurationError(
|
|
2207
2316
|
`adoptTransaction received a handle that is not a ${label} Drizzle transaction. Pass the \`tx\` from a ${label} \`db.transaction(...)\` opened on this backend's connection.`,
|
|
2208
2317
|
{ backend, capability: "adoptTransaction" }
|
|
@@ -2691,6 +2800,8 @@ function createCommonOperationBackend(options) {
|
|
|
2691
2800
|
}
|
|
2692
2801
|
};
|
|
2693
2802
|
}
|
|
2803
|
+
|
|
2804
|
+
// src/backend/drizzle/trusted-import.ts
|
|
2694
2805
|
var DATABASE_NULL = null;
|
|
2695
2806
|
function quoteSqlIdentifier(identifier) {
|
|
2696
2807
|
return `"${identifier.replaceAll('"', '""')}"`;
|
|
@@ -2715,7 +2826,7 @@ function requireStatementExecution(backend) {
|
|
|
2715
2826
|
}
|
|
2716
2827
|
function rowIndicatesExistingData(row) {
|
|
2717
2828
|
if (typeof row !== "object" || row === null) return false;
|
|
2718
|
-
const value = row
|
|
2829
|
+
const value = row["has_rows"];
|
|
2719
2830
|
return value === true || value === 1 || value === "1";
|
|
2720
2831
|
}
|
|
2721
2832
|
async function assertTrustedImportDatabaseEmpty(backend, tableNames) {
|
|
@@ -2741,7 +2852,7 @@ async function lockPostgresTrustedImportTables(backend, tableNames) {
|
|
|
2741
2852
|
const executeStatement = requireStatementExecution(backend);
|
|
2742
2853
|
await executeStatement(
|
|
2743
2854
|
asCompiledStatementSql(
|
|
2744
|
-
sql.raw(
|
|
2855
|
+
sql$1.raw(
|
|
2745
2856
|
`LOCK TABLE ${quoteSqlIdentifier(tableNames.nodes)}, ${quoteSqlIdentifier(tableNames.edges)} IN ACCESS EXCLUSIVE MODE`
|
|
2746
2857
|
)
|
|
2747
2858
|
)
|
|
@@ -2762,7 +2873,7 @@ async function suspendSqliteSecondaryIndexes(backend, tableNames) {
|
|
|
2762
2873
|
for (const definition of definitions) {
|
|
2763
2874
|
await executeStatement(
|
|
2764
2875
|
asCompiledStatementSql(
|
|
2765
|
-
sql.raw(`DROP INDEX ${quoteSqlIdentifier(definition.index_name)}`)
|
|
2876
|
+
sql$1.raw(`DROP INDEX ${quoteSqlIdentifier(definition.index_name)}`)
|
|
2766
2877
|
)
|
|
2767
2878
|
);
|
|
2768
2879
|
}
|
|
@@ -2793,7 +2904,7 @@ async function suspendPostgresSecondaryIndexes(backend, tableNames) {
|
|
|
2793
2904
|
for (const definition of definitions) {
|
|
2794
2905
|
await executeStatement(
|
|
2795
2906
|
asCompiledStatementSql(
|
|
2796
|
-
sql.raw(`DROP INDEX ${quoteSqlIdentifier(definition.index_name)}`)
|
|
2907
|
+
sql$1.raw(`DROP INDEX ${quoteSqlIdentifier(definition.index_name)}`)
|
|
2797
2908
|
)
|
|
2798
2909
|
);
|
|
2799
2910
|
}
|
|
@@ -2803,7 +2914,7 @@ async function restoreSecondaryIndexes(backend, definitions) {
|
|
|
2803
2914
|
const executeStatement = requireStatementExecution(backend);
|
|
2804
2915
|
for (const definition of definitions) {
|
|
2805
2916
|
await executeStatement(
|
|
2806
|
-
asCompiledStatementSql(sql.raw(definition.index_definition))
|
|
2917
|
+
asCompiledStatementSql(sql$1.raw(definition.index_definition))
|
|
2807
2918
|
);
|
|
2808
2919
|
}
|
|
2809
2920
|
}
|
|
@@ -2811,12 +2922,12 @@ async function analyzeImportedTables(backend, tableNames) {
|
|
|
2811
2922
|
const executeStatement = requireStatementExecution(backend);
|
|
2812
2923
|
await executeStatement(
|
|
2813
2924
|
asCompiledStatementSql(
|
|
2814
|
-
sql.raw(`ANALYZE ${quoteSqlIdentifier(tableNames.nodes)}`)
|
|
2925
|
+
sql$1.raw(`ANALYZE ${quoteSqlIdentifier(tableNames.nodes)}`)
|
|
2815
2926
|
)
|
|
2816
2927
|
);
|
|
2817
2928
|
await executeStatement(
|
|
2818
2929
|
asCompiledStatementSql(
|
|
2819
|
-
sql.raw(`ANALYZE ${quoteSqlIdentifier(tableNames.edges)}`)
|
|
2930
|
+
sql$1.raw(`ANALYZE ${quoteSqlIdentifier(tableNames.edges)}`)
|
|
2820
2931
|
)
|
|
2821
2932
|
);
|
|
2822
2933
|
}
|
|
@@ -2959,16 +3070,6 @@ function getOrCreateLru(cache, key, cacheMax, create) {
|
|
|
2959
3070
|
return value;
|
|
2960
3071
|
}
|
|
2961
3072
|
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
const compiler = databaseWithCompiler.dialect;
|
|
2966
|
-
if (compiler === void 0) {
|
|
2967
|
-
throw new Error(`${backendName} backend is missing a SQL compiler`);
|
|
2968
|
-
}
|
|
2969
|
-
return compiler.sqlToQuery(query);
|
|
2970
|
-
}
|
|
2971
|
-
|
|
2972
|
-
export { EMBEDDING_UPSERT_PARAM_COUNT, POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS, POSTGRES_INDEX_MAT_TIMESTAMPS, POSTGRES_KIND_REMOVAL_TIMESTAMPS, SQLITE_CONTRIBUTION_MAT_TIMESTAMPS, SQLITE_INDEX_MAT_TIMESTAMPS, SQLITE_KIND_REMOVAL_TIMESTAMPS, analyzeImportedTables, assertAdoptedDialect, assertTrustedImportDatabaseEmpty, buildContributionInsertValues, buildContributionOnConflictSet, buildKindRemovalInsertValues, buildKindRemovalOnConflictSet, buildMaterializationInsertValues, buildMaterializationOnConflictSet, compileQueryWithDialect, createCachedTableExistence, createCommonOperationBackend, createContributionMaterializer, createPostgresOperationStrategy, createPostgresTables, createPostgresTrustedImportSession, createSqliteOperationStrategy, createSqliteTrustedImportSession, edges, fulltext, gateFulltext, gateFulltextMethods, generatePgCreateTableSQL, generatePostgresDDL, generatePostgresMigrationSQL, generateSqliteCreateTableSQL, generateSqliteDDL, generateSqliteMigrationSQL, getOrCreateLru, hybridCandidatesRef, lockPostgresTrustedImportTables, mapContributionMaterializationRow, mapHybridSearchRow, mapKindRemovalRow, mapMaterializationRow, mapVectorWriteError, nodes, recordedClock, recordedEdges, recordedNodes, restoreSecondaryIndexes, schemaVersions, suspendPostgresSecondaryIndexes, suspendSqliteSecondaryIndexes, tables2 as tables, uniques, vectorSlotFromCreateIndexParams, vectorSlotFromDropIndexParams, vectorSlotFromParams };
|
|
2973
|
-
//# sourceMappingURL=chunk-K3Q3LJY3.js.map
|
|
2974
|
-
//# sourceMappingURL=chunk-K3Q3LJY3.js.map
|
|
3073
|
+
export { EMBEDDING_UPSERT_PARAM_COUNT, POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS, POSTGRES_INDEX_MAT_TIMESTAMPS, POSTGRES_KIND_REMOVAL_TIMESTAMPS, SQLITE_CONTRIBUTION_MAT_TIMESTAMPS, SQLITE_INDEX_MAT_TIMESTAMPS, SQLITE_KIND_REMOVAL_TIMESTAMPS, analyzeImportedTables, assertAdoptedDialect, assertTrustedImportDatabaseEmpty, buildContributionInsertValues, buildContributionOnConflictSet, buildKindRemovalInsertValues, buildKindRemovalOnConflictSet, buildLiveNodeCandidates, buildMaterializationInsertValues, buildMaterializationOnConflictSet, createCachedTableExistence, createCommonOperationBackend, createContributionMaterializer, createPostgresOperationStrategy, createPostgresTables, createPostgresTrustedImportSession, createSqliteOperationStrategy, createSqliteTrustedImportSession, edges, fulltext, gateFulltext, gateFulltextMethods, generatePgCreateTableSQL, generatePostgresDDL, generatePostgresMigrationSQL, generateSqliteCreateTableSQL, generateSqliteDDL, generateSqliteMigrationSQL, getOrCreateLru, lockPostgresTrustedImportTables, mapContributionMaterializationRow, mapHybridSearchRow, mapKindRemovalRow, mapMaterializationRow, mapVectorWriteError, nodes, recordedClock, recordedEdges, recordedNodes, restoreSecondaryIndexes, schemaVersions, suspendPostgresSecondaryIndexes, suspendSqliteSecondaryIndexes, tables2 as tables, uniques, vectorSlotFromCreateIndexParams, vectorSlotFromDropIndexParams, vectorSlotFromParams };
|
|
3074
|
+
//# sourceMappingURL=chunk-G32AO634.js.map
|
|
3075
|
+
//# sourceMappingURL=chunk-G32AO634.js.map
|