@nicia-ai/typegraph 0.37.1 → 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-5AVRFNP4.cjs → chunk-2SL7OGPR.cjs} +2866 -1507
- 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-GA4TT3DH.js → chunk-A2FGSWMQ.js} +1845 -489
- 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-UV3WP5WZ.js → chunk-TE5ZA4VX.js} +55 -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-EJYMTO3K.cjs → chunk-YLINFV7Z.cjs} +144 -116
- 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-5AVRFNP4.cjs.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-EJYMTO3K.cjs.map +0 -1
- package/dist/chunk-EXU3RASM.js.map +0 -1
- package/dist/chunk-GA4TT3DH.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-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-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-UV3WP5WZ.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,16 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkEOJFGECD_cjs = require('./chunk-EOJFGECD.cjs');
|
|
4
|
+
var chunkE6TXEISH_cjs = require('./chunk-E6TXEISH.cjs');
|
|
5
|
+
var chunkDOVMTPKE_cjs = require('./chunk-DOVMTPKE.cjs');
|
|
6
|
+
var chunkZDH3DX3C_cjs = require('./chunk-ZDH3DX3C.cjs');
|
|
7
|
+
var chunkGNPGGLAE_cjs = require('./chunk-GNPGGLAE.cjs');
|
|
6
8
|
var chunkACSVZPK7_cjs = require('./chunk-ACSVZPK7.cjs');
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
9
|
+
var chunkO5H62ZWJ_cjs = require('./chunk-O5H62ZWJ.cjs');
|
|
10
|
+
var chunkGUUWKPTK_cjs = require('./chunk-GUUWKPTK.cjs');
|
|
11
|
+
var chunkZY4GXIVN_cjs = require('./chunk-ZY4GXIVN.cjs');
|
|
12
|
+
var chunkZKZAIX42_cjs = require('./chunk-ZKZAIX42.cjs');
|
|
13
|
+
var chunkX6RDQ5NB_cjs = require('./chunk-X6RDQ5NB.cjs');
|
|
14
|
+
var chunk764JHTLT_cjs = require('./chunk-764JHTLT.cjs');
|
|
15
|
+
var chunkSAFZ6JTI_cjs = require('./chunk-SAFZ6JTI.cjs');
|
|
14
16
|
var drizzleOrm = require('drizzle-orm');
|
|
15
17
|
var pgCore = require('drizzle-orm/pg-core');
|
|
16
18
|
var sqliteCore = require('drizzle-orm/sqlite-core');
|
|
@@ -41,7 +43,7 @@ var DEFAULT_TABLE_NAMES = {
|
|
|
41
43
|
function createPostgresTables(names = {}, options = {}) {
|
|
42
44
|
const n = { ...DEFAULT_TABLE_NAMES, ...names };
|
|
43
45
|
const indexes = options.indexes ?? [];
|
|
44
|
-
|
|
46
|
+
chunkGUUWKPTK_cjs.assertNoSystemIndexNameCollision(indexes, n);
|
|
45
47
|
const nodes2 = pgCore.pgTable(
|
|
46
48
|
n.nodes,
|
|
47
49
|
{
|
|
@@ -60,8 +62,8 @@ function createPostgresTables(names = {}, options = {}) {
|
|
|
60
62
|
pgCore.primaryKey({ columns: [t.graphId, t.kind, t.id] }),
|
|
61
63
|
// System indexes come from SYSTEM_INDEX_DECLARATIONS (single source
|
|
62
64
|
// for both dialects + the runtime materializer).
|
|
63
|
-
...
|
|
64
|
-
...
|
|
65
|
+
...chunkDOVMTPKE_cjs.buildPostgresSystemIndexBuilders("nodes", n.nodes, t),
|
|
66
|
+
...chunkDOVMTPKE_cjs.buildPostgresNodeIndexBuilders(t, indexes)
|
|
65
67
|
]
|
|
66
68
|
);
|
|
67
69
|
const edges2 = pgCore.pgTable(
|
|
@@ -83,8 +85,8 @@ function createPostgresTables(names = {}, options = {}) {
|
|
|
83
85
|
},
|
|
84
86
|
(t) => [
|
|
85
87
|
pgCore.primaryKey({ columns: [t.graphId, t.id] }),
|
|
86
|
-
...
|
|
87
|
-
...
|
|
88
|
+
...chunkDOVMTPKE_cjs.buildPostgresSystemIndexBuilders("edges", n.edges, t),
|
|
89
|
+
...chunkDOVMTPKE_cjs.buildPostgresEdgeIndexBuilders(t, indexes)
|
|
88
90
|
]
|
|
89
91
|
);
|
|
90
92
|
const recordedNodes2 = pgCore.pgTable(
|
|
@@ -101,7 +103,9 @@ function createPostgresTables(names = {}, options = {}) {
|
|
|
101
103
|
createdAt: pgCore.timestamp("created_at", { withTimezone: true }).notNull(),
|
|
102
104
|
updatedAt: pgCore.timestamp("updated_at", { withTimezone: true }).notNull(),
|
|
103
105
|
deletedAt: pgCore.timestamp("deleted_at", { withTimezone: true }),
|
|
104
|
-
recordedFrom: pgCore.timestamp("recorded_from", {
|
|
106
|
+
recordedFrom: pgCore.timestamp("recorded_from", {
|
|
107
|
+
withTimezone: true
|
|
108
|
+
}).notNull(),
|
|
105
109
|
recordedTo: pgCore.timestamp("recorded_to", { withTimezone: true }).notNull(),
|
|
106
110
|
op: pgCore.text("op").notNull(),
|
|
107
111
|
schemaVersion: pgCore.integer("schema_version"),
|
|
@@ -110,7 +114,7 @@ function createPostgresTables(names = {}, options = {}) {
|
|
|
110
114
|
},
|
|
111
115
|
(t) => [
|
|
112
116
|
pgCore.primaryKey({ columns: [t.historyId] }),
|
|
113
|
-
...
|
|
117
|
+
...chunkDOVMTPKE_cjs.buildPostgresSystemIndexBuilders("recordedNodes", n.recordedNodes, t)
|
|
114
118
|
]
|
|
115
119
|
);
|
|
116
120
|
const recordedEdges2 = pgCore.pgTable(
|
|
@@ -130,7 +134,9 @@ function createPostgresTables(names = {}, options = {}) {
|
|
|
130
134
|
createdAt: pgCore.timestamp("created_at", { withTimezone: true }).notNull(),
|
|
131
135
|
updatedAt: pgCore.timestamp("updated_at", { withTimezone: true }).notNull(),
|
|
132
136
|
deletedAt: pgCore.timestamp("deleted_at", { withTimezone: true }),
|
|
133
|
-
recordedFrom: pgCore.timestamp("recorded_from", {
|
|
137
|
+
recordedFrom: pgCore.timestamp("recorded_from", {
|
|
138
|
+
withTimezone: true
|
|
139
|
+
}).notNull(),
|
|
134
140
|
recordedTo: pgCore.timestamp("recorded_to", { withTimezone: true }).notNull(),
|
|
135
141
|
op: pgCore.text("op").notNull(),
|
|
136
142
|
schemaVersion: pgCore.integer("schema_version"),
|
|
@@ -139,7 +145,7 @@ function createPostgresTables(names = {}, options = {}) {
|
|
|
139
145
|
},
|
|
140
146
|
(t) => [
|
|
141
147
|
pgCore.primaryKey({ columns: [t.historyId] }),
|
|
142
|
-
...
|
|
148
|
+
...chunkDOVMTPKE_cjs.buildPostgresSystemIndexBuilders("recordedEdges", n.recordedEdges, t)
|
|
143
149
|
]
|
|
144
150
|
);
|
|
145
151
|
const recordedClock2 = pgCore.pgTable(
|
|
@@ -368,9 +374,9 @@ function renderIndexColumn(col) {
|
|
|
368
374
|
if (col && typeof col === "object" && "name" in col) {
|
|
369
375
|
return `"${col.name}"`;
|
|
370
376
|
}
|
|
371
|
-
const
|
|
372
|
-
if (
|
|
373
|
-
return
|
|
377
|
+
const sql16 = tryInlineSql(col);
|
|
378
|
+
if (sql16 !== void 0) {
|
|
379
|
+
return sql16;
|
|
374
380
|
}
|
|
375
381
|
return "unknown";
|
|
376
382
|
}
|
|
@@ -446,13 +452,13 @@ function isSqliteTable(value) {
|
|
|
446
452
|
function runtimeStrategyContributions(fulltextStrategy, fulltextTableName) {
|
|
447
453
|
return fulltextStrategy.ownedTables(fulltextTableName).filter((contribution) => contribution.runtimeEnsure);
|
|
448
454
|
}
|
|
449
|
-
function sqliteContributions(tables3 =
|
|
455
|
+
function sqliteContributions(tables3 = chunkEOJFGECD_cjs.tables, fulltextStrategy = chunkZKZAIX42_cjs.fts5Strategy) {
|
|
450
456
|
const contributions = [];
|
|
451
457
|
for (const [key, table] of Object.entries(tables3)) {
|
|
452
458
|
if (!isSqliteTable(table)) continue;
|
|
453
459
|
contributions.push({
|
|
454
460
|
logicalName: key,
|
|
455
|
-
owner:
|
|
461
|
+
owner: chunkZKZAIX42_cjs.BASE_CONTRIBUTION_OWNER,
|
|
456
462
|
tableName: sqliteCore.getTableConfig(table).name,
|
|
457
463
|
createDdl: [
|
|
458
464
|
generateSqliteCreateTableSQL(table),
|
|
@@ -468,12 +474,12 @@ function sqliteContributions(tables3 = chunk3C2RYI6L_cjs.tables, fulltextStrateg
|
|
|
468
474
|
}
|
|
469
475
|
return contributions;
|
|
470
476
|
}
|
|
471
|
-
function generateSqliteDDL(tables3 =
|
|
477
|
+
function generateSqliteDDL(tables3 = chunkEOJFGECD_cjs.tables, fulltextStrategy = chunkZKZAIX42_cjs.fts5Strategy) {
|
|
472
478
|
return sqliteContributions(tables3, fulltextStrategy).flatMap(
|
|
473
479
|
(contribution) => [...contribution.createDdl]
|
|
474
480
|
);
|
|
475
481
|
}
|
|
476
|
-
function generateSqliteMigrationSQL(tables3 =
|
|
482
|
+
function generateSqliteMigrationSQL(tables3 = chunkEOJFGECD_cjs.tables, fulltextStrategy = chunkZKZAIX42_cjs.fts5Strategy) {
|
|
477
483
|
return generateSqliteDDL(tables3, fulltextStrategy).join("\n\n");
|
|
478
484
|
}
|
|
479
485
|
function getPgColumnType(column) {
|
|
@@ -555,14 +561,14 @@ function generatePgCreateIndexSQL(table) {
|
|
|
555
561
|
function isPgTable(value) {
|
|
556
562
|
return drizzleOrm.is(value, pgCore.PgTable);
|
|
557
563
|
}
|
|
558
|
-
function postgresContributions(tables3 = tables2, fulltextStrategy =
|
|
564
|
+
function postgresContributions(tables3 = tables2, fulltextStrategy = chunkZKZAIX42_cjs.tsvectorStrategy) {
|
|
559
565
|
const contributions = [];
|
|
560
566
|
for (const [key, table] of Object.entries(tables3)) {
|
|
561
567
|
if (!isPgTable(table)) continue;
|
|
562
568
|
if (table === tables3.fulltext) continue;
|
|
563
569
|
contributions.push({
|
|
564
570
|
logicalName: key,
|
|
565
|
-
owner:
|
|
571
|
+
owner: chunkZKZAIX42_cjs.BASE_CONTRIBUTION_OWNER,
|
|
566
572
|
tableName: pgCore.getTableConfig(table).name,
|
|
567
573
|
createDdl: [
|
|
568
574
|
generatePgCreateTableSQL(table),
|
|
@@ -578,12 +584,12 @@ function postgresContributions(tables3 = tables2, fulltextStrategy = chunkXGU7DZ
|
|
|
578
584
|
}
|
|
579
585
|
return contributions;
|
|
580
586
|
}
|
|
581
|
-
function generatePostgresDDL(tables3 = tables2, fulltextStrategy =
|
|
587
|
+
function generatePostgresDDL(tables3 = tables2, fulltextStrategy = chunkZKZAIX42_cjs.tsvectorStrategy) {
|
|
582
588
|
return postgresContributions(tables3, fulltextStrategy).flatMap(
|
|
583
589
|
(contribution) => [...contribution.createDdl]
|
|
584
590
|
);
|
|
585
591
|
}
|
|
586
|
-
function generatePostgresMigrationSQL(tables3 = tables2, fulltextStrategy =
|
|
592
|
+
function generatePostgresMigrationSQL(tables3 = tables2, fulltextStrategy = chunkZKZAIX42_cjs.tsvectorStrategy) {
|
|
587
593
|
const extensionSql = "-- Enable pgvector extension for vector similarity search\nCREATE EXTENSION IF NOT EXISTS vector;";
|
|
588
594
|
const ddlSql = generatePostgresDDL(tables3, fulltextStrategy).join("\n\n");
|
|
589
595
|
return `${extensionSql}
|
|
@@ -591,6 +597,20 @@ function generatePostgresMigrationSQL(tables3 = tables2, fulltextStrategy = chun
|
|
|
591
597
|
${ddlSql}`;
|
|
592
598
|
}
|
|
593
599
|
|
|
600
|
+
// src/backend/live-node-candidates.ts
|
|
601
|
+
function buildLiveNodeCandidates(nodesTableName, graphId, nodeKind, now) {
|
|
602
|
+
const nodes2 = chunkX6RDQ5NB_cjs.sql.identifier(nodesTableName);
|
|
603
|
+
return chunkX6RDQ5NB_cjs.sql`
|
|
604
|
+
SELECT "id" AS node_id
|
|
605
|
+
FROM ${nodes2}
|
|
606
|
+
WHERE "graph_id" = ${graphId}
|
|
607
|
+
AND "kind" = ${nodeKind}
|
|
608
|
+
AND "deleted_at" IS NULL
|
|
609
|
+
AND ("valid_from" IS NULL OR "valid_from" <= ${now})
|
|
610
|
+
AND ("valid_to" IS NULL OR "valid_to" > ${now})
|
|
611
|
+
`;
|
|
612
|
+
}
|
|
613
|
+
|
|
594
614
|
// src/backend/drizzle/vector-runtime.ts
|
|
595
615
|
var VECTOR_SLOT_PLACEHOLDER_DIMENSIONS = 1;
|
|
596
616
|
var EMBEDDING_UPSERT_PARAM_COUNT = 5;
|
|
@@ -621,10 +641,10 @@ function vectorSlotFromDropIndexParams(params) {
|
|
|
621
641
|
};
|
|
622
642
|
}
|
|
623
643
|
function mapVectorWriteError(error, params) {
|
|
624
|
-
const mismatch =
|
|
644
|
+
const mismatch = chunkO5H62ZWJ_cjs.parseDimensionMismatch(error);
|
|
625
645
|
if (mismatch === void 0) return error;
|
|
626
646
|
const attempted = mismatch.actual ?? "a different number of";
|
|
627
|
-
return new
|
|
647
|
+
return new chunkSAFZ6JTI_cjs.EmbeddingDimensionChangedError(
|
|
628
648
|
`Embedding "${params.nodeKind}.${params.fieldPath}" was written with ${attempted} dimensions, but its per-field storage expects ${mismatch.expected}. The field's embedding dimension changed; existing vectors must be recreated and re-embedded.`,
|
|
629
649
|
{
|
|
630
650
|
kind: params.nodeKind,
|
|
@@ -640,7 +660,7 @@ var SQLITE_CONTRIBUTION_MAT_TIMESTAMPS = {
|
|
|
640
660
|
encode: (value) => value
|
|
641
661
|
};
|
|
642
662
|
var POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS = {
|
|
643
|
-
decode:
|
|
663
|
+
decode: chunkE6TXEISH_cjs.formatPostgresTimestamp,
|
|
644
664
|
encode: (value) => new Date(value)
|
|
645
665
|
};
|
|
646
666
|
function mapContributionMaterializationRow(row, decode) {
|
|
@@ -710,21 +730,21 @@ function identityOf(graphId, contribution) {
|
|
|
710
730
|
function gateFulltextMethods(source, assert) {
|
|
711
731
|
const gated = {};
|
|
712
732
|
if (source.upsertFulltext) {
|
|
713
|
-
const raw = source.upsertFulltext
|
|
733
|
+
const raw = source.upsertFulltext;
|
|
714
734
|
gated.upsertFulltext = async (params) => {
|
|
715
735
|
await assert(params.graphId);
|
|
716
736
|
await raw(params);
|
|
717
737
|
};
|
|
718
738
|
}
|
|
719
739
|
if (source.deleteFulltext) {
|
|
720
|
-
const raw = source.deleteFulltext
|
|
740
|
+
const raw = source.deleteFulltext;
|
|
721
741
|
gated.deleteFulltext = async (params) => {
|
|
722
742
|
await assert(params.graphId);
|
|
723
743
|
await raw(params);
|
|
724
744
|
};
|
|
725
745
|
}
|
|
726
746
|
if (source.upsertFulltextBatch) {
|
|
727
|
-
const raw = source.upsertFulltextBatch
|
|
747
|
+
const raw = source.upsertFulltextBatch;
|
|
728
748
|
gated.upsertFulltextBatch = async (params) => {
|
|
729
749
|
if (params.rows.length === 0) return;
|
|
730
750
|
await assert(params.graphId);
|
|
@@ -732,7 +752,7 @@ function gateFulltextMethods(source, assert) {
|
|
|
732
752
|
};
|
|
733
753
|
}
|
|
734
754
|
if (source.deleteFulltextBatch) {
|
|
735
|
-
const raw = source.deleteFulltextBatch
|
|
755
|
+
const raw = source.deleteFulltextBatch;
|
|
736
756
|
gated.deleteFulltextBatch = async (params) => {
|
|
737
757
|
if (params.nodeIds.length === 0) return;
|
|
738
758
|
await assert(params.graphId);
|
|
@@ -740,13 +760,13 @@ function gateFulltextMethods(source, assert) {
|
|
|
740
760
|
};
|
|
741
761
|
}
|
|
742
762
|
if (source.fulltextSearch) {
|
|
743
|
-
const raw = source.fulltextSearch
|
|
763
|
+
const raw = source.fulltextSearch;
|
|
744
764
|
gated.fulltextSearch = async (params) => {
|
|
745
765
|
await assert(params.graphId);
|
|
746
766
|
return raw(params);
|
|
747
767
|
};
|
|
748
768
|
}
|
|
749
|
-
const rawHardDelete = source.hardDeleteNode
|
|
769
|
+
const rawHardDelete = source.hardDeleteNode;
|
|
750
770
|
gated.hardDeleteNode = async (params) => {
|
|
751
771
|
await assert(params.graphId);
|
|
752
772
|
await rawHardDelete(params);
|
|
@@ -754,7 +774,7 @@ function gateFulltextMethods(source, assert) {
|
|
|
754
774
|
return gated;
|
|
755
775
|
}
|
|
756
776
|
function gateFulltext(tx, assert) {
|
|
757
|
-
return
|
|
777
|
+
return chunkGNPGGLAE_cjs.createBackendOverlay(
|
|
758
778
|
tx,
|
|
759
779
|
gateFulltextMethods(tx, assert)
|
|
760
780
|
);
|
|
@@ -788,7 +808,7 @@ function createContributionMaterializer(deps) {
|
|
|
788
808
|
);
|
|
789
809
|
const entry = {
|
|
790
810
|
createDdl: [...contribution.createDdl],
|
|
791
|
-
signature:
|
|
811
|
+
signature: chunkZY4GXIVN_cjs.sha256Hex(input, 16)
|
|
792
812
|
};
|
|
793
813
|
computedSignatures.set(key, entry);
|
|
794
814
|
try {
|
|
@@ -823,13 +843,13 @@ function createContributionMaterializer(deps) {
|
|
|
823
843
|
await deps.recordMarker({
|
|
824
844
|
...identity,
|
|
825
845
|
signature,
|
|
826
|
-
attemptedAt:
|
|
846
|
+
attemptedAt: chunkE6TXEISH_cjs.nowIso(),
|
|
827
847
|
materializedAt: void 0,
|
|
828
848
|
error: error.message
|
|
829
849
|
});
|
|
830
850
|
throw error;
|
|
831
851
|
}
|
|
832
|
-
const attemptedAt =
|
|
852
|
+
const attemptedAt = chunkE6TXEISH_cjs.nowIso();
|
|
833
853
|
try {
|
|
834
854
|
for (const statement of contribution.createDdl) {
|
|
835
855
|
await deps.execDdl(statement);
|
|
@@ -865,7 +885,7 @@ function createContributionMaterializer(deps) {
|
|
|
865
885
|
rows: indexMarkerRows(graphId, await deps.getMarkers(graphId))
|
|
866
886
|
};
|
|
867
887
|
} catch (error) {
|
|
868
|
-
if (!
|
|
888
|
+
if (!chunkO5H62ZWJ_cjs.isMissingTableError(error)) throw error;
|
|
869
889
|
return { kind: "missing-table", error };
|
|
870
890
|
}
|
|
871
891
|
}
|
|
@@ -937,7 +957,7 @@ function createContributionMaterializer(deps) {
|
|
|
937
957
|
if (read.kind === "missing-table") {
|
|
938
958
|
const first = pending[0];
|
|
939
959
|
if (first === void 0) return;
|
|
940
|
-
throw new
|
|
960
|
+
throw new chunkSAFZ6JTI_cjs.StoreNotInitializedError(graphId, "missing", {
|
|
941
961
|
cause: read.error,
|
|
942
962
|
details: { logicalName: first.contribution.logicalName }
|
|
943
963
|
});
|
|
@@ -946,7 +966,7 @@ function createContributionMaterializer(deps) {
|
|
|
946
966
|
const { contribution, key, signature } = entry;
|
|
947
967
|
const state = evaluateContributionState(read.rows.get(key), signature);
|
|
948
968
|
if (state !== "initialized") {
|
|
949
|
-
throw new
|
|
969
|
+
throw new chunkSAFZ6JTI_cjs.StoreNotInitializedError(graphId, state, {
|
|
950
970
|
details: { logicalName: contribution.logicalName }
|
|
951
971
|
});
|
|
952
972
|
}
|
|
@@ -1010,7 +1030,7 @@ var SQLITE_INDEX_MAT_TIMESTAMPS = {
|
|
|
1010
1030
|
encode: (value) => value
|
|
1011
1031
|
};
|
|
1012
1032
|
var POSTGRES_INDEX_MAT_TIMESTAMPS = {
|
|
1013
|
-
decode:
|
|
1033
|
+
decode: chunkE6TXEISH_cjs.formatPostgresTimestamp,
|
|
1014
1034
|
encode: (value) => new Date(value)
|
|
1015
1035
|
};
|
|
1016
1036
|
function mapMaterializationRow(row, decode) {
|
|
@@ -1068,7 +1088,7 @@ var SQLITE_KIND_REMOVAL_TIMESTAMPS = {
|
|
|
1068
1088
|
encode: (value) => value
|
|
1069
1089
|
};
|
|
1070
1090
|
var POSTGRES_KIND_REMOVAL_TIMESTAMPS = {
|
|
1071
|
-
decode:
|
|
1091
|
+
decode: chunkE6TXEISH_cjs.formatPostgresTimestamp,
|
|
1072
1092
|
encode: (value) => new Date(value)
|
|
1073
1093
|
};
|
|
1074
1094
|
function mapKindRemovalRow(row, decode) {
|
|
@@ -1109,8 +1129,43 @@ function buildKindRemovalOnConflictSet(removedAtColumn, paramsRemovedAt) {
|
|
|
1109
1129
|
lastError: drizzleOrm.sql`excluded.${drizzleOrm.sql.identifier("last_error")}`
|
|
1110
1130
|
};
|
|
1111
1131
|
}
|
|
1132
|
+
function sqlNull(value) {
|
|
1133
|
+
return value ?? drizzleOrm.sql.raw("NULL");
|
|
1134
|
+
}
|
|
1135
|
+
function resolveValidFrom(validFrom, timestamp2) {
|
|
1136
|
+
if (validFrom === null) return void 0;
|
|
1137
|
+
return validFrom ?? timestamp2;
|
|
1138
|
+
}
|
|
1139
|
+
function quotedColumn(column) {
|
|
1140
|
+
return drizzleOrm.sql.raw(`"${column.name.replaceAll('"', '""')}"`);
|
|
1141
|
+
}
|
|
1142
|
+
function quotedTableName(tableName) {
|
|
1143
|
+
return drizzleOrm.sql.raw(`"${tableName.replaceAll('"', '""')}"`);
|
|
1144
|
+
}
|
|
1145
|
+
var CODE_POINT_ORDER_BUILDERS = {
|
|
1146
|
+
postgres: (value) => drizzleOrm.sql`${value} COLLATE "C"`,
|
|
1147
|
+
sqlite: (value) => value
|
|
1148
|
+
};
|
|
1149
|
+
function codePointOrderKey(column, dialect) {
|
|
1150
|
+
return CODE_POINT_ORDER_BUILDERS[dialect](column);
|
|
1151
|
+
}
|
|
1152
|
+
function liveNodeIdsSubquery(nodes2, graphId, nodeKind, nowIso2) {
|
|
1153
|
+
return drizzleOrm.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})`;
|
|
1154
|
+
}
|
|
1155
|
+
function nodeColumnList(nodes2) {
|
|
1156
|
+
return drizzleOrm.sql.raw(
|
|
1157
|
+
`"${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}"`
|
|
1158
|
+
);
|
|
1159
|
+
}
|
|
1160
|
+
function edgeColumnList(edges2) {
|
|
1161
|
+
return drizzleOrm.sql.raw(
|
|
1162
|
+
`"${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}"`
|
|
1163
|
+
);
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
// src/backend/drizzle/operations/hybrid.ts
|
|
1112
1167
|
function nodeIdOrderKey(dialect) {
|
|
1113
|
-
return
|
|
1168
|
+
return codePointOrderKey(drizzleOrm.sql.raw("node_id"), dialect);
|
|
1114
1169
|
}
|
|
1115
1170
|
function hybridCandidatesRef() {
|
|
1116
1171
|
return drizzleOrm.sql`SELECT node_id FROM tg_hybrid_cand`;
|
|
@@ -1192,7 +1247,7 @@ function buildHybridSearchStatement(input) {
|
|
|
1192
1247
|
`;
|
|
1193
1248
|
}
|
|
1194
1249
|
function qualified(nodes2, member) {
|
|
1195
|
-
return drizzleOrm.sql`tg_hybrid_node.${
|
|
1250
|
+
return drizzleOrm.sql`tg_hybrid_node.${quotedColumn(nodes2[member])}`;
|
|
1196
1251
|
}
|
|
1197
1252
|
function present(value) {
|
|
1198
1253
|
return value !== null && value !== void 0;
|
|
@@ -1200,20 +1255,20 @@ function present(value) {
|
|
|
1200
1255
|
function mapHybridSearchRow(row, toNodeRow) {
|
|
1201
1256
|
return {
|
|
1202
1257
|
node: toNodeRow(row),
|
|
1203
|
-
fusedScore:
|
|
1204
|
-
...present(row
|
|
1205
|
-
...present(row
|
|
1206
|
-
...present(row
|
|
1207
|
-
...present(row
|
|
1208
|
-
fulltextScore:
|
|
1209
|
-
row
|
|
1258
|
+
fusedScore: chunkE6TXEISH_cjs.coerceNumericScore(row["fused_score"]),
|
|
1259
|
+
...present(row["vector_rank"]) ? { vectorRank: Number(row["vector_rank"]) } : {},
|
|
1260
|
+
...present(row["vector_score"]) ? { vectorScore: chunkE6TXEISH_cjs.coerceNumericScore(row["vector_score"]) } : {},
|
|
1261
|
+
...present(row["fulltext_rank"]) ? { fulltextRank: Number(row["fulltext_rank"]) } : {},
|
|
1262
|
+
...present(row["fulltext_score"]) ? {
|
|
1263
|
+
fulltextScore: chunkE6TXEISH_cjs.coerceNumericScore(
|
|
1264
|
+
row["fulltext_score"]
|
|
1210
1265
|
)
|
|
1211
1266
|
} : {},
|
|
1212
|
-
...present(row
|
|
1267
|
+
...present(row["snippet"]) ? { snippet: String(row["snippet"]) } : {}
|
|
1213
1268
|
};
|
|
1214
1269
|
}
|
|
1215
1270
|
function buildClearGraph(tables3, graphId) {
|
|
1216
|
-
const fulltext2 =
|
|
1271
|
+
const fulltext2 = quotedTableName(tables3.fulltextTableName);
|
|
1217
1272
|
return [
|
|
1218
1273
|
{ query: drizzleOrm.sql`DELETE FROM ${fulltext2} WHERE "graph_id" = ${graphId}` },
|
|
1219
1274
|
{
|
|
@@ -1263,9 +1318,7 @@ function buildTemporalConditions(table, params) {
|
|
|
1263
1318
|
}
|
|
1264
1319
|
if (mode === "current" || mode === "asOf") {
|
|
1265
1320
|
if (params.asOf === void 0) {
|
|
1266
|
-
throw new Error(
|
|
1267
|
-
`asOf timestamp is required for temporal mode "${mode}"`
|
|
1268
|
-
);
|
|
1321
|
+
throw new Error(`asOf timestamp is required for temporal mode "${mode}"`);
|
|
1269
1322
|
}
|
|
1270
1323
|
conditions.push(
|
|
1271
1324
|
drizzleOrm.sql`(${table.validFrom} IS NULL OR ${table.validFrom} <= ${params.asOf})`,
|
|
@@ -1395,13 +1448,13 @@ function buildCountEdgesByKind(tables3, params) {
|
|
|
1395
1448
|
function buildInsertEdge(tables3, params, timestamp2) {
|
|
1396
1449
|
const { edges: edges2 } = tables3;
|
|
1397
1450
|
const propsJson = JSON.stringify(params.props);
|
|
1398
|
-
const columns =
|
|
1451
|
+
const columns = edgeColumnList(edges2);
|
|
1399
1452
|
return drizzleOrm.sql`
|
|
1400
1453
|
INSERT INTO ${edges2} (${columns})
|
|
1401
1454
|
VALUES (
|
|
1402
1455
|
${params.graphId}, ${params.id}, ${params.kind},
|
|
1403
1456
|
${params.fromKind}, ${params.fromId}, ${params.toKind}, ${params.toId},
|
|
1404
|
-
${propsJson}, ${
|
|
1457
|
+
${propsJson}, ${sqlNull(resolveValidFrom(params.validFrom, timestamp2))}, ${sqlNull(params.validTo)},
|
|
1405
1458
|
${timestamp2}, ${timestamp2}
|
|
1406
1459
|
)
|
|
1407
1460
|
RETURNING *
|
|
@@ -1410,23 +1463,23 @@ function buildInsertEdge(tables3, params, timestamp2) {
|
|
|
1410
1463
|
function buildInsertEdgeNoReturn(tables3, params, timestamp2) {
|
|
1411
1464
|
const { edges: edges2 } = tables3;
|
|
1412
1465
|
const propsJson = JSON.stringify(params.props);
|
|
1413
|
-
const columns =
|
|
1466
|
+
const columns = edgeColumnList(edges2);
|
|
1414
1467
|
return drizzleOrm.sql`
|
|
1415
1468
|
INSERT INTO ${edges2} (${columns})
|
|
1416
1469
|
VALUES (
|
|
1417
1470
|
${params.graphId}, ${params.id}, ${params.kind},
|
|
1418
1471
|
${params.fromKind}, ${params.fromId}, ${params.toKind}, ${params.toId},
|
|
1419
|
-
${propsJson}, ${
|
|
1472
|
+
${propsJson}, ${sqlNull(resolveValidFrom(params.validFrom, timestamp2))}, ${sqlNull(params.validTo)},
|
|
1420
1473
|
${timestamp2}, ${timestamp2}
|
|
1421
1474
|
)
|
|
1422
1475
|
`;
|
|
1423
1476
|
}
|
|
1424
1477
|
function buildInsertEdgesBatch(tables3, params, timestamp2) {
|
|
1425
1478
|
const { edges: edges2 } = tables3;
|
|
1426
|
-
const columns =
|
|
1479
|
+
const columns = edgeColumnList(edges2);
|
|
1427
1480
|
const values = params.map((edgeParams) => {
|
|
1428
1481
|
const propsJson = JSON.stringify(edgeParams.props);
|
|
1429
|
-
return drizzleOrm.sql`(${edgeParams.graphId}, ${edgeParams.id}, ${edgeParams.kind}, ${edgeParams.fromKind}, ${edgeParams.fromId}, ${edgeParams.toKind}, ${edgeParams.toId}, ${propsJson}, ${
|
|
1482
|
+
return drizzleOrm.sql`(${edgeParams.graphId}, ${edgeParams.id}, ${edgeParams.kind}, ${edgeParams.fromKind}, ${edgeParams.fromId}, ${edgeParams.toKind}, ${edgeParams.toId}, ${propsJson}, ${sqlNull(resolveValidFrom(edgeParams.validFrom, timestamp2))}, ${sqlNull(edgeParams.validTo)}, ${timestamp2}, ${timestamp2})`;
|
|
1430
1483
|
});
|
|
1431
1484
|
return drizzleOrm.sql`
|
|
1432
1485
|
INSERT INTO ${edges2} (${columns})
|
|
@@ -1435,10 +1488,10 @@ function buildInsertEdgesBatch(tables3, params, timestamp2) {
|
|
|
1435
1488
|
}
|
|
1436
1489
|
function buildInsertEdgesBatchReturning(tables3, params, timestamp2) {
|
|
1437
1490
|
const { edges: edges2 } = tables3;
|
|
1438
|
-
const columns =
|
|
1491
|
+
const columns = edgeColumnList(edges2);
|
|
1439
1492
|
const values = params.map((edgeParams) => {
|
|
1440
1493
|
const propsJson = JSON.stringify(edgeParams.props);
|
|
1441
|
-
return drizzleOrm.sql`(${edgeParams.graphId}, ${edgeParams.id}, ${edgeParams.kind}, ${edgeParams.fromKind}, ${edgeParams.fromId}, ${edgeParams.toKind}, ${edgeParams.toId}, ${propsJson}, ${
|
|
1494
|
+
return drizzleOrm.sql`(${edgeParams.graphId}, ${edgeParams.id}, ${edgeParams.kind}, ${edgeParams.fromKind}, ${edgeParams.fromId}, ${edgeParams.toKind}, ${edgeParams.toId}, ${propsJson}, ${sqlNull(resolveValidFrom(edgeParams.validFrom, timestamp2))}, ${sqlNull(edgeParams.validTo)}, ${timestamp2}, ${timestamp2})`;
|
|
1442
1495
|
});
|
|
1443
1496
|
return drizzleOrm.sql`
|
|
1444
1497
|
INSERT INTO ${edges2} (${columns})
|
|
@@ -1459,21 +1512,24 @@ function buildGetEdges(tables3, graphId, ids) {
|
|
|
1459
1512
|
return drizzleOrm.sql`
|
|
1460
1513
|
SELECT * FROM ${edges2}
|
|
1461
1514
|
WHERE ${edges2.graphId} = ${graphId}
|
|
1462
|
-
AND ${edges2.id} IN (${
|
|
1515
|
+
AND ${edges2.id} IN (${drizzleOrm.sql.join(
|
|
1516
|
+
ids.map((id) => drizzleOrm.sql`${id}`),
|
|
1517
|
+
drizzleOrm.sql`, `
|
|
1518
|
+
)})
|
|
1463
1519
|
`;
|
|
1464
1520
|
}
|
|
1465
1521
|
function buildUpdateEdge(tables3, params, timestamp2) {
|
|
1466
1522
|
const { edges: edges2 } = tables3;
|
|
1467
1523
|
const propsJson = JSON.stringify(params.props);
|
|
1468
1524
|
const setParts = [
|
|
1469
|
-
drizzleOrm.sql`${
|
|
1470
|
-
drizzleOrm.sql`${
|
|
1525
|
+
drizzleOrm.sql`${quotedColumn(edges2.props)} = ${propsJson}`,
|
|
1526
|
+
drizzleOrm.sql`${quotedColumn(edges2.updatedAt)} = ${timestamp2}`
|
|
1471
1527
|
];
|
|
1472
1528
|
if (params.validTo !== void 0) {
|
|
1473
|
-
setParts.push(drizzleOrm.sql`${
|
|
1529
|
+
setParts.push(drizzleOrm.sql`${quotedColumn(edges2.validTo)} = ${params.validTo}`);
|
|
1474
1530
|
}
|
|
1475
1531
|
if (params.clearDeleted) {
|
|
1476
|
-
setParts.push(drizzleOrm.sql`${
|
|
1532
|
+
setParts.push(drizzleOrm.sql`${quotedColumn(edges2.deletedAt)} = NULL`);
|
|
1477
1533
|
}
|
|
1478
1534
|
const setClause = drizzleOrm.sql.join(setParts, drizzleOrm.sql`, `);
|
|
1479
1535
|
if (params.clearDeleted) {
|
|
@@ -1498,7 +1554,7 @@ function buildDeleteEdge(tables3, params, timestamp2) {
|
|
|
1498
1554
|
const { edges: edges2 } = tables3;
|
|
1499
1555
|
return drizzleOrm.sql`
|
|
1500
1556
|
UPDATE ${edges2}
|
|
1501
|
-
SET ${
|
|
1557
|
+
SET ${quotedColumn(edges2.deletedAt)} = ${timestamp2}
|
|
1502
1558
|
WHERE ${edges2.graphId} = ${params.graphId}
|
|
1503
1559
|
AND ${edges2.id} = ${params.id}
|
|
1504
1560
|
AND ${edges2.deletedAt} IS NULL
|
|
@@ -1508,9 +1564,12 @@ function buildDeleteEdgesBatch(tables3, params, timestamp2) {
|
|
|
1508
1564
|
const { edges: edges2 } = tables3;
|
|
1509
1565
|
return drizzleOrm.sql`
|
|
1510
1566
|
UPDATE ${edges2}
|
|
1511
|
-
SET ${
|
|
1567
|
+
SET ${quotedColumn(edges2.deletedAt)} = ${timestamp2}
|
|
1512
1568
|
WHERE ${edges2.graphId} = ${params.graphId}
|
|
1513
|
-
AND ${edges2.id} IN (${
|
|
1569
|
+
AND ${edges2.id} IN (${drizzleOrm.sql.join(
|
|
1570
|
+
params.ids.map((id) => drizzleOrm.sql`${id}`),
|
|
1571
|
+
drizzleOrm.sql`, `
|
|
1572
|
+
)})
|
|
1514
1573
|
AND ${edges2.deletedAt} IS NULL
|
|
1515
1574
|
`;
|
|
1516
1575
|
}
|
|
@@ -1519,7 +1578,10 @@ function buildHardDeleteEdgesBatch(tables3, params) {
|
|
|
1519
1578
|
return drizzleOrm.sql`
|
|
1520
1579
|
DELETE FROM ${edges2}
|
|
1521
1580
|
WHERE ${edges2.graphId} = ${params.graphId}
|
|
1522
|
-
AND ${edges2.id} IN (${
|
|
1581
|
+
AND ${edges2.id} IN (${drizzleOrm.sql.join(
|
|
1582
|
+
params.ids.map((id) => drizzleOrm.sql`${id}`),
|
|
1583
|
+
drizzleOrm.sql`, `
|
|
1584
|
+
)})
|
|
1523
1585
|
`;
|
|
1524
1586
|
}
|
|
1525
1587
|
function buildHardDeleteEdge(tables3, params) {
|
|
@@ -1603,18 +1665,14 @@ function resolveMode(mode) {
|
|
|
1603
1665
|
function buildFulltextSearch(tableName, params, strategy, dialect, candidates) {
|
|
1604
1666
|
assertValidSearchParams(params);
|
|
1605
1667
|
const mode = resolveMode(params.mode);
|
|
1606
|
-
const table =
|
|
1607
|
-
const matchCondition =
|
|
1608
|
-
tableName,
|
|
1609
|
-
|
|
1610
|
-
mode,
|
|
1611
|
-
params.language
|
|
1668
|
+
const table = quotedTableName(tableName);
|
|
1669
|
+
const matchCondition = chunkDOVMTPKE_cjs.toDrizzleSql(
|
|
1670
|
+
strategy.matchCondition(tableName, params.query, mode, params.language),
|
|
1671
|
+
dialect
|
|
1612
1672
|
);
|
|
1613
|
-
const rankExpression =
|
|
1614
|
-
tableName,
|
|
1615
|
-
|
|
1616
|
-
mode,
|
|
1617
|
-
params.language
|
|
1673
|
+
const rankExpression = chunkDOVMTPKE_cjs.toDrizzleSql(
|
|
1674
|
+
strategy.rankExpression(tableName, params.query, mode, params.language),
|
|
1675
|
+
dialect
|
|
1618
1676
|
);
|
|
1619
1677
|
const conditions = [
|
|
1620
1678
|
matchCondition,
|
|
@@ -1625,13 +1683,17 @@ function buildFulltextSearch(tableName, params, strategy, dialect, candidates) {
|
|
|
1625
1683
|
conditions.push(drizzleOrm.sql`${rankExpression} >= ${params.minScore}`);
|
|
1626
1684
|
}
|
|
1627
1685
|
if (candidates !== void 0) {
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1686
|
+
const candidateSql = chunkX6RDQ5NB_cjs.isSqlFragment(candidates) ? chunkDOVMTPKE_cjs.toDrizzleSql(candidates, dialect) : candidates;
|
|
1687
|
+
conditions.push(drizzleOrm.sql`"node_id" IN (${candidateSql})`);
|
|
1688
|
+
}
|
|
1689
|
+
const snippetExpr = params.includeSnippets === true && strategy.supportsSnippets ? chunkDOVMTPKE_cjs.toDrizzleSql(
|
|
1690
|
+
strategy.snippetExpression(
|
|
1691
|
+
tableName,
|
|
1692
|
+
params.query,
|
|
1693
|
+
mode,
|
|
1694
|
+
params.language
|
|
1695
|
+
),
|
|
1696
|
+
dialect
|
|
1635
1697
|
) : drizzleOrm.sql`NULL`;
|
|
1636
1698
|
const pageClause = params.offset === void 0 || params.offset === 0 ? drizzleOrm.sql`LIMIT ${params.limit}` : drizzleOrm.sql`LIMIT ${params.limit} OFFSET ${params.offset}`;
|
|
1637
1699
|
return drizzleOrm.sql`
|
|
@@ -1641,7 +1703,7 @@ function buildFulltextSearch(tableName, params, strategy, dialect, candidates) {
|
|
|
1641
1703
|
${snippetExpr} AS snippet
|
|
1642
1704
|
FROM ${table}
|
|
1643
1705
|
WHERE ${drizzleOrm.sql.join(conditions, drizzleOrm.sql` AND `)}
|
|
1644
|
-
ORDER BY ${rankExpression} DESC, ${
|
|
1706
|
+
ORDER BY ${rankExpression} DESC, ${codePointOrderKey(drizzleOrm.sql.raw('"node_id"'), dialect)} ASC
|
|
1645
1707
|
${pageClause}
|
|
1646
1708
|
`;
|
|
1647
1709
|
}
|
|
@@ -1658,12 +1720,12 @@ function assertValidSearchParams(params) {
|
|
|
1658
1720
|
function buildInsertNode(tables3, params, timestamp2) {
|
|
1659
1721
|
const { nodes: nodes2 } = tables3;
|
|
1660
1722
|
const propsJson = JSON.stringify(params.props);
|
|
1661
|
-
const columns =
|
|
1723
|
+
const columns = nodeColumnList(nodes2);
|
|
1662
1724
|
return drizzleOrm.sql`
|
|
1663
1725
|
INSERT INTO ${nodes2} (${columns})
|
|
1664
1726
|
VALUES (
|
|
1665
1727
|
${params.graphId}, ${params.kind}, ${params.id}, ${propsJson},
|
|
1666
|
-
1, ${
|
|
1728
|
+
1, ${sqlNull(resolveValidFrom(params.validFrom, timestamp2))}, ${sqlNull(params.validTo)},
|
|
1667
1729
|
${timestamp2}, ${timestamp2}
|
|
1668
1730
|
)
|
|
1669
1731
|
RETURNING *
|
|
@@ -1672,22 +1734,22 @@ function buildInsertNode(tables3, params, timestamp2) {
|
|
|
1672
1734
|
function buildInsertNodeNoReturn(tables3, params, timestamp2) {
|
|
1673
1735
|
const { nodes: nodes2 } = tables3;
|
|
1674
1736
|
const propsJson = JSON.stringify(params.props);
|
|
1675
|
-
const columns =
|
|
1737
|
+
const columns = nodeColumnList(nodes2);
|
|
1676
1738
|
return drizzleOrm.sql`
|
|
1677
1739
|
INSERT INTO ${nodes2} (${columns})
|
|
1678
1740
|
VALUES (
|
|
1679
1741
|
${params.graphId}, ${params.kind}, ${params.id}, ${propsJson},
|
|
1680
|
-
1, ${
|
|
1742
|
+
1, ${sqlNull(resolveValidFrom(params.validFrom, timestamp2))}, ${sqlNull(params.validTo)},
|
|
1681
1743
|
${timestamp2}, ${timestamp2}
|
|
1682
1744
|
)
|
|
1683
1745
|
`;
|
|
1684
1746
|
}
|
|
1685
1747
|
function buildInsertNodesBatch(tables3, params, timestamp2) {
|
|
1686
1748
|
const { nodes: nodes2 } = tables3;
|
|
1687
|
-
const columns =
|
|
1749
|
+
const columns = nodeColumnList(nodes2);
|
|
1688
1750
|
const values = params.map((nodeParams) => {
|
|
1689
1751
|
const propsJson = JSON.stringify(nodeParams.props);
|
|
1690
|
-
return drizzleOrm.sql`(${nodeParams.graphId}, ${nodeParams.kind}, ${nodeParams.id}, ${propsJson}, 1, ${
|
|
1752
|
+
return drizzleOrm.sql`(${nodeParams.graphId}, ${nodeParams.kind}, ${nodeParams.id}, ${propsJson}, 1, ${sqlNull(resolveValidFrom(nodeParams.validFrom, timestamp2))}, ${sqlNull(nodeParams.validTo)}, ${timestamp2}, ${timestamp2})`;
|
|
1691
1753
|
});
|
|
1692
1754
|
return drizzleOrm.sql`
|
|
1693
1755
|
INSERT INTO ${nodes2} (${columns})
|
|
@@ -1696,10 +1758,10 @@ function buildInsertNodesBatch(tables3, params, timestamp2) {
|
|
|
1696
1758
|
}
|
|
1697
1759
|
function buildInsertNodesBatchReturning(tables3, params, timestamp2) {
|
|
1698
1760
|
const { nodes: nodes2 } = tables3;
|
|
1699
|
-
const columns =
|
|
1761
|
+
const columns = nodeColumnList(nodes2);
|
|
1700
1762
|
const values = params.map((nodeParams) => {
|
|
1701
1763
|
const propsJson = JSON.stringify(nodeParams.props);
|
|
1702
|
-
return drizzleOrm.sql`(${nodeParams.graphId}, ${nodeParams.kind}, ${nodeParams.id}, ${propsJson}, 1, ${
|
|
1764
|
+
return drizzleOrm.sql`(${nodeParams.graphId}, ${nodeParams.kind}, ${nodeParams.id}, ${propsJson}, 1, ${sqlNull(resolveValidFrom(nodeParams.validFrom, timestamp2))}, ${sqlNull(nodeParams.validTo)}, ${timestamp2}, ${timestamp2})`;
|
|
1703
1765
|
});
|
|
1704
1766
|
return drizzleOrm.sql`
|
|
1705
1767
|
INSERT INTO ${nodes2} (${columns})
|
|
@@ -1722,26 +1784,29 @@ function buildGetNodes(tables3, graphId, kind, ids) {
|
|
|
1722
1784
|
SELECT * FROM ${nodes2}
|
|
1723
1785
|
WHERE ${nodes2.graphId} = ${graphId}
|
|
1724
1786
|
AND ${nodes2.kind} = ${kind}
|
|
1725
|
-
AND ${nodes2.id} IN (${
|
|
1787
|
+
AND ${nodes2.id} IN (${drizzleOrm.sql.join(
|
|
1788
|
+
ids.map((id) => drizzleOrm.sql`${id}`),
|
|
1789
|
+
drizzleOrm.sql`, `
|
|
1790
|
+
)})
|
|
1726
1791
|
`;
|
|
1727
1792
|
}
|
|
1728
1793
|
function buildUpdateNode(tables3, params, timestamp2) {
|
|
1729
1794
|
const { nodes: nodes2 } = tables3;
|
|
1730
1795
|
const propsJson = JSON.stringify(params.props);
|
|
1731
1796
|
const setParts = [
|
|
1732
|
-
drizzleOrm.sql`${
|
|
1733
|
-
drizzleOrm.sql`${
|
|
1797
|
+
drizzleOrm.sql`${quotedColumn(nodes2.props)} = ${propsJson}`,
|
|
1798
|
+
drizzleOrm.sql`${quotedColumn(nodes2.updatedAt)} = ${timestamp2}`
|
|
1734
1799
|
];
|
|
1735
1800
|
if (params.incrementVersion) {
|
|
1736
1801
|
setParts.push(
|
|
1737
|
-
drizzleOrm.sql`${
|
|
1802
|
+
drizzleOrm.sql`${quotedColumn(nodes2.version)} = ${quotedColumn(nodes2.version)} + 1`
|
|
1738
1803
|
);
|
|
1739
1804
|
}
|
|
1740
1805
|
if (params.validTo !== void 0) {
|
|
1741
|
-
setParts.push(drizzleOrm.sql`${
|
|
1806
|
+
setParts.push(drizzleOrm.sql`${quotedColumn(nodes2.validTo)} = ${params.validTo}`);
|
|
1742
1807
|
}
|
|
1743
1808
|
if (params.clearDeleted) {
|
|
1744
|
-
setParts.push(drizzleOrm.sql`${
|
|
1809
|
+
setParts.push(drizzleOrm.sql`${quotedColumn(nodes2.deletedAt)} = NULL`);
|
|
1745
1810
|
}
|
|
1746
1811
|
const setClause = drizzleOrm.sql.join(setParts, drizzleOrm.sql`, `);
|
|
1747
1812
|
if (params.clearDeleted) {
|
|
@@ -1768,7 +1833,7 @@ function buildDeleteNode(tables3, params, timestamp2) {
|
|
|
1768
1833
|
const { nodes: nodes2 } = tables3;
|
|
1769
1834
|
return drizzleOrm.sql`
|
|
1770
1835
|
UPDATE ${nodes2}
|
|
1771
|
-
SET ${
|
|
1836
|
+
SET ${quotedColumn(nodes2.deletedAt)} = ${timestamp2}
|
|
1772
1837
|
WHERE ${nodes2.graphId} = ${params.graphId}
|
|
1773
1838
|
AND ${nodes2.kind} = ${params.kind}
|
|
1774
1839
|
AND ${nodes2.id} = ${params.id}
|
|
@@ -1785,8 +1850,13 @@ function buildHardDeleteNode(tables3, params) {
|
|
|
1785
1850
|
`;
|
|
1786
1851
|
}
|
|
1787
1852
|
function createSchemaDialectStrategy(dialect) {
|
|
1788
|
-
const
|
|
1789
|
-
|
|
1853
|
+
const literals = {
|
|
1854
|
+
postgres: { false: "FALSE", true: "TRUE" },
|
|
1855
|
+
sqlite: { false: "0", true: "1" }
|
|
1856
|
+
};
|
|
1857
|
+
const dialectLiterals = literals[dialect];
|
|
1858
|
+
const trueLiteral = drizzleOrm.sql.raw(dialectLiterals.true);
|
|
1859
|
+
const falseLiteral = drizzleOrm.sql.raw(dialectLiterals.false);
|
|
1790
1860
|
return {
|
|
1791
1861
|
booleanLiteral(value) {
|
|
1792
1862
|
return value ? trueLiteral : falseLiteral;
|
|
@@ -1802,7 +1872,9 @@ function buildInsertSchema(tables3, params, timestamp2, dialect = "sqlite") {
|
|
|
1802
1872
|
const strategy = SCHEMA_DIALECT_STRATEGIES[dialect];
|
|
1803
1873
|
const schemaDocumentJson = JSON.stringify(params.schemaDoc);
|
|
1804
1874
|
const isActiveValue = strategy.booleanLiteral(params.isActive);
|
|
1805
|
-
const columns = drizzleOrm.sql.raw(
|
|
1875
|
+
const columns = drizzleOrm.sql.raw(
|
|
1876
|
+
`"${schemaVersions2.graphId.name}", "${schemaVersions2.version.name}", "${schemaVersions2.schemaHash.name}", "${schemaVersions2.schemaDoc.name}", "${schemaVersions2.createdAt.name}", "${schemaVersions2.isActive.name}"`
|
|
1877
|
+
);
|
|
1806
1878
|
return drizzleOrm.sql`
|
|
1807
1879
|
INSERT INTO ${schemaVersions2} (${columns})
|
|
1808
1880
|
VALUES (
|
|
@@ -1835,12 +1907,12 @@ function buildSetActiveSchema(tables3, graphId, version, dialect = "sqlite") {
|
|
|
1835
1907
|
const strategy = SCHEMA_DIALECT_STRATEGIES[dialect];
|
|
1836
1908
|
const deactivateAll = drizzleOrm.sql`
|
|
1837
1909
|
UPDATE ${schemaVersions2}
|
|
1838
|
-
SET ${
|
|
1910
|
+
SET ${quotedColumn(schemaVersions2.isActive)} = ${strategy.booleanLiteral(false)}
|
|
1839
1911
|
WHERE ${schemaVersions2.graphId} = ${graphId}
|
|
1840
1912
|
`;
|
|
1841
1913
|
const activateVersion = drizzleOrm.sql`
|
|
1842
1914
|
UPDATE ${schemaVersions2}
|
|
1843
|
-
SET ${
|
|
1915
|
+
SET ${quotedColumn(schemaVersions2.isActive)} = ${strategy.booleanLiteral(true)}
|
|
1844
1916
|
WHERE ${schemaVersions2.graphId} = ${graphId}
|
|
1845
1917
|
AND ${schemaVersions2.version} = ${version}
|
|
1846
1918
|
`;
|
|
@@ -1848,8 +1920,12 @@ function buildSetActiveSchema(tables3, graphId, version, dialect = "sqlite") {
|
|
|
1848
1920
|
}
|
|
1849
1921
|
function buildInsertUniqueSqlite(tables3, params) {
|
|
1850
1922
|
const { uniques: uniques2 } = tables3;
|
|
1851
|
-
const columns = drizzleOrm.sql.raw(
|
|
1852
|
-
|
|
1923
|
+
const columns = drizzleOrm.sql.raw(
|
|
1924
|
+
`"${uniques2.graphId.name}", "${uniques2.nodeKind.name}", "${uniques2.constraintName.name}", "${uniques2.key.name}", "${uniques2.nodeId.name}", "${uniques2.concreteKind.name}", "${uniques2.deletedAt.name}"`
|
|
1925
|
+
);
|
|
1926
|
+
const conflictColumns = drizzleOrm.sql.raw(
|
|
1927
|
+
`"${uniques2.graphId.name}", "${uniques2.nodeKind.name}", "${uniques2.constraintName.name}", "${uniques2.key.name}"`
|
|
1928
|
+
);
|
|
1853
1929
|
return drizzleOrm.sql`
|
|
1854
1930
|
INSERT INTO ${uniques2} (${columns})
|
|
1855
1931
|
VALUES (
|
|
@@ -1858,28 +1934,32 @@ function buildInsertUniqueSqlite(tables3, params) {
|
|
|
1858
1934
|
)
|
|
1859
1935
|
ON CONFLICT (${conflictColumns})
|
|
1860
1936
|
DO UPDATE SET
|
|
1861
|
-
${
|
|
1862
|
-
WHEN ${
|
|
1863
|
-
WHEN ${
|
|
1864
|
-
ELSE ${
|
|
1937
|
+
${quotedColumn(uniques2.nodeId)} = CASE
|
|
1938
|
+
WHEN ${quotedColumn(uniques2.nodeId)} = ${params.nodeId} THEN ${params.nodeId}
|
|
1939
|
+
WHEN ${quotedColumn(uniques2.deletedAt)} IS NOT NULL THEN ${params.nodeId}
|
|
1940
|
+
ELSE ${quotedColumn(uniques2.nodeId)}
|
|
1865
1941
|
END,
|
|
1866
|
-
${
|
|
1867
|
-
WHEN ${
|
|
1868
|
-
WHEN ${
|
|
1869
|
-
ELSE ${
|
|
1942
|
+
${quotedColumn(uniques2.concreteKind)} = CASE
|
|
1943
|
+
WHEN ${quotedColumn(uniques2.nodeId)} = ${params.nodeId} THEN ${params.concreteKind}
|
|
1944
|
+
WHEN ${quotedColumn(uniques2.deletedAt)} IS NOT NULL THEN ${params.concreteKind}
|
|
1945
|
+
ELSE ${quotedColumn(uniques2.concreteKind)}
|
|
1870
1946
|
END,
|
|
1871
|
-
${
|
|
1872
|
-
WHEN ${
|
|
1873
|
-
WHEN ${
|
|
1874
|
-
ELSE ${
|
|
1947
|
+
${quotedColumn(uniques2.deletedAt)} = CASE
|
|
1948
|
+
WHEN ${quotedColumn(uniques2.nodeId)} = ${params.nodeId} THEN NULL
|
|
1949
|
+
WHEN ${quotedColumn(uniques2.deletedAt)} IS NOT NULL THEN NULL
|
|
1950
|
+
ELSE ${quotedColumn(uniques2.deletedAt)}
|
|
1875
1951
|
END
|
|
1876
|
-
RETURNING ${
|
|
1952
|
+
RETURNING ${quotedColumn(uniques2.nodeId)} as node_id
|
|
1877
1953
|
`;
|
|
1878
1954
|
}
|
|
1879
1955
|
function buildInsertUniquePostgres(tables3, params) {
|
|
1880
1956
|
const { uniques: uniques2 } = tables3;
|
|
1881
|
-
const columns = drizzleOrm.sql.raw(
|
|
1882
|
-
|
|
1957
|
+
const columns = drizzleOrm.sql.raw(
|
|
1958
|
+
`"${uniques2.graphId.name}", "${uniques2.nodeKind.name}", "${uniques2.constraintName.name}", "${uniques2.key.name}", "${uniques2.nodeId.name}", "${uniques2.concreteKind.name}", "${uniques2.deletedAt.name}"`
|
|
1959
|
+
);
|
|
1960
|
+
const conflictColumns = drizzleOrm.sql.raw(
|
|
1961
|
+
`"${uniques2.graphId.name}", "${uniques2.nodeKind.name}", "${uniques2.constraintName.name}", "${uniques2.key.name}"`
|
|
1962
|
+
);
|
|
1883
1963
|
const tableName = drizzleOrm.getTableName(uniques2);
|
|
1884
1964
|
const existingColumn = (column) => drizzleOrm.sql.raw(`"${tableName}"."${column.name}"`);
|
|
1885
1965
|
return drizzleOrm.sql`
|
|
@@ -1890,22 +1970,22 @@ function buildInsertUniquePostgres(tables3, params) {
|
|
|
1890
1970
|
)
|
|
1891
1971
|
ON CONFLICT (${conflictColumns})
|
|
1892
1972
|
DO UPDATE SET
|
|
1893
|
-
${
|
|
1973
|
+
${quotedColumn(uniques2.nodeId)} = CASE
|
|
1894
1974
|
WHEN ${existingColumn(uniques2.nodeId)} = ${params.nodeId} THEN ${params.nodeId}
|
|
1895
1975
|
WHEN ${existingColumn(uniques2.deletedAt)} IS NOT NULL THEN ${params.nodeId}
|
|
1896
1976
|
ELSE ${existingColumn(uniques2.nodeId)}
|
|
1897
1977
|
END,
|
|
1898
|
-
${
|
|
1978
|
+
${quotedColumn(uniques2.concreteKind)} = CASE
|
|
1899
1979
|
WHEN ${existingColumn(uniques2.nodeId)} = ${params.nodeId} THEN ${params.concreteKind}
|
|
1900
1980
|
WHEN ${existingColumn(uniques2.deletedAt)} IS NOT NULL THEN ${params.concreteKind}
|
|
1901
1981
|
ELSE ${existingColumn(uniques2.concreteKind)}
|
|
1902
1982
|
END,
|
|
1903
|
-
${
|
|
1983
|
+
${quotedColumn(uniques2.deletedAt)} = CASE
|
|
1904
1984
|
WHEN ${existingColumn(uniques2.nodeId)} = ${params.nodeId} THEN NULL
|
|
1905
1985
|
WHEN ${existingColumn(uniques2.deletedAt)} IS NOT NULL THEN NULL
|
|
1906
1986
|
ELSE ${existingColumn(uniques2.deletedAt)}
|
|
1907
1987
|
END
|
|
1908
|
-
RETURNING ${
|
|
1988
|
+
RETURNING ${quotedColumn(uniques2.nodeId)} as node_id
|
|
1909
1989
|
`;
|
|
1910
1990
|
}
|
|
1911
1991
|
var UNIQUE_INSERT_BUILDERS = {
|
|
@@ -1925,7 +2005,19 @@ function buildInsertUniqueBatch(tables3, dialect, entries) {
|
|
|
1925
2005
|
`"${uniques2.graphId.name}", "${uniques2.nodeKind.name}", "${uniques2.constraintName.name}", "${uniques2.key.name}"`
|
|
1926
2006
|
);
|
|
1927
2007
|
const tableName = drizzleOrm.getTableName(uniques2);
|
|
1928
|
-
const existingColumn = (column) =>
|
|
2008
|
+
const existingColumn = (column) => {
|
|
2009
|
+
switch (dialect) {
|
|
2010
|
+
case "postgres": {
|
|
2011
|
+
return drizzleOrm.sql.raw(`"${tableName}"."${column.name}"`);
|
|
2012
|
+
}
|
|
2013
|
+
case "sqlite": {
|
|
2014
|
+
return drizzleOrm.sql.raw(`"${column.name}"`);
|
|
2015
|
+
}
|
|
2016
|
+
default: {
|
|
2017
|
+
return dialect;
|
|
2018
|
+
}
|
|
2019
|
+
}
|
|
2020
|
+
};
|
|
1929
2021
|
const excludedColumn = (column) => drizzleOrm.sql.raw(`excluded."${column.name}"`);
|
|
1930
2022
|
const valueRows = drizzleOrm.sql.join(
|
|
1931
2023
|
entries.map(
|
|
@@ -1938,33 +2030,33 @@ function buildInsertUniqueBatch(tables3, dialect, entries) {
|
|
|
1938
2030
|
VALUES ${valueRows}
|
|
1939
2031
|
ON CONFLICT (${conflictColumns})
|
|
1940
2032
|
DO UPDATE SET
|
|
1941
|
-
${
|
|
2033
|
+
${quotedColumn(uniques2.nodeId)} = CASE
|
|
1942
2034
|
WHEN ${existingColumn(uniques2.nodeId)} = ${excludedColumn(uniques2.nodeId)} THEN ${excludedColumn(uniques2.nodeId)}
|
|
1943
2035
|
WHEN ${existingColumn(uniques2.deletedAt)} IS NOT NULL THEN ${excludedColumn(uniques2.nodeId)}
|
|
1944
2036
|
ELSE ${existingColumn(uniques2.nodeId)}
|
|
1945
2037
|
END,
|
|
1946
|
-
${
|
|
2038
|
+
${quotedColumn(uniques2.concreteKind)} = CASE
|
|
1947
2039
|
WHEN ${existingColumn(uniques2.nodeId)} = ${excludedColumn(uniques2.nodeId)} THEN ${excludedColumn(uniques2.concreteKind)}
|
|
1948
2040
|
WHEN ${existingColumn(uniques2.deletedAt)} IS NOT NULL THEN ${excludedColumn(uniques2.concreteKind)}
|
|
1949
2041
|
ELSE ${existingColumn(uniques2.concreteKind)}
|
|
1950
2042
|
END,
|
|
1951
|
-
${
|
|
2043
|
+
${quotedColumn(uniques2.deletedAt)} = CASE
|
|
1952
2044
|
WHEN ${existingColumn(uniques2.nodeId)} = ${excludedColumn(uniques2.nodeId)} THEN NULL
|
|
1953
2045
|
WHEN ${existingColumn(uniques2.deletedAt)} IS NOT NULL THEN NULL
|
|
1954
2046
|
ELSE ${existingColumn(uniques2.deletedAt)}
|
|
1955
2047
|
END
|
|
1956
2048
|
RETURNING
|
|
1957
|
-
${
|
|
1958
|
-
${
|
|
1959
|
-
${
|
|
1960
|
-
${
|
|
2049
|
+
${quotedColumn(uniques2.nodeKind)} as node_kind,
|
|
2050
|
+
${quotedColumn(uniques2.constraintName)} as constraint_name,
|
|
2051
|
+
${quotedColumn(uniques2.key)} as key,
|
|
2052
|
+
${quotedColumn(uniques2.nodeId)} as node_id
|
|
1961
2053
|
`;
|
|
1962
2054
|
}
|
|
1963
2055
|
function buildDeleteUnique(tables3, params, timestamp2) {
|
|
1964
2056
|
const { uniques: uniques2 } = tables3;
|
|
1965
2057
|
return drizzleOrm.sql`
|
|
1966
2058
|
UPDATE ${uniques2}
|
|
1967
|
-
SET ${
|
|
2059
|
+
SET ${quotedColumn(uniques2.deletedAt)} = ${timestamp2}
|
|
1968
2060
|
WHERE ${uniques2.graphId} = ${params.graphId}
|
|
1969
2061
|
AND ${uniques2.nodeKind} = ${params.nodeKind}
|
|
1970
2062
|
AND ${uniques2.constraintName} = ${params.constraintName}
|
|
@@ -2033,7 +2125,9 @@ function bindTableOperationBuilders(tables3, builders) {
|
|
|
2033
2125
|
}
|
|
2034
2126
|
return [name, boundBuilder];
|
|
2035
2127
|
});
|
|
2036
|
-
return Object.fromEntries(
|
|
2128
|
+
return Object.fromEntries(
|
|
2129
|
+
boundEntries
|
|
2130
|
+
);
|
|
2037
2131
|
}
|
|
2038
2132
|
var COMMON_TABLE_OPERATION_BUILDERS = {
|
|
2039
2133
|
buildInsertNode,
|
|
@@ -2077,15 +2171,15 @@ function createCommonOperationStrategy(tables3, dialect, fulltextStrategy) {
|
|
|
2077
2171
|
);
|
|
2078
2172
|
const fulltextTable = tables3.fulltextTableName;
|
|
2079
2173
|
const fulltextBuilders = {
|
|
2080
|
-
buildUpsertFulltext: (params, timestamp2) => fulltextStrategy.buildUpsert(fulltextTable, params, timestamp2),
|
|
2081
|
-
buildDeleteFulltext: (params) => fulltextStrategy.buildDelete(fulltextTable, params),
|
|
2174
|
+
buildUpsertFulltext: (params, timestamp2) => fulltextStrategy.buildUpsert(fulltextTable, params, timestamp2).map((statement) => chunkDOVMTPKE_cjs.toDrizzleSql(statement, dialect)),
|
|
2175
|
+
buildDeleteFulltext: (params) => fulltextStrategy.buildDelete(fulltextTable, params).map((statement) => chunkDOVMTPKE_cjs.toDrizzleSql(statement, dialect)),
|
|
2082
2176
|
buildDeleteFulltextByNode: (graphId, nodeKind, nodeId) => fulltextStrategy.buildDelete(fulltextTable, {
|
|
2083
2177
|
graphId,
|
|
2084
2178
|
nodeKind,
|
|
2085
2179
|
nodeId
|
|
2086
|
-
}),
|
|
2087
|
-
buildUpsertFulltextBatch: (params, timestamp2) => fulltextStrategy.buildBatchUpsert(fulltextTable, params, timestamp2),
|
|
2088
|
-
buildDeleteFulltextBatch: (params) => fulltextStrategy.buildBatchDelete(fulltextTable, params),
|
|
2180
|
+
}).map((statement) => chunkDOVMTPKE_cjs.toDrizzleSql(statement, dialect)),
|
|
2181
|
+
buildUpsertFulltextBatch: (params, timestamp2) => fulltextStrategy.buildBatchUpsert(fulltextTable, params, timestamp2).map((statement) => chunkDOVMTPKE_cjs.toDrizzleSql(statement, dialect)),
|
|
2182
|
+
buildDeleteFulltextBatch: (params) => fulltextStrategy.buildBatchDelete(fulltextTable, params).map((statement) => chunkDOVMTPKE_cjs.toDrizzleSql(statement, dialect)),
|
|
2089
2183
|
buildFulltextSearch: (params) => buildFulltextSearch(
|
|
2090
2184
|
fulltextTable,
|
|
2091
2185
|
params,
|
|
@@ -2093,15 +2187,19 @@ function createCommonOperationStrategy(tables3, dialect, fulltextStrategy) {
|
|
|
2093
2187
|
dialect,
|
|
2094
2188
|
// Store-compiled candidates (predicates + subclass + currency)
|
|
2095
2189
|
// take precedence; the live-node default covers direct backend use.
|
|
2096
|
-
params.candidates ??
|
|
2190
|
+
params.candidates ?? liveNodeIdsSubquery(
|
|
2191
|
+
tables3.nodes,
|
|
2192
|
+
params.graphId,
|
|
2193
|
+
params.nodeKind,
|
|
2194
|
+
chunkE6TXEISH_cjs.nowIso()
|
|
2195
|
+
)
|
|
2097
2196
|
),
|
|
2098
|
-
buildLiveNodeIds: (graphId, nodeKind) => chunk7YSP4V4R_cjs.liveNodeIdsSubquery(tables3.nodes, graphId, nodeKind, chunkVL2V6PEN_cjs.nowIso()),
|
|
2099
2197
|
buildHybridSearch: (params, vectorSql, vectorScoreDescending) => {
|
|
2100
|
-
const candidates = params.candidates ??
|
|
2198
|
+
const candidates = params.candidates ?? liveNodeIdsSubquery(
|
|
2101
2199
|
tables3.nodes,
|
|
2102
2200
|
params.graphId,
|
|
2103
2201
|
params.nodeKind,
|
|
2104
|
-
|
|
2202
|
+
chunkE6TXEISH_cjs.nowIso()
|
|
2105
2203
|
);
|
|
2106
2204
|
const fulltextSql = buildFulltextSearch(
|
|
2107
2205
|
fulltextTable,
|
|
@@ -2122,7 +2220,7 @@ function createCommonOperationStrategy(tables3, dialect, fulltextStrategy) {
|
|
|
2122
2220
|
hybridCandidatesRef()
|
|
2123
2221
|
);
|
|
2124
2222
|
return buildHybridSearchStatement({
|
|
2125
|
-
candidatesSql: candidates,
|
|
2223
|
+
candidatesSql: chunkX6RDQ5NB_cjs.isSqlFragment(candidates) ? chunkDOVMTPKE_cjs.toDrizzleSql(candidates, dialect) : candidates,
|
|
2126
2224
|
vectorSql,
|
|
2127
2225
|
vectorScoreDescending,
|
|
2128
2226
|
fulltextSql,
|
|
@@ -2157,17 +2255,24 @@ function createCommonOperationStrategy(tables3, dialect, fulltextStrategy) {
|
|
|
2157
2255
|
return buildSetActiveSchema(tables3, graphId, version, dialect);
|
|
2158
2256
|
},
|
|
2159
2257
|
buildTableExists(tableName) {
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2258
|
+
switch (dialect) {
|
|
2259
|
+
case "postgres": {
|
|
2260
|
+
return drizzleOrm.sql`
|
|
2261
|
+
SELECT c.relname AS table_name
|
|
2262
|
+
FROM pg_catalog.pg_class AS c
|
|
2263
|
+
WHERE c.relname = ${tableName}
|
|
2264
|
+
AND c.relkind IN ('r', 'p', 'v', 'm', 'f')
|
|
2265
|
+
AND pg_catalog.pg_table_is_visible(c.oid)
|
|
2266
|
+
LIMIT 1
|
|
2267
|
+
`;
|
|
2268
|
+
}
|
|
2269
|
+
case "sqlite": {
|
|
2270
|
+
return drizzleOrm.sql`SELECT name AS table_name FROM sqlite_master WHERE type IN ('table', 'view') AND name = ${tableName}`;
|
|
2271
|
+
}
|
|
2272
|
+
default: {
|
|
2273
|
+
return dialect;
|
|
2274
|
+
}
|
|
2169
2275
|
}
|
|
2170
|
-
return drizzleOrm.sql`SELECT name AS table_name FROM sqlite_master WHERE type IN ('table', 'view') AND name = ${tableName}`;
|
|
2171
2276
|
},
|
|
2172
2277
|
buildClearGraph(graphId) {
|
|
2173
2278
|
return buildClearGraph(tables3, graphId);
|
|
@@ -2176,7 +2281,7 @@ function createCommonOperationStrategy(tables3, dialect, fulltextStrategy) {
|
|
|
2176
2281
|
}
|
|
2177
2282
|
function tableExistsFromRow(row) {
|
|
2178
2283
|
if (row === void 0) return false;
|
|
2179
|
-
return Object.values(row).some((value) =>
|
|
2284
|
+
return Object.values(row).some((value) => chunk764JHTLT_cjs.isPresent(value));
|
|
2180
2285
|
}
|
|
2181
2286
|
function createCachedTableExistence(probe, options) {
|
|
2182
2287
|
const cacheExisting = options?.cacheExisting !== false;
|
|
@@ -2202,10 +2307,14 @@ function createSqliteOperationStrategy(tables3, fulltextStrategy) {
|
|
|
2202
2307
|
function createPostgresOperationStrategy(tables3, fulltextStrategy) {
|
|
2203
2308
|
return createCommonOperationStrategy(tables3, "postgres", fulltextStrategy);
|
|
2204
2309
|
}
|
|
2310
|
+
var DRIZZLE_DIALECT_LABELS = {
|
|
2311
|
+
postgres: "Postgres",
|
|
2312
|
+
sqlite: "SQLite"
|
|
2313
|
+
};
|
|
2205
2314
|
function assertAdoptedDialect(externalTx, brand, backend) {
|
|
2206
2315
|
if (drizzleOrm.is(externalTx, brand)) return;
|
|
2207
|
-
const label = backend
|
|
2208
|
-
throw new
|
|
2316
|
+
const label = DRIZZLE_DIALECT_LABELS[backend];
|
|
2317
|
+
throw new chunkSAFZ6JTI_cjs.ConfigurationError(
|
|
2209
2318
|
`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.`,
|
|
2210
2319
|
{ backend, capability: "adoptTransaction" }
|
|
2211
2320
|
);
|
|
@@ -2213,7 +2322,7 @@ function assertAdoptedDialect(externalTx, brand, backend) {
|
|
|
2213
2322
|
function verifyExpectedActiveVersion(graphId, expected, actualActiveVersion) {
|
|
2214
2323
|
const expectedVersion = expected.kind === "active" ? expected.version : 0;
|
|
2215
2324
|
if (actualActiveVersion !== expectedVersion) {
|
|
2216
|
-
throw new
|
|
2325
|
+
throw new chunkSAFZ6JTI_cjs.StaleVersionError({
|
|
2217
2326
|
graphId,
|
|
2218
2327
|
expected: expectedVersion,
|
|
2219
2328
|
actual: actualActiveVersion
|
|
@@ -2222,7 +2331,7 @@ function verifyExpectedActiveVersion(graphId, expected, actualActiveVersion) {
|
|
|
2222
2331
|
}
|
|
2223
2332
|
function createCommonOperationBackend(options) {
|
|
2224
2333
|
const { batchConfig, execution, operationStrategy, rowMappers } = options;
|
|
2225
|
-
const nowIso2 = options.nowIso ??
|
|
2334
|
+
const nowIso2 = options.nowIso ?? chunkE6TXEISH_cjs.nowIso;
|
|
2226
2335
|
const requiredClearTableExists = createCachedTableExistence(
|
|
2227
2336
|
(tableName) => execution.execGet(
|
|
2228
2337
|
operationStrategy.buildTableExists(tableName)
|
|
@@ -2253,7 +2362,7 @@ function createCommonOperationBackend(options) {
|
|
|
2253
2362
|
const query = operationStrategy.buildInsertNode(params, timestamp2);
|
|
2254
2363
|
const row = await execution.execGet(query);
|
|
2255
2364
|
if (!row)
|
|
2256
|
-
throw new
|
|
2365
|
+
throw new chunkSAFZ6JTI_cjs.DatabaseOperationError(
|
|
2257
2366
|
"Insert node failed: no row returned",
|
|
2258
2367
|
{ operation: "insert", entity: "node" }
|
|
2259
2368
|
);
|
|
@@ -2272,7 +2381,7 @@ function createCommonOperationBackend(options) {
|
|
|
2272
2381
|
return;
|
|
2273
2382
|
}
|
|
2274
2383
|
const timestamp2 = nowIso2();
|
|
2275
|
-
for (const chunk2 of
|
|
2384
|
+
for (const chunk2 of chunkZDH3DX3C_cjs.chunk(params, batchConfig.nodeInsertBatchSize)) {
|
|
2276
2385
|
const query = operationStrategy.buildInsertNodesBatch(chunk2, timestamp2);
|
|
2277
2386
|
await execution.execRun(query);
|
|
2278
2387
|
}
|
|
@@ -2283,7 +2392,7 @@ function createCommonOperationBackend(options) {
|
|
|
2283
2392
|
}
|
|
2284
2393
|
const timestamp2 = nowIso2();
|
|
2285
2394
|
const allRows = [];
|
|
2286
|
-
for (const chunk2 of
|
|
2395
|
+
for (const chunk2 of chunkZDH3DX3C_cjs.chunk(params, batchConfig.nodeInsertBatchSize)) {
|
|
2287
2396
|
const query = operationStrategy.buildInsertNodesBatchReturning(
|
|
2288
2397
|
chunk2,
|
|
2289
2398
|
timestamp2
|
|
@@ -2301,7 +2410,7 @@ function createCommonOperationBackend(options) {
|
|
|
2301
2410
|
async getNodes(graphId, kind, ids) {
|
|
2302
2411
|
if (ids.length === 0) return [];
|
|
2303
2412
|
const allRows = [];
|
|
2304
|
-
for (const chunk2 of
|
|
2413
|
+
for (const chunk2 of chunkZDH3DX3C_cjs.chunk(ids, batchConfig.getNodesChunkSize)) {
|
|
2305
2414
|
const query = operationStrategy.buildGetNodes(graphId, kind, chunk2);
|
|
2306
2415
|
const rows = await execution.execAll(query);
|
|
2307
2416
|
allRows.push(...rows.map((row) => rowMappers.toNodeRow(row)));
|
|
@@ -2313,7 +2422,7 @@ function createCommonOperationBackend(options) {
|
|
|
2313
2422
|
const query = operationStrategy.buildUpdateNode(params, timestamp2);
|
|
2314
2423
|
const row = await execution.execGet(query);
|
|
2315
2424
|
if (!row)
|
|
2316
|
-
throw new
|
|
2425
|
+
throw new chunkSAFZ6JTI_cjs.DatabaseOperationError(
|
|
2317
2426
|
"Update node failed: no row returned",
|
|
2318
2427
|
{ operation: "update", entity: "node" }
|
|
2319
2428
|
);
|
|
@@ -2361,7 +2470,7 @@ function createCommonOperationBackend(options) {
|
|
|
2361
2470
|
const query = operationStrategy.buildInsertEdge(params, timestamp2);
|
|
2362
2471
|
const row = await execution.execGet(query);
|
|
2363
2472
|
if (!row)
|
|
2364
|
-
throw new
|
|
2473
|
+
throw new chunkSAFZ6JTI_cjs.DatabaseOperationError(
|
|
2365
2474
|
"Insert edge failed: no row returned",
|
|
2366
2475
|
{ operation: "insert", entity: "edge" }
|
|
2367
2476
|
);
|
|
@@ -2380,7 +2489,7 @@ function createCommonOperationBackend(options) {
|
|
|
2380
2489
|
return;
|
|
2381
2490
|
}
|
|
2382
2491
|
const timestamp2 = nowIso2();
|
|
2383
|
-
for (const chunk2 of
|
|
2492
|
+
for (const chunk2 of chunkZDH3DX3C_cjs.chunk(params, batchConfig.edgeInsertBatchSize)) {
|
|
2384
2493
|
const query = operationStrategy.buildInsertEdgesBatch(chunk2, timestamp2);
|
|
2385
2494
|
await execution.execRun(query);
|
|
2386
2495
|
}
|
|
@@ -2391,7 +2500,7 @@ function createCommonOperationBackend(options) {
|
|
|
2391
2500
|
}
|
|
2392
2501
|
const timestamp2 = nowIso2();
|
|
2393
2502
|
const allRows = [];
|
|
2394
|
-
for (const chunk2 of
|
|
2503
|
+
for (const chunk2 of chunkZDH3DX3C_cjs.chunk(params, batchConfig.edgeInsertBatchSize)) {
|
|
2395
2504
|
const query = operationStrategy.buildInsertEdgesBatchReturning(
|
|
2396
2505
|
chunk2,
|
|
2397
2506
|
timestamp2
|
|
@@ -2409,7 +2518,7 @@ function createCommonOperationBackend(options) {
|
|
|
2409
2518
|
async getEdges(graphId, ids) {
|
|
2410
2519
|
if (ids.length === 0) return [];
|
|
2411
2520
|
const allRows = [];
|
|
2412
|
-
for (const chunk2 of
|
|
2521
|
+
for (const chunk2 of chunkZDH3DX3C_cjs.chunk(ids, batchConfig.getEdgesChunkSize)) {
|
|
2413
2522
|
const query = operationStrategy.buildGetEdges(graphId, chunk2);
|
|
2414
2523
|
const rows = await execution.execAll(query);
|
|
2415
2524
|
allRows.push(...rows.map((row) => rowMappers.toEdgeRow(row)));
|
|
@@ -2421,7 +2530,7 @@ function createCommonOperationBackend(options) {
|
|
|
2421
2530
|
const query = operationStrategy.buildUpdateEdge(params, timestamp2);
|
|
2422
2531
|
const row = await execution.execGet(query);
|
|
2423
2532
|
if (!row)
|
|
2424
|
-
throw new
|
|
2533
|
+
throw new chunkSAFZ6JTI_cjs.DatabaseOperationError(
|
|
2425
2534
|
"Update edge failed: no row returned",
|
|
2426
2535
|
{ operation: "update", entity: "edge" }
|
|
2427
2536
|
);
|
|
@@ -2443,7 +2552,7 @@ function createCommonOperationBackend(options) {
|
|
|
2443
2552
|
1,
|
|
2444
2553
|
batchConfig.getEdgesChunkSize - 1
|
|
2445
2554
|
);
|
|
2446
|
-
for (const chunk2 of
|
|
2555
|
+
for (const chunk2 of chunkZDH3DX3C_cjs.chunk(params.ids, softDeleteChunkSize)) {
|
|
2447
2556
|
const query = operationStrategy.buildDeleteEdgesBatch(
|
|
2448
2557
|
{ graphId: params.graphId, ids: chunk2 },
|
|
2449
2558
|
timestamp2
|
|
@@ -2453,7 +2562,7 @@ function createCommonOperationBackend(options) {
|
|
|
2453
2562
|
},
|
|
2454
2563
|
async hardDeleteEdgesBatch(params) {
|
|
2455
2564
|
if (params.ids.length === 0) return;
|
|
2456
|
-
for (const chunk2 of
|
|
2565
|
+
for (const chunk2 of chunkZDH3DX3C_cjs.chunk(
|
|
2457
2566
|
params.ids,
|
|
2458
2567
|
batchConfig.getEdgesChunkSize
|
|
2459
2568
|
)) {
|
|
@@ -2503,7 +2612,7 @@ function createCommonOperationBackend(options) {
|
|
|
2503
2612
|
const query = operationStrategy.buildInsertUnique(params);
|
|
2504
2613
|
const result = await execution.execGet(query);
|
|
2505
2614
|
if (result && result.node_id !== params.nodeId) {
|
|
2506
|
-
throw new
|
|
2615
|
+
throw new chunkSAFZ6JTI_cjs.UniquenessError({
|
|
2507
2616
|
constraintName: params.constraintName,
|
|
2508
2617
|
kind: params.nodeKind,
|
|
2509
2618
|
existingId: result.node_id,
|
|
@@ -2523,7 +2632,7 @@ function createCommonOperationBackend(options) {
|
|
|
2523
2632
|
continue;
|
|
2524
2633
|
}
|
|
2525
2634
|
if (existing.nodeId !== entry.nodeId) {
|
|
2526
|
-
throw new
|
|
2635
|
+
throw new chunkSAFZ6JTI_cjs.UniquenessError({
|
|
2527
2636
|
constraintName: entry.constraintName,
|
|
2528
2637
|
kind: entry.nodeKind,
|
|
2529
2638
|
existingId: existing.nodeId,
|
|
@@ -2533,7 +2642,7 @@ function createCommonOperationBackend(options) {
|
|
|
2533
2642
|
}
|
|
2534
2643
|
}
|
|
2535
2644
|
const deduped = [...byTarget.values()];
|
|
2536
|
-
for (const chunk2 of
|
|
2645
|
+
for (const chunk2 of chunkZDH3DX3C_cjs.chunk(
|
|
2537
2646
|
deduped,
|
|
2538
2647
|
batchConfig.uniqueInsertBatchSize
|
|
2539
2648
|
)) {
|
|
@@ -2548,7 +2657,7 @@ function createCommonOperationBackend(options) {
|
|
|
2548
2657
|
for (const entry of chunk2) {
|
|
2549
2658
|
const owner = ownerByTarget.get(targetKey(entry));
|
|
2550
2659
|
if (owner !== void 0 && owner !== entry.nodeId) {
|
|
2551
|
-
throw new
|
|
2660
|
+
throw new chunkSAFZ6JTI_cjs.UniquenessError({
|
|
2552
2661
|
constraintName: entry.constraintName,
|
|
2553
2662
|
kind: entry.nodeKind,
|
|
2554
2663
|
existingId: owner,
|
|
@@ -2572,7 +2681,7 @@ function createCommonOperationBackend(options) {
|
|
|
2572
2681
|
async checkUniqueBatch(params) {
|
|
2573
2682
|
if (params.keys.length === 0) return [];
|
|
2574
2683
|
const allRows = [];
|
|
2575
|
-
for (const chunk2 of
|
|
2684
|
+
for (const chunk2 of chunkZDH3DX3C_cjs.chunk(
|
|
2576
2685
|
params.keys,
|
|
2577
2686
|
batchConfig.checkUniqueBatchChunkSize
|
|
2578
2687
|
)) {
|
|
@@ -2603,7 +2712,7 @@ function createCommonOperationBackend(options) {
|
|
|
2603
2712
|
if (existingRaw !== void 0) {
|
|
2604
2713
|
const existing = rowMappers.toSchemaVersionRow(existingRaw);
|
|
2605
2714
|
if (existing.schema_hash !== params.schemaHash) {
|
|
2606
|
-
throw new
|
|
2715
|
+
throw new chunkSAFZ6JTI_cjs.SchemaContentConflictError({
|
|
2607
2716
|
graphId: params.graphId,
|
|
2608
2717
|
version: params.version,
|
|
2609
2718
|
existingHash: existing.schema_hash,
|
|
@@ -2651,7 +2760,7 @@ function createCommonOperationBackend(options) {
|
|
|
2651
2760
|
);
|
|
2652
2761
|
const insertedRaw = await execution.execGet(insertQuery);
|
|
2653
2762
|
if (!insertedRaw) {
|
|
2654
|
-
throw new
|
|
2763
|
+
throw new chunkSAFZ6JTI_cjs.DatabaseOperationError(
|
|
2655
2764
|
"Insert schema failed: no row returned",
|
|
2656
2765
|
{ operation: "insert", entity: "schema" }
|
|
2657
2766
|
);
|
|
@@ -2669,7 +2778,7 @@ function createCommonOperationBackend(options) {
|
|
|
2669
2778
|
operationStrategy.buildGetSchemaVersion(params.graphId, params.version)
|
|
2670
2779
|
);
|
|
2671
2780
|
if (!targetRaw) {
|
|
2672
|
-
throw new
|
|
2781
|
+
throw new chunkSAFZ6JTI_cjs.MigrationError(
|
|
2673
2782
|
`Cannot activate version ${params.version}: version does not exist for graph "${params.graphId}".`,
|
|
2674
2783
|
{
|
|
2675
2784
|
graphId: params.graphId,
|
|
@@ -2693,13 +2802,15 @@ function createCommonOperationBackend(options) {
|
|
|
2693
2802
|
}
|
|
2694
2803
|
};
|
|
2695
2804
|
}
|
|
2805
|
+
|
|
2806
|
+
// src/backend/drizzle/trusted-import.ts
|
|
2696
2807
|
var DATABASE_NULL = null;
|
|
2697
2808
|
function quoteSqlIdentifier(identifier) {
|
|
2698
2809
|
return `"${identifier.replaceAll('"', '""')}"`;
|
|
2699
2810
|
}
|
|
2700
2811
|
function requireRawExecution(backend) {
|
|
2701
2812
|
if (backend.executeRaw === void 0) {
|
|
2702
|
-
throw new
|
|
2813
|
+
throw new chunkSAFZ6JTI_cjs.TrustedImportError(
|
|
2703
2814
|
"This backend cannot execute the raw statements required by trusted import.",
|
|
2704
2815
|
"backend_unsupported"
|
|
2705
2816
|
);
|
|
@@ -2708,7 +2819,7 @@ function requireRawExecution(backend) {
|
|
|
2708
2819
|
}
|
|
2709
2820
|
function requireStatementExecution(backend) {
|
|
2710
2821
|
if (backend.executeStatement === void 0) {
|
|
2711
|
-
throw new
|
|
2822
|
+
throw new chunkSAFZ6JTI_cjs.TrustedImportError(
|
|
2712
2823
|
"This backend cannot execute the index lifecycle required by trusted import.",
|
|
2713
2824
|
"backend_unsupported"
|
|
2714
2825
|
);
|
|
@@ -2717,7 +2828,7 @@ function requireStatementExecution(backend) {
|
|
|
2717
2828
|
}
|
|
2718
2829
|
function rowIndicatesExistingData(row) {
|
|
2719
2830
|
if (typeof row !== "object" || row === null) return false;
|
|
2720
|
-
const value = row
|
|
2831
|
+
const value = row["has_rows"];
|
|
2721
2832
|
return value === true || value === 1 || value === "1";
|
|
2722
2833
|
}
|
|
2723
2834
|
async function assertTrustedImportDatabaseEmpty(backend, tableNames) {
|
|
@@ -2730,7 +2841,7 @@ async function assertTrustedImportDatabaseEmpty(backend, tableNames) {
|
|
|
2730
2841
|
[]
|
|
2731
2842
|
);
|
|
2732
2843
|
if (!rowIndicatesExistingData(rows[0])) return;
|
|
2733
|
-
throw new
|
|
2844
|
+
throw new chunkSAFZ6JTI_cjs.TrustedImportError(
|
|
2734
2845
|
"Trusted import requires globally empty TypeGraph node and edge tables.",
|
|
2735
2846
|
"database_not_empty",
|
|
2736
2847
|
{ tables: [tableNames.nodes, tableNames.edges] },
|
|
@@ -2742,8 +2853,8 @@ async function assertTrustedImportDatabaseEmpty(backend, tableNames) {
|
|
|
2742
2853
|
async function lockPostgresTrustedImportTables(backend, tableNames) {
|
|
2743
2854
|
const executeStatement = requireStatementExecution(backend);
|
|
2744
2855
|
await executeStatement(
|
|
2745
|
-
|
|
2746
|
-
|
|
2856
|
+
chunkX6RDQ5NB_cjs.asCompiledStatementSql(
|
|
2857
|
+
chunkX6RDQ5NB_cjs.sql.raw(
|
|
2747
2858
|
`LOCK TABLE ${quoteSqlIdentifier(tableNames.nodes)}, ${quoteSqlIdentifier(tableNames.edges)} IN ACCESS EXCLUSIVE MODE`
|
|
2748
2859
|
)
|
|
2749
2860
|
)
|
|
@@ -2763,8 +2874,8 @@ async function suspendSqliteSecondaryIndexes(backend, tableNames) {
|
|
|
2763
2874
|
);
|
|
2764
2875
|
for (const definition of definitions) {
|
|
2765
2876
|
await executeStatement(
|
|
2766
|
-
|
|
2767
|
-
|
|
2877
|
+
chunkX6RDQ5NB_cjs.asCompiledStatementSql(
|
|
2878
|
+
chunkX6RDQ5NB_cjs.sql.raw(`DROP INDEX ${quoteSqlIdentifier(definition.index_name)}`)
|
|
2768
2879
|
)
|
|
2769
2880
|
);
|
|
2770
2881
|
}
|
|
@@ -2794,8 +2905,8 @@ async function suspendPostgresSecondaryIndexes(backend, tableNames) {
|
|
|
2794
2905
|
);
|
|
2795
2906
|
for (const definition of definitions) {
|
|
2796
2907
|
await executeStatement(
|
|
2797
|
-
|
|
2798
|
-
|
|
2908
|
+
chunkX6RDQ5NB_cjs.asCompiledStatementSql(
|
|
2909
|
+
chunkX6RDQ5NB_cjs.sql.raw(`DROP INDEX ${quoteSqlIdentifier(definition.index_name)}`)
|
|
2799
2910
|
)
|
|
2800
2911
|
);
|
|
2801
2912
|
}
|
|
@@ -2805,20 +2916,20 @@ async function restoreSecondaryIndexes(backend, definitions) {
|
|
|
2805
2916
|
const executeStatement = requireStatementExecution(backend);
|
|
2806
2917
|
for (const definition of definitions) {
|
|
2807
2918
|
await executeStatement(
|
|
2808
|
-
|
|
2919
|
+
chunkX6RDQ5NB_cjs.asCompiledStatementSql(chunkX6RDQ5NB_cjs.sql.raw(definition.index_definition))
|
|
2809
2920
|
);
|
|
2810
2921
|
}
|
|
2811
2922
|
}
|
|
2812
2923
|
async function analyzeImportedTables(backend, tableNames) {
|
|
2813
2924
|
const executeStatement = requireStatementExecution(backend);
|
|
2814
2925
|
await executeStatement(
|
|
2815
|
-
|
|
2816
|
-
|
|
2926
|
+
chunkX6RDQ5NB_cjs.asCompiledStatementSql(
|
|
2927
|
+
chunkX6RDQ5NB_cjs.sql.raw(`ANALYZE ${quoteSqlIdentifier(tableNames.nodes)}`)
|
|
2817
2928
|
)
|
|
2818
2929
|
);
|
|
2819
2930
|
await executeStatement(
|
|
2820
|
-
|
|
2821
|
-
|
|
2931
|
+
chunkX6RDQ5NB_cjs.asCompiledStatementSql(
|
|
2932
|
+
chunkX6RDQ5NB_cjs.sql.raw(`ANALYZE ${quoteSqlIdentifier(tableNames.edges)}`)
|
|
2822
2933
|
)
|
|
2823
2934
|
);
|
|
2824
2935
|
}
|
|
@@ -2833,7 +2944,7 @@ function postgresArray(values) {
|
|
|
2833
2944
|
function createSqliteTrustedImportSession(executionAdapter, tableNames) {
|
|
2834
2945
|
const executePreparedRunBatch = executionAdapter.executePreparedRunBatch;
|
|
2835
2946
|
if (executePreparedRunBatch === void 0) {
|
|
2836
|
-
throw new
|
|
2947
|
+
throw new chunkSAFZ6JTI_cjs.TrustedImportError(
|
|
2837
2948
|
"Trusted import requires a synchronous SQLite driver with prepared statement support.",
|
|
2838
2949
|
"backend_unsupported"
|
|
2839
2950
|
);
|
|
@@ -2961,16 +3072,6 @@ function getOrCreateLru(cache, key, cacheMax, create) {
|
|
|
2961
3072
|
return value;
|
|
2962
3073
|
}
|
|
2963
3074
|
|
|
2964
|
-
// src/backend/drizzle/execution/types.ts
|
|
2965
|
-
function compileQueryWithDialect(db, query, backendName) {
|
|
2966
|
-
const databaseWithCompiler = db;
|
|
2967
|
-
const compiler = databaseWithCompiler.dialect;
|
|
2968
|
-
if (compiler === void 0) {
|
|
2969
|
-
throw new Error(`${backendName} backend is missing a SQL compiler`);
|
|
2970
|
-
}
|
|
2971
|
-
return compiler.sqlToQuery(query);
|
|
2972
|
-
}
|
|
2973
|
-
|
|
2974
3075
|
exports.EMBEDDING_UPSERT_PARAM_COUNT = EMBEDDING_UPSERT_PARAM_COUNT;
|
|
2975
3076
|
exports.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS = POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS;
|
|
2976
3077
|
exports.POSTGRES_INDEX_MAT_TIMESTAMPS = POSTGRES_INDEX_MAT_TIMESTAMPS;
|
|
@@ -2985,9 +3086,9 @@ exports.buildContributionInsertValues = buildContributionInsertValues;
|
|
|
2985
3086
|
exports.buildContributionOnConflictSet = buildContributionOnConflictSet;
|
|
2986
3087
|
exports.buildKindRemovalInsertValues = buildKindRemovalInsertValues;
|
|
2987
3088
|
exports.buildKindRemovalOnConflictSet = buildKindRemovalOnConflictSet;
|
|
3089
|
+
exports.buildLiveNodeCandidates = buildLiveNodeCandidates;
|
|
2988
3090
|
exports.buildMaterializationInsertValues = buildMaterializationInsertValues;
|
|
2989
3091
|
exports.buildMaterializationOnConflictSet = buildMaterializationOnConflictSet;
|
|
2990
|
-
exports.compileQueryWithDialect = compileQueryWithDialect;
|
|
2991
3092
|
exports.createCachedTableExistence = createCachedTableExistence;
|
|
2992
3093
|
exports.createCommonOperationBackend = createCommonOperationBackend;
|
|
2993
3094
|
exports.createContributionMaterializer = createContributionMaterializer;
|
|
@@ -3007,7 +3108,6 @@ exports.generateSqliteCreateTableSQL = generateSqliteCreateTableSQL;
|
|
|
3007
3108
|
exports.generateSqliteDDL = generateSqliteDDL;
|
|
3008
3109
|
exports.generateSqliteMigrationSQL = generateSqliteMigrationSQL;
|
|
3009
3110
|
exports.getOrCreateLru = getOrCreateLru;
|
|
3010
|
-
exports.hybridCandidatesRef = hybridCandidatesRef;
|
|
3011
3111
|
exports.lockPostgresTrustedImportTables = lockPostgresTrustedImportTables;
|
|
3012
3112
|
exports.mapContributionMaterializationRow = mapContributionMaterializationRow;
|
|
3013
3113
|
exports.mapHybridSearchRow = mapHybridSearchRow;
|
|
@@ -3027,5 +3127,5 @@ exports.uniques = uniques;
|
|
|
3027
3127
|
exports.vectorSlotFromCreateIndexParams = vectorSlotFromCreateIndexParams;
|
|
3028
3128
|
exports.vectorSlotFromDropIndexParams = vectorSlotFromDropIndexParams;
|
|
3029
3129
|
exports.vectorSlotFromParams = vectorSlotFromParams;
|
|
3030
|
-
//# sourceMappingURL=chunk-
|
|
3031
|
-
//# sourceMappingURL=chunk-
|
|
3130
|
+
//# sourceMappingURL=chunk-XFY73JWD.cjs.map
|
|
3131
|
+
//# sourceMappingURL=chunk-XFY73JWD.cjs.map
|