@nicia-ai/typegraph 0.46.2 → 0.48.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 +20 -1
- 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 +58 -49
- package/dist/backend/index.d.cts +37 -55
- package/dist/backend/index.d.ts +37 -55
- package/dist/backend/index.js +11 -10
- package/dist/backend/postgres/index.cjs +27 -26
- package/dist/backend/postgres/index.d.cts +21 -7
- package/dist/backend/postgres/index.d.ts +21 -7
- package/dist/backend/postgres/index.js +14 -13
- package/dist/backend/postgres/pglite-store.cjs +34 -33
- package/dist/backend/postgres/pglite-store.cjs.map +1 -1
- 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 +30 -29
- package/dist/backend/postgres/pglite-store.js.map +1 -1
- package/dist/backend/postgres/pglite.cjs +16 -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 +15 -14
- package/dist/backend/sqlite/index.cjs +24 -23
- package/dist/backend/sqlite/index.d.cts +20 -7
- package/dist/backend/sqlite/index.d.ts +20 -7
- package/dist/backend/sqlite/index.js +12 -11
- package/dist/backend/sqlite/libsql.cjs +19 -18
- package/dist/backend/sqlite/libsql.cjs.map +1 -1
- package/dist/backend/sqlite/libsql.d.cts +3 -3
- package/dist/backend/sqlite/libsql.d.ts +3 -3
- package/dist/backend/sqlite/libsql.js +14 -13
- package/dist/backend/sqlite/libsql.js.map +1 -1
- package/dist/backend/sqlite/local-store.cjs +35 -34
- package/dist/backend/sqlite/local-store.cjs.map +1 -1
- 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 +31 -30
- package/dist/backend/sqlite/local-store.js.map +1 -1
- package/dist/backend/sqlite/local.cjs +17 -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 +15 -14
- package/dist/{chunk-TCT66A7N.cjs → chunk-26YKDNUD.cjs} +10 -10
- package/dist/{chunk-TCT66A7N.cjs.map → chunk-26YKDNUD.cjs.map} +1 -1
- package/dist/{chunk-E4OSGBCM.cjs → chunk-2HIYYMWY.cjs} +139 -136
- package/dist/chunk-2HIYYMWY.cjs.map +1 -0
- package/dist/chunk-2QGYQBS2.cjs +161 -0
- package/dist/chunk-2QGYQBS2.cjs.map +1 -0
- package/dist/{chunk-GWXXHOLU.js → chunk-2SYZXD54.js} +21 -18
- package/dist/chunk-2SYZXD54.js.map +1 -0
- package/dist/{chunk-KA4L2NZ3.js → chunk-2TYSSBU5.js} +14 -14
- package/dist/{chunk-KA4L2NZ3.js.map → chunk-2TYSSBU5.js.map} +1 -1
- package/dist/{chunk-QOJ2L2AD.js → chunk-3DMMGT6S.js} +3 -3
- package/dist/{chunk-QOJ2L2AD.js.map → chunk-3DMMGT6S.js.map} +1 -1
- package/dist/{chunk-F36KZDFX.cjs → chunk-3FPR224C.cjs} +91 -91
- package/dist/{chunk-F36KZDFX.cjs.map → chunk-3FPR224C.cjs.map} +1 -1
- package/dist/{chunk-32UETY6S.cjs → chunk-3KOY4FH3.cjs} +207 -28
- package/dist/chunk-3KOY4FH3.cjs.map +1 -0
- package/dist/{chunk-QU7QLJA4.cjs → chunk-3U5ABFDW.cjs} +26 -26
- package/dist/{chunk-QU7QLJA4.cjs.map → chunk-3U5ABFDW.cjs.map} +1 -1
- package/dist/{chunk-RFDEYLIK.js → chunk-4WMMBDS5.js} +7 -7
- package/dist/chunk-4WMMBDS5.js.map +1 -0
- package/dist/{chunk-R7EWHKID.js → chunk-5K2BKEBD.js} +19 -145
- package/dist/chunk-5K2BKEBD.js.map +1 -0
- package/dist/chunk-5PRKMB24.cjs +124 -0
- package/dist/chunk-5PRKMB24.cjs.map +1 -0
- package/dist/chunk-6LN7FIVU.js +107 -0
- package/dist/chunk-6LN7FIVU.js.map +1 -0
- package/dist/{chunk-D6GCNNMK.cjs → chunk-6NGW27EO.cjs} +10 -10
- package/dist/{chunk-D6GCNNMK.cjs.map → chunk-6NGW27EO.cjs.map} +1 -1
- package/dist/{chunk-WHS2Y43J.js → chunk-6SWPJEYN.js} +5 -5
- package/dist/{chunk-WHS2Y43J.js.map → chunk-6SWPJEYN.js.map} +1 -1
- package/dist/{chunk-7TKNK32B.js → chunk-7SQSZN2J.js} +5 -5
- package/dist/{chunk-7TKNK32B.js.map → chunk-7SQSZN2J.js.map} +1 -1
- package/dist/{chunk-UTVQPZPN.cjs → chunk-7XUYFFR4.cjs} +20 -20
- package/dist/chunk-7XUYFFR4.cjs.map +1 -0
- package/dist/{chunk-KXSMF6PL.js → chunk-ACGSAMD3.js} +39 -34
- package/dist/chunk-ACGSAMD3.js.map +1 -0
- package/dist/{chunk-PYKF7UIL.cjs → chunk-AOSSQDVO.cjs} +13 -13
- package/dist/{chunk-PYKF7UIL.cjs.map → chunk-AOSSQDVO.cjs.map} +1 -1
- package/dist/{chunk-AT3MLMJV.js → chunk-AX6JGVTZ.js} +91 -20
- package/dist/chunk-AX6JGVTZ.js.map +1 -0
- package/dist/{chunk-WA64ZSCA.cjs → chunk-BFUOME67.cjs} +11 -11
- package/dist/{chunk-WA64ZSCA.cjs.map → chunk-BFUOME67.cjs.map} +1 -1
- package/dist/{chunk-YQ4JONWE.js → chunk-BRRP76WO.js} +401 -131
- package/dist/chunk-BRRP76WO.js.map +1 -0
- package/dist/{chunk-FCIZNUW5.js → chunk-CHAOFCHV.js} +3 -3
- package/dist/{chunk-FCIZNUW5.js.map → chunk-CHAOFCHV.js.map} +1 -1
- package/dist/chunk-CICO5GXD.cjs +12 -0
- package/dist/{chunk-73MWKDFK.cjs.map → chunk-CICO5GXD.cjs.map} +1 -1
- package/dist/{chunk-S3G5VLSW.js → chunk-CT3ZKTOF.js} +7 -6
- package/dist/chunk-CT3ZKTOF.js.map +1 -0
- package/dist/{chunk-SXWLLQ3D.js → chunk-D5R42W5D.js} +4 -4
- package/dist/{chunk-SXWLLQ3D.js.map → chunk-D5R42W5D.js.map} +1 -1
- package/dist/{chunk-BZZI7B43.cjs → chunk-DO7SAMEK.cjs} +47 -47
- package/dist/{chunk-BZZI7B43.cjs.map → chunk-DO7SAMEK.cjs.map} +1 -1
- package/dist/chunk-DZAICA5J.js +147 -0
- package/dist/chunk-DZAICA5J.js.map +1 -0
- package/dist/{chunk-2ZWM2RFH.cjs → chunk-EDN4Y4ZG.cjs} +9 -9
- package/dist/{chunk-2ZWM2RFH.cjs.map → chunk-EDN4Y4ZG.cjs.map} +1 -1
- package/dist/{chunk-A4R3H7RU.cjs → chunk-EZEEWCFJ.cjs} +264 -361
- package/dist/chunk-EZEEWCFJ.cjs.map +1 -0
- package/dist/{chunk-BEB4OFZF.cjs → chunk-FA2AFWLP.cjs} +51 -59
- package/dist/chunk-FA2AFWLP.cjs.map +1 -0
- package/dist/{chunk-ZBVZ7HXD.cjs → chunk-FQPEMEWX.cjs} +12 -12
- package/dist/{chunk-ZBVZ7HXD.cjs.map → chunk-FQPEMEWX.cjs.map} +1 -1
- package/dist/{chunk-LNIWCQR4.js → chunk-GLHXM7C4.js} +3 -3
- package/dist/{chunk-LNIWCQR4.js.map → chunk-GLHXM7C4.js.map} +1 -1
- package/dist/{chunk-6BD6ZBKT.cjs → chunk-GYEG3ZLZ.cjs} +10 -10
- package/dist/{chunk-6BD6ZBKT.cjs.map → chunk-GYEG3ZLZ.cjs.map} +1 -1
- package/dist/{chunk-A7NMUYEL.cjs → chunk-HDL2ARHX.cjs} +27 -27
- package/dist/{chunk-A7NMUYEL.cjs.map → chunk-HDL2ARHX.cjs.map} +1 -1
- package/dist/{chunk-5ZJOB5YS.js → chunk-HEV35TGT.js} +4 -4
- package/dist/{chunk-5ZJOB5YS.js.map → chunk-HEV35TGT.js.map} +1 -1
- package/dist/{chunk-LHYSY6SE.js → chunk-I4GAZH5Z.js} +186 -9
- package/dist/chunk-I4GAZH5Z.js.map +1 -0
- package/dist/{chunk-BQM5P2NO.cjs → chunk-JB6T4GLL.cjs} +260 -223
- package/dist/chunk-JB6T4GLL.cjs.map +1 -0
- package/dist/{chunk-QPOQX2DI.cjs → chunk-JFRT7S3B.cjs} +1026 -369
- package/dist/chunk-JFRT7S3B.cjs.map +1 -0
- package/dist/{chunk-JCNTKRAK.js → chunk-JONXFAPO.js} +5 -5
- package/dist/{chunk-JCNTKRAK.js.map → chunk-JONXFAPO.js.map} +1 -1
- package/dist/{chunk-WEJHA7AD.js → chunk-KF6K7TGH.js} +109 -75
- package/dist/chunk-KF6K7TGH.js.map +1 -0
- package/dist/{chunk-EDJDDY6H.js → chunk-KKBDXCLQ.js} +4 -4
- package/dist/{chunk-EDJDDY6H.js.map → chunk-KKBDXCLQ.js.map} +1 -1
- package/dist/{chunk-ZHOAZD7Q.cjs → chunk-L3LQNR34.cjs} +161 -161
- package/dist/{chunk-ZHOAZD7Q.cjs.map → chunk-L3LQNR34.cjs.map} +1 -1
- package/dist/{chunk-AF3TWL5C.cjs → chunk-LRQKXRXO.cjs} +4 -4
- package/dist/{chunk-AF3TWL5C.cjs.map → chunk-LRQKXRXO.cjs.map} +1 -1
- package/dist/chunk-MKJ4KXL5.cjs +12 -0
- package/dist/{chunk-6LAXM4J2.cjs.map → chunk-MKJ4KXL5.cjs.map} +1 -1
- package/dist/{chunk-KCH7WQA5.cjs → chunk-MRDBBHIZ.cjs} +48 -2
- package/dist/chunk-MRDBBHIZ.cjs.map +1 -0
- package/dist/{chunk-FXNHZFZV.js → chunk-MYKHJI2J.js} +3 -3
- package/dist/{chunk-FXNHZFZV.js.map → chunk-MYKHJI2J.js.map} +1 -1
- package/dist/{chunk-Z43KWLZF.js → chunk-NACVVDWB.js} +213 -12
- package/dist/chunk-NACVVDWB.js.map +1 -0
- package/dist/{chunk-72WUT4GG.js → chunk-NVY5CJFP.js} +4 -4
- package/dist/{chunk-72WUT4GG.js.map → chunk-NVY5CJFP.js.map} +1 -1
- package/dist/{chunk-WYFB7BN3.js → chunk-OD4SSY2U.js} +166 -48
- package/dist/chunk-OD4SSY2U.js.map +1 -0
- package/dist/{chunk-ZIH42CRX.cjs → chunk-OI2GQ25X.cjs} +7 -7
- package/dist/{chunk-ZIH42CRX.cjs.map → chunk-OI2GQ25X.cjs.map} +1 -1
- package/dist/{chunk-AU3IJNNP.js → chunk-OMZ37BM2.js} +5 -5
- package/dist/{chunk-AU3IJNNP.js.map → chunk-OMZ37BM2.js.map} +1 -1
- package/dist/{chunk-C4DYN2SD.cjs → chunk-OORXGFL5.cjs} +48 -48
- package/dist/{chunk-C4DYN2SD.cjs.map → chunk-OORXGFL5.cjs.map} +1 -1
- package/dist/{chunk-HNYLMPQQ.cjs → chunk-OTUPEF2W.cjs} +149 -78
- package/dist/chunk-OTUPEF2W.cjs.map +1 -0
- package/dist/{chunk-BRN3RGD2.js → chunk-OVI7IXYX.js} +3 -3
- package/dist/{chunk-BRN3RGD2.js.map → chunk-OVI7IXYX.js.map} +1 -1
- package/dist/{chunk-WMKEGJG4.js → chunk-P6YLZTRE.js} +3 -3
- package/dist/{chunk-WMKEGJG4.js.map → chunk-P6YLZTRE.js.map} +1 -1
- package/dist/{chunk-C2ZP5YS6.cjs → chunk-PFBRJBUL.cjs} +278 -160
- package/dist/chunk-PFBRJBUL.cjs.map +1 -0
- package/dist/{chunk-EJSYWAEV.js → chunk-QTD6HX4O.js} +5 -5
- package/dist/{chunk-EJSYWAEV.js.map → chunk-QTD6HX4O.js.map} +1 -1
- package/dist/{chunk-JL5UEBWT.cjs → chunk-ROR5ZR6A.cjs} +45 -45
- package/dist/{chunk-JL5UEBWT.cjs.map → chunk-ROR5ZR6A.cjs.map} +1 -1
- package/dist/{chunk-EDHV4CBU.js → chunk-S5TERQVW.js} +37 -134
- package/dist/chunk-S5TERQVW.js.map +1 -0
- package/dist/{chunk-FSLTU57P.js → chunk-SDBBMD4N.js} +3 -3
- package/dist/{chunk-FSLTU57P.js.map → chunk-SDBBMD4N.js.map} +1 -1
- package/dist/{chunk-36LIJXWC.js → chunk-SHFBB23Q.js} +4 -4
- package/dist/{chunk-36LIJXWC.js.map → chunk-SHFBB23Q.js.map} +1 -1
- package/dist/chunk-SIT26LAZ.cjs +614 -0
- package/dist/chunk-SIT26LAZ.cjs.map +1 -0
- package/dist/{chunk-C6KE2HSQ.cjs → chunk-SR725PWF.cjs} +1662 -1392
- package/dist/chunk-SR725PWF.cjs.map +1 -0
- package/dist/{chunk-S7WIRFNS.cjs → chunk-TKZXMWQF.cjs} +13 -12
- package/dist/chunk-TKZXMWQF.cjs.map +1 -0
- package/dist/{chunk-5PDSCELM.cjs → chunk-TQHGE7UC.cjs} +29 -164
- package/dist/chunk-TQHGE7UC.cjs.map +1 -0
- package/dist/{chunk-XBHRKLZU.cjs → chunk-TUNPBZY3.cjs} +4 -4
- package/dist/{chunk-XBHRKLZU.cjs.map → chunk-TUNPBZY3.cjs.map} +1 -1
- package/dist/{chunk-KOAI3KIV.cjs → chunk-TZEGUG6D.cjs} +4 -4
- package/dist/{chunk-KOAI3KIV.cjs.map → chunk-TZEGUG6D.cjs.map} +1 -1
- package/dist/chunk-UGHG7PGX.js +592 -0
- package/dist/chunk-UGHG7PGX.js.map +1 -0
- package/dist/{chunk-N3QTGPC7.cjs → chunk-UMGZDVOA.cjs} +303 -101
- package/dist/chunk-UMGZDVOA.cjs.map +1 -0
- package/dist/{chunk-RHDOAQCT.cjs → chunk-WCCATHMB.cjs} +140 -135
- package/dist/chunk-WCCATHMB.cjs.map +1 -0
- package/dist/{chunk-DYPRZ53S.cjs → chunk-WODMN3Q2.cjs} +27 -27
- package/dist/{chunk-DYPRZ53S.cjs.map → chunk-WODMN3Q2.cjs.map} +1 -1
- package/dist/{chunk-OZJCH7ZS.js → chunk-XVWOYKIK.js} +3 -3
- package/dist/{chunk-OZJCH7ZS.js.map → chunk-XVWOYKIK.js.map} +1 -1
- package/dist/{chunk-IHRDX7K6.js → chunk-YIURNGXI.js} +46 -56
- package/dist/chunk-YIURNGXI.js.map +1 -0
- package/dist/{chunk-GWUWRZXW.js → chunk-YVF2EM7B.js} +3 -3
- package/dist/{chunk-GWUWRZXW.js.map → chunk-YVF2EM7B.js.map} +1 -1
- package/dist/{chunk-EAMVXR5B.js → chunk-ZDKTPBGV.js} +4 -4
- package/dist/{chunk-EAMVXR5B.js.map → chunk-ZDKTPBGV.js.map} +1 -1
- package/dist/{chunk-A2LJG5GM.js → chunk-ZFMCDJGB.js} +803 -148
- package/dist/chunk-ZFMCDJGB.js.map +1 -0
- package/dist/{chunk-62ZXBMSD.js → chunk-ZLONH2UD.js} +46 -3
- package/dist/chunk-ZLONH2UD.js.map +1 -0
- package/dist/core/index.cjs +28 -27
- package/dist/core/index.d.cts +4 -4
- package/dist/core/index.d.ts +4 -4
- package/dist/core/index.js +8 -7
- package/dist/ddl-BL1NZLMY.d.cts +78 -0
- package/dist/ddl-D_oW-EVO.d.ts +78 -0
- 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 +3418 -706
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +550 -58
- package/dist/graph-merge/index.d.ts +550 -58
- package/dist/graph-merge/index.js +3191 -497
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/{index-Deyu8IXL.d.ts → index-COs_z6nV.d.cts} +47 -3
- package/dist/{index-DrRS51Ld.d.cts → index-D7d1u2gr.d.ts} +47 -3
- package/dist/index.cjs +233 -216
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -12
- package/dist/index.d.ts +12 -12
- package/dist/index.js +35 -34
- package/dist/index.js.map +1 -1
- 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 +53 -52
- package/dist/interchange/index.cjs.map +1 -1
- package/dist/interchange/index.d.cts +17 -13
- package/dist/interchange/index.d.ts +17 -13
- package/dist/interchange/index.js +17 -16
- package/dist/interchange/index.js.map +1 -1
- package/dist/{manager-ptr3JLRP.d.cts → manager-CYaff3n3.d.cts} +2 -2
- package/dist/{manager-DX983gJ0.d.ts → manager-D9eRT_ns.d.ts} +2 -2
- package/dist/{materialize-indexes-CpXoggWU.d.ts → materialize-indexes-DJ3ykH59.d.ts} +1 -1
- package/dist/{materialize-indexes-BXz77YqO.d.cts → materialize-indexes-DTtAnvfY.d.cts} +1 -1
- package/dist/{postgres-DwgEXSPI.d.cts → postgres-CcL4bAHS.d.ts} +1 -1
- package/dist/{postgres-QdOMHTBz.d.ts → postgres-DMj39MEu.d.cts} +1 -1
- package/dist/profiler/index.d.cts +9 -9
- package/dist/profiler/index.d.ts +9 -9
- package/dist/provenance/index.cjs +46 -46
- package/dist/provenance/index.cjs.map +1 -1
- package/dist/provenance/index.d.cts +7 -7
- package/dist/provenance/index.d.ts +7 -7
- package/dist/provenance/index.js +13 -13
- package/dist/provenance/index.js.map +1 -1
- package/dist/repair-validity-windows-BFNZvd_H.d.cts +166 -0
- package/dist/repair-validity-windows-DlUSqwCg.d.ts +166 -0
- package/dist/schema/index.cjs +45 -44
- package/dist/schema/index.d.cts +6 -6
- package/dist/schema/index.d.ts +6 -6
- package/dist/schema/index.js +18 -17
- package/dist/{searchable-BOUuA83f.d.ts → searchable-DHJMh_nj.d.cts} +1 -1
- package/dist/{searchable-BrUh0pdc.d.cts → searchable-bpE1bBfc.d.ts} +1 -1
- package/dist/{sqlite-BfYcV61E.d.cts → sqlite-D7Oz0SQh.d.ts} +1 -1
- package/dist/{sqlite-DK40XVR1.d.ts → sqlite-YppHrNFb.d.cts} +1 -1
- package/dist/{store-FTqBpuJD.d.cts → store-JUVvtmR4.d.cts} +228 -92
- package/dist/{store-Bo1psfVZ.d.ts → store-UzrGvZOo.d.ts} +228 -92
- package/dist/{temporal-DPtn0HOu.d.ts → temporal-5GqpYCk2.d.cts} +1 -1
- package/dist/{temporal-CXewwLTB.d.cts → temporal-CbnLzTmM.d.ts} +1 -1
- package/dist/{types-Du78EvpN.d.ts → types-BqFZTQmV.d.cts} +60 -9
- package/dist/{types-Du78EvpN.d.cts → types-BqFZTQmV.d.ts} +60 -9
- package/dist/{types-CeT7xM4M.d.ts → types-Bx74kaTt.d.ts} +1 -1
- package/dist/{types-XR1nHERK.d.cts → types-CXAhpW-c.d.cts} +1 -1
- package/dist/{where-CJsp-YUf.d.cts → where-DI_Fqz-X.d.cts} +1 -1
- package/dist/{where-CMbFiWwp.d.ts → where-O-k2wgYm.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-32UETY6S.cjs.map +0 -1
- package/dist/chunk-5PDSCELM.cjs.map +0 -1
- package/dist/chunk-62ZXBMSD.js.map +0 -1
- package/dist/chunk-6LAXM4J2.cjs +0 -12
- package/dist/chunk-73MWKDFK.cjs +0 -12
- package/dist/chunk-A2LJG5GM.js.map +0 -1
- package/dist/chunk-A4R3H7RU.cjs.map +0 -1
- package/dist/chunk-ANKOXPCC.cjs +0 -267
- package/dist/chunk-ANKOXPCC.cjs.map +0 -1
- package/dist/chunk-AT3MLMJV.js.map +0 -1
- package/dist/chunk-BEB4OFZF.cjs.map +0 -1
- package/dist/chunk-BQM5P2NO.cjs.map +0 -1
- package/dist/chunk-C2ZP5YS6.cjs.map +0 -1
- package/dist/chunk-C6KE2HSQ.cjs.map +0 -1
- package/dist/chunk-DSAWGCMP.js +0 -254
- package/dist/chunk-DSAWGCMP.js.map +0 -1
- package/dist/chunk-E4OSGBCM.cjs.map +0 -1
- package/dist/chunk-EDHV4CBU.js.map +0 -1
- package/dist/chunk-FA6Z7B5L.js +0 -244
- package/dist/chunk-FA6Z7B5L.js.map +0 -1
- package/dist/chunk-GVAMRRZR.cjs +0 -268
- package/dist/chunk-GVAMRRZR.cjs.map +0 -1
- package/dist/chunk-GWXXHOLU.js.map +0 -1
- package/dist/chunk-HNYLMPQQ.cjs.map +0 -1
- package/dist/chunk-IHRDX7K6.js.map +0 -1
- package/dist/chunk-KCH7WQA5.cjs.map +0 -1
- package/dist/chunk-KXSMF6PL.js.map +0 -1
- package/dist/chunk-LHYSY6SE.js.map +0 -1
- package/dist/chunk-N3QTGPC7.cjs.map +0 -1
- package/dist/chunk-QPOQX2DI.cjs.map +0 -1
- package/dist/chunk-R7EWHKID.js.map +0 -1
- package/dist/chunk-RFDEYLIK.js.map +0 -1
- package/dist/chunk-RHDOAQCT.cjs.map +0 -1
- package/dist/chunk-S3G5VLSW.js.map +0 -1
- package/dist/chunk-S7WIRFNS.cjs.map +0 -1
- package/dist/chunk-UTVQPZPN.cjs.map +0 -1
- package/dist/chunk-WEJHA7AD.js.map +0 -1
- package/dist/chunk-WYFB7BN3.js.map +0 -1
- package/dist/chunk-YQ4JONWE.js.map +0 -1
- package/dist/chunk-Z43KWLZF.js.map +0 -1
- package/dist/ddl-mE07h_EM.d.cts +0 -38
- package/dist/ddl-opIn8DfX.d.ts +0 -38
|
@@ -1,11 +1,27 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
3
|
+
var chunkHDL2ARHX_cjs = require('./chunk-HDL2ARHX.cjs');
|
|
4
|
+
var chunk3U5ABFDW_cjs = require('./chunk-3U5ABFDW.cjs');
|
|
5
|
+
var chunk5PRKMB24_cjs = require('./chunk-5PRKMB24.cjs');
|
|
6
|
+
var chunk2QGYQBS2_cjs = require('./chunk-2QGYQBS2.cjs');
|
|
7
|
+
var chunkTQHGE7UC_cjs = require('./chunk-TQHGE7UC.cjs');
|
|
8
|
+
var chunkL3LQNR34_cjs = require('./chunk-L3LQNR34.cjs');
|
|
9
|
+
var chunkEDN4Y4ZG_cjs = require('./chunk-EDN4Y4ZG.cjs');
|
|
10
|
+
var chunkMRDBBHIZ_cjs = require('./chunk-MRDBBHIZ.cjs');
|
|
11
|
+
|
|
12
|
+
// src/backend/table-names.ts
|
|
13
|
+
function definedTableNameOverrides(override) {
|
|
14
|
+
if (override === void 0) return {};
|
|
15
|
+
return Object.fromEntries(
|
|
16
|
+
Object.entries(override).filter(([, tableName]) => tableName !== void 0)
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
function resolvedTableNames(backend, override) {
|
|
20
|
+
return chunk3U5ABFDW_cjs.createSqlSchema({
|
|
21
|
+
...backend.tableNames,
|
|
22
|
+
...definedTableNameOverrides(override)
|
|
23
|
+
}).tables;
|
|
24
|
+
}
|
|
9
25
|
|
|
10
26
|
// src/backend/migrate-recorded-time.ts
|
|
11
27
|
var LEGACY_RECORDED_MAX = "9999-12-31T23:59:59.999Z";
|
|
@@ -51,25 +67,22 @@ var RECORDED_EDGE_COLUMNS = [
|
|
|
51
67
|
"tx_id",
|
|
52
68
|
"meta"
|
|
53
69
|
];
|
|
54
|
-
function resolvedTableNames(backend, override) {
|
|
55
|
-
return chunkQU7QLJA4_cjs.createSqlSchema(override ?? backend.tableNames ?? {}).tables;
|
|
56
|
-
}
|
|
57
70
|
function shortenedIdentifier(value) {
|
|
58
71
|
if (value.length <= 63) return value;
|
|
59
|
-
return `${value.slice(0, 50)}_${
|
|
72
|
+
return `${value.slice(0, 50)}_${chunkL3LQNR34_cjs.shortHash(value)}`;
|
|
60
73
|
}
|
|
61
74
|
function mappingTableName(tables, override) {
|
|
62
75
|
const candidate = override ?? `${tables.recordedClock}_${MIGRATION_SUFFIX}`;
|
|
63
|
-
return
|
|
76
|
+
return chunk3U5ABFDW_cjs.createSqlSchema({
|
|
64
77
|
recordedClock: shortenedIdentifier(candidate)
|
|
65
78
|
}).tables.recordedClock;
|
|
66
79
|
}
|
|
67
80
|
function temporaryTableName(tableName, role) {
|
|
68
|
-
return shortenedIdentifier(`__tg_${role}_${
|
|
81
|
+
return shortenedIdentifier(`__tg_${role}_${chunkL3LQNR34_cjs.shortHash(tableName)}`);
|
|
69
82
|
}
|
|
70
83
|
function requireStatements(target) {
|
|
71
84
|
if (target.executeStatement === void 0) {
|
|
72
|
-
throw new
|
|
85
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
73
86
|
"Recorded-time migration requires executeStatement support.",
|
|
74
87
|
{ dialect: target.dialect },
|
|
75
88
|
{ suggestion: "Use a built-in SQLite or PostgreSQL backend." }
|
|
@@ -78,15 +91,15 @@ function requireStatements(target) {
|
|
|
78
91
|
return target.executeStatement;
|
|
79
92
|
}
|
|
80
93
|
async function executeStatement(target, statement) {
|
|
81
|
-
await requireStatements(target)(
|
|
94
|
+
await requireStatements(target)(chunkEDN4Y4ZG_cjs.asCompiledStatementSql(statement));
|
|
82
95
|
}
|
|
83
96
|
async function executeDdl(target, ddl) {
|
|
84
|
-
await executeStatement(target,
|
|
97
|
+
await executeStatement(target, chunkEDN4Y4ZG_cjs.sql.raw(ddl));
|
|
85
98
|
}
|
|
86
99
|
function canonicalLegacyInstant(value) {
|
|
87
|
-
const canonical =
|
|
100
|
+
const canonical = chunkTQHGE7UC_cjs.canonicalizeDatabaseTimestamp(value);
|
|
88
101
|
if (canonical === void 0) {
|
|
89
|
-
throw new
|
|
102
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
90
103
|
"Legacy recorded-time relation contained an invalid timestamp.",
|
|
91
104
|
{ value }
|
|
92
105
|
);
|
|
@@ -95,8 +108,8 @@ function canonicalLegacyInstant(value) {
|
|
|
95
108
|
}
|
|
96
109
|
function safeRevision(value) {
|
|
97
110
|
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
|
|
111
|
+
if (typeof revision !== "number" || !Number.isSafeInteger(revision) || revision < 1 || revision >= chunk2QGYQBS2_cjs.RECORDED_MAX_REVISION) {
|
|
112
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
100
113
|
"Recorded anchor mapping contained an invalid revision.",
|
|
101
114
|
{ value }
|
|
102
115
|
);
|
|
@@ -105,9 +118,9 @@ function safeRevision(value) {
|
|
|
105
118
|
}
|
|
106
119
|
async function columnNames(target, tableName) {
|
|
107
120
|
const rows = target.dialect === "sqlite" ? await target.execute(
|
|
108
|
-
|
|
121
|
+
chunkEDN4Y4ZG_cjs.asCompiledRowsSql(chunkEDN4Y4ZG_cjs.sql`PRAGMA table_info(${chunkEDN4Y4ZG_cjs.sql.identifier(tableName)})`)
|
|
109
122
|
) : await target.execute(
|
|
110
|
-
|
|
123
|
+
chunkEDN4Y4ZG_cjs.asCompiledRowsSql(chunkEDN4Y4ZG_cjs.sql`
|
|
111
124
|
SELECT column_name AS name
|
|
112
125
|
FROM information_schema.columns
|
|
113
126
|
WHERE table_schema = current_schema()
|
|
@@ -120,28 +133,28 @@ async function columnNames(target, tableName) {
|
|
|
120
133
|
}
|
|
121
134
|
async function readLegacyInstants(target, tables) {
|
|
122
135
|
const rows = await target.execute(
|
|
123
|
-
|
|
136
|
+
chunkEDN4Y4ZG_cjs.asCompiledRowsSql(chunkEDN4Y4ZG_cjs.sql`
|
|
124
137
|
SELECT graph_id, recorded_from AS recorded_at
|
|
125
|
-
FROM ${
|
|
138
|
+
FROM ${chunkEDN4Y4ZG_cjs.sql.identifier(tables.recordedNodes)}
|
|
126
139
|
UNION
|
|
127
140
|
SELECT graph_id, recorded_to AS recorded_at
|
|
128
|
-
FROM ${
|
|
141
|
+
FROM ${chunkEDN4Y4ZG_cjs.sql.identifier(tables.recordedNodes)}
|
|
129
142
|
WHERE recorded_to <> ${LEGACY_RECORDED_MAX}
|
|
130
143
|
UNION
|
|
131
144
|
SELECT graph_id, recorded_from AS recorded_at
|
|
132
|
-
FROM ${
|
|
145
|
+
FROM ${chunkEDN4Y4ZG_cjs.sql.identifier(tables.recordedEdges)}
|
|
133
146
|
UNION
|
|
134
147
|
SELECT graph_id, recorded_to AS recorded_at
|
|
135
|
-
FROM ${
|
|
148
|
+
FROM ${chunkEDN4Y4ZG_cjs.sql.identifier(tables.recordedEdges)}
|
|
136
149
|
WHERE recorded_to <> ${LEGACY_RECORDED_MAX}
|
|
137
150
|
UNION
|
|
138
151
|
SELECT graph_id, recorded_at
|
|
139
|
-
FROM ${
|
|
152
|
+
FROM ${chunkEDN4Y4ZG_cjs.sql.identifier(tables.recordedClock)}
|
|
140
153
|
`)
|
|
141
154
|
);
|
|
142
155
|
const instants = rows.map((row) => {
|
|
143
156
|
if (typeof row.graph_id !== "string") {
|
|
144
|
-
throw new
|
|
157
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
145
158
|
"Legacy recorded-time relation contained an invalid graph id.",
|
|
146
159
|
{ graphId: row.graph_id }
|
|
147
160
|
);
|
|
@@ -192,38 +205,38 @@ function migrationMapDdl(dialect, table) {
|
|
|
192
205
|
);`;
|
|
193
206
|
}
|
|
194
207
|
async function writeMappingRows(target, tableName, rows) {
|
|
195
|
-
await executeStatement(target,
|
|
208
|
+
await executeStatement(target, chunkEDN4Y4ZG_cjs.sql`DELETE FROM ${chunkEDN4Y4ZG_cjs.sql.identifier(tableName)}`);
|
|
196
209
|
const rowsPerStatement = Math.max(
|
|
197
210
|
1,
|
|
198
211
|
Math.floor((target.capabilities.maxBindParameters ?? 900) / 4)
|
|
199
212
|
);
|
|
200
213
|
for (let start = 0; start < rows.length; start += rowsPerStatement) {
|
|
201
214
|
const values = rows.slice(start, start + rowsPerStatement).map(
|
|
202
|
-
(row) =>
|
|
215
|
+
(row) => chunkEDN4Y4ZG_cjs.sql`(${row.graphId}, ${row.legacyRecordedAt}, ${row.revision}, ${row.recordedAt})`
|
|
203
216
|
);
|
|
204
217
|
await executeStatement(
|
|
205
218
|
target,
|
|
206
|
-
|
|
207
|
-
INSERT INTO ${
|
|
219
|
+
chunkEDN4Y4ZG_cjs.sql`
|
|
220
|
+
INSERT INTO ${chunkEDN4Y4ZG_cjs.sql.identifier(tableName)}
|
|
208
221
|
(graph_id, legacy_recorded_at, revision, recorded_at)
|
|
209
|
-
VALUES ${
|
|
222
|
+
VALUES ${chunkEDN4Y4ZG_cjs.sql.join(values, chunkEDN4Y4ZG_cjs.sql`, `)}
|
|
210
223
|
`
|
|
211
224
|
);
|
|
212
225
|
}
|
|
213
226
|
}
|
|
214
227
|
function tableDdl(dialect, tables, temporary) {
|
|
215
228
|
if (dialect === "sqlite") {
|
|
216
|
-
const temporaryTables2 =
|
|
217
|
-
const finalTables2 =
|
|
218
|
-
const temporaryContributions =
|
|
219
|
-
const finalContributions =
|
|
229
|
+
const temporaryTables2 = chunkHDL2ARHX_cjs.createSqliteTables(temporary);
|
|
230
|
+
const finalTables2 = chunkHDL2ARHX_cjs.createSqliteTables(tables);
|
|
231
|
+
const temporaryContributions = chunkHDL2ARHX_cjs.sqliteContributions(temporaryTables2);
|
|
232
|
+
const finalContributions = chunkHDL2ARHX_cjs.sqliteContributions(finalTables2);
|
|
220
233
|
return ddlForRecordedTables(temporaryContributions, finalContributions);
|
|
221
234
|
}
|
|
222
|
-
const temporaryTables =
|
|
223
|
-
const finalTables =
|
|
235
|
+
const temporaryTables = chunkHDL2ARHX_cjs.createPostgresTables(temporary);
|
|
236
|
+
const finalTables = chunkHDL2ARHX_cjs.createPostgresTables(tables);
|
|
224
237
|
return ddlForRecordedTables(
|
|
225
|
-
|
|
226
|
-
|
|
238
|
+
chunkHDL2ARHX_cjs.postgresContributions(temporaryTables),
|
|
239
|
+
chunkHDL2ARHX_cjs.postgresContributions(finalTables)
|
|
227
240
|
);
|
|
228
241
|
}
|
|
229
242
|
function ddlForRecordedTables(temporary, final) {
|
|
@@ -235,13 +248,13 @@ function ddlForRecordedTables(temporary, final) {
|
|
|
235
248
|
(entry) => entry.logicalName === logicalName
|
|
236
249
|
)?.createDdl;
|
|
237
250
|
if (temporaryDdl === void 0 || finalDdl === void 0) {
|
|
238
|
-
throw new
|
|
251
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
239
252
|
`Could not generate migration DDL for ${logicalName}.`
|
|
240
253
|
);
|
|
241
254
|
}
|
|
242
255
|
const createTable = temporaryDdl[0];
|
|
243
256
|
if (createTable === void 0) {
|
|
244
|
-
throw new
|
|
257
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
245
258
|
`Could not generate migration table DDL for ${logicalName}.`
|
|
246
259
|
);
|
|
247
260
|
}
|
|
@@ -254,27 +267,27 @@ function ddlForRecordedTables(temporary, final) {
|
|
|
254
267
|
};
|
|
255
268
|
}
|
|
256
269
|
function migratedColumn(column, legacyAlias) {
|
|
257
|
-
if (column === "recorded_from") return
|
|
270
|
+
if (column === "recorded_from") return chunkEDN4Y4ZG_cjs.sql`from_map.revision`;
|
|
258
271
|
if (column === "recorded_to") {
|
|
259
|
-
return
|
|
272
|
+
return chunkEDN4Y4ZG_cjs.sql`
|
|
260
273
|
CASE
|
|
261
|
-
WHEN ${
|
|
262
|
-
THEN ${
|
|
274
|
+
WHEN ${chunkEDN4Y4ZG_cjs.sql.raw(legacyAlias)}.recorded_to = ${LEGACY_RECORDED_MAX}
|
|
275
|
+
THEN ${chunk2QGYQBS2_cjs.RECORDED_MAX_REVISION}
|
|
263
276
|
ELSE to_map.revision
|
|
264
277
|
END
|
|
265
278
|
`;
|
|
266
279
|
}
|
|
267
|
-
return
|
|
280
|
+
return chunkEDN4Y4ZG_cjs.sql`${chunkEDN4Y4ZG_cjs.sql.raw(legacyAlias)}.${chunkEDN4Y4ZG_cjs.sql.identifier(column)}`;
|
|
268
281
|
}
|
|
269
282
|
function mappingMatch(dialect, mappingAlias, legacyColumn) {
|
|
270
|
-
const mapping =
|
|
271
|
-
const legacy =
|
|
272
|
-
return dialect === "postgres" ?
|
|
283
|
+
const mapping = chunkEDN4Y4ZG_cjs.sql.raw(mappingAlias);
|
|
284
|
+
const legacy = chunkEDN4Y4ZG_cjs.sql.raw(`legacy.${legacyColumn}`);
|
|
285
|
+
return dialect === "postgres" ? chunkEDN4Y4ZG_cjs.sql`${mapping}.recorded_at = ${legacy}` : chunkEDN4Y4ZG_cjs.sql`${mapping}.legacy_recorded_at = ${legacy}`;
|
|
273
286
|
}
|
|
274
287
|
function missingMappingCount(value, legacyTable) {
|
|
275
288
|
const count = Number(value);
|
|
276
289
|
if (!Number.isSafeInteger(count) || count < 0) {
|
|
277
|
-
throw new
|
|
290
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
278
291
|
"Recorded-time migration returned an invalid integrity-check count.",
|
|
279
292
|
{ legacyTable, value }
|
|
280
293
|
);
|
|
@@ -285,12 +298,12 @@ async function assertRecordedRelationMappings(target, options) {
|
|
|
285
298
|
const fromMatch = mappingMatch(target.dialect, "from_map", "recorded_from");
|
|
286
299
|
const toMatch = mappingMatch(target.dialect, "to_map", "recorded_to");
|
|
287
300
|
const rows = await target.execute(
|
|
288
|
-
|
|
301
|
+
chunkEDN4Y4ZG_cjs.asCompiledRowsSql(chunkEDN4Y4ZG_cjs.sql`
|
|
289
302
|
SELECT COUNT(*) AS missing
|
|
290
|
-
FROM ${
|
|
291
|
-
LEFT JOIN ${
|
|
303
|
+
FROM ${chunkEDN4Y4ZG_cjs.sql.identifier(options.legacyTable)} AS legacy
|
|
304
|
+
LEFT JOIN ${chunkEDN4Y4ZG_cjs.sql.identifier(options.mappingTable)} AS from_map
|
|
292
305
|
ON from_map.graph_id = legacy.graph_id AND ${fromMatch}
|
|
293
|
-
LEFT JOIN ${
|
|
306
|
+
LEFT JOIN ${chunkEDN4Y4ZG_cjs.sql.identifier(options.mappingTable)} AS to_map
|
|
294
307
|
ON to_map.graph_id = legacy.graph_id AND ${toMatch}
|
|
295
308
|
WHERE from_map.revision IS NULL
|
|
296
309
|
OR (
|
|
@@ -301,7 +314,7 @@ async function assertRecordedRelationMappings(target, options) {
|
|
|
301
314
|
);
|
|
302
315
|
const missing = missingMappingCount(rows[0]?.missing, options.legacyTable);
|
|
303
316
|
if (missing === 0) return;
|
|
304
|
-
throw new
|
|
317
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
305
318
|
"Legacy recorded-time boundaries could not be mapped exactly.",
|
|
306
319
|
{ legacyTable: options.legacyTable, missingRows: missing },
|
|
307
320
|
{
|
|
@@ -312,17 +325,17 @@ async function assertRecordedRelationMappings(target, options) {
|
|
|
312
325
|
async function assertRecordedClockMappings(target, options) {
|
|
313
326
|
const match = mappingMatch(target.dialect, "anchor_map", "recorded_at");
|
|
314
327
|
const rows = await target.execute(
|
|
315
|
-
|
|
328
|
+
chunkEDN4Y4ZG_cjs.asCompiledRowsSql(chunkEDN4Y4ZG_cjs.sql`
|
|
316
329
|
SELECT COUNT(*) AS missing
|
|
317
|
-
FROM ${
|
|
318
|
-
LEFT JOIN ${
|
|
330
|
+
FROM ${chunkEDN4Y4ZG_cjs.sql.identifier(options.legacyTable)} AS legacy
|
|
331
|
+
LEFT JOIN ${chunkEDN4Y4ZG_cjs.sql.identifier(options.mappingTable)} AS anchor_map
|
|
319
332
|
ON anchor_map.graph_id = legacy.graph_id AND ${match}
|
|
320
333
|
WHERE anchor_map.revision IS NULL
|
|
321
334
|
`)
|
|
322
335
|
);
|
|
323
336
|
const missing = missingMappingCount(rows[0]?.missing, options.legacyTable);
|
|
324
337
|
if (missing === 0) return;
|
|
325
|
-
throw new
|
|
338
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
326
339
|
"Legacy recorded clock values could not be mapped exactly.",
|
|
327
340
|
{ legacyTable: options.legacyTable, missingRows: missing },
|
|
328
341
|
{
|
|
@@ -331,7 +344,7 @@ async function assertRecordedClockMappings(target, options) {
|
|
|
331
344
|
);
|
|
332
345
|
}
|
|
333
346
|
async function copyRecordedRelation(target, options) {
|
|
334
|
-
const columnList = options.columns.map((column) =>
|
|
347
|
+
const columnList = options.columns.map((column) => chunkEDN4Y4ZG_cjs.sql.identifier(column));
|
|
335
348
|
const values = options.columns.map(
|
|
336
349
|
(column) => migratedColumn(column, "legacy")
|
|
337
350
|
);
|
|
@@ -340,16 +353,16 @@ async function copyRecordedRelation(target, options) {
|
|
|
340
353
|
const toMatch = mappingMatch(target.dialect, "to_map", "recorded_to");
|
|
341
354
|
await executeStatement(
|
|
342
355
|
target,
|
|
343
|
-
|
|
344
|
-
INSERT INTO ${
|
|
345
|
-
(${
|
|
346
|
-
SELECT ${
|
|
347
|
-
FROM ${
|
|
356
|
+
chunkEDN4Y4ZG_cjs.sql`
|
|
357
|
+
INSERT INTO ${chunkEDN4Y4ZG_cjs.sql.identifier(options.temporaryTable)}
|
|
358
|
+
(${chunkEDN4Y4ZG_cjs.sql.join(columnList, chunkEDN4Y4ZG_cjs.sql`, `)})
|
|
359
|
+
SELECT ${chunkEDN4Y4ZG_cjs.sql.join(values, chunkEDN4Y4ZG_cjs.sql`, `)}
|
|
360
|
+
FROM ${chunkEDN4Y4ZG_cjs.sql.identifier(options.legacyTable)} AS legacy
|
|
348
361
|
-- LEFT JOIN is deliberate: a missing mapping reaches the NOT NULL
|
|
349
362
|
-- revision columns and fails loud instead of silently dropping history.
|
|
350
|
-
LEFT JOIN ${
|
|
363
|
+
LEFT JOIN ${chunkEDN4Y4ZG_cjs.sql.identifier(options.mappingTable)} AS from_map
|
|
351
364
|
ON from_map.graph_id = legacy.graph_id AND ${fromMatch}
|
|
352
|
-
LEFT JOIN ${
|
|
365
|
+
LEFT JOIN ${chunkEDN4Y4ZG_cjs.sql.identifier(options.mappingTable)} AS to_map
|
|
353
366
|
ON to_map.graph_id = legacy.graph_id AND ${toMatch}
|
|
354
367
|
`
|
|
355
368
|
);
|
|
@@ -359,13 +372,13 @@ async function copyRecordedClock(target, options) {
|
|
|
359
372
|
const match = mappingMatch(target.dialect, "anchor_map", "recorded_at");
|
|
360
373
|
await executeStatement(
|
|
361
374
|
target,
|
|
362
|
-
|
|
363
|
-
INSERT INTO ${
|
|
375
|
+
chunkEDN4Y4ZG_cjs.sql`
|
|
376
|
+
INSERT INTO ${chunkEDN4Y4ZG_cjs.sql.identifier(options.temporaryTable)}
|
|
364
377
|
(graph_id, revision, recorded_at)
|
|
365
378
|
SELECT legacy.graph_id, anchor_map.revision, legacy.recorded_at
|
|
366
|
-
FROM ${
|
|
379
|
+
FROM ${chunkEDN4Y4ZG_cjs.sql.identifier(options.legacyTable)} AS legacy
|
|
367
380
|
-- Preserve fail-loud behavior if the preflight invariant changes later.
|
|
368
|
-
LEFT JOIN ${
|
|
381
|
+
LEFT JOIN ${chunkEDN4Y4ZG_cjs.sql.identifier(options.mappingTable)} AS anchor_map
|
|
369
382
|
ON anchor_map.graph_id = legacy.graph_id AND ${match}
|
|
370
383
|
`
|
|
371
384
|
);
|
|
@@ -380,7 +393,7 @@ async function replaceLegacyTables(target, tables, mappingTable) {
|
|
|
380
393
|
for (const table of Object.values(temporary)) {
|
|
381
394
|
await executeStatement(
|
|
382
395
|
target,
|
|
383
|
-
|
|
396
|
+
chunkEDN4Y4ZG_cjs.sql`DROP TABLE IF EXISTS ${chunkEDN4Y4ZG_cjs.sql.identifier(table)}`
|
|
384
397
|
);
|
|
385
398
|
}
|
|
386
399
|
await executeDdl(target, requireCreateTable(ddl.nodes));
|
|
@@ -405,15 +418,15 @@ async function replaceLegacyTables(target, tables, mappingTable) {
|
|
|
405
418
|
});
|
|
406
419
|
await executeStatement(
|
|
407
420
|
target,
|
|
408
|
-
|
|
421
|
+
chunkEDN4Y4ZG_cjs.sql`DROP TABLE ${chunkEDN4Y4ZG_cjs.sql.identifier(tables.recordedNodes)}`
|
|
409
422
|
);
|
|
410
423
|
await executeStatement(
|
|
411
424
|
target,
|
|
412
|
-
|
|
425
|
+
chunkEDN4Y4ZG_cjs.sql`DROP TABLE ${chunkEDN4Y4ZG_cjs.sql.identifier(tables.recordedEdges)}`
|
|
413
426
|
);
|
|
414
427
|
await executeStatement(
|
|
415
428
|
target,
|
|
416
|
-
|
|
429
|
+
chunkEDN4Y4ZG_cjs.sql`DROP TABLE ${chunkEDN4Y4ZG_cjs.sql.identifier(tables.recordedClock)}`
|
|
417
430
|
);
|
|
418
431
|
await renameTable(target, temporary.recordedNodes, tables.recordedNodes);
|
|
419
432
|
await renameTable(target, temporary.recordedEdges, tables.recordedEdges);
|
|
@@ -445,17 +458,17 @@ async function renamePrimaryKeyConstraint(target, temporaryTable, finalTable) {
|
|
|
445
458
|
if (target.dialect !== "postgres") return;
|
|
446
459
|
await executeStatement(
|
|
447
460
|
target,
|
|
448
|
-
|
|
449
|
-
ALTER TABLE ${
|
|
450
|
-
RENAME CONSTRAINT ${
|
|
451
|
-
TO ${
|
|
461
|
+
chunkEDN4Y4ZG_cjs.sql`
|
|
462
|
+
ALTER TABLE ${chunkEDN4Y4ZG_cjs.sql.identifier(finalTable)}
|
|
463
|
+
RENAME CONSTRAINT ${chunkEDN4Y4ZG_cjs.sql.identifier(`${temporaryTable}_pkey`)}
|
|
464
|
+
TO ${chunkEDN4Y4ZG_cjs.sql.identifier(shortenedIdentifier(`${finalTable}_pkey`))}
|
|
452
465
|
`
|
|
453
466
|
);
|
|
454
467
|
}
|
|
455
468
|
function requireCreateTable(statements) {
|
|
456
469
|
const statement = statements[0];
|
|
457
470
|
if (statement === void 0) {
|
|
458
|
-
throw new
|
|
471
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError("Recorded migration table DDL was empty.");
|
|
459
472
|
}
|
|
460
473
|
return statement;
|
|
461
474
|
}
|
|
@@ -463,10 +476,10 @@ async function renameTable(target, from, to) {
|
|
|
463
476
|
try {
|
|
464
477
|
await executeStatement(
|
|
465
478
|
target,
|
|
466
|
-
|
|
479
|
+
chunkEDN4Y4ZG_cjs.sql`ALTER TABLE ${chunkEDN4Y4ZG_cjs.sql.identifier(from)} RENAME TO ${chunkEDN4Y4ZG_cjs.sql.identifier(to)}`
|
|
467
480
|
);
|
|
468
481
|
} catch (error) {
|
|
469
|
-
throw new
|
|
482
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
470
483
|
"Could not rename a migrated recorded-time table.",
|
|
471
484
|
{ from, to },
|
|
472
485
|
{ cause: error }
|
|
@@ -497,9 +510,9 @@ async function migrateLegacyRecordedTime(options) {
|
|
|
497
510
|
};
|
|
498
511
|
}
|
|
499
512
|
const rows = await target.execute(
|
|
500
|
-
|
|
513
|
+
chunkEDN4Y4ZG_cjs.asCompiledRowsSql(chunkEDN4Y4ZG_cjs.sql`
|
|
501
514
|
SELECT COUNT(*) AS anchors, COUNT(DISTINCT graph_id) AS graphs
|
|
502
|
-
FROM ${
|
|
515
|
+
FROM ${chunkEDN4Y4ZG_cjs.sql.identifier(mapTable)}
|
|
503
516
|
`)
|
|
504
517
|
);
|
|
505
518
|
const anchors = Number(rows[0]?.anchors ?? 0);
|
|
@@ -514,7 +527,7 @@ async function migrateLegacyRecordedTime(options) {
|
|
|
514
527
|
const nodeColumns = await columnNames(target, tables.recordedNodes);
|
|
515
528
|
const edgeColumns = await columnNames(target, tables.recordedEdges);
|
|
516
529
|
if (!nodeColumns.has("recorded_from") || !edgeColumns.has("recorded_from")) {
|
|
517
|
-
throw new
|
|
530
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
518
531
|
"Legacy recorded-time schema is incomplete.",
|
|
519
532
|
{ tables }
|
|
520
533
|
);
|
|
@@ -533,24 +546,24 @@ async function migrateLegacyRecordedTime(options) {
|
|
|
533
546
|
}
|
|
534
547
|
async function migrateRecordedAnchor(options) {
|
|
535
548
|
try {
|
|
536
|
-
return
|
|
549
|
+
return chunk2QGYQBS2_cjs.asRecordedInstant(options.anchor);
|
|
537
550
|
} catch (error) {
|
|
538
|
-
if (!(error instanceof
|
|
551
|
+
if (!(error instanceof chunkMRDBBHIZ_cjs.ValidationError)) throw error;
|
|
539
552
|
}
|
|
540
553
|
const legacyRecordedAt = canonicalLegacyInstant(options.anchor);
|
|
541
554
|
const tables = resolvedTableNames(options.backend, options.tableNames);
|
|
542
555
|
const mapTable = mappingTableName(tables, options.mappingTableName);
|
|
543
556
|
const rows = await options.backend.execute(
|
|
544
|
-
|
|
557
|
+
chunkEDN4Y4ZG_cjs.asCompiledRowsSql(chunkEDN4Y4ZG_cjs.sql`
|
|
545
558
|
SELECT revision, recorded_at
|
|
546
|
-
FROM ${
|
|
559
|
+
FROM ${chunkEDN4Y4ZG_cjs.sql.identifier(mapTable)}
|
|
547
560
|
WHERE graph_id = ${options.graphId}
|
|
548
561
|
AND legacy_recorded_at = ${legacyRecordedAt}
|
|
549
562
|
`)
|
|
550
563
|
);
|
|
551
564
|
const row = rows[0];
|
|
552
565
|
if (row === void 0) {
|
|
553
|
-
throw new
|
|
566
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
554
567
|
"No migrated recorded anchor matches this graph and legacy timestamp.",
|
|
555
568
|
{ anchor: options.anchor, graphId: options.graphId },
|
|
556
569
|
{
|
|
@@ -558,14 +571,14 @@ async function migrateRecordedAnchor(options) {
|
|
|
558
571
|
}
|
|
559
572
|
);
|
|
560
573
|
}
|
|
561
|
-
return
|
|
574
|
+
return chunk2QGYQBS2_cjs.createRecordedInstant(
|
|
562
575
|
safeRevision(row.revision),
|
|
563
576
|
canonicalLegacyInstant(row.recorded_at)
|
|
564
577
|
);
|
|
565
578
|
}
|
|
566
579
|
async function deleteLegacyRecordedAnchorMap(options) {
|
|
567
580
|
if (options.backend.executeStatement === void 0) {
|
|
568
|
-
throw new
|
|
581
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
569
582
|
"Deleting a recorded anchor migration map requires executeStatement support.",
|
|
570
583
|
{ dialect: options.backend.dialect }
|
|
571
584
|
);
|
|
@@ -575,30 +588,219 @@ async function deleteLegacyRecordedAnchorMap(options) {
|
|
|
575
588
|
await options.backend.transaction(async (target) => {
|
|
576
589
|
await executeStatement(
|
|
577
590
|
target,
|
|
578
|
-
|
|
579
|
-
DELETE FROM ${
|
|
591
|
+
chunkEDN4Y4ZG_cjs.sql`
|
|
592
|
+
DELETE FROM ${chunkEDN4Y4ZG_cjs.sql.identifier(mapTable)}
|
|
580
593
|
WHERE graph_id = ${options.graphId}
|
|
581
594
|
`
|
|
582
595
|
);
|
|
583
596
|
if (options.dropWhenEmpty !== true) return;
|
|
584
597
|
const rows = await target.execute(
|
|
585
|
-
|
|
598
|
+
chunkEDN4Y4ZG_cjs.asCompiledRowsSql(chunkEDN4Y4ZG_cjs.sql`
|
|
586
599
|
SELECT COUNT(*) AS anchors, COUNT(DISTINCT graph_id) AS graphs
|
|
587
|
-
FROM ${
|
|
600
|
+
FROM ${chunkEDN4Y4ZG_cjs.sql.identifier(mapTable)}
|
|
588
601
|
`)
|
|
589
602
|
);
|
|
590
603
|
const remaining = missingMappingCount(rows[0]?.anchors, mapTable);
|
|
591
604
|
if (remaining === 0) {
|
|
592
605
|
await executeStatement(
|
|
593
606
|
target,
|
|
594
|
-
|
|
607
|
+
chunkEDN4Y4ZG_cjs.sql`DROP TABLE ${chunkEDN4Y4ZG_cjs.sql.identifier(mapTable)}`
|
|
595
608
|
);
|
|
596
609
|
}
|
|
597
610
|
});
|
|
598
611
|
}
|
|
599
612
|
|
|
613
|
+
// src/backend/repair-validity-windows.ts
|
|
614
|
+
var LIVE_RELATIONS = [
|
|
615
|
+
"nodes",
|
|
616
|
+
"edges"
|
|
617
|
+
];
|
|
618
|
+
var RECORDED_RELATIONS = [
|
|
619
|
+
"recordedNodes",
|
|
620
|
+
"recordedEdges"
|
|
621
|
+
];
|
|
622
|
+
var CANONICAL_INSTANT_GLOB = "[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]Z";
|
|
623
|
+
function scopedRelations(scope) {
|
|
624
|
+
return scope === "live" ? LIVE_RELATIONS : [...LIVE_RELATIONS, ...RECORDED_RELATIONS];
|
|
625
|
+
}
|
|
626
|
+
function relationTable(tables, relation) {
|
|
627
|
+
switch (relation) {
|
|
628
|
+
case "nodes": {
|
|
629
|
+
return tables.nodes;
|
|
630
|
+
}
|
|
631
|
+
case "edges": {
|
|
632
|
+
return tables.edges;
|
|
633
|
+
}
|
|
634
|
+
case "recordedNodes": {
|
|
635
|
+
return tables.recordedNodes;
|
|
636
|
+
}
|
|
637
|
+
case "recordedEdges": {
|
|
638
|
+
return tables.recordedEdges;
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
function graphScopeClauses(graphId) {
|
|
643
|
+
return graphId === void 0 ? [] : [chunkEDN4Y4ZG_cjs.sql`graph_id = ${graphId}`];
|
|
644
|
+
}
|
|
645
|
+
function canonicalBoundsClauses(dialect) {
|
|
646
|
+
if (dialect !== "sqlite") return [];
|
|
647
|
+
return [
|
|
648
|
+
chunkEDN4Y4ZG_cjs.sql`valid_from GLOB ${CANONICAL_INSTANT_GLOB}`,
|
|
649
|
+
chunkEDN4Y4ZG_cjs.sql`valid_to GLOB ${CANONICAL_INSTANT_GLOB}`
|
|
650
|
+
];
|
|
651
|
+
}
|
|
652
|
+
function invertedValidityWindowPredicate(options) {
|
|
653
|
+
return chunkEDN4Y4ZG_cjs.sql.join(
|
|
654
|
+
[
|
|
655
|
+
chunkEDN4Y4ZG_cjs.sql`valid_from IS NOT NULL`,
|
|
656
|
+
chunkEDN4Y4ZG_cjs.sql`valid_to IS NOT NULL`,
|
|
657
|
+
...canonicalBoundsClauses(options.dialect),
|
|
658
|
+
chunkEDN4Y4ZG_cjs.sql`valid_from > valid_to`,
|
|
659
|
+
...graphScopeClauses(options.graphId)
|
|
660
|
+
],
|
|
661
|
+
chunkEDN4Y4ZG_cjs.sql` AND `
|
|
662
|
+
);
|
|
663
|
+
}
|
|
664
|
+
function nonCanonicalWindowPredicate(graphId) {
|
|
665
|
+
return chunkEDN4Y4ZG_cjs.sql.join(
|
|
666
|
+
[
|
|
667
|
+
chunkEDN4Y4ZG_cjs.sql`valid_from IS NOT NULL`,
|
|
668
|
+
chunkEDN4Y4ZG_cjs.sql`valid_to IS NOT NULL`,
|
|
669
|
+
chunkEDN4Y4ZG_cjs.sql`(valid_from NOT GLOB ${CANONICAL_INSTANT_GLOB} OR valid_to NOT GLOB ${CANONICAL_INSTANT_GLOB})`,
|
|
670
|
+
...graphScopeClauses(graphId)
|
|
671
|
+
],
|
|
672
|
+
chunkEDN4Y4ZG_cjs.sql` AND `
|
|
673
|
+
);
|
|
674
|
+
}
|
|
675
|
+
function safeCount(value, table) {
|
|
676
|
+
const count = Number(value);
|
|
677
|
+
if (!Number.isSafeInteger(count) || count < 0) {
|
|
678
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
679
|
+
"Validity-window repair returned an invalid row count.",
|
|
680
|
+
{ table, value }
|
|
681
|
+
);
|
|
682
|
+
}
|
|
683
|
+
return count;
|
|
684
|
+
}
|
|
685
|
+
async function countMatching(target, table, predicate) {
|
|
686
|
+
const rows = await target.execute(
|
|
687
|
+
chunkEDN4Y4ZG_cjs.asCompiledRowsSql(chunkEDN4Y4ZG_cjs.sql`
|
|
688
|
+
SELECT COUNT(*) AS matches
|
|
689
|
+
FROM ${chunkEDN4Y4ZG_cjs.sql.identifier(table)}
|
|
690
|
+
WHERE ${predicate}
|
|
691
|
+
`)
|
|
692
|
+
);
|
|
693
|
+
return safeCount(rows[0]?.matches, table);
|
|
694
|
+
}
|
|
695
|
+
function requireStatements2(target) {
|
|
696
|
+
if (target.executeStatement === void 0) {
|
|
697
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
698
|
+
"Repairing inverted validity windows requires executeStatement support.",
|
|
699
|
+
{ dialect: target.dialect, mode: "apply" },
|
|
700
|
+
{
|
|
701
|
+
suggestion: 'Use a built-in SQLite or PostgreSQL backend to apply the repair. Detection needs no such support: call this with mode: "report" to count the affected rows on any backend.'
|
|
702
|
+
}
|
|
703
|
+
);
|
|
704
|
+
}
|
|
705
|
+
return target.executeStatement;
|
|
706
|
+
}
|
|
707
|
+
function translatedCaptureRefusal(error) {
|
|
708
|
+
if (!(error instanceof chunkMRDBBHIZ_cjs.ConfigurationError) || error.details["code"] !== "RECORDED_CAPTURE_RAW_SQL_DISABLED") {
|
|
709
|
+
return error;
|
|
710
|
+
}
|
|
711
|
+
return new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
712
|
+
"Repairing inverted validity windows cannot run against a history-capturing backend.",
|
|
713
|
+
{ code: "RECORDED_CAPTURE_RAW_SQL_DISABLED", mode: "apply" },
|
|
714
|
+
{
|
|
715
|
+
cause: error,
|
|
716
|
+
suggestion: 'Pass the raw backend you constructed the history store from. The repair deliberately mints no revision \u2014 it normalizes storage for rows that were never visible at any coordinate \u2014 so bypassing recorded-time capture is the intended behavior, not a workaround. mode: "report" needs no such care: it runs against the capture-wrapped backend.'
|
|
717
|
+
}
|
|
718
|
+
);
|
|
719
|
+
}
|
|
720
|
+
async function repairRelation(target, table, predicate) {
|
|
721
|
+
try {
|
|
722
|
+
await requireStatements2(target)(
|
|
723
|
+
chunkEDN4Y4ZG_cjs.asCompiledStatementSql(chunkEDN4Y4ZG_cjs.sql`
|
|
724
|
+
UPDATE ${chunkEDN4Y4ZG_cjs.sql.identifier(table)}
|
|
725
|
+
SET valid_from = NULL
|
|
726
|
+
WHERE ${predicate}
|
|
727
|
+
`)
|
|
728
|
+
);
|
|
729
|
+
} catch (error) {
|
|
730
|
+
throw translatedCaptureRefusal(error);
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
function assertClassifiableBounds(nonCanonical) {
|
|
734
|
+
const unclassified = [...nonCanonical].filter(([, count]) => count > 0);
|
|
735
|
+
if (unclassified.length === 0) return;
|
|
736
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
737
|
+
"Refusing to repair validity windows: some scanned rows store non-canonical bounds.",
|
|
738
|
+
{ nonCanonical: Object.fromEntries(unclassified) },
|
|
739
|
+
{
|
|
740
|
+
suggestion: 'Normalize those bounds to canonical UTC ISO 8601 (YYYY-MM-DDTHH:MM:SS.mmmZ) and re-run, or narrow the call with graphId. Classifying them here would need a timestamp semantics this repair does not own, and skipping them silently would report a repair it did not make. mode: "report" still counts them.'
|
|
741
|
+
}
|
|
742
|
+
);
|
|
743
|
+
}
|
|
744
|
+
function transactionOptionsFor(mode) {
|
|
745
|
+
return mode === "report" ? { transaction: { accessMode: "read_only" } } : void 0;
|
|
746
|
+
}
|
|
747
|
+
function relationRecord(counts) {
|
|
748
|
+
return {
|
|
749
|
+
nodes: counts.get("nodes"),
|
|
750
|
+
edges: counts.get("edges"),
|
|
751
|
+
recordedNodes: counts.get("recordedNodes"),
|
|
752
|
+
recordedEdges: counts.get("recordedEdges")
|
|
753
|
+
};
|
|
754
|
+
}
|
|
755
|
+
async function repairInvertedValidityWindows(options) {
|
|
756
|
+
const tables = resolvedTableNames(options.backend, options.tableNames);
|
|
757
|
+
const relations = scopedRelations(options.relations);
|
|
758
|
+
if (options.mode === "apply") requireStatements2(options.backend);
|
|
759
|
+
return chunk5PRKMB24_cjs.runOptionallyInTransaction(
|
|
760
|
+
options.backend,
|
|
761
|
+
async (target, execution) => {
|
|
762
|
+
const predicate = invertedValidityWindowPredicate({
|
|
763
|
+
dialect: target.dialect,
|
|
764
|
+
graphId: options.graphId
|
|
765
|
+
});
|
|
766
|
+
const inverted = /* @__PURE__ */ new Map();
|
|
767
|
+
const nonCanonical = /* @__PURE__ */ new Map();
|
|
768
|
+
for (const relation of relations) {
|
|
769
|
+
const table = relationTable(tables, relation);
|
|
770
|
+
nonCanonical.set(
|
|
771
|
+
relation,
|
|
772
|
+
target.dialect === "sqlite" ? await countMatching(
|
|
773
|
+
target,
|
|
774
|
+
table,
|
|
775
|
+
nonCanonicalWindowPredicate(options.graphId)
|
|
776
|
+
) : 0
|
|
777
|
+
);
|
|
778
|
+
inverted.set(relation, await countMatching(target, table, predicate));
|
|
779
|
+
}
|
|
780
|
+
if (options.mode === "apply") {
|
|
781
|
+
assertClassifiableBounds(nonCanonical);
|
|
782
|
+
for (const relation of relations) {
|
|
783
|
+
await repairRelation(
|
|
784
|
+
target,
|
|
785
|
+
relationTable(tables, relation),
|
|
786
|
+
predicate
|
|
787
|
+
);
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
return {
|
|
791
|
+
relations: options.relations,
|
|
792
|
+
counts: relationRecord(inverted),
|
|
793
|
+
nonCanonical: relationRecord(nonCanonical),
|
|
794
|
+
atomic: execution.atomic
|
|
795
|
+
};
|
|
796
|
+
},
|
|
797
|
+
transactionOptionsFor(options.mode)
|
|
798
|
+
);
|
|
799
|
+
}
|
|
800
|
+
|
|
600
801
|
exports.deleteLegacyRecordedAnchorMap = deleteLegacyRecordedAnchorMap;
|
|
601
802
|
exports.migrateLegacyRecordedTime = migrateLegacyRecordedTime;
|
|
602
803
|
exports.migrateRecordedAnchor = migrateRecordedAnchor;
|
|
603
|
-
|
|
604
|
-
//# sourceMappingURL=chunk-
|
|
804
|
+
exports.repairInvertedValidityWindows = repairInvertedValidityWindows;
|
|
805
|
+
//# sourceMappingURL=chunk-UMGZDVOA.cjs.map
|
|
806
|
+
//# sourceMappingURL=chunk-UMGZDVOA.cjs.map
|