@nicia-ai/typegraph 0.46.1 → 0.46.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backend/drizzle/indexes.cjs +9 -9
- package/dist/backend/drizzle/indexes.d.cts +1 -1
- package/dist/backend/drizzle/indexes.d.ts +1 -1
- package/dist/backend/drizzle/indexes.js +5 -5
- package/dist/backend/index.cjs +49 -49
- package/dist/backend/index.d.cts +3 -3
- package/dist/backend/index.d.ts +3 -3
- package/dist/backend/index.js +10 -10
- package/dist/backend/postgres/index.cjs +26 -26
- package/dist/backend/postgres/index.d.cts +6 -6
- package/dist/backend/postgres/index.d.ts +6 -6
- package/dist/backend/postgres/index.js +13 -13
- package/dist/backend/postgres/pglite-store.cjs +33 -33
- package/dist/backend/postgres/pglite-store.d.cts +8 -8
- package/dist/backend/postgres/pglite-store.d.ts +8 -8
- package/dist/backend/postgres/pglite-store.js +29 -29
- package/dist/backend/postgres/pglite.cjs +15 -15
- package/dist/backend/postgres/pglite.d.cts +3 -3
- package/dist/backend/postgres/pglite.d.ts +3 -3
- package/dist/backend/postgres/pglite.js +14 -14
- package/dist/backend/sqlite/index.cjs +23 -23
- package/dist/backend/sqlite/index.d.cts +6 -6
- package/dist/backend/sqlite/index.d.ts +6 -6
- package/dist/backend/sqlite/index.js +11 -11
- package/dist/backend/sqlite/libsql.cjs +18 -18
- package/dist/backend/sqlite/libsql.d.cts +3 -3
- package/dist/backend/sqlite/libsql.d.ts +3 -3
- package/dist/backend/sqlite/libsql.js +13 -13
- package/dist/backend/sqlite/local-store.cjs +34 -34
- package/dist/backend/sqlite/local-store.d.cts +8 -8
- package/dist/backend/sqlite/local-store.d.ts +8 -8
- package/dist/backend/sqlite/local-store.js +30 -30
- package/dist/backend/sqlite/local.cjs +16 -16
- package/dist/backend/sqlite/local.d.cts +3 -3
- package/dist/backend/sqlite/local.d.ts +3 -3
- package/dist/backend/sqlite/local.js +14 -14
- package/dist/{chunk-VCRRKBLN.cjs → chunk-2ZWM2RFH.cjs} +9 -9
- package/dist/{chunk-VCRRKBLN.cjs.map → chunk-2ZWM2RFH.cjs.map} +1 -1
- package/dist/{chunk-Q3G6A4I3.cjs → chunk-32UETY6S.cjs} +26 -26
- package/dist/chunk-32UETY6S.cjs.map +1 -0
- package/dist/{chunk-JXA2ZP2Q.js → chunk-36LIJXWC.js} +4 -4
- package/dist/{chunk-JXA2ZP2Q.js.map → chunk-36LIJXWC.js.map} +1 -1
- package/dist/{chunk-MCLYU6BN.cjs → chunk-5PDSCELM.cjs} +14 -14
- package/dist/{chunk-MCLYU6BN.cjs.map → chunk-5PDSCELM.cjs.map} +1 -1
- package/dist/{chunk-775A4ZMN.js → chunk-5ZJOB5YS.js} +4 -4
- package/dist/{chunk-775A4ZMN.js.map → chunk-5ZJOB5YS.js.map} +1 -1
- package/dist/{chunk-J3WZ3FA2.js → chunk-62ZXBMSD.js} +24 -3
- package/dist/chunk-62ZXBMSD.js.map +1 -0
- package/dist/{chunk-7BQXPCGN.cjs → chunk-6BD6ZBKT.cjs} +10 -10
- package/dist/{chunk-7BQXPCGN.cjs.map → chunk-6BD6ZBKT.cjs.map} +1 -1
- package/dist/chunk-6LAXM4J2.cjs +12 -0
- package/dist/{chunk-VQH4VAWD.cjs.map → chunk-6LAXM4J2.cjs.map} +1 -1
- package/dist/{chunk-MSY7FSX4.js → chunk-72WUT4GG.js} +4 -4
- package/dist/{chunk-MSY7FSX4.js.map → chunk-72WUT4GG.js.map} +1 -1
- package/dist/chunk-73MWKDFK.cjs +12 -0
- package/dist/{chunk-A4OC4DVN.cjs.map → chunk-73MWKDFK.cjs.map} +1 -1
- package/dist/{chunk-BKCUOV7A.js → chunk-7TKNK32B.js} +5 -5
- package/dist/{chunk-BKCUOV7A.js.map → chunk-7TKNK32B.js.map} +1 -1
- package/dist/{chunk-GF3KXUTW.js → chunk-A2LJG5GM.js} +9 -9
- package/dist/{chunk-GF3KXUTW.js.map → chunk-A2LJG5GM.js.map} +1 -1
- package/dist/{chunk-PF6F5NLJ.cjs → chunk-A4R3H7RU.cjs} +237 -237
- package/dist/{chunk-PF6F5NLJ.cjs.map → chunk-A4R3H7RU.cjs.map} +1 -1
- package/dist/{chunk-RMQLSPA2.cjs → chunk-A7NMUYEL.cjs} +27 -27
- package/dist/{chunk-RMQLSPA2.cjs.map → chunk-A7NMUYEL.cjs.map} +1 -1
- package/dist/{chunk-U63GDNRC.cjs → chunk-AF3TWL5C.cjs} +4 -4
- package/dist/{chunk-U63GDNRC.cjs.map → chunk-AF3TWL5C.cjs.map} +1 -1
- package/dist/{chunk-XBYVV3MP.cjs → chunk-ANKOXPCC.cjs} +4 -4
- package/dist/chunk-ANKOXPCC.cjs.map +1 -0
- package/dist/{chunk-WQZLUGVR.js → chunk-AT3MLMJV.js} +10 -10
- package/dist/{chunk-WQZLUGVR.js.map → chunk-AT3MLMJV.js.map} +1 -1
- package/dist/{chunk-UV3SN74I.js → chunk-AU3IJNNP.js} +5 -5
- package/dist/{chunk-UV3SN74I.js.map → chunk-AU3IJNNP.js.map} +1 -1
- package/dist/{chunk-YAAM3M2S.cjs → chunk-BEB4OFZF.cjs} +10 -10
- package/dist/{chunk-YAAM3M2S.cjs.map → chunk-BEB4OFZF.cjs.map} +1 -1
- package/dist/{chunk-PT7RIRIZ.cjs → chunk-BQM5P2NO.cjs} +168 -168
- package/dist/{chunk-PT7RIRIZ.cjs.map → chunk-BQM5P2NO.cjs.map} +1 -1
- package/dist/{chunk-YWGVVALJ.js → chunk-BRN3RGD2.js} +3 -3
- package/dist/{chunk-YWGVVALJ.js.map → chunk-BRN3RGD2.js.map} +1 -1
- package/dist/{chunk-UDISNXDL.cjs → chunk-BZZI7B43.cjs} +47 -47
- package/dist/{chunk-UDISNXDL.cjs.map → chunk-BZZI7B43.cjs.map} +1 -1
- package/dist/{chunk-TQR4KBY2.cjs → chunk-C2ZP5YS6.cjs} +135 -133
- package/dist/chunk-C2ZP5YS6.cjs.map +1 -0
- package/dist/{chunk-PNN7RHVR.cjs → chunk-C4DYN2SD.cjs} +48 -48
- package/dist/{chunk-PNN7RHVR.cjs.map → chunk-C4DYN2SD.cjs.map} +1 -1
- package/dist/{chunk-PNTCATDE.cjs → chunk-C6KE2HSQ.cjs} +1355 -1312
- package/dist/chunk-C6KE2HSQ.cjs.map +1 -0
- package/dist/{chunk-LBJKZXDE.cjs → chunk-D6GCNNMK.cjs} +10 -10
- package/dist/{chunk-LBJKZXDE.cjs.map → chunk-D6GCNNMK.cjs.map} +1 -1
- package/dist/{chunk-JZUR7ZWE.js → chunk-DSAWGCMP.js} +3 -3
- package/dist/{chunk-JZUR7ZWE.js.map → chunk-DSAWGCMP.js.map} +1 -1
- package/dist/{chunk-U5SON7R2.cjs → chunk-DYPRZ53S.cjs} +27 -27
- package/dist/{chunk-U5SON7R2.cjs.map → chunk-DYPRZ53S.cjs.map} +1 -1
- package/dist/{chunk-YVWGEQJE.cjs → chunk-E4OSGBCM.cjs} +139 -133
- package/dist/chunk-E4OSGBCM.cjs.map +1 -0
- package/dist/{chunk-YDFDBE6D.js → chunk-EAMVXR5B.js} +4 -4
- package/dist/{chunk-YDFDBE6D.js.map → chunk-EAMVXR5B.js.map} +1 -1
- package/dist/{chunk-NLI2AVEF.js → chunk-EDHV4CBU.js} +8 -8
- package/dist/{chunk-NLI2AVEF.js.map → chunk-EDHV4CBU.js.map} +1 -1
- package/dist/{chunk-DCQVHAYQ.js → chunk-EDJDDY6H.js} +4 -4
- package/dist/{chunk-DCQVHAYQ.js.map → chunk-EDJDDY6H.js.map} +1 -1
- package/dist/{chunk-5262ZMTR.js → chunk-EJSYWAEV.js} +5 -5
- package/dist/{chunk-5262ZMTR.js.map → chunk-EJSYWAEV.js.map} +1 -1
- package/dist/{chunk-65E3XWGF.cjs → chunk-F36KZDFX.cjs} +91 -91
- package/dist/{chunk-65E3XWGF.cjs.map → chunk-F36KZDFX.cjs.map} +1 -1
- package/dist/{chunk-AKLS3BYZ.js → chunk-FA6Z7B5L.js} +3 -3
- package/dist/chunk-FA6Z7B5L.js.map +1 -0
- package/dist/{chunk-ASTI57H3.js → chunk-FCIZNUW5.js} +3 -3
- package/dist/{chunk-ASTI57H3.js.map → chunk-FCIZNUW5.js.map} +1 -1
- package/dist/{chunk-CBTIUB76.js → chunk-FSLTU57P.js} +3 -3
- package/dist/{chunk-CBTIUB76.js.map → chunk-FSLTU57P.js.map} +1 -1
- package/dist/{chunk-2LG2XB2M.js → chunk-FXNHZFZV.js} +3 -3
- package/dist/{chunk-2LG2XB2M.js.map → chunk-FXNHZFZV.js.map} +1 -1
- package/dist/{chunk-BSFJMMV3.cjs → chunk-GVAMRRZR.cjs} +4 -4
- package/dist/{chunk-BSFJMMV3.cjs.map → chunk-GVAMRRZR.cjs.map} +1 -1
- package/dist/{chunk-2Z2Z3ZD6.js → chunk-GWUWRZXW.js} +3 -3
- package/dist/{chunk-2Z2Z3ZD6.js.map → chunk-GWUWRZXW.js.map} +1 -1
- package/dist/{chunk-C23WSN5E.js → chunk-GWXXHOLU.js} +20 -14
- package/dist/chunk-GWXXHOLU.js.map +1 -0
- package/dist/{chunk-CMWHLBVN.cjs → chunk-HNYLMPQQ.cjs} +68 -68
- package/dist/{chunk-CMWHLBVN.cjs.map → chunk-HNYLMPQQ.cjs.map} +1 -1
- package/dist/{chunk-NMWDXFPH.js → chunk-IHRDX7K6.js} +4 -4
- package/dist/{chunk-NMWDXFPH.js.map → chunk-IHRDX7K6.js.map} +1 -1
- package/dist/{chunk-VGTJPTIC.js → chunk-JCNTKRAK.js} +5 -5
- package/dist/{chunk-VGTJPTIC.js.map → chunk-JCNTKRAK.js.map} +1 -1
- package/dist/{chunk-MXJDTH5B.cjs → chunk-JL5UEBWT.cjs} +45 -45
- package/dist/{chunk-MXJDTH5B.cjs.map → chunk-JL5UEBWT.cjs.map} +1 -1
- package/dist/{chunk-LGHCOKTT.js → chunk-KA4L2NZ3.js} +14 -14
- package/dist/{chunk-LGHCOKTT.js.map → chunk-KA4L2NZ3.js.map} +1 -1
- package/dist/{chunk-NI72YOJB.cjs → chunk-KCH7WQA5.cjs} +24 -2
- package/dist/chunk-KCH7WQA5.cjs.map +1 -0
- package/dist/{chunk-2NA5DYLO.cjs → chunk-KOAI3KIV.cjs} +4 -4
- package/dist/{chunk-2NA5DYLO.cjs.map → chunk-KOAI3KIV.cjs.map} +1 -1
- package/dist/{chunk-7VQXLT5O.js → chunk-KXSMF6PL.js} +101 -25
- package/dist/chunk-KXSMF6PL.js.map +1 -0
- package/dist/{chunk-M3WP7RQZ.js → chunk-LHYSY6SE.js} +6 -6
- package/dist/chunk-LHYSY6SE.js.map +1 -0
- package/dist/{chunk-WDGA7IYB.js → chunk-LNIWCQR4.js} +3 -3
- package/dist/{chunk-WDGA7IYB.js.map → chunk-LNIWCQR4.js.map} +1 -1
- package/dist/{chunk-YBQOHKHN.cjs → chunk-N3QTGPC7.cjs} +99 -99
- package/dist/{chunk-YBQOHKHN.cjs.map → chunk-N3QTGPC7.cjs.map} +1 -1
- package/dist/{chunk-K5ELX2GT.js → chunk-OZJCH7ZS.js} +3 -3
- package/dist/{chunk-K5ELX2GT.js.map → chunk-OZJCH7ZS.js.map} +1 -1
- package/dist/{chunk-62ZP23AW.cjs → chunk-PYKF7UIL.cjs} +13 -13
- package/dist/{chunk-62ZP23AW.cjs.map → chunk-PYKF7UIL.cjs.map} +1 -1
- package/dist/{chunk-PQBQG7IM.js → chunk-QOJ2L2AD.js} +3 -3
- package/dist/{chunk-PQBQG7IM.js.map → chunk-QOJ2L2AD.js.map} +1 -1
- package/dist/{chunk-DTVWX77L.cjs → chunk-QPOQX2DI.cjs} +235 -235
- package/dist/{chunk-DTVWX77L.cjs.map → chunk-QPOQX2DI.cjs.map} +1 -1
- package/dist/{chunk-NFCVHQ5P.cjs → chunk-QU7QLJA4.cjs} +26 -26
- package/dist/{chunk-NFCVHQ5P.cjs.map → chunk-QU7QLJA4.cjs.map} +1 -1
- package/dist/{chunk-XL7SLCXS.js → chunk-R7EWHKID.js} +3 -3
- package/dist/{chunk-XL7SLCXS.js.map → chunk-R7EWHKID.js.map} +1 -1
- package/dist/{chunk-HFHTMECK.js → chunk-RFDEYLIK.js} +7 -7
- package/dist/{chunk-HFHTMECK.js.map → chunk-RFDEYLIK.js.map} +1 -1
- package/dist/{chunk-MUK4BU7K.cjs → chunk-RHDOAQCT.cjs} +200 -124
- package/dist/chunk-RHDOAQCT.cjs.map +1 -0
- package/dist/{chunk-YBFHZUXX.js → chunk-S3G5VLSW.js} +6 -6
- package/dist/{chunk-YBFHZUXX.js.map → chunk-S3G5VLSW.js.map} +1 -1
- package/dist/{chunk-M4BDU5RX.cjs → chunk-S7WIRFNS.cjs} +12 -12
- package/dist/{chunk-M4BDU5RX.cjs.map → chunk-S7WIRFNS.cjs.map} +1 -1
- package/dist/{chunk-T4XNKYXB.js → chunk-SXWLLQ3D.js} +4 -4
- package/dist/{chunk-T4XNKYXB.js.map → chunk-SXWLLQ3D.js.map} +1 -1
- package/dist/{chunk-NK5Q7UNE.cjs → chunk-TCT66A7N.cjs} +10 -10
- package/dist/{chunk-NK5Q7UNE.cjs.map → chunk-TCT66A7N.cjs.map} +1 -1
- package/dist/{chunk-3DHZCOT7.cjs → chunk-UTVQPZPN.cjs} +20 -20
- package/dist/{chunk-3DHZCOT7.cjs.map → chunk-UTVQPZPN.cjs.map} +1 -1
- package/dist/{chunk-CXBHOOIQ.cjs → chunk-WA64ZSCA.cjs} +11 -11
- package/dist/{chunk-CXBHOOIQ.cjs.map → chunk-WA64ZSCA.cjs.map} +1 -1
- package/dist/{chunk-L65OU2U3.js → chunk-WEJHA7AD.js} +13 -13
- package/dist/{chunk-L65OU2U3.js.map → chunk-WEJHA7AD.js.map} +1 -1
- package/dist/{chunk-5UVRGXD3.js → chunk-WHS2Y43J.js} +5 -5
- package/dist/{chunk-5UVRGXD3.js.map → chunk-WHS2Y43J.js.map} +1 -1
- package/dist/{chunk-I5MOXA4H.js → chunk-WMKEGJG4.js} +3 -3
- package/dist/{chunk-I5MOXA4H.js.map → chunk-WMKEGJG4.js.map} +1 -1
- package/dist/{chunk-5763DULU.js → chunk-WYFB7BN3.js} +16 -14
- package/dist/chunk-WYFB7BN3.js.map +1 -0
- package/dist/{chunk-VLT6PEWR.cjs → chunk-XBHRKLZU.cjs} +4 -4
- package/dist/{chunk-VLT6PEWR.cjs.map → chunk-XBHRKLZU.cjs.map} +1 -1
- package/dist/{chunk-S6PW7VV5.js → chunk-YQ4JONWE.js} +91 -48
- package/dist/chunk-YQ4JONWE.js.map +1 -0
- package/dist/{chunk-MZLPX2R7.js → chunk-Z43KWLZF.js} +8 -8
- package/dist/{chunk-MZLPX2R7.js.map → chunk-Z43KWLZF.js.map} +1 -1
- package/dist/{chunk-E4WNQBEF.cjs → chunk-ZBVZ7HXD.cjs} +12 -12
- package/dist/{chunk-E4WNQBEF.cjs.map → chunk-ZBVZ7HXD.cjs.map} +1 -1
- package/dist/{chunk-4UGOKMI5.cjs → chunk-ZHOAZD7Q.cjs} +161 -161
- package/dist/{chunk-4UGOKMI5.cjs.map → chunk-ZHOAZD7Q.cjs.map} +1 -1
- package/dist/{chunk-XCAGZAKP.cjs → chunk-ZIH42CRX.cjs} +7 -7
- package/dist/{chunk-XCAGZAKP.cjs.map → chunk-ZIH42CRX.cjs.map} +1 -1
- package/dist/core/index.cjs +27 -27
- package/dist/core/index.d.cts +4 -4
- package/dist/core/index.d.ts +4 -4
- package/dist/core/index.js +7 -7
- package/dist/{ddl-BJcOp4WZ.d.cts → ddl-mE07h_EM.d.cts} +3 -3
- package/dist/{ddl-BXfGHbPN.d.ts → ddl-opIn8DfX.d.ts} +3 -3
- package/dist/graph-extension/index.cjs +20 -20
- package/dist/graph-extension/index.d.cts +4 -4
- package/dist/graph-extension/index.d.ts +4 -4
- package/dist/graph-extension/index.js +4 -4
- package/dist/graph-merge/index.cjs +248 -248
- package/dist/graph-merge/index.d.cts +8 -8
- package/dist/graph-merge/index.d.ts +8 -8
- package/dist/graph-merge/index.js +24 -24
- package/dist/{index-DxaYCv8Y.d.cts → index-Deyu8IXL.d.ts} +20 -3
- package/dist/{index-BSHvKfok.d.ts → index-DrRS51Ld.d.cts} +20 -3
- package/dist/index.cjs +219 -215
- package/dist/index.d.cts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +34 -34
- package/dist/indexes/index.cjs +13 -13
- package/dist/indexes/index.d.cts +4 -4
- package/dist/indexes/index.d.ts +4 -4
- package/dist/indexes/index.js +6 -6
- package/dist/interchange/index.cjs +52 -52
- package/dist/interchange/index.d.cts +7 -7
- package/dist/interchange/index.d.ts +7 -7
- package/dist/interchange/index.js +16 -16
- package/dist/{manager-CfZAimti.d.ts → manager-DX983gJ0.d.ts} +2 -2
- package/dist/{manager-HGk6E_HW.d.cts → manager-ptr3JLRP.d.cts} +2 -2
- package/dist/{materialize-indexes-6A7dWGtb.d.cts → materialize-indexes-BXz77YqO.d.cts} +1 -1
- package/dist/{materialize-indexes-BMJP6Tms.d.ts → materialize-indexes-CpXoggWU.d.ts} +1 -1
- package/dist/{postgres-DFYWENdR.d.cts → postgres-DwgEXSPI.d.cts} +1 -1
- package/dist/{postgres-e7a9TdvR.d.ts → postgres-QdOMHTBz.d.ts} +1 -1
- package/dist/profiler/index.d.cts +9 -9
- package/dist/profiler/index.d.ts +9 -9
- package/dist/provenance/index.cjs +42 -42
- package/dist/provenance/index.d.cts +7 -7
- package/dist/provenance/index.d.ts +7 -7
- package/dist/provenance/index.js +9 -9
- package/dist/schema/index.cjs +44 -44
- package/dist/schema/index.d.cts +6 -6
- package/dist/schema/index.d.ts +6 -6
- package/dist/schema/index.js +17 -17
- package/dist/{searchable-9OQoPuRs.d.ts → searchable-BOUuA83f.d.ts} +1 -1
- package/dist/{searchable-CIje5XYD.d.cts → searchable-BrUh0pdc.d.cts} +1 -1
- package/dist/{sqlite-DerU5tc7.d.ts → sqlite-BfYcV61E.d.cts} +1 -1
- package/dist/{sqlite-DitnISa9.d.cts → sqlite-DK40XVR1.d.ts} +1 -1
- package/dist/{store-B0h6x7wo.d.cts → store-Bo1psfVZ.d.ts} +15 -5
- package/dist/{store-ClQ-MZQS.d.ts → store-FTqBpuJD.d.cts} +15 -5
- package/dist/{temporal-Bn-Fi8FJ.d.cts → temporal-CXewwLTB.d.cts} +1 -1
- package/dist/{temporal-BtM4UALv.d.ts → temporal-DPtn0HOu.d.ts} +1 -1
- package/dist/{types-KFfk-8Ah.d.ts → types-CeT7xM4M.d.ts} +1 -1
- package/dist/{types-HkveCCx0.d.ts → types-Du78EvpN.d.cts} +7 -6
- package/dist/{types-HkveCCx0.d.cts → types-Du78EvpN.d.ts} +7 -6
- package/dist/{types-CoIx8HX5.d.cts → types-XR1nHERK.d.cts} +1 -1
- package/dist/{where--fk7_0kv.d.cts → where-CJsp-YUf.d.cts} +1 -1
- package/dist/{where-ws5hf-Ov.d.ts → where-CMbFiWwp.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-5763DULU.js.map +0 -1
- package/dist/chunk-7VQXLT5O.js.map +0 -1
- package/dist/chunk-A4OC4DVN.cjs +0 -12
- package/dist/chunk-AKLS3BYZ.js.map +0 -1
- package/dist/chunk-C23WSN5E.js.map +0 -1
- package/dist/chunk-J3WZ3FA2.js.map +0 -1
- package/dist/chunk-M3WP7RQZ.js.map +0 -1
- package/dist/chunk-MUK4BU7K.cjs.map +0 -1
- package/dist/chunk-NI72YOJB.cjs.map +0 -1
- package/dist/chunk-PNTCATDE.cjs.map +0 -1
- package/dist/chunk-Q3G6A4I3.cjs.map +0 -1
- package/dist/chunk-S6PW7VV5.js.map +0 -1
- package/dist/chunk-TQR4KBY2.cjs.map +0 -1
- package/dist/chunk-VQH4VAWD.cjs +0 -12
- package/dist/chunk-XBYVV3MP.cjs.map +0 -1
- package/dist/chunk-YVWGEQJE.cjs.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
3
|
+
var chunkA7NMUYEL_cjs = require('./chunk-A7NMUYEL.cjs');
|
|
4
|
+
var chunkQU7QLJA4_cjs = require('./chunk-QU7QLJA4.cjs');
|
|
5
|
+
var chunk5PDSCELM_cjs = require('./chunk-5PDSCELM.cjs');
|
|
6
|
+
var chunkZHOAZD7Q_cjs = require('./chunk-ZHOAZD7Q.cjs');
|
|
7
|
+
var chunk2ZWM2RFH_cjs = require('./chunk-2ZWM2RFH.cjs');
|
|
8
|
+
var chunkKCH7WQA5_cjs = require('./chunk-KCH7WQA5.cjs');
|
|
9
9
|
|
|
10
10
|
// src/backend/migrate-recorded-time.ts
|
|
11
11
|
var LEGACY_RECORDED_MAX = "9999-12-31T23:59:59.999Z";
|
|
@@ -52,24 +52,24 @@ var RECORDED_EDGE_COLUMNS = [
|
|
|
52
52
|
"meta"
|
|
53
53
|
];
|
|
54
54
|
function resolvedTableNames(backend, override) {
|
|
55
|
-
return
|
|
55
|
+
return chunkQU7QLJA4_cjs.createSqlSchema(override ?? backend.tableNames ?? {}).tables;
|
|
56
56
|
}
|
|
57
57
|
function shortenedIdentifier(value) {
|
|
58
58
|
if (value.length <= 63) return value;
|
|
59
|
-
return `${value.slice(0, 50)}_${
|
|
59
|
+
return `${value.slice(0, 50)}_${chunkZHOAZD7Q_cjs.shortHash(value)}`;
|
|
60
60
|
}
|
|
61
61
|
function mappingTableName(tables, override) {
|
|
62
62
|
const candidate = override ?? `${tables.recordedClock}_${MIGRATION_SUFFIX}`;
|
|
63
|
-
return
|
|
63
|
+
return chunkQU7QLJA4_cjs.createSqlSchema({
|
|
64
64
|
recordedClock: shortenedIdentifier(candidate)
|
|
65
65
|
}).tables.recordedClock;
|
|
66
66
|
}
|
|
67
67
|
function temporaryTableName(tableName, role) {
|
|
68
|
-
return shortenedIdentifier(`__tg_${role}_${
|
|
68
|
+
return shortenedIdentifier(`__tg_${role}_${chunkZHOAZD7Q_cjs.shortHash(tableName)}`);
|
|
69
69
|
}
|
|
70
70
|
function requireStatements(target) {
|
|
71
71
|
if (target.executeStatement === void 0) {
|
|
72
|
-
throw new
|
|
72
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
73
73
|
"Recorded-time migration requires executeStatement support.",
|
|
74
74
|
{ dialect: target.dialect },
|
|
75
75
|
{ suggestion: "Use a built-in SQLite or PostgreSQL backend." }
|
|
@@ -78,15 +78,15 @@ function requireStatements(target) {
|
|
|
78
78
|
return target.executeStatement;
|
|
79
79
|
}
|
|
80
80
|
async function executeStatement(target, statement) {
|
|
81
|
-
await requireStatements(target)(
|
|
81
|
+
await requireStatements(target)(chunk2ZWM2RFH_cjs.asCompiledStatementSql(statement));
|
|
82
82
|
}
|
|
83
83
|
async function executeDdl(target, ddl) {
|
|
84
|
-
await executeStatement(target,
|
|
84
|
+
await executeStatement(target, chunk2ZWM2RFH_cjs.sql.raw(ddl));
|
|
85
85
|
}
|
|
86
86
|
function canonicalLegacyInstant(value) {
|
|
87
|
-
const canonical =
|
|
87
|
+
const canonical = chunk5PDSCELM_cjs.canonicalizeDatabaseTimestamp(value);
|
|
88
88
|
if (canonical === void 0) {
|
|
89
|
-
throw new
|
|
89
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
90
90
|
"Legacy recorded-time relation contained an invalid timestamp.",
|
|
91
91
|
{ value }
|
|
92
92
|
);
|
|
@@ -95,8 +95,8 @@ function canonicalLegacyInstant(value) {
|
|
|
95
95
|
}
|
|
96
96
|
function safeRevision(value) {
|
|
97
97
|
const revision = typeof value === "bigint" ? Number(value) : typeof value === "string" && /^\d+$/.test(value) ? Number(value) : value;
|
|
98
|
-
if (typeof revision !== "number" || !Number.isSafeInteger(revision) || revision < 1 || revision >=
|
|
99
|
-
throw new
|
|
98
|
+
if (typeof revision !== "number" || !Number.isSafeInteger(revision) || revision < 1 || revision >= chunk5PDSCELM_cjs.RECORDED_MAX_REVISION) {
|
|
99
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
100
100
|
"Recorded anchor mapping contained an invalid revision.",
|
|
101
101
|
{ value }
|
|
102
102
|
);
|
|
@@ -105,9 +105,9 @@ function safeRevision(value) {
|
|
|
105
105
|
}
|
|
106
106
|
async function columnNames(target, tableName) {
|
|
107
107
|
const rows = target.dialect === "sqlite" ? await target.execute(
|
|
108
|
-
|
|
108
|
+
chunk2ZWM2RFH_cjs.asCompiledRowsSql(chunk2ZWM2RFH_cjs.sql`PRAGMA table_info(${chunk2ZWM2RFH_cjs.sql.identifier(tableName)})`)
|
|
109
109
|
) : await target.execute(
|
|
110
|
-
|
|
110
|
+
chunk2ZWM2RFH_cjs.asCompiledRowsSql(chunk2ZWM2RFH_cjs.sql`
|
|
111
111
|
SELECT column_name AS name
|
|
112
112
|
FROM information_schema.columns
|
|
113
113
|
WHERE table_schema = current_schema()
|
|
@@ -120,28 +120,28 @@ async function columnNames(target, tableName) {
|
|
|
120
120
|
}
|
|
121
121
|
async function readLegacyInstants(target, tables) {
|
|
122
122
|
const rows = await target.execute(
|
|
123
|
-
|
|
123
|
+
chunk2ZWM2RFH_cjs.asCompiledRowsSql(chunk2ZWM2RFH_cjs.sql`
|
|
124
124
|
SELECT graph_id, recorded_from AS recorded_at
|
|
125
|
-
FROM ${
|
|
125
|
+
FROM ${chunk2ZWM2RFH_cjs.sql.identifier(tables.recordedNodes)}
|
|
126
126
|
UNION
|
|
127
127
|
SELECT graph_id, recorded_to AS recorded_at
|
|
128
|
-
FROM ${
|
|
128
|
+
FROM ${chunk2ZWM2RFH_cjs.sql.identifier(tables.recordedNodes)}
|
|
129
129
|
WHERE recorded_to <> ${LEGACY_RECORDED_MAX}
|
|
130
130
|
UNION
|
|
131
131
|
SELECT graph_id, recorded_from AS recorded_at
|
|
132
|
-
FROM ${
|
|
132
|
+
FROM ${chunk2ZWM2RFH_cjs.sql.identifier(tables.recordedEdges)}
|
|
133
133
|
UNION
|
|
134
134
|
SELECT graph_id, recorded_to AS recorded_at
|
|
135
|
-
FROM ${
|
|
135
|
+
FROM ${chunk2ZWM2RFH_cjs.sql.identifier(tables.recordedEdges)}
|
|
136
136
|
WHERE recorded_to <> ${LEGACY_RECORDED_MAX}
|
|
137
137
|
UNION
|
|
138
138
|
SELECT graph_id, recorded_at
|
|
139
|
-
FROM ${
|
|
139
|
+
FROM ${chunk2ZWM2RFH_cjs.sql.identifier(tables.recordedClock)}
|
|
140
140
|
`)
|
|
141
141
|
);
|
|
142
142
|
const instants = rows.map((row) => {
|
|
143
143
|
if (typeof row.graph_id !== "string") {
|
|
144
|
-
throw new
|
|
144
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
145
145
|
"Legacy recorded-time relation contained an invalid graph id.",
|
|
146
146
|
{ graphId: row.graph_id }
|
|
147
147
|
);
|
|
@@ -192,38 +192,38 @@ function migrationMapDdl(dialect, table) {
|
|
|
192
192
|
);`;
|
|
193
193
|
}
|
|
194
194
|
async function writeMappingRows(target, tableName, rows) {
|
|
195
|
-
await executeStatement(target,
|
|
195
|
+
await executeStatement(target, chunk2ZWM2RFH_cjs.sql`DELETE FROM ${chunk2ZWM2RFH_cjs.sql.identifier(tableName)}`);
|
|
196
196
|
const rowsPerStatement = Math.max(
|
|
197
197
|
1,
|
|
198
198
|
Math.floor((target.capabilities.maxBindParameters ?? 900) / 4)
|
|
199
199
|
);
|
|
200
200
|
for (let start = 0; start < rows.length; start += rowsPerStatement) {
|
|
201
201
|
const values = rows.slice(start, start + rowsPerStatement).map(
|
|
202
|
-
(row) =>
|
|
202
|
+
(row) => chunk2ZWM2RFH_cjs.sql`(${row.graphId}, ${row.legacyRecordedAt}, ${row.revision}, ${row.recordedAt})`
|
|
203
203
|
);
|
|
204
204
|
await executeStatement(
|
|
205
205
|
target,
|
|
206
|
-
|
|
207
|
-
INSERT INTO ${
|
|
206
|
+
chunk2ZWM2RFH_cjs.sql`
|
|
207
|
+
INSERT INTO ${chunk2ZWM2RFH_cjs.sql.identifier(tableName)}
|
|
208
208
|
(graph_id, legacy_recorded_at, revision, recorded_at)
|
|
209
|
-
VALUES ${
|
|
209
|
+
VALUES ${chunk2ZWM2RFH_cjs.sql.join(values, chunk2ZWM2RFH_cjs.sql`, `)}
|
|
210
210
|
`
|
|
211
211
|
);
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
function tableDdl(dialect, tables, temporary) {
|
|
215
215
|
if (dialect === "sqlite") {
|
|
216
|
-
const temporaryTables2 =
|
|
217
|
-
const finalTables2 =
|
|
218
|
-
const temporaryContributions =
|
|
219
|
-
const finalContributions =
|
|
216
|
+
const temporaryTables2 = chunkA7NMUYEL_cjs.createSqliteTables(temporary);
|
|
217
|
+
const finalTables2 = chunkA7NMUYEL_cjs.createSqliteTables(tables);
|
|
218
|
+
const temporaryContributions = chunkA7NMUYEL_cjs.sqliteContributions(temporaryTables2);
|
|
219
|
+
const finalContributions = chunkA7NMUYEL_cjs.sqliteContributions(finalTables2);
|
|
220
220
|
return ddlForRecordedTables(temporaryContributions, finalContributions);
|
|
221
221
|
}
|
|
222
|
-
const temporaryTables =
|
|
223
|
-
const finalTables =
|
|
222
|
+
const temporaryTables = chunkA7NMUYEL_cjs.createPostgresTables(temporary);
|
|
223
|
+
const finalTables = chunkA7NMUYEL_cjs.createPostgresTables(tables);
|
|
224
224
|
return ddlForRecordedTables(
|
|
225
|
-
|
|
226
|
-
|
|
225
|
+
chunkA7NMUYEL_cjs.postgresContributions(temporaryTables),
|
|
226
|
+
chunkA7NMUYEL_cjs.postgresContributions(finalTables)
|
|
227
227
|
);
|
|
228
228
|
}
|
|
229
229
|
function ddlForRecordedTables(temporary, final) {
|
|
@@ -235,13 +235,13 @@ function ddlForRecordedTables(temporary, final) {
|
|
|
235
235
|
(entry) => entry.logicalName === logicalName
|
|
236
236
|
)?.createDdl;
|
|
237
237
|
if (temporaryDdl === void 0 || finalDdl === void 0) {
|
|
238
|
-
throw new
|
|
238
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
239
239
|
`Could not generate migration DDL for ${logicalName}.`
|
|
240
240
|
);
|
|
241
241
|
}
|
|
242
242
|
const createTable = temporaryDdl[0];
|
|
243
243
|
if (createTable === void 0) {
|
|
244
|
-
throw new
|
|
244
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
245
245
|
`Could not generate migration table DDL for ${logicalName}.`
|
|
246
246
|
);
|
|
247
247
|
}
|
|
@@ -254,27 +254,27 @@ function ddlForRecordedTables(temporary, final) {
|
|
|
254
254
|
};
|
|
255
255
|
}
|
|
256
256
|
function migratedColumn(column, legacyAlias) {
|
|
257
|
-
if (column === "recorded_from") return
|
|
257
|
+
if (column === "recorded_from") return chunk2ZWM2RFH_cjs.sql`from_map.revision`;
|
|
258
258
|
if (column === "recorded_to") {
|
|
259
|
-
return
|
|
259
|
+
return chunk2ZWM2RFH_cjs.sql`
|
|
260
260
|
CASE
|
|
261
|
-
WHEN ${
|
|
262
|
-
THEN ${
|
|
261
|
+
WHEN ${chunk2ZWM2RFH_cjs.sql.raw(legacyAlias)}.recorded_to = ${LEGACY_RECORDED_MAX}
|
|
262
|
+
THEN ${chunk5PDSCELM_cjs.RECORDED_MAX_REVISION}
|
|
263
263
|
ELSE to_map.revision
|
|
264
264
|
END
|
|
265
265
|
`;
|
|
266
266
|
}
|
|
267
|
-
return
|
|
267
|
+
return chunk2ZWM2RFH_cjs.sql`${chunk2ZWM2RFH_cjs.sql.raw(legacyAlias)}.${chunk2ZWM2RFH_cjs.sql.identifier(column)}`;
|
|
268
268
|
}
|
|
269
269
|
function mappingMatch(dialect, mappingAlias, legacyColumn) {
|
|
270
|
-
const mapping =
|
|
271
|
-
const legacy =
|
|
272
|
-
return dialect === "postgres" ?
|
|
270
|
+
const mapping = chunk2ZWM2RFH_cjs.sql.raw(mappingAlias);
|
|
271
|
+
const legacy = chunk2ZWM2RFH_cjs.sql.raw(`legacy.${legacyColumn}`);
|
|
272
|
+
return dialect === "postgres" ? chunk2ZWM2RFH_cjs.sql`${mapping}.recorded_at = ${legacy}` : chunk2ZWM2RFH_cjs.sql`${mapping}.legacy_recorded_at = ${legacy}`;
|
|
273
273
|
}
|
|
274
274
|
function missingMappingCount(value, legacyTable) {
|
|
275
275
|
const count = Number(value);
|
|
276
276
|
if (!Number.isSafeInteger(count) || count < 0) {
|
|
277
|
-
throw new
|
|
277
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
278
278
|
"Recorded-time migration returned an invalid integrity-check count.",
|
|
279
279
|
{ legacyTable, value }
|
|
280
280
|
);
|
|
@@ -285,12 +285,12 @@ async function assertRecordedRelationMappings(target, options) {
|
|
|
285
285
|
const fromMatch = mappingMatch(target.dialect, "from_map", "recorded_from");
|
|
286
286
|
const toMatch = mappingMatch(target.dialect, "to_map", "recorded_to");
|
|
287
287
|
const rows = await target.execute(
|
|
288
|
-
|
|
288
|
+
chunk2ZWM2RFH_cjs.asCompiledRowsSql(chunk2ZWM2RFH_cjs.sql`
|
|
289
289
|
SELECT COUNT(*) AS missing
|
|
290
|
-
FROM ${
|
|
291
|
-
LEFT JOIN ${
|
|
290
|
+
FROM ${chunk2ZWM2RFH_cjs.sql.identifier(options.legacyTable)} AS legacy
|
|
291
|
+
LEFT JOIN ${chunk2ZWM2RFH_cjs.sql.identifier(options.mappingTable)} AS from_map
|
|
292
292
|
ON from_map.graph_id = legacy.graph_id AND ${fromMatch}
|
|
293
|
-
LEFT JOIN ${
|
|
293
|
+
LEFT JOIN ${chunk2ZWM2RFH_cjs.sql.identifier(options.mappingTable)} AS to_map
|
|
294
294
|
ON to_map.graph_id = legacy.graph_id AND ${toMatch}
|
|
295
295
|
WHERE from_map.revision IS NULL
|
|
296
296
|
OR (
|
|
@@ -301,7 +301,7 @@ async function assertRecordedRelationMappings(target, options) {
|
|
|
301
301
|
);
|
|
302
302
|
const missing = missingMappingCount(rows[0]?.missing, options.legacyTable);
|
|
303
303
|
if (missing === 0) return;
|
|
304
|
-
throw new
|
|
304
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
305
305
|
"Legacy recorded-time boundaries could not be mapped exactly.",
|
|
306
306
|
{ legacyTable: options.legacyTable, missingRows: missing },
|
|
307
307
|
{
|
|
@@ -312,17 +312,17 @@ async function assertRecordedRelationMappings(target, options) {
|
|
|
312
312
|
async function assertRecordedClockMappings(target, options) {
|
|
313
313
|
const match = mappingMatch(target.dialect, "anchor_map", "recorded_at");
|
|
314
314
|
const rows = await target.execute(
|
|
315
|
-
|
|
315
|
+
chunk2ZWM2RFH_cjs.asCompiledRowsSql(chunk2ZWM2RFH_cjs.sql`
|
|
316
316
|
SELECT COUNT(*) AS missing
|
|
317
|
-
FROM ${
|
|
318
|
-
LEFT JOIN ${
|
|
317
|
+
FROM ${chunk2ZWM2RFH_cjs.sql.identifier(options.legacyTable)} AS legacy
|
|
318
|
+
LEFT JOIN ${chunk2ZWM2RFH_cjs.sql.identifier(options.mappingTable)} AS anchor_map
|
|
319
319
|
ON anchor_map.graph_id = legacy.graph_id AND ${match}
|
|
320
320
|
WHERE anchor_map.revision IS NULL
|
|
321
321
|
`)
|
|
322
322
|
);
|
|
323
323
|
const missing = missingMappingCount(rows[0]?.missing, options.legacyTable);
|
|
324
324
|
if (missing === 0) return;
|
|
325
|
-
throw new
|
|
325
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
326
326
|
"Legacy recorded clock values could not be mapped exactly.",
|
|
327
327
|
{ legacyTable: options.legacyTable, missingRows: missing },
|
|
328
328
|
{
|
|
@@ -331,7 +331,7 @@ async function assertRecordedClockMappings(target, options) {
|
|
|
331
331
|
);
|
|
332
332
|
}
|
|
333
333
|
async function copyRecordedRelation(target, options) {
|
|
334
|
-
const columnList = options.columns.map((column) =>
|
|
334
|
+
const columnList = options.columns.map((column) => chunk2ZWM2RFH_cjs.sql.identifier(column));
|
|
335
335
|
const values = options.columns.map(
|
|
336
336
|
(column) => migratedColumn(column, "legacy")
|
|
337
337
|
);
|
|
@@ -340,16 +340,16 @@ async function copyRecordedRelation(target, options) {
|
|
|
340
340
|
const toMatch = mappingMatch(target.dialect, "to_map", "recorded_to");
|
|
341
341
|
await executeStatement(
|
|
342
342
|
target,
|
|
343
|
-
|
|
344
|
-
INSERT INTO ${
|
|
345
|
-
(${
|
|
346
|
-
SELECT ${
|
|
347
|
-
FROM ${
|
|
343
|
+
chunk2ZWM2RFH_cjs.sql`
|
|
344
|
+
INSERT INTO ${chunk2ZWM2RFH_cjs.sql.identifier(options.temporaryTable)}
|
|
345
|
+
(${chunk2ZWM2RFH_cjs.sql.join(columnList, chunk2ZWM2RFH_cjs.sql`, `)})
|
|
346
|
+
SELECT ${chunk2ZWM2RFH_cjs.sql.join(values, chunk2ZWM2RFH_cjs.sql`, `)}
|
|
347
|
+
FROM ${chunk2ZWM2RFH_cjs.sql.identifier(options.legacyTable)} AS legacy
|
|
348
348
|
-- LEFT JOIN is deliberate: a missing mapping reaches the NOT NULL
|
|
349
349
|
-- revision columns and fails loud instead of silently dropping history.
|
|
350
|
-
LEFT JOIN ${
|
|
350
|
+
LEFT JOIN ${chunk2ZWM2RFH_cjs.sql.identifier(options.mappingTable)} AS from_map
|
|
351
351
|
ON from_map.graph_id = legacy.graph_id AND ${fromMatch}
|
|
352
|
-
LEFT JOIN ${
|
|
352
|
+
LEFT JOIN ${chunk2ZWM2RFH_cjs.sql.identifier(options.mappingTable)} AS to_map
|
|
353
353
|
ON to_map.graph_id = legacy.graph_id AND ${toMatch}
|
|
354
354
|
`
|
|
355
355
|
);
|
|
@@ -359,13 +359,13 @@ async function copyRecordedClock(target, options) {
|
|
|
359
359
|
const match = mappingMatch(target.dialect, "anchor_map", "recorded_at");
|
|
360
360
|
await executeStatement(
|
|
361
361
|
target,
|
|
362
|
-
|
|
363
|
-
INSERT INTO ${
|
|
362
|
+
chunk2ZWM2RFH_cjs.sql`
|
|
363
|
+
INSERT INTO ${chunk2ZWM2RFH_cjs.sql.identifier(options.temporaryTable)}
|
|
364
364
|
(graph_id, revision, recorded_at)
|
|
365
365
|
SELECT legacy.graph_id, anchor_map.revision, legacy.recorded_at
|
|
366
|
-
FROM ${
|
|
366
|
+
FROM ${chunk2ZWM2RFH_cjs.sql.identifier(options.legacyTable)} AS legacy
|
|
367
367
|
-- Preserve fail-loud behavior if the preflight invariant changes later.
|
|
368
|
-
LEFT JOIN ${
|
|
368
|
+
LEFT JOIN ${chunk2ZWM2RFH_cjs.sql.identifier(options.mappingTable)} AS anchor_map
|
|
369
369
|
ON anchor_map.graph_id = legacy.graph_id AND ${match}
|
|
370
370
|
`
|
|
371
371
|
);
|
|
@@ -380,7 +380,7 @@ async function replaceLegacyTables(target, tables, mappingTable) {
|
|
|
380
380
|
for (const table of Object.values(temporary)) {
|
|
381
381
|
await executeStatement(
|
|
382
382
|
target,
|
|
383
|
-
|
|
383
|
+
chunk2ZWM2RFH_cjs.sql`DROP TABLE IF EXISTS ${chunk2ZWM2RFH_cjs.sql.identifier(table)}`
|
|
384
384
|
);
|
|
385
385
|
}
|
|
386
386
|
await executeDdl(target, requireCreateTable(ddl.nodes));
|
|
@@ -405,15 +405,15 @@ async function replaceLegacyTables(target, tables, mappingTable) {
|
|
|
405
405
|
});
|
|
406
406
|
await executeStatement(
|
|
407
407
|
target,
|
|
408
|
-
|
|
408
|
+
chunk2ZWM2RFH_cjs.sql`DROP TABLE ${chunk2ZWM2RFH_cjs.sql.identifier(tables.recordedNodes)}`
|
|
409
409
|
);
|
|
410
410
|
await executeStatement(
|
|
411
411
|
target,
|
|
412
|
-
|
|
412
|
+
chunk2ZWM2RFH_cjs.sql`DROP TABLE ${chunk2ZWM2RFH_cjs.sql.identifier(tables.recordedEdges)}`
|
|
413
413
|
);
|
|
414
414
|
await executeStatement(
|
|
415
415
|
target,
|
|
416
|
-
|
|
416
|
+
chunk2ZWM2RFH_cjs.sql`DROP TABLE ${chunk2ZWM2RFH_cjs.sql.identifier(tables.recordedClock)}`
|
|
417
417
|
);
|
|
418
418
|
await renameTable(target, temporary.recordedNodes, tables.recordedNodes);
|
|
419
419
|
await renameTable(target, temporary.recordedEdges, tables.recordedEdges);
|
|
@@ -445,17 +445,17 @@ async function renamePrimaryKeyConstraint(target, temporaryTable, finalTable) {
|
|
|
445
445
|
if (target.dialect !== "postgres") return;
|
|
446
446
|
await executeStatement(
|
|
447
447
|
target,
|
|
448
|
-
|
|
449
|
-
ALTER TABLE ${
|
|
450
|
-
RENAME CONSTRAINT ${
|
|
451
|
-
TO ${
|
|
448
|
+
chunk2ZWM2RFH_cjs.sql`
|
|
449
|
+
ALTER TABLE ${chunk2ZWM2RFH_cjs.sql.identifier(finalTable)}
|
|
450
|
+
RENAME CONSTRAINT ${chunk2ZWM2RFH_cjs.sql.identifier(`${temporaryTable}_pkey`)}
|
|
451
|
+
TO ${chunk2ZWM2RFH_cjs.sql.identifier(shortenedIdentifier(`${finalTable}_pkey`))}
|
|
452
452
|
`
|
|
453
453
|
);
|
|
454
454
|
}
|
|
455
455
|
function requireCreateTable(statements) {
|
|
456
456
|
const statement = statements[0];
|
|
457
457
|
if (statement === void 0) {
|
|
458
|
-
throw new
|
|
458
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError("Recorded migration table DDL was empty.");
|
|
459
459
|
}
|
|
460
460
|
return statement;
|
|
461
461
|
}
|
|
@@ -463,10 +463,10 @@ async function renameTable(target, from, to) {
|
|
|
463
463
|
try {
|
|
464
464
|
await executeStatement(
|
|
465
465
|
target,
|
|
466
|
-
|
|
466
|
+
chunk2ZWM2RFH_cjs.sql`ALTER TABLE ${chunk2ZWM2RFH_cjs.sql.identifier(from)} RENAME TO ${chunk2ZWM2RFH_cjs.sql.identifier(to)}`
|
|
467
467
|
);
|
|
468
468
|
} catch (error) {
|
|
469
|
-
throw new
|
|
469
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
470
470
|
"Could not rename a migrated recorded-time table.",
|
|
471
471
|
{ from, to },
|
|
472
472
|
{ cause: error }
|
|
@@ -497,9 +497,9 @@ async function migrateLegacyRecordedTime(options) {
|
|
|
497
497
|
};
|
|
498
498
|
}
|
|
499
499
|
const rows = await target.execute(
|
|
500
|
-
|
|
500
|
+
chunk2ZWM2RFH_cjs.asCompiledRowsSql(chunk2ZWM2RFH_cjs.sql`
|
|
501
501
|
SELECT COUNT(*) AS anchors, COUNT(DISTINCT graph_id) AS graphs
|
|
502
|
-
FROM ${
|
|
502
|
+
FROM ${chunk2ZWM2RFH_cjs.sql.identifier(mapTable)}
|
|
503
503
|
`)
|
|
504
504
|
);
|
|
505
505
|
const anchors = Number(rows[0]?.anchors ?? 0);
|
|
@@ -514,7 +514,7 @@ async function migrateLegacyRecordedTime(options) {
|
|
|
514
514
|
const nodeColumns = await columnNames(target, tables.recordedNodes);
|
|
515
515
|
const edgeColumns = await columnNames(target, tables.recordedEdges);
|
|
516
516
|
if (!nodeColumns.has("recorded_from") || !edgeColumns.has("recorded_from")) {
|
|
517
|
-
throw new
|
|
517
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
518
518
|
"Legacy recorded-time schema is incomplete.",
|
|
519
519
|
{ tables }
|
|
520
520
|
);
|
|
@@ -533,24 +533,24 @@ async function migrateLegacyRecordedTime(options) {
|
|
|
533
533
|
}
|
|
534
534
|
async function migrateRecordedAnchor(options) {
|
|
535
535
|
try {
|
|
536
|
-
return
|
|
536
|
+
return chunk5PDSCELM_cjs.asRecordedInstant(options.anchor);
|
|
537
537
|
} catch (error) {
|
|
538
|
-
if (!(error instanceof
|
|
538
|
+
if (!(error instanceof chunkKCH7WQA5_cjs.ValidationError)) throw error;
|
|
539
539
|
}
|
|
540
540
|
const legacyRecordedAt = canonicalLegacyInstant(options.anchor);
|
|
541
541
|
const tables = resolvedTableNames(options.backend, options.tableNames);
|
|
542
542
|
const mapTable = mappingTableName(tables, options.mappingTableName);
|
|
543
543
|
const rows = await options.backend.execute(
|
|
544
|
-
|
|
544
|
+
chunk2ZWM2RFH_cjs.asCompiledRowsSql(chunk2ZWM2RFH_cjs.sql`
|
|
545
545
|
SELECT revision, recorded_at
|
|
546
|
-
FROM ${
|
|
546
|
+
FROM ${chunk2ZWM2RFH_cjs.sql.identifier(mapTable)}
|
|
547
547
|
WHERE graph_id = ${options.graphId}
|
|
548
548
|
AND legacy_recorded_at = ${legacyRecordedAt}
|
|
549
549
|
`)
|
|
550
550
|
);
|
|
551
551
|
const row = rows[0];
|
|
552
552
|
if (row === void 0) {
|
|
553
|
-
throw new
|
|
553
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
554
554
|
"No migrated recorded anchor matches this graph and legacy timestamp.",
|
|
555
555
|
{ anchor: options.anchor, graphId: options.graphId },
|
|
556
556
|
{
|
|
@@ -558,14 +558,14 @@ async function migrateRecordedAnchor(options) {
|
|
|
558
558
|
}
|
|
559
559
|
);
|
|
560
560
|
}
|
|
561
|
-
return
|
|
561
|
+
return chunk5PDSCELM_cjs.createRecordedInstant(
|
|
562
562
|
safeRevision(row.revision),
|
|
563
563
|
canonicalLegacyInstant(row.recorded_at)
|
|
564
564
|
);
|
|
565
565
|
}
|
|
566
566
|
async function deleteLegacyRecordedAnchorMap(options) {
|
|
567
567
|
if (options.backend.executeStatement === void 0) {
|
|
568
|
-
throw new
|
|
568
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
569
569
|
"Deleting a recorded anchor migration map requires executeStatement support.",
|
|
570
570
|
{ dialect: options.backend.dialect }
|
|
571
571
|
);
|
|
@@ -575,23 +575,23 @@ async function deleteLegacyRecordedAnchorMap(options) {
|
|
|
575
575
|
await options.backend.transaction(async (target) => {
|
|
576
576
|
await executeStatement(
|
|
577
577
|
target,
|
|
578
|
-
|
|
579
|
-
DELETE FROM ${
|
|
578
|
+
chunk2ZWM2RFH_cjs.sql`
|
|
579
|
+
DELETE FROM ${chunk2ZWM2RFH_cjs.sql.identifier(mapTable)}
|
|
580
580
|
WHERE graph_id = ${options.graphId}
|
|
581
581
|
`
|
|
582
582
|
);
|
|
583
583
|
if (options.dropWhenEmpty !== true) return;
|
|
584
584
|
const rows = await target.execute(
|
|
585
|
-
|
|
585
|
+
chunk2ZWM2RFH_cjs.asCompiledRowsSql(chunk2ZWM2RFH_cjs.sql`
|
|
586
586
|
SELECT COUNT(*) AS anchors, COUNT(DISTINCT graph_id) AS graphs
|
|
587
|
-
FROM ${
|
|
587
|
+
FROM ${chunk2ZWM2RFH_cjs.sql.identifier(mapTable)}
|
|
588
588
|
`)
|
|
589
589
|
);
|
|
590
590
|
const remaining = missingMappingCount(rows[0]?.anchors, mapTable);
|
|
591
591
|
if (remaining === 0) {
|
|
592
592
|
await executeStatement(
|
|
593
593
|
target,
|
|
594
|
-
|
|
594
|
+
chunk2ZWM2RFH_cjs.sql`DROP TABLE ${chunk2ZWM2RFH_cjs.sql.identifier(mapTable)}`
|
|
595
595
|
);
|
|
596
596
|
}
|
|
597
597
|
});
|
|
@@ -600,5 +600,5 @@ async function deleteLegacyRecordedAnchorMap(options) {
|
|
|
600
600
|
exports.deleteLegacyRecordedAnchorMap = deleteLegacyRecordedAnchorMap;
|
|
601
601
|
exports.migrateLegacyRecordedTime = migrateLegacyRecordedTime;
|
|
602
602
|
exports.migrateRecordedAnchor = migrateRecordedAnchor;
|
|
603
|
-
//# sourceMappingURL=chunk-
|
|
604
|
-
//# sourceMappingURL=chunk-
|
|
603
|
+
//# sourceMappingURL=chunk-N3QTGPC7.cjs.map
|
|
604
|
+
//# sourceMappingURL=chunk-N3QTGPC7.cjs.map
|