@nicia-ai/typegraph 0.49.0 → 0.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backend/drizzle/indexes.cjs +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 +56 -52
- package/dist/backend/index.d.cts +3 -3
- package/dist/backend/index.d.ts +3 -3
- package/dist/backend/index.js +11 -11
- package/dist/backend/postgres/index.cjs +34 -28
- package/dist/backend/postgres/index.d.cts +7 -7
- package/dist/backend/postgres/index.d.ts +7 -7
- package/dist/backend/postgres/index.js +17 -15
- package/dist/backend/postgres/pglite-store.cjs +36 -35
- 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 +32 -31
- package/dist/backend/postgres/pglite-store.js.map +1 -1
- package/dist/backend/postgres/pglite.cjs +19 -17
- package/dist/backend/postgres/pglite.d.cts +3 -3
- package/dist/backend/postgres/pglite.d.ts +3 -3
- package/dist/backend/postgres/pglite.js +18 -16
- package/dist/backend/sqlite/index.cjs +31 -25
- package/dist/backend/sqlite/index.d.cts +7 -7
- package/dist/backend/sqlite/index.d.ts +7 -7
- package/dist/backend/sqlite/index.js +15 -13
- package/dist/backend/sqlite/libsql.cjs +22 -20
- 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 +17 -15
- package/dist/backend/sqlite/libsql.js.map +1 -1
- package/dist/backend/sqlite/local-store.cjs +37 -36
- 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 +33 -32
- package/dist/backend/sqlite/local-store.js.map +1 -1
- package/dist/backend/sqlite/local.cjs +20 -18
- package/dist/backend/sqlite/local.d.cts +3 -3
- package/dist/backend/sqlite/local.d.ts +3 -3
- package/dist/backend/sqlite/local.js +18 -16
- package/dist/{chunk-LTXQOEIC.js → chunk-2CYI5HRH.js} +248 -203
- package/dist/chunk-2CYI5HRH.js.map +1 -0
- package/dist/{chunk-KF6K7TGH.js → chunk-2GIV5X4P.js} +702 -422
- package/dist/chunk-2GIV5X4P.js.map +1 -0
- package/dist/{chunk-2TYSSBU5.js → chunk-2Q45FAIE.js} +15 -15
- package/dist/{chunk-2TYSSBU5.js.map → chunk-2Q45FAIE.js.map} +1 -1
- package/dist/{chunk-WODMN3Q2.cjs → chunk-45YZXI6X.cjs} +27 -27
- package/dist/{chunk-WODMN3Q2.cjs.map → chunk-45YZXI6X.cjs.map} +1 -1
- package/dist/{chunk-3DMMGT6S.js → chunk-46UGOVRW.js} +3 -3
- package/dist/{chunk-3DMMGT6S.js.map → chunk-46UGOVRW.js.map} +1 -1
- package/dist/{chunk-GLHXM7C4.js → chunk-5LKOVCPP.js} +60 -23
- package/dist/chunk-5LKOVCPP.js.map +1 -0
- package/dist/{chunk-JFRT7S3B.cjs → chunk-5OWHU7Z7.cjs} +261 -459
- package/dist/chunk-5OWHU7Z7.cjs.map +1 -0
- package/dist/{chunk-7SQSZN2J.js → chunk-5PP4KRPV.js} +5 -5
- package/dist/{chunk-7SQSZN2J.js.map → chunk-5PP4KRPV.js.map} +1 -1
- package/dist/chunk-6KQEICJ6.cjs +12 -0
- package/dist/{chunk-MKJ4KXL5.cjs.map → chunk-6KQEICJ6.cjs.map} +1 -1
- package/dist/{chunk-6SWPJEYN.js → chunk-6LEOAIIB.js} +40 -6
- package/dist/chunk-6LEOAIIB.js.map +1 -0
- package/dist/{chunk-DZAICA5J.js → chunk-6NKSE5AU.js} +4 -4
- package/dist/{chunk-DZAICA5J.js.map → chunk-6NKSE5AU.js.map} +1 -1
- package/dist/{chunk-OVI7IXYX.js → chunk-6S3PTHL4.js} +3 -3
- package/dist/{chunk-OVI7IXYX.js.map → chunk-6S3PTHL4.js.map} +1 -1
- package/dist/{chunk-3FPR224C.cjs → chunk-7CCMCMJO.cjs} +102 -102
- package/dist/{chunk-3FPR224C.cjs.map → chunk-7CCMCMJO.cjs.map} +1 -1
- package/dist/{chunk-SHFBB23Q.js → chunk-7OWE7WD6.js} +6 -4
- package/dist/chunk-7OWE7WD6.js.map +1 -0
- package/dist/chunk-7PRMDZIA.cjs +182 -0
- package/dist/chunk-7PRMDZIA.cjs.map +1 -0
- package/dist/{chunk-CHAOFCHV.js → chunk-AH2A74OZ.js} +3 -3
- package/dist/{chunk-CHAOFCHV.js.map → chunk-AH2A74OZ.js.map} +1 -1
- package/dist/{chunk-OORXGFL5.cjs → chunk-BYBDM423.cjs} +48 -48
- package/dist/{chunk-OORXGFL5.cjs.map → chunk-BYBDM423.cjs.map} +1 -1
- package/dist/{chunk-JB6T4GLL.cjs → chunk-C76WFIVZ.cjs} +808 -519
- package/dist/chunk-C76WFIVZ.cjs.map +1 -0
- package/dist/{chunk-3G5W2U2L.cjs → chunk-CS6JTQQ2.cjs} +302 -257
- package/dist/chunk-CS6JTQQ2.cjs.map +1 -0
- package/dist/{chunk-AOSSQDVO.cjs → chunk-CSNOYIB4.cjs} +13 -13
- package/dist/{chunk-AOSSQDVO.cjs.map → chunk-CSNOYIB4.cjs.map} +1 -1
- package/dist/{chunk-HEV35TGT.js → chunk-DI6VC62F.js} +13 -4
- package/dist/chunk-DI6VC62F.js.map +1 -0
- package/dist/{chunk-2QGYQBS2.cjs → chunk-DWUDZ66O.cjs} +10 -10
- package/dist/{chunk-2QGYQBS2.cjs.map → chunk-DWUDZ66O.cjs.map} +1 -1
- package/dist/{chunk-ZDKTPBGV.js → chunk-EDLKIQRI.js} +4 -4
- package/dist/{chunk-ZDKTPBGV.js.map → chunk-EDLKIQRI.js.map} +1 -1
- package/dist/chunk-EH3JZJUM.cjs +567 -0
- package/dist/chunk-EH3JZJUM.cjs.map +1 -0
- package/dist/{chunk-S5TERQVW.js → chunk-FX5ZW6PN.js} +196 -33
- package/dist/chunk-FX5ZW6PN.js.map +1 -0
- package/dist/{chunk-XVWOYKIK.js → chunk-FZHF5UWR.js} +3 -3
- package/dist/{chunk-XVWOYKIK.js.map → chunk-FZHF5UWR.js.map} +1 -1
- package/dist/{chunk-BFUOME67.cjs → chunk-G2TLHH6T.cjs} +20 -11
- package/dist/chunk-G2TLHH6T.cjs.map +1 -0
- package/dist/{chunk-5PRKMB24.cjs → chunk-GHZPZNFC.cjs} +12 -4
- package/dist/chunk-GHZPZNFC.cjs.map +1 -0
- package/dist/{chunk-ZFMCDJGB.js → chunk-GVYVGGPJ.js} +11 -199
- package/dist/chunk-GVYVGGPJ.js.map +1 -0
- package/dist/{chunk-SDBBMD4N.js → chunk-H3XP6BAV.js} +3 -3
- package/dist/{chunk-SDBBMD4N.js.map → chunk-H3XP6BAV.js.map} +1 -1
- package/dist/{chunk-ROR5ZR6A.cjs → chunk-HSEZ7X6Y.cjs} +45 -45
- package/dist/{chunk-ROR5ZR6A.cjs.map → chunk-HSEZ7X6Y.cjs.map} +1 -1
- package/dist/{chunk-LRQKXRXO.cjs → chunk-HY5BNOUN.cjs} +4 -4
- package/dist/{chunk-LRQKXRXO.cjs.map → chunk-HY5BNOUN.cjs.map} +1 -1
- package/dist/chunk-HZUB5CON.js +27 -0
- package/dist/chunk-HZUB5CON.js.map +1 -0
- package/dist/{chunk-MYKHJI2J.js → chunk-I5C6OTKR.js} +3 -3
- package/dist/{chunk-MYKHJI2J.js.map → chunk-I5C6OTKR.js.map} +1 -1
- package/dist/{chunk-3U5ABFDW.cjs → chunk-IHK5KA2Q.cjs} +31 -28
- package/dist/chunk-IHK5KA2Q.cjs.map +1 -0
- package/dist/{chunk-26YKDNUD.cjs → chunk-IPRP6TDL.cjs} +12 -10
- package/dist/chunk-IPRP6TDL.cjs.map +1 -0
- package/dist/{chunk-UGHG7PGX.js → chunk-IRPYOHRC.js} +26 -4
- package/dist/chunk-IRPYOHRC.js.map +1 -0
- package/dist/{chunk-7UOLHNWC.cjs → chunk-ISKCIQF2.cjs} +20 -20
- package/dist/{chunk-7UOLHNWC.cjs.map → chunk-ISKCIQF2.cjs.map} +1 -1
- package/dist/{chunk-7LZJNLA5.js → chunk-JG5XIJDY.js} +57 -31
- package/dist/chunk-JG5XIJDY.js.map +1 -0
- package/dist/{chunk-YYUHLYM2.cjs → chunk-K2XYLVVB.cjs} +134 -133
- package/dist/chunk-K2XYLVVB.cjs.map +1 -0
- package/dist/{chunk-5K2BKEBD.js → chunk-K46SDNQD.js} +10 -4
- package/dist/chunk-K46SDNQD.js.map +1 -0
- package/dist/{chunk-TZEGUG6D.cjs → chunk-K6VKTBST.cjs} +4 -4
- package/dist/{chunk-TZEGUG6D.cjs.map → chunk-K6VKTBST.cjs.map} +1 -1
- package/dist/chunk-KWNWG4RC.cjs +12 -0
- package/dist/{chunk-CICO5GXD.cjs.map → chunk-KWNWG4RC.cjs.map} +1 -1
- package/dist/{chunk-FQPEMEWX.cjs → chunk-LLVOQOWE.cjs} +80 -32
- package/dist/chunk-LLVOQOWE.cjs.map +1 -0
- package/dist/{chunk-TQHGE7UC.cjs → chunk-M5MSP3BI.cjs} +18 -10
- package/dist/chunk-M5MSP3BI.cjs.map +1 -0
- package/dist/{chunk-Z2JCLZFJ.js → chunk-MJPZNEJZ.js} +273 -291
- package/dist/chunk-MJPZNEJZ.js.map +1 -0
- package/dist/{chunk-TUNPBZY3.cjs → chunk-MM3JHVKZ.cjs} +4 -4
- package/dist/{chunk-TUNPBZY3.cjs.map → chunk-MM3JHVKZ.cjs.map} +1 -1
- package/dist/{chunk-BRRP76WO.js → chunk-MX7EKQPM.js} +457 -299
- package/dist/chunk-MX7EKQPM.js.map +1 -0
- package/dist/{chunk-D4QLTJSM.js → chunk-MZ34E2GN.js} +13 -12
- package/dist/chunk-MZ34E2GN.js.map +1 -0
- package/dist/{chunk-EDN4Y4ZG.cjs → chunk-OJHD3LXJ.cjs} +9 -9
- package/dist/{chunk-EDN4Y4ZG.cjs.map → chunk-OJHD3LXJ.cjs.map} +1 -1
- package/dist/{chunk-DO7SAMEK.cjs → chunk-ON47CBE4.cjs} +47 -47
- package/dist/{chunk-DO7SAMEK.cjs.map → chunk-ON47CBE4.cjs.map} +1 -1
- package/dist/{chunk-6LN7FIVU.js → chunk-PALYTHGM.js} +11 -4
- package/dist/chunk-PALYTHGM.js.map +1 -0
- package/dist/{chunk-YVF2EM7B.js → chunk-R7MRFE5P.js} +3 -3
- package/dist/{chunk-YVF2EM7B.js.map → chunk-R7MRFE5P.js.map} +1 -1
- package/dist/{chunk-EZEEWCFJ.cjs → chunk-RDP6ZRSM.cjs} +435 -265
- package/dist/chunk-RDP6ZRSM.cjs.map +1 -0
- package/dist/{chunk-GYEG3ZLZ.cjs → chunk-RJMHU2MG.cjs} +121 -18
- package/dist/chunk-RJMHU2MG.cjs.map +1 -0
- package/dist/chunk-RWUWTJQY.cjs +30 -0
- package/dist/chunk-RWUWTJQY.cjs.map +1 -0
- package/dist/{chunk-JPD2CTC3.js → chunk-S33YQEL7.js} +7 -7
- package/dist/{chunk-JPD2CTC3.js.map → chunk-S33YQEL7.js.map} +1 -1
- package/dist/chunk-S3SDEQMC.js +532 -0
- package/dist/chunk-S3SDEQMC.js.map +1 -0
- package/dist/{chunk-OI2GQ25X.cjs → chunk-SHC7BCG5.cjs} +7 -7
- package/dist/{chunk-OI2GQ25X.cjs.map → chunk-SHC7BCG5.cjs.map} +1 -1
- package/dist/{chunk-L3LQNR34.cjs → chunk-TEC24ZDA.cjs} +161 -161
- package/dist/{chunk-L3LQNR34.cjs.map → chunk-TEC24ZDA.cjs.map} +1 -1
- package/dist/{chunk-HDL2ARHX.cjs → chunk-TP4NJTI3.cjs} +63 -27
- package/dist/chunk-TP4NJTI3.cjs.map +1 -0
- package/dist/{chunk-UMGZDVOA.cjs → chunk-TTCOPKUL.cjs} +124 -124
- package/dist/{chunk-UMGZDVOA.cjs.map → chunk-TTCOPKUL.cjs.map} +1 -1
- package/dist/chunk-TUVD4DFR.cjs +1207 -0
- package/dist/chunk-TUVD4DFR.cjs.map +1 -0
- package/dist/{chunk-UGHQV7MP.cjs → chunk-TYGGUWMS.cjs} +178 -152
- package/dist/chunk-TYGGUWMS.cjs.map +1 -0
- package/dist/{chunk-WIC7DRXW.js → chunk-U3Z7XKAG.js} +7 -7
- package/dist/{chunk-WIC7DRXW.js.map → chunk-U3Z7XKAG.js.map} +1 -1
- package/dist/{chunk-NACVVDWB.js → chunk-U5EL6JUV.js} +10 -10
- package/dist/{chunk-NACVVDWB.js.map → chunk-U5EL6JUV.js.map} +1 -1
- package/dist/{chunk-OMZ37BM2.js → chunk-V76FGHY3.js} +5 -5
- package/dist/{chunk-OMZ37BM2.js.map → chunk-V76FGHY3.js.map} +1 -1
- package/dist/{chunk-6NGW27EO.cjs → chunk-VLBTRXA2.cjs} +10 -10
- package/dist/{chunk-6NGW27EO.cjs.map → chunk-VLBTRXA2.cjs.map} +1 -1
- package/dist/chunk-VTJVMP4I.js +1182 -0
- package/dist/chunk-VTJVMP4I.js.map +1 -0
- package/dist/{chunk-QTD6HX4O.js → chunk-W5SOCUBL.js} +5 -5
- package/dist/{chunk-QTD6HX4O.js.map → chunk-W5SOCUBL.js.map} +1 -1
- package/dist/{chunk-SR725PWF.cjs → chunk-WCLMKNQE.cjs} +1750 -1592
- package/dist/chunk-WCLMKNQE.cjs.map +1 -0
- package/dist/{chunk-2O4PCIZ6.cjs → chunk-WK23PGTP.cjs} +13 -13
- package/dist/{chunk-2O4PCIZ6.cjs.map → chunk-WK23PGTP.cjs.map} +1 -1
- package/dist/{chunk-KKBDXCLQ.js → chunk-WQBAQZHR.js} +4 -4
- package/dist/{chunk-KKBDXCLQ.js.map → chunk-WQBAQZHR.js.map} +1 -1
- package/dist/{chunk-MRDBBHIZ.cjs → chunk-X4GDXBOP.cjs} +2 -2
- package/dist/chunk-X4GDXBOP.cjs.map +1 -0
- package/dist/{chunk-3QNZ5SAJ.cjs → chunk-XMY2SXOH.cjs} +437 -455
- package/dist/chunk-XMY2SXOH.cjs.map +1 -0
- package/dist/{chunk-D5R42W5D.js → chunk-XZW2CTNO.js} +115 -12
- package/dist/chunk-XZW2CTNO.js.map +1 -0
- package/dist/{chunk-NVY5CJFP.js → chunk-Y55DLLEG.js} +9 -6
- package/dist/chunk-Y55DLLEG.js.map +1 -0
- package/dist/chunk-YA36ABIL.js +174 -0
- package/dist/chunk-YA36ABIL.js.map +1 -0
- package/dist/{chunk-ZLONH2UD.js → chunk-YDEJQWOL.js} +2 -2
- package/dist/chunk-YDEJQWOL.js.map +1 -0
- package/dist/{chunk-JONXFAPO.js → chunk-ZAQUKCUC.js} +5 -5
- package/dist/{chunk-JONXFAPO.js.map → chunk-ZAQUKCUC.js.map} +1 -1
- package/dist/{chunk-SIT26LAZ.cjs → chunk-ZBFZGLZE.cjs} +29 -5
- package/dist/chunk-ZBFZGLZE.cjs.map +1 -0
- package/dist/{chunk-P6YLZTRE.js → chunk-ZRJTM7MT.js} +3 -3
- package/dist/{chunk-P6YLZTRE.js.map → chunk-ZRJTM7MT.js.map} +1 -1
- package/dist/core/index.cjs +29 -28
- package/dist/core/index.d.cts +4 -4
- package/dist/core/index.d.ts +4 -4
- package/dist/core/index.js +9 -8
- package/dist/{ddl-D_oW-EVO.d.ts → ddl-B49O7dB_.d.ts} +3 -3
- package/dist/{ddl-BL1NZLMY.d.cts → ddl-DcZG660s.d.cts} +3 -3
- package/dist/graph-extension/index.cjs +21 -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 +5 -4
- package/dist/graph-merge/index.cjs +305 -303
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +9 -9
- package/dist/graph-merge/index.d.ts +9 -9
- package/dist/graph-merge/index.js +29 -27
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/{index-D7d1u2gr.d.ts → index-B0PrmE3K.d.cts} +16 -2
- package/dist/{index-COs_z6nV.d.cts → index-CwcXsL5R.d.ts} +16 -2
- package/dist/index.cjs +223 -222
- 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 +37 -36
- 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/{ingestion-import-target-dNeL7iAv.d.ts → ingestion-import-target-CI8OWIkM.d.ts} +1 -1
- package/dist/{ingestion-import-target-XPxZYw89.d.cts → ingestion-import-target-DCpfM1PX.d.cts} +1 -1
- package/dist/interchange/index.cjs +55 -54
- package/dist/interchange/index.cjs.map +1 -1
- package/dist/interchange/index.d.cts +19 -8
- package/dist/interchange/index.d.ts +19 -8
- package/dist/interchange/index.js +19 -18
- package/dist/interchange/index.js.map +1 -1
- package/dist/{manager-D9eRT_ns.d.ts → manager-Cfg1ENj1.d.ts} +30 -2
- package/dist/{manager-CYaff3n3.d.cts → manager-D348fa6W.d.cts} +30 -2
- package/dist/{materialize-indexes-DJ3ykH59.d.ts → materialize-indexes-C9GG3O3C.d.ts} +1 -1
- package/dist/{materialize-indexes-DTtAnvfY.d.cts → materialize-indexes-CrSiW_lT.d.cts} +1 -1
- package/dist/{postgres-CcL4bAHS.d.ts → postgres-CH1kkM5J.d.cts} +279 -2
- package/dist/{postgres-DMj39MEu.d.cts → postgres-UStOycLI.d.ts} +279 -2
- package/dist/profiler/index.d.cts +9 -9
- package/dist/profiler/index.d.ts +9 -9
- package/dist/provenance/index.cjs +46 -44
- package/dist/provenance/index.cjs.map +1 -1
- package/dist/provenance/index.d.cts +7 -7
- package/dist/provenance/index.d.ts +7 -7
- package/dist/provenance/index.js +12 -10
- package/dist/provenance/index.js.map +1 -1
- package/dist/{repair-validity-windows-DlUSqwCg.d.ts → repair-validity-windows-BtOEe2pS.d.ts} +2 -2
- package/dist/{repair-validity-windows-BFNZvd_H.d.cts → repair-validity-windows-aWX7VNvv.d.cts} +2 -2
- package/dist/schema/index.cjs +46 -46
- package/dist/schema/index.d.cts +6 -6
- package/dist/schema/index.d.ts +6 -6
- package/dist/schema/index.js +19 -19
- package/dist/{searchable-DHJMh_nj.d.cts → searchable-C8-RrL3l.d.cts} +1 -1
- package/dist/{searchable-bpE1bBfc.d.ts → searchable-z4BiFfHI.d.ts} +1 -1
- package/dist/{sqlite-YppHrNFb.d.cts → sqlite-Cyx9j9o6.d.cts} +309 -2
- package/dist/{sqlite-D7Oz0SQh.d.ts → sqlite-axLw5Lo5.d.ts} +309 -2
- package/dist/{store-bphCSo7z.d.cts → store-CTfQ9taw.d.ts} +102 -13
- package/dist/{store-DRrFCx5x.d.ts → store-DR9J7JVB.d.cts} +102 -13
- package/dist/{temporal-5GqpYCk2.d.cts → temporal-B4Ky4wzh.d.cts} +1 -1
- package/dist/{temporal-CbnLzTmM.d.ts → temporal-CBOrERz5.d.ts} +1 -1
- package/dist/{types-CXAhpW-c.d.cts → types-BE921wRl.d.cts} +1 -1
- package/dist/{types-Bx74kaTt.d.ts → types-BScHXVM7.d.ts} +1 -1
- package/dist/{types-BqFZTQmV.d.cts → types-CWg4dTjj.d.cts} +257 -6
- package/dist/{types-BqFZTQmV.d.ts → types-CWg4dTjj.d.ts} +257 -6
- package/dist/{where-O-k2wgYm.d.ts → where-BWXUPV3C.d.ts} +1 -1
- package/dist/{where-DI_Fqz-X.d.cts → where-CNtx1aLc.d.cts} +1 -1
- package/package.json +3 -2
- package/dist/chunk-26YKDNUD.cjs.map +0 -1
- package/dist/chunk-3G5W2U2L.cjs.map +0 -1
- package/dist/chunk-3KOY4FH3.cjs +0 -934
- package/dist/chunk-3KOY4FH3.cjs.map +0 -1
- package/dist/chunk-3QNZ5SAJ.cjs.map +0 -1
- package/dist/chunk-3U5ABFDW.cjs.map +0 -1
- package/dist/chunk-5K2BKEBD.js.map +0 -1
- package/dist/chunk-5PRKMB24.cjs.map +0 -1
- package/dist/chunk-6LN7FIVU.js.map +0 -1
- package/dist/chunk-6SWPJEYN.js.map +0 -1
- package/dist/chunk-7LZJNLA5.js.map +0 -1
- package/dist/chunk-BFUOME67.cjs.map +0 -1
- package/dist/chunk-BRRP76WO.js.map +0 -1
- package/dist/chunk-CICO5GXD.cjs +0 -12
- package/dist/chunk-D4QLTJSM.js.map +0 -1
- package/dist/chunk-D5R42W5D.js.map +0 -1
- package/dist/chunk-EZEEWCFJ.cjs.map +0 -1
- package/dist/chunk-FA2AFWLP.cjs +0 -167
- package/dist/chunk-FA2AFWLP.cjs.map +0 -1
- package/dist/chunk-FQPEMEWX.cjs.map +0 -1
- package/dist/chunk-GLHXM7C4.js.map +0 -1
- package/dist/chunk-GYEG3ZLZ.cjs.map +0 -1
- package/dist/chunk-HDL2ARHX.cjs.map +0 -1
- package/dist/chunk-HEV35TGT.js.map +0 -1
- package/dist/chunk-I4GAZH5Z.js +0 -913
- package/dist/chunk-I4GAZH5Z.js.map +0 -1
- package/dist/chunk-JB6T4GLL.cjs.map +0 -1
- package/dist/chunk-JBQQ7THH.js +0 -20
- package/dist/chunk-JBQQ7THH.js.map +0 -1
- package/dist/chunk-JFRT7S3B.cjs.map +0 -1
- package/dist/chunk-KF6K7TGH.js.map +0 -1
- package/dist/chunk-LTXQOEIC.js.map +0 -1
- package/dist/chunk-MKJ4KXL5.cjs +0 -12
- package/dist/chunk-MRDBBHIZ.cjs.map +0 -1
- package/dist/chunk-NVY5CJFP.js.map +0 -1
- package/dist/chunk-PWLJ77UV.cjs +0 -23
- package/dist/chunk-PWLJ77UV.cjs.map +0 -1
- package/dist/chunk-S5TERQVW.js.map +0 -1
- package/dist/chunk-SHFBB23Q.js.map +0 -1
- package/dist/chunk-SIT26LAZ.cjs.map +0 -1
- package/dist/chunk-SR725PWF.cjs.map +0 -1
- package/dist/chunk-TQHGE7UC.cjs.map +0 -1
- package/dist/chunk-UGHG7PGX.js.map +0 -1
- package/dist/chunk-UGHQV7MP.cjs.map +0 -1
- package/dist/chunk-YIURNGXI.js +0 -155
- package/dist/chunk-YIURNGXI.js.map +0 -1
- package/dist/chunk-YYUHLYM2.cjs.map +0 -1
- package/dist/chunk-Z2JCLZFJ.js.map +0 -1
- package/dist/chunk-ZFMCDJGB.js.map +0 -1
- package/dist/chunk-ZLONH2UD.js.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
3
|
+
var chunkTP4NJTI3_cjs = require('./chunk-TP4NJTI3.cjs');
|
|
4
|
+
var chunkIHK5KA2Q_cjs = require('./chunk-IHK5KA2Q.cjs');
|
|
5
|
+
var chunkGHZPZNFC_cjs = require('./chunk-GHZPZNFC.cjs');
|
|
6
|
+
var chunkDWUDZ66O_cjs = require('./chunk-DWUDZ66O.cjs');
|
|
7
|
+
var chunkM5MSP3BI_cjs = require('./chunk-M5MSP3BI.cjs');
|
|
8
|
+
var chunkTEC24ZDA_cjs = require('./chunk-TEC24ZDA.cjs');
|
|
9
|
+
var chunkOJHD3LXJ_cjs = require('./chunk-OJHD3LXJ.cjs');
|
|
10
|
+
var chunkX4GDXBOP_cjs = require('./chunk-X4GDXBOP.cjs');
|
|
11
11
|
|
|
12
12
|
// src/backend/table-names.ts
|
|
13
13
|
function definedTableNameOverrides(override) {
|
|
@@ -17,7 +17,7 @@ function definedTableNameOverrides(override) {
|
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
19
|
function resolvedTableNames(backend, override) {
|
|
20
|
-
return
|
|
20
|
+
return chunkIHK5KA2Q_cjs.createSqlSchema({
|
|
21
21
|
...backend.tableNames,
|
|
22
22
|
...definedTableNameOverrides(override)
|
|
23
23
|
}).tables;
|
|
@@ -69,20 +69,20 @@ var RECORDED_EDGE_COLUMNS = [
|
|
|
69
69
|
];
|
|
70
70
|
function shortenedIdentifier(value) {
|
|
71
71
|
if (value.length <= 63) return value;
|
|
72
|
-
return `${value.slice(0, 50)}_${
|
|
72
|
+
return `${value.slice(0, 50)}_${chunkTEC24ZDA_cjs.shortHash(value)}`;
|
|
73
73
|
}
|
|
74
74
|
function mappingTableName(tables, override) {
|
|
75
75
|
const candidate = override ?? `${tables.recordedClock}_${MIGRATION_SUFFIX}`;
|
|
76
|
-
return
|
|
76
|
+
return chunkIHK5KA2Q_cjs.createSqlSchema({
|
|
77
77
|
recordedClock: shortenedIdentifier(candidate)
|
|
78
78
|
}).tables.recordedClock;
|
|
79
79
|
}
|
|
80
80
|
function temporaryTableName(tableName, role) {
|
|
81
|
-
return shortenedIdentifier(`__tg_${role}_${
|
|
81
|
+
return shortenedIdentifier(`__tg_${role}_${chunkTEC24ZDA_cjs.shortHash(tableName)}`);
|
|
82
82
|
}
|
|
83
83
|
function requireStatements(target) {
|
|
84
84
|
if (target.executeStatement === void 0) {
|
|
85
|
-
throw new
|
|
85
|
+
throw new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
86
86
|
"Recorded-time migration requires executeStatement support.",
|
|
87
87
|
{ dialect: target.dialect },
|
|
88
88
|
{ suggestion: "Use a built-in SQLite or PostgreSQL backend." }
|
|
@@ -91,15 +91,15 @@ function requireStatements(target) {
|
|
|
91
91
|
return target.executeStatement;
|
|
92
92
|
}
|
|
93
93
|
async function executeStatement(target, statement) {
|
|
94
|
-
await requireStatements(target)(
|
|
94
|
+
await requireStatements(target)(chunkOJHD3LXJ_cjs.asCompiledStatementSql(statement));
|
|
95
95
|
}
|
|
96
96
|
async function executeDdl(target, ddl) {
|
|
97
|
-
await executeStatement(target,
|
|
97
|
+
await executeStatement(target, chunkOJHD3LXJ_cjs.sql.raw(ddl));
|
|
98
98
|
}
|
|
99
99
|
function canonicalLegacyInstant(value) {
|
|
100
|
-
const canonical =
|
|
100
|
+
const canonical = chunkM5MSP3BI_cjs.canonicalizeDatabaseTimestamp(value);
|
|
101
101
|
if (canonical === void 0) {
|
|
102
|
-
throw new
|
|
102
|
+
throw new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
103
103
|
"Legacy recorded-time relation contained an invalid timestamp.",
|
|
104
104
|
{ value }
|
|
105
105
|
);
|
|
@@ -108,8 +108,8 @@ function canonicalLegacyInstant(value) {
|
|
|
108
108
|
}
|
|
109
109
|
function safeRevision(value) {
|
|
110
110
|
const revision = typeof value === "bigint" ? Number(value) : typeof value === "string" && /^\d+$/.test(value) ? Number(value) : value;
|
|
111
|
-
if (typeof revision !== "number" || !Number.isSafeInteger(revision) || revision < 1 || revision >=
|
|
112
|
-
throw new
|
|
111
|
+
if (typeof revision !== "number" || !Number.isSafeInteger(revision) || revision < 1 || revision >= chunkDWUDZ66O_cjs.RECORDED_MAX_REVISION) {
|
|
112
|
+
throw new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
113
113
|
"Recorded anchor mapping contained an invalid revision.",
|
|
114
114
|
{ value }
|
|
115
115
|
);
|
|
@@ -118,9 +118,9 @@ function safeRevision(value) {
|
|
|
118
118
|
}
|
|
119
119
|
async function columnNames(target, tableName) {
|
|
120
120
|
const rows = target.dialect === "sqlite" ? await target.execute(
|
|
121
|
-
|
|
121
|
+
chunkOJHD3LXJ_cjs.asCompiledRowsSql(chunkOJHD3LXJ_cjs.sql`PRAGMA table_info(${chunkOJHD3LXJ_cjs.sql.identifier(tableName)})`)
|
|
122
122
|
) : await target.execute(
|
|
123
|
-
|
|
123
|
+
chunkOJHD3LXJ_cjs.asCompiledRowsSql(chunkOJHD3LXJ_cjs.sql`
|
|
124
124
|
SELECT column_name AS name
|
|
125
125
|
FROM information_schema.columns
|
|
126
126
|
WHERE table_schema = current_schema()
|
|
@@ -133,28 +133,28 @@ async function columnNames(target, tableName) {
|
|
|
133
133
|
}
|
|
134
134
|
async function readLegacyInstants(target, tables) {
|
|
135
135
|
const rows = await target.execute(
|
|
136
|
-
|
|
136
|
+
chunkOJHD3LXJ_cjs.asCompiledRowsSql(chunkOJHD3LXJ_cjs.sql`
|
|
137
137
|
SELECT graph_id, recorded_from AS recorded_at
|
|
138
|
-
FROM ${
|
|
138
|
+
FROM ${chunkOJHD3LXJ_cjs.sql.identifier(tables.recordedNodes)}
|
|
139
139
|
UNION
|
|
140
140
|
SELECT graph_id, recorded_to AS recorded_at
|
|
141
|
-
FROM ${
|
|
141
|
+
FROM ${chunkOJHD3LXJ_cjs.sql.identifier(tables.recordedNodes)}
|
|
142
142
|
WHERE recorded_to <> ${LEGACY_RECORDED_MAX}
|
|
143
143
|
UNION
|
|
144
144
|
SELECT graph_id, recorded_from AS recorded_at
|
|
145
|
-
FROM ${
|
|
145
|
+
FROM ${chunkOJHD3LXJ_cjs.sql.identifier(tables.recordedEdges)}
|
|
146
146
|
UNION
|
|
147
147
|
SELECT graph_id, recorded_to AS recorded_at
|
|
148
|
-
FROM ${
|
|
148
|
+
FROM ${chunkOJHD3LXJ_cjs.sql.identifier(tables.recordedEdges)}
|
|
149
149
|
WHERE recorded_to <> ${LEGACY_RECORDED_MAX}
|
|
150
150
|
UNION
|
|
151
151
|
SELECT graph_id, recorded_at
|
|
152
|
-
FROM ${
|
|
152
|
+
FROM ${chunkOJHD3LXJ_cjs.sql.identifier(tables.recordedClock)}
|
|
153
153
|
`)
|
|
154
154
|
);
|
|
155
155
|
const instants = rows.map((row) => {
|
|
156
156
|
if (typeof row.graph_id !== "string") {
|
|
157
|
-
throw new
|
|
157
|
+
throw new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
158
158
|
"Legacy recorded-time relation contained an invalid graph id.",
|
|
159
159
|
{ graphId: row.graph_id }
|
|
160
160
|
);
|
|
@@ -205,38 +205,38 @@ function migrationMapDdl(dialect, table) {
|
|
|
205
205
|
);`;
|
|
206
206
|
}
|
|
207
207
|
async function writeMappingRows(target, tableName, rows) {
|
|
208
|
-
await executeStatement(target,
|
|
208
|
+
await executeStatement(target, chunkOJHD3LXJ_cjs.sql`DELETE FROM ${chunkOJHD3LXJ_cjs.sql.identifier(tableName)}`);
|
|
209
209
|
const rowsPerStatement = Math.max(
|
|
210
210
|
1,
|
|
211
211
|
Math.floor((target.capabilities.maxBindParameters ?? 900) / 4)
|
|
212
212
|
);
|
|
213
213
|
for (let start = 0; start < rows.length; start += rowsPerStatement) {
|
|
214
214
|
const values = rows.slice(start, start + rowsPerStatement).map(
|
|
215
|
-
(row) =>
|
|
215
|
+
(row) => chunkOJHD3LXJ_cjs.sql`(${row.graphId}, ${row.legacyRecordedAt}, ${row.revision}, ${row.recordedAt})`
|
|
216
216
|
);
|
|
217
217
|
await executeStatement(
|
|
218
218
|
target,
|
|
219
|
-
|
|
220
|
-
INSERT INTO ${
|
|
219
|
+
chunkOJHD3LXJ_cjs.sql`
|
|
220
|
+
INSERT INTO ${chunkOJHD3LXJ_cjs.sql.identifier(tableName)}
|
|
221
221
|
(graph_id, legacy_recorded_at, revision, recorded_at)
|
|
222
|
-
VALUES ${
|
|
222
|
+
VALUES ${chunkOJHD3LXJ_cjs.sql.join(values, chunkOJHD3LXJ_cjs.sql`, `)}
|
|
223
223
|
`
|
|
224
224
|
);
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
function tableDdl(dialect, tables, temporary) {
|
|
228
228
|
if (dialect === "sqlite") {
|
|
229
|
-
const temporaryTables2 =
|
|
230
|
-
const finalTables2 =
|
|
231
|
-
const temporaryContributions =
|
|
232
|
-
const finalContributions =
|
|
229
|
+
const temporaryTables2 = chunkTP4NJTI3_cjs.createSqliteTables(temporary);
|
|
230
|
+
const finalTables2 = chunkTP4NJTI3_cjs.createSqliteTables(tables);
|
|
231
|
+
const temporaryContributions = chunkTP4NJTI3_cjs.sqliteContributions(temporaryTables2);
|
|
232
|
+
const finalContributions = chunkTP4NJTI3_cjs.sqliteContributions(finalTables2);
|
|
233
233
|
return ddlForRecordedTables(temporaryContributions, finalContributions);
|
|
234
234
|
}
|
|
235
|
-
const temporaryTables =
|
|
236
|
-
const finalTables =
|
|
235
|
+
const temporaryTables = chunkTP4NJTI3_cjs.createPostgresTables(temporary);
|
|
236
|
+
const finalTables = chunkTP4NJTI3_cjs.createPostgresTables(tables);
|
|
237
237
|
return ddlForRecordedTables(
|
|
238
|
-
|
|
239
|
-
|
|
238
|
+
chunkTP4NJTI3_cjs.postgresContributions(temporaryTables),
|
|
239
|
+
chunkTP4NJTI3_cjs.postgresContributions(finalTables)
|
|
240
240
|
);
|
|
241
241
|
}
|
|
242
242
|
function ddlForRecordedTables(temporary, final) {
|
|
@@ -248,13 +248,13 @@ function ddlForRecordedTables(temporary, final) {
|
|
|
248
248
|
(entry) => entry.logicalName === logicalName
|
|
249
249
|
)?.createDdl;
|
|
250
250
|
if (temporaryDdl === void 0 || finalDdl === void 0) {
|
|
251
|
-
throw new
|
|
251
|
+
throw new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
252
252
|
`Could not generate migration DDL for ${logicalName}.`
|
|
253
253
|
);
|
|
254
254
|
}
|
|
255
255
|
const createTable = temporaryDdl[0];
|
|
256
256
|
if (createTable === void 0) {
|
|
257
|
-
throw new
|
|
257
|
+
throw new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
258
258
|
`Could not generate migration table DDL for ${logicalName}.`
|
|
259
259
|
);
|
|
260
260
|
}
|
|
@@ -267,27 +267,27 @@ function ddlForRecordedTables(temporary, final) {
|
|
|
267
267
|
};
|
|
268
268
|
}
|
|
269
269
|
function migratedColumn(column, legacyAlias) {
|
|
270
|
-
if (column === "recorded_from") return
|
|
270
|
+
if (column === "recorded_from") return chunkOJHD3LXJ_cjs.sql`from_map.revision`;
|
|
271
271
|
if (column === "recorded_to") {
|
|
272
|
-
return
|
|
272
|
+
return chunkOJHD3LXJ_cjs.sql`
|
|
273
273
|
CASE
|
|
274
|
-
WHEN ${
|
|
275
|
-
THEN ${
|
|
274
|
+
WHEN ${chunkOJHD3LXJ_cjs.sql.raw(legacyAlias)}.recorded_to = ${LEGACY_RECORDED_MAX}
|
|
275
|
+
THEN ${chunkDWUDZ66O_cjs.RECORDED_MAX_REVISION}
|
|
276
276
|
ELSE to_map.revision
|
|
277
277
|
END
|
|
278
278
|
`;
|
|
279
279
|
}
|
|
280
|
-
return
|
|
280
|
+
return chunkOJHD3LXJ_cjs.sql`${chunkOJHD3LXJ_cjs.sql.raw(legacyAlias)}.${chunkOJHD3LXJ_cjs.sql.identifier(column)}`;
|
|
281
281
|
}
|
|
282
282
|
function mappingMatch(dialect, mappingAlias, legacyColumn) {
|
|
283
|
-
const mapping =
|
|
284
|
-
const legacy =
|
|
285
|
-
return dialect === "postgres" ?
|
|
283
|
+
const mapping = chunkOJHD3LXJ_cjs.sql.raw(mappingAlias);
|
|
284
|
+
const legacy = chunkOJHD3LXJ_cjs.sql.raw(`legacy.${legacyColumn}`);
|
|
285
|
+
return dialect === "postgres" ? chunkOJHD3LXJ_cjs.sql`${mapping}.recorded_at = ${legacy}` : chunkOJHD3LXJ_cjs.sql`${mapping}.legacy_recorded_at = ${legacy}`;
|
|
286
286
|
}
|
|
287
287
|
function missingMappingCount(value, legacyTable) {
|
|
288
288
|
const count = Number(value);
|
|
289
289
|
if (!Number.isSafeInteger(count) || count < 0) {
|
|
290
|
-
throw new
|
|
290
|
+
throw new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
291
291
|
"Recorded-time migration returned an invalid integrity-check count.",
|
|
292
292
|
{ legacyTable, value }
|
|
293
293
|
);
|
|
@@ -298,12 +298,12 @@ async function assertRecordedRelationMappings(target, options) {
|
|
|
298
298
|
const fromMatch = mappingMatch(target.dialect, "from_map", "recorded_from");
|
|
299
299
|
const toMatch = mappingMatch(target.dialect, "to_map", "recorded_to");
|
|
300
300
|
const rows = await target.execute(
|
|
301
|
-
|
|
301
|
+
chunkOJHD3LXJ_cjs.asCompiledRowsSql(chunkOJHD3LXJ_cjs.sql`
|
|
302
302
|
SELECT COUNT(*) AS missing
|
|
303
|
-
FROM ${
|
|
304
|
-
LEFT JOIN ${
|
|
303
|
+
FROM ${chunkOJHD3LXJ_cjs.sql.identifier(options.legacyTable)} AS legacy
|
|
304
|
+
LEFT JOIN ${chunkOJHD3LXJ_cjs.sql.identifier(options.mappingTable)} AS from_map
|
|
305
305
|
ON from_map.graph_id = legacy.graph_id AND ${fromMatch}
|
|
306
|
-
LEFT JOIN ${
|
|
306
|
+
LEFT JOIN ${chunkOJHD3LXJ_cjs.sql.identifier(options.mappingTable)} AS to_map
|
|
307
307
|
ON to_map.graph_id = legacy.graph_id AND ${toMatch}
|
|
308
308
|
WHERE from_map.revision IS NULL
|
|
309
309
|
OR (
|
|
@@ -314,7 +314,7 @@ async function assertRecordedRelationMappings(target, options) {
|
|
|
314
314
|
);
|
|
315
315
|
const missing = missingMappingCount(rows[0]?.missing, options.legacyTable);
|
|
316
316
|
if (missing === 0) return;
|
|
317
|
-
throw new
|
|
317
|
+
throw new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
318
318
|
"Legacy recorded-time boundaries could not be mapped exactly.",
|
|
319
319
|
{ legacyTable: options.legacyTable, missingRows: missing },
|
|
320
320
|
{
|
|
@@ -325,17 +325,17 @@ async function assertRecordedRelationMappings(target, options) {
|
|
|
325
325
|
async function assertRecordedClockMappings(target, options) {
|
|
326
326
|
const match = mappingMatch(target.dialect, "anchor_map", "recorded_at");
|
|
327
327
|
const rows = await target.execute(
|
|
328
|
-
|
|
328
|
+
chunkOJHD3LXJ_cjs.asCompiledRowsSql(chunkOJHD3LXJ_cjs.sql`
|
|
329
329
|
SELECT COUNT(*) AS missing
|
|
330
|
-
FROM ${
|
|
331
|
-
LEFT JOIN ${
|
|
330
|
+
FROM ${chunkOJHD3LXJ_cjs.sql.identifier(options.legacyTable)} AS legacy
|
|
331
|
+
LEFT JOIN ${chunkOJHD3LXJ_cjs.sql.identifier(options.mappingTable)} AS anchor_map
|
|
332
332
|
ON anchor_map.graph_id = legacy.graph_id AND ${match}
|
|
333
333
|
WHERE anchor_map.revision IS NULL
|
|
334
334
|
`)
|
|
335
335
|
);
|
|
336
336
|
const missing = missingMappingCount(rows[0]?.missing, options.legacyTable);
|
|
337
337
|
if (missing === 0) return;
|
|
338
|
-
throw new
|
|
338
|
+
throw new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
339
339
|
"Legacy recorded clock values could not be mapped exactly.",
|
|
340
340
|
{ legacyTable: options.legacyTable, missingRows: missing },
|
|
341
341
|
{
|
|
@@ -344,7 +344,7 @@ async function assertRecordedClockMappings(target, options) {
|
|
|
344
344
|
);
|
|
345
345
|
}
|
|
346
346
|
async function copyRecordedRelation(target, options) {
|
|
347
|
-
const columnList = options.columns.map((column) =>
|
|
347
|
+
const columnList = options.columns.map((column) => chunkOJHD3LXJ_cjs.sql.identifier(column));
|
|
348
348
|
const values = options.columns.map(
|
|
349
349
|
(column) => migratedColumn(column, "legacy")
|
|
350
350
|
);
|
|
@@ -353,16 +353,16 @@ async function copyRecordedRelation(target, options) {
|
|
|
353
353
|
const toMatch = mappingMatch(target.dialect, "to_map", "recorded_to");
|
|
354
354
|
await executeStatement(
|
|
355
355
|
target,
|
|
356
|
-
|
|
357
|
-
INSERT INTO ${
|
|
358
|
-
(${
|
|
359
|
-
SELECT ${
|
|
360
|
-
FROM ${
|
|
356
|
+
chunkOJHD3LXJ_cjs.sql`
|
|
357
|
+
INSERT INTO ${chunkOJHD3LXJ_cjs.sql.identifier(options.temporaryTable)}
|
|
358
|
+
(${chunkOJHD3LXJ_cjs.sql.join(columnList, chunkOJHD3LXJ_cjs.sql`, `)})
|
|
359
|
+
SELECT ${chunkOJHD3LXJ_cjs.sql.join(values, chunkOJHD3LXJ_cjs.sql`, `)}
|
|
360
|
+
FROM ${chunkOJHD3LXJ_cjs.sql.identifier(options.legacyTable)} AS legacy
|
|
361
361
|
-- LEFT JOIN is deliberate: a missing mapping reaches the NOT NULL
|
|
362
362
|
-- revision columns and fails loud instead of silently dropping history.
|
|
363
|
-
LEFT JOIN ${
|
|
363
|
+
LEFT JOIN ${chunkOJHD3LXJ_cjs.sql.identifier(options.mappingTable)} AS from_map
|
|
364
364
|
ON from_map.graph_id = legacy.graph_id AND ${fromMatch}
|
|
365
|
-
LEFT JOIN ${
|
|
365
|
+
LEFT JOIN ${chunkOJHD3LXJ_cjs.sql.identifier(options.mappingTable)} AS to_map
|
|
366
366
|
ON to_map.graph_id = legacy.graph_id AND ${toMatch}
|
|
367
367
|
`
|
|
368
368
|
);
|
|
@@ -372,13 +372,13 @@ async function copyRecordedClock(target, options) {
|
|
|
372
372
|
const match = mappingMatch(target.dialect, "anchor_map", "recorded_at");
|
|
373
373
|
await executeStatement(
|
|
374
374
|
target,
|
|
375
|
-
|
|
376
|
-
INSERT INTO ${
|
|
375
|
+
chunkOJHD3LXJ_cjs.sql`
|
|
376
|
+
INSERT INTO ${chunkOJHD3LXJ_cjs.sql.identifier(options.temporaryTable)}
|
|
377
377
|
(graph_id, revision, recorded_at)
|
|
378
378
|
SELECT legacy.graph_id, anchor_map.revision, legacy.recorded_at
|
|
379
|
-
FROM ${
|
|
379
|
+
FROM ${chunkOJHD3LXJ_cjs.sql.identifier(options.legacyTable)} AS legacy
|
|
380
380
|
-- Preserve fail-loud behavior if the preflight invariant changes later.
|
|
381
|
-
LEFT JOIN ${
|
|
381
|
+
LEFT JOIN ${chunkOJHD3LXJ_cjs.sql.identifier(options.mappingTable)} AS anchor_map
|
|
382
382
|
ON anchor_map.graph_id = legacy.graph_id AND ${match}
|
|
383
383
|
`
|
|
384
384
|
);
|
|
@@ -393,7 +393,7 @@ async function replaceLegacyTables(target, tables, mappingTable) {
|
|
|
393
393
|
for (const table of Object.values(temporary)) {
|
|
394
394
|
await executeStatement(
|
|
395
395
|
target,
|
|
396
|
-
|
|
396
|
+
chunkOJHD3LXJ_cjs.sql`DROP TABLE IF EXISTS ${chunkOJHD3LXJ_cjs.sql.identifier(table)}`
|
|
397
397
|
);
|
|
398
398
|
}
|
|
399
399
|
await executeDdl(target, requireCreateTable(ddl.nodes));
|
|
@@ -418,15 +418,15 @@ async function replaceLegacyTables(target, tables, mappingTable) {
|
|
|
418
418
|
});
|
|
419
419
|
await executeStatement(
|
|
420
420
|
target,
|
|
421
|
-
|
|
421
|
+
chunkOJHD3LXJ_cjs.sql`DROP TABLE ${chunkOJHD3LXJ_cjs.sql.identifier(tables.recordedNodes)}`
|
|
422
422
|
);
|
|
423
423
|
await executeStatement(
|
|
424
424
|
target,
|
|
425
|
-
|
|
425
|
+
chunkOJHD3LXJ_cjs.sql`DROP TABLE ${chunkOJHD3LXJ_cjs.sql.identifier(tables.recordedEdges)}`
|
|
426
426
|
);
|
|
427
427
|
await executeStatement(
|
|
428
428
|
target,
|
|
429
|
-
|
|
429
|
+
chunkOJHD3LXJ_cjs.sql`DROP TABLE ${chunkOJHD3LXJ_cjs.sql.identifier(tables.recordedClock)}`
|
|
430
430
|
);
|
|
431
431
|
await renameTable(target, temporary.recordedNodes, tables.recordedNodes);
|
|
432
432
|
await renameTable(target, temporary.recordedEdges, tables.recordedEdges);
|
|
@@ -458,17 +458,17 @@ async function renamePrimaryKeyConstraint(target, temporaryTable, finalTable) {
|
|
|
458
458
|
if (target.dialect !== "postgres") return;
|
|
459
459
|
await executeStatement(
|
|
460
460
|
target,
|
|
461
|
-
|
|
462
|
-
ALTER TABLE ${
|
|
463
|
-
RENAME CONSTRAINT ${
|
|
464
|
-
TO ${
|
|
461
|
+
chunkOJHD3LXJ_cjs.sql`
|
|
462
|
+
ALTER TABLE ${chunkOJHD3LXJ_cjs.sql.identifier(finalTable)}
|
|
463
|
+
RENAME CONSTRAINT ${chunkOJHD3LXJ_cjs.sql.identifier(`${temporaryTable}_pkey`)}
|
|
464
|
+
TO ${chunkOJHD3LXJ_cjs.sql.identifier(shortenedIdentifier(`${finalTable}_pkey`))}
|
|
465
465
|
`
|
|
466
466
|
);
|
|
467
467
|
}
|
|
468
468
|
function requireCreateTable(statements) {
|
|
469
469
|
const statement = statements[0];
|
|
470
470
|
if (statement === void 0) {
|
|
471
|
-
throw new
|
|
471
|
+
throw new chunkX4GDXBOP_cjs.ConfigurationError("Recorded migration table DDL was empty.");
|
|
472
472
|
}
|
|
473
473
|
return statement;
|
|
474
474
|
}
|
|
@@ -476,10 +476,10 @@ async function renameTable(target, from, to) {
|
|
|
476
476
|
try {
|
|
477
477
|
await executeStatement(
|
|
478
478
|
target,
|
|
479
|
-
|
|
479
|
+
chunkOJHD3LXJ_cjs.sql`ALTER TABLE ${chunkOJHD3LXJ_cjs.sql.identifier(from)} RENAME TO ${chunkOJHD3LXJ_cjs.sql.identifier(to)}`
|
|
480
480
|
);
|
|
481
481
|
} catch (error) {
|
|
482
|
-
throw new
|
|
482
|
+
throw new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
483
483
|
"Could not rename a migrated recorded-time table.",
|
|
484
484
|
{ from, to },
|
|
485
485
|
{ cause: error }
|
|
@@ -510,9 +510,9 @@ async function migrateLegacyRecordedTime(options) {
|
|
|
510
510
|
};
|
|
511
511
|
}
|
|
512
512
|
const rows = await target.execute(
|
|
513
|
-
|
|
513
|
+
chunkOJHD3LXJ_cjs.asCompiledRowsSql(chunkOJHD3LXJ_cjs.sql`
|
|
514
514
|
SELECT COUNT(*) AS anchors, COUNT(DISTINCT graph_id) AS graphs
|
|
515
|
-
FROM ${
|
|
515
|
+
FROM ${chunkOJHD3LXJ_cjs.sql.identifier(mapTable)}
|
|
516
516
|
`)
|
|
517
517
|
);
|
|
518
518
|
const anchors = Number(rows[0]?.anchors ?? 0);
|
|
@@ -527,7 +527,7 @@ async function migrateLegacyRecordedTime(options) {
|
|
|
527
527
|
const nodeColumns = await columnNames(target, tables.recordedNodes);
|
|
528
528
|
const edgeColumns = await columnNames(target, tables.recordedEdges);
|
|
529
529
|
if (!nodeColumns.has("recorded_from") || !edgeColumns.has("recorded_from")) {
|
|
530
|
-
throw new
|
|
530
|
+
throw new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
531
531
|
"Legacy recorded-time schema is incomplete.",
|
|
532
532
|
{ tables }
|
|
533
533
|
);
|
|
@@ -546,24 +546,24 @@ async function migrateLegacyRecordedTime(options) {
|
|
|
546
546
|
}
|
|
547
547
|
async function migrateRecordedAnchor(options) {
|
|
548
548
|
try {
|
|
549
|
-
return
|
|
549
|
+
return chunkDWUDZ66O_cjs.asRecordedInstant(options.anchor);
|
|
550
550
|
} catch (error) {
|
|
551
|
-
if (!(error instanceof
|
|
551
|
+
if (!(error instanceof chunkX4GDXBOP_cjs.ValidationError)) throw error;
|
|
552
552
|
}
|
|
553
553
|
const legacyRecordedAt = canonicalLegacyInstant(options.anchor);
|
|
554
554
|
const tables = resolvedTableNames(options.backend, options.tableNames);
|
|
555
555
|
const mapTable = mappingTableName(tables, options.mappingTableName);
|
|
556
556
|
const rows = await options.backend.execute(
|
|
557
|
-
|
|
557
|
+
chunkOJHD3LXJ_cjs.asCompiledRowsSql(chunkOJHD3LXJ_cjs.sql`
|
|
558
558
|
SELECT revision, recorded_at
|
|
559
|
-
FROM ${
|
|
559
|
+
FROM ${chunkOJHD3LXJ_cjs.sql.identifier(mapTable)}
|
|
560
560
|
WHERE graph_id = ${options.graphId}
|
|
561
561
|
AND legacy_recorded_at = ${legacyRecordedAt}
|
|
562
562
|
`)
|
|
563
563
|
);
|
|
564
564
|
const row = rows[0];
|
|
565
565
|
if (row === void 0) {
|
|
566
|
-
throw new
|
|
566
|
+
throw new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
567
567
|
"No migrated recorded anchor matches this graph and legacy timestamp.",
|
|
568
568
|
{ anchor: options.anchor, graphId: options.graphId },
|
|
569
569
|
{
|
|
@@ -571,14 +571,14 @@ async function migrateRecordedAnchor(options) {
|
|
|
571
571
|
}
|
|
572
572
|
);
|
|
573
573
|
}
|
|
574
|
-
return
|
|
574
|
+
return chunkDWUDZ66O_cjs.createRecordedInstant(
|
|
575
575
|
safeRevision(row.revision),
|
|
576
576
|
canonicalLegacyInstant(row.recorded_at)
|
|
577
577
|
);
|
|
578
578
|
}
|
|
579
579
|
async function deleteLegacyRecordedAnchorMap(options) {
|
|
580
580
|
if (options.backend.executeStatement === void 0) {
|
|
581
|
-
throw new
|
|
581
|
+
throw new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
582
582
|
"Deleting a recorded anchor migration map requires executeStatement support.",
|
|
583
583
|
{ dialect: options.backend.dialect }
|
|
584
584
|
);
|
|
@@ -588,23 +588,23 @@ async function deleteLegacyRecordedAnchorMap(options) {
|
|
|
588
588
|
await options.backend.transaction(async (target) => {
|
|
589
589
|
await executeStatement(
|
|
590
590
|
target,
|
|
591
|
-
|
|
592
|
-
DELETE FROM ${
|
|
591
|
+
chunkOJHD3LXJ_cjs.sql`
|
|
592
|
+
DELETE FROM ${chunkOJHD3LXJ_cjs.sql.identifier(mapTable)}
|
|
593
593
|
WHERE graph_id = ${options.graphId}
|
|
594
594
|
`
|
|
595
595
|
);
|
|
596
596
|
if (options.dropWhenEmpty !== true) return;
|
|
597
597
|
const rows = await target.execute(
|
|
598
|
-
|
|
598
|
+
chunkOJHD3LXJ_cjs.asCompiledRowsSql(chunkOJHD3LXJ_cjs.sql`
|
|
599
599
|
SELECT COUNT(*) AS anchors, COUNT(DISTINCT graph_id) AS graphs
|
|
600
|
-
FROM ${
|
|
600
|
+
FROM ${chunkOJHD3LXJ_cjs.sql.identifier(mapTable)}
|
|
601
601
|
`)
|
|
602
602
|
);
|
|
603
603
|
const remaining = missingMappingCount(rows[0]?.anchors, mapTable);
|
|
604
604
|
if (remaining === 0) {
|
|
605
605
|
await executeStatement(
|
|
606
606
|
target,
|
|
607
|
-
|
|
607
|
+
chunkOJHD3LXJ_cjs.sql`DROP TABLE ${chunkOJHD3LXJ_cjs.sql.identifier(mapTable)}`
|
|
608
608
|
);
|
|
609
609
|
}
|
|
610
610
|
});
|
|
@@ -640,42 +640,42 @@ function relationTable(tables, relation) {
|
|
|
640
640
|
}
|
|
641
641
|
}
|
|
642
642
|
function graphScopeClauses(graphId) {
|
|
643
|
-
return graphId === void 0 ? [] : [
|
|
643
|
+
return graphId === void 0 ? [] : [chunkOJHD3LXJ_cjs.sql`graph_id = ${graphId}`];
|
|
644
644
|
}
|
|
645
645
|
function canonicalBoundsClauses(dialect) {
|
|
646
646
|
if (dialect !== "sqlite") return [];
|
|
647
647
|
return [
|
|
648
|
-
|
|
649
|
-
|
|
648
|
+
chunkOJHD3LXJ_cjs.sql`valid_from GLOB ${CANONICAL_INSTANT_GLOB}`,
|
|
649
|
+
chunkOJHD3LXJ_cjs.sql`valid_to GLOB ${CANONICAL_INSTANT_GLOB}`
|
|
650
650
|
];
|
|
651
651
|
}
|
|
652
652
|
function invertedValidityWindowPredicate(options) {
|
|
653
|
-
return
|
|
653
|
+
return chunkOJHD3LXJ_cjs.sql.join(
|
|
654
654
|
[
|
|
655
|
-
|
|
656
|
-
|
|
655
|
+
chunkOJHD3LXJ_cjs.sql`valid_from IS NOT NULL`,
|
|
656
|
+
chunkOJHD3LXJ_cjs.sql`valid_to IS NOT NULL`,
|
|
657
657
|
...canonicalBoundsClauses(options.dialect),
|
|
658
|
-
|
|
658
|
+
chunkOJHD3LXJ_cjs.sql`valid_from > valid_to`,
|
|
659
659
|
...graphScopeClauses(options.graphId)
|
|
660
660
|
],
|
|
661
|
-
|
|
661
|
+
chunkOJHD3LXJ_cjs.sql` AND `
|
|
662
662
|
);
|
|
663
663
|
}
|
|
664
664
|
function nonCanonicalWindowPredicate(graphId) {
|
|
665
|
-
return
|
|
665
|
+
return chunkOJHD3LXJ_cjs.sql.join(
|
|
666
666
|
[
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
667
|
+
chunkOJHD3LXJ_cjs.sql`valid_from IS NOT NULL`,
|
|
668
|
+
chunkOJHD3LXJ_cjs.sql`valid_to IS NOT NULL`,
|
|
669
|
+
chunkOJHD3LXJ_cjs.sql`(valid_from NOT GLOB ${CANONICAL_INSTANT_GLOB} OR valid_to NOT GLOB ${CANONICAL_INSTANT_GLOB})`,
|
|
670
670
|
...graphScopeClauses(graphId)
|
|
671
671
|
],
|
|
672
|
-
|
|
672
|
+
chunkOJHD3LXJ_cjs.sql` AND `
|
|
673
673
|
);
|
|
674
674
|
}
|
|
675
675
|
function safeCount(value, table) {
|
|
676
676
|
const count = Number(value);
|
|
677
677
|
if (!Number.isSafeInteger(count) || count < 0) {
|
|
678
|
-
throw new
|
|
678
|
+
throw new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
679
679
|
"Validity-window repair returned an invalid row count.",
|
|
680
680
|
{ table, value }
|
|
681
681
|
);
|
|
@@ -684,9 +684,9 @@ function safeCount(value, table) {
|
|
|
684
684
|
}
|
|
685
685
|
async function countMatching(target, table, predicate) {
|
|
686
686
|
const rows = await target.execute(
|
|
687
|
-
|
|
687
|
+
chunkOJHD3LXJ_cjs.asCompiledRowsSql(chunkOJHD3LXJ_cjs.sql`
|
|
688
688
|
SELECT COUNT(*) AS matches
|
|
689
|
-
FROM ${
|
|
689
|
+
FROM ${chunkOJHD3LXJ_cjs.sql.identifier(table)}
|
|
690
690
|
WHERE ${predicate}
|
|
691
691
|
`)
|
|
692
692
|
);
|
|
@@ -694,7 +694,7 @@ async function countMatching(target, table, predicate) {
|
|
|
694
694
|
}
|
|
695
695
|
function requireStatements2(target) {
|
|
696
696
|
if (target.executeStatement === void 0) {
|
|
697
|
-
throw new
|
|
697
|
+
throw new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
698
698
|
"Repairing inverted validity windows requires executeStatement support.",
|
|
699
699
|
{ dialect: target.dialect, mode: "apply" },
|
|
700
700
|
{
|
|
@@ -705,10 +705,10 @@ function requireStatements2(target) {
|
|
|
705
705
|
return target.executeStatement;
|
|
706
706
|
}
|
|
707
707
|
function translatedCaptureRefusal(error) {
|
|
708
|
-
if (!(error instanceof
|
|
708
|
+
if (!(error instanceof chunkX4GDXBOP_cjs.ConfigurationError) || error.details["code"] !== "RECORDED_CAPTURE_RAW_SQL_DISABLED") {
|
|
709
709
|
return error;
|
|
710
710
|
}
|
|
711
|
-
return new
|
|
711
|
+
return new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
712
712
|
"Repairing inverted validity windows cannot run against a history-capturing backend.",
|
|
713
713
|
{ code: "RECORDED_CAPTURE_RAW_SQL_DISABLED", mode: "apply" },
|
|
714
714
|
{
|
|
@@ -720,8 +720,8 @@ function translatedCaptureRefusal(error) {
|
|
|
720
720
|
async function repairRelation(target, table, predicate) {
|
|
721
721
|
try {
|
|
722
722
|
await requireStatements2(target)(
|
|
723
|
-
|
|
724
|
-
UPDATE ${
|
|
723
|
+
chunkOJHD3LXJ_cjs.asCompiledStatementSql(chunkOJHD3LXJ_cjs.sql`
|
|
724
|
+
UPDATE ${chunkOJHD3LXJ_cjs.sql.identifier(table)}
|
|
725
725
|
SET valid_from = NULL
|
|
726
726
|
WHERE ${predicate}
|
|
727
727
|
`)
|
|
@@ -733,7 +733,7 @@ async function repairRelation(target, table, predicate) {
|
|
|
733
733
|
function assertClassifiableBounds(nonCanonical) {
|
|
734
734
|
const unclassified = [...nonCanonical].filter(([, count]) => count > 0);
|
|
735
735
|
if (unclassified.length === 0) return;
|
|
736
|
-
throw new
|
|
736
|
+
throw new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
737
737
|
"Refusing to repair validity windows: some scanned rows store non-canonical bounds.",
|
|
738
738
|
{ nonCanonical: Object.fromEntries(unclassified) },
|
|
739
739
|
{
|
|
@@ -756,7 +756,7 @@ async function repairInvertedValidityWindows(options) {
|
|
|
756
756
|
const tables = resolvedTableNames(options.backend, options.tableNames);
|
|
757
757
|
const relations = scopedRelations(options.relations);
|
|
758
758
|
if (options.mode === "apply") requireStatements2(options.backend);
|
|
759
|
-
return
|
|
759
|
+
return chunkGHZPZNFC_cjs.runOptionallyInTransaction(
|
|
760
760
|
options.backend,
|
|
761
761
|
async (target, execution) => {
|
|
762
762
|
const predicate = invertedValidityWindowPredicate({
|
|
@@ -802,5 +802,5 @@ exports.deleteLegacyRecordedAnchorMap = deleteLegacyRecordedAnchorMap;
|
|
|
802
802
|
exports.migrateLegacyRecordedTime = migrateLegacyRecordedTime;
|
|
803
803
|
exports.migrateRecordedAnchor = migrateRecordedAnchor;
|
|
804
804
|
exports.repairInvertedValidityWindows = repairInvertedValidityWindows;
|
|
805
|
-
//# sourceMappingURL=chunk-
|
|
806
|
-
//# sourceMappingURL=chunk-
|
|
805
|
+
//# sourceMappingURL=chunk-TTCOPKUL.cjs.map
|
|
806
|
+
//# sourceMappingURL=chunk-TTCOPKUL.cjs.map
|