@nicia-ai/typegraph 0.50.0 → 0.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/dist/backend/drizzle/indexes.cjs +10 -8
- package/dist/backend/drizzle/indexes.d.cts +1 -1
- package/dist/backend/drizzle/indexes.d.ts +1 -1
- package/dist/backend/drizzle/indexes.js +6 -4
- package/dist/backend/index.cjs +183 -50
- package/dist/backend/index.d.cts +90 -4
- package/dist/backend/index.d.ts +90 -4
- package/dist/backend/index.js +6 -9
- package/dist/backend/postgres/index.cjs +30 -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 +16 -14
- package/dist/backend/postgres/pglite-store.cjs +6 -62
- 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 +6 -62
- package/dist/backend/postgres/pglite-store.js.map +1 -1
- package/dist/backend/postgres/pglite.cjs +18 -16
- package/dist/backend/postgres/pglite.d.cts +3 -3
- package/dist/backend/postgres/pglite.d.ts +3 -3
- package/dist/backend/postgres/pglite.js +17 -15
- package/dist/backend/sqlite/index.cjs +27 -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 +14 -12
- package/dist/backend/sqlite/libsql.cjs +21 -19
- 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 +16 -14
- package/dist/backend/sqlite/libsql.js.map +1 -1
- package/dist/backend/sqlite/local-store.cjs +8 -64
- 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 +7 -64
- package/dist/backend/sqlite/local-store.js.map +1 -1
- package/dist/backend/sqlite/local.cjs +22 -19
- 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 -15
- package/dist/{chunk-TUVD4DFR.cjs → chunk-2CVDZCXH.cjs} +122 -51
- package/dist/chunk-2CVDZCXH.cjs.map +1 -0
- package/dist/{chunk-I5C6OTKR.js → chunk-2DWTBNSH.js} +3 -3
- package/dist/{chunk-I5C6OTKR.js.map → chunk-2DWTBNSH.js.map} +1 -1
- package/dist/{chunk-C76WFIVZ.cjs → chunk-2KCTP3U2.cjs} +180 -127
- package/dist/chunk-2KCTP3U2.cjs.map +1 -0
- package/dist/{chunk-BYBDM423.cjs → chunk-322TBTOQ.cjs} +48 -48
- package/dist/{chunk-BYBDM423.cjs.map → chunk-322TBTOQ.cjs.map} +1 -1
- package/dist/chunk-36SX6QXP.cjs +186 -0
- package/dist/chunk-36SX6QXP.cjs.map +1 -0
- package/dist/{chunk-H3XP6BAV.js → chunk-36VYWVQU.js} +3 -3
- package/dist/{chunk-H3XP6BAV.js.map → chunk-36VYWVQU.js.map} +1 -1
- package/dist/{chunk-VTJVMP4I.js → chunk-4DKY6RIU.js} +102 -31
- package/dist/chunk-4DKY6RIU.js.map +1 -0
- package/dist/chunk-4QKOZYMV.js +9 -0
- package/dist/chunk-4QKOZYMV.js.map +1 -0
- package/dist/{chunk-U3Z7XKAG.js → chunk-57JM6NW3.js} +8 -18
- package/dist/chunk-57JM6NW3.js.map +1 -0
- package/dist/{chunk-XMY2SXOH.cjs → chunk-5WWEYV4H.cjs} +2208 -579
- package/dist/chunk-5WWEYV4H.cjs.map +1 -0
- package/dist/{chunk-WQBAQZHR.js → chunk-6NLYIMJO.js} +4 -4
- package/dist/{chunk-WQBAQZHR.js.map → chunk-6NLYIMJO.js.map} +1 -1
- package/dist/{chunk-G2TLHH6T.cjs → chunk-7B7I7YAW.cjs} +6 -6
- package/dist/{chunk-G2TLHH6T.cjs.map → chunk-7B7I7YAW.cjs.map} +1 -1
- package/dist/{chunk-EDLKIQRI.js → chunk-7G5IYROL.js} +6 -548
- package/dist/chunk-7G5IYROL.js.map +1 -0
- package/dist/{chunk-46UGOVRW.js → chunk-7QFRK6PU.js} +3 -7
- package/dist/chunk-7QFRK6PU.js.map +1 -0
- package/dist/chunk-A4C4NJ5U.cjs +12 -0
- package/dist/chunk-A4C4NJ5U.cjs.map +1 -0
- package/dist/{chunk-TYGGUWMS.cjs → chunk-B3MN7EJR.cjs} +177 -137
- package/dist/chunk-B3MN7EJR.cjs.map +1 -0
- package/dist/{chunk-K6VKTBST.cjs → chunk-BZ5MVITP.cjs} +4 -4
- package/dist/{chunk-K6VKTBST.cjs.map → chunk-BZ5MVITP.cjs.map} +1 -1
- package/dist/{chunk-R7MRFE5P.js → chunk-CAI6SMP6.js} +3 -3
- package/dist/{chunk-R7MRFE5P.js.map → chunk-CAI6SMP6.js.map} +1 -1
- package/dist/{chunk-ZAQUKCUC.js → chunk-CBOD7TXH.js} +5 -5
- package/dist/{chunk-ZAQUKCUC.js.map → chunk-CBOD7TXH.js.map} +1 -1
- package/dist/{chunk-LLVOQOWE.cjs → chunk-CRZ56SZU.cjs} +6 -5
- package/dist/chunk-CRZ56SZU.cjs.map +1 -0
- package/dist/{chunk-ON47CBE4.cjs → chunk-D3GWARN7.cjs} +47 -47
- package/dist/{chunk-ON47CBE4.cjs.map → chunk-D3GWARN7.cjs.map} +1 -1
- package/dist/{chunk-W5SOCUBL.js → chunk-D3OUDFU7.js} +5 -5
- package/dist/{chunk-W5SOCUBL.js.map → chunk-D3OUDFU7.js.map} +1 -1
- package/dist/chunk-EKG2UXNX.cjs +23 -0
- package/dist/chunk-EKG2UXNX.cjs.map +1 -0
- package/dist/{chunk-7PRMDZIA.cjs → chunk-FMMW3KX7.cjs} +21 -55
- package/dist/chunk-FMMW3KX7.cjs.map +1 -0
- package/dist/chunk-H2VWDQWC.cjs +571 -0
- package/dist/chunk-H2VWDQWC.cjs.map +1 -0
- package/dist/chunk-H4FY6OZK.js +13 -0
- package/dist/chunk-H4FY6OZK.js.map +1 -0
- package/dist/{chunk-OJHD3LXJ.cjs → chunk-H5IJSROF.cjs} +2 -8
- package/dist/chunk-H5IJSROF.cjs.map +1 -0
- package/dist/{chunk-U5EL6JUV.js → chunk-I5IOSA27.js} +101 -103
- package/dist/chunk-I5IOSA27.js.map +1 -0
- package/dist/{chunk-SHC7BCG5.cjs → chunk-I7YAY2VQ.cjs} +7 -7
- package/dist/{chunk-SHC7BCG5.cjs.map → chunk-I7YAY2VQ.cjs.map} +1 -1
- package/dist/chunk-IRCWIA3R.js +20 -0
- package/dist/chunk-IRCWIA3R.js.map +1 -0
- package/dist/chunk-IVQBLXBK.cjs +55 -0
- package/dist/chunk-IVQBLXBK.cjs.map +1 -0
- package/dist/{chunk-5PP4KRPV.js → chunk-IZD4HTCP.js} +5 -5
- package/dist/{chunk-5PP4KRPV.js.map → chunk-IZD4HTCP.js.map} +1 -1
- package/dist/{chunk-7CCMCMJO.cjs → chunk-JHRUZ73O.cjs} +75 -66
- package/dist/chunk-JHRUZ73O.cjs.map +1 -0
- package/dist/{chunk-RDP6ZRSM.cjs → chunk-JQKMEKKW.cjs} +261 -204
- package/dist/chunk-JQKMEKKW.cjs.map +1 -0
- package/dist/chunk-JVA3KDEA.cjs +691 -0
- package/dist/chunk-JVA3KDEA.cjs.map +1 -0
- package/dist/{chunk-JG5XIJDY.js → chunk-K67P5DLL.js} +62 -22
- package/dist/chunk-K67P5DLL.js.map +1 -0
- package/dist/{chunk-CS6JTQQ2.cjs → chunk-KACEYDYV.cjs} +94 -62
- package/dist/chunk-KACEYDYV.cjs.map +1 -0
- package/dist/{chunk-5OWHU7Z7.cjs → chunk-L6EVYIID.cjs} +248 -210
- package/dist/chunk-L6EVYIID.cjs.map +1 -0
- package/dist/{chunk-7OWE7WD6.js → chunk-LI4K2KEJ.js} +4 -4
- package/dist/{chunk-7OWE7WD6.js.map → chunk-LI4K2KEJ.js.map} +1 -1
- package/dist/chunk-LKZDQ2B4.js +1581 -0
- package/dist/chunk-LKZDQ2B4.js.map +1 -0
- package/dist/{chunk-45YZXI6X.cjs → chunk-LLFPQOBA.cjs} +27 -27
- package/dist/{chunk-45YZXI6X.cjs.map → chunk-LLFPQOBA.cjs.map} +1 -1
- package/dist/{chunk-ZRJTM7MT.js → chunk-LZMQ3SFK.js} +3 -3
- package/dist/{chunk-ZRJTM7MT.js.map → chunk-LZMQ3SFK.js.map} +1 -1
- package/dist/{chunk-DI6VC62F.js → chunk-M3VTS3F6.js} +3 -3
- package/dist/{chunk-DI6VC62F.js.map → chunk-M3VTS3F6.js.map} +1 -1
- package/dist/{chunk-MZ34E2GN.js → chunk-NBOS7BY3.js} +60 -21
- package/dist/chunk-NBOS7BY3.js.map +1 -0
- package/dist/{chunk-YA36ABIL.js → chunk-NGQDGL5X.js} +14 -48
- package/dist/chunk-NGQDGL5X.js.map +1 -0
- package/dist/{chunk-ZBFZGLZE.cjs → chunk-NLX5OWK7.cjs} +6 -2
- package/dist/chunk-NLX5OWK7.cjs.map +1 -0
- package/dist/chunk-NUQ2YFFH.cjs +1637 -0
- package/dist/chunk-NUQ2YFFH.cjs.map +1 -0
- package/dist/{chunk-TTCOPKUL.cjs → chunk-OGL4X4PH.cjs} +182 -184
- package/dist/chunk-OGL4X4PH.cjs.map +1 -0
- package/dist/{chunk-HY5BNOUN.cjs → chunk-OTNTGEXR.cjs} +4 -4
- package/dist/{chunk-HY5BNOUN.cjs.map → chunk-OTNTGEXR.cjs.map} +1 -1
- package/dist/chunk-OTWE63BW.js +53 -0
- package/dist/chunk-OTWE63BW.js.map +1 -0
- package/dist/chunk-PC5NGH5A.js +549 -0
- package/dist/chunk-PC5NGH5A.js.map +1 -0
- package/dist/{chunk-IPRP6TDL.cjs → chunk-PS3TUWJM.cjs} +7 -7
- package/dist/{chunk-IPRP6TDL.cjs.map → chunk-PS3TUWJM.cjs.map} +1 -1
- package/dist/{chunk-V76FGHY3.js → chunk-PVFFH7TL.js} +5 -5
- package/dist/{chunk-V76FGHY3.js.map → chunk-PVFFH7TL.js.map} +1 -1
- package/dist/chunk-QCD5JKU4.cjs +15 -0
- package/dist/chunk-QCD5JKU4.cjs.map +1 -0
- package/dist/{chunk-IRPYOHRC.js → chunk-QG5VEOKX.js} +6 -2
- package/dist/chunk-QG5VEOKX.js.map +1 -0
- package/dist/{chunk-MM3JHVKZ.cjs → chunk-QLLZM5I3.cjs} +4 -4
- package/dist/{chunk-MM3JHVKZ.cjs.map → chunk-QLLZM5I3.cjs.map} +1 -1
- package/dist/{chunk-MX7EKQPM.js → chunk-RCBG6YMT.js} +345 -97
- package/dist/chunk-RCBG6YMT.js.map +1 -0
- package/dist/{chunk-2CYI5HRH.js → chunk-RI7RJH4G.js} +49 -17
- package/dist/chunk-RI7RJH4G.js.map +1 -0
- package/dist/{chunk-5LKOVCPP.js → chunk-RVUL2HXY.js} +6 -5
- package/dist/chunk-RVUL2HXY.js.map +1 -0
- package/dist/{chunk-WK23PGTP.cjs → chunk-S5GU4LUN.cjs} +11 -11
- package/dist/{chunk-WK23PGTP.cjs.map → chunk-S5GU4LUN.cjs.map} +1 -1
- package/dist/{chunk-S33YQEL7.js → chunk-SDPWO2Z5.js} +6 -6
- package/dist/{chunk-S33YQEL7.js.map → chunk-SDPWO2Z5.js.map} +1 -1
- package/dist/{chunk-6S3PTHL4.js → chunk-SLGGT2XD.js} +3 -3
- package/dist/{chunk-6S3PTHL4.js.map → chunk-SLGGT2XD.js.map} +1 -1
- package/dist/{chunk-HSEZ7X6Y.cjs → chunk-TIJUA4I6.cjs} +45 -45
- package/dist/{chunk-HSEZ7X6Y.cjs.map → chunk-TIJUA4I6.cjs.map} +1 -1
- package/dist/{chunk-CSNOYIB4.cjs → chunk-TM54OBHX.cjs} +13 -13
- package/dist/{chunk-CSNOYIB4.cjs.map → chunk-TM54OBHX.cjs.map} +1 -1
- package/dist/{chunk-2GIV5X4P.js → chunk-TYEYRCXL.js} +86 -33
- package/dist/chunk-TYEYRCXL.js.map +1 -0
- package/dist/{chunk-MJPZNEJZ.js → chunk-UKOVGCRN.js} +2095 -496
- package/dist/chunk-UKOVGCRN.js.map +1 -0
- package/dist/chunk-UYKDYE5D.cjs +12 -0
- package/dist/{chunk-KWNWG4RC.cjs.map → chunk-UYKDYE5D.cjs.map} +1 -1
- package/dist/{chunk-FX5ZW6PN.js → chunk-VAAC7L57.js} +95 -40
- package/dist/chunk-VAAC7L57.js.map +1 -0
- package/dist/{chunk-ISKCIQF2.cjs → chunk-VKHXYVN7.cjs} +14 -25
- package/dist/chunk-VKHXYVN7.cjs.map +1 -0
- package/dist/chunk-VUQZNUHU.js +171 -0
- package/dist/chunk-VUQZNUHU.js.map +1 -0
- package/dist/{chunk-K2XYLVVB.cjs → chunk-WDM5WQK4.cjs} +175 -136
- package/dist/chunk-WDM5WQK4.cjs.map +1 -0
- package/dist/{chunk-GVYVGGPJ.js → chunk-WFSYYU4W.js} +66 -28
- package/dist/chunk-WFSYYU4W.js.map +1 -0
- package/dist/{chunk-WCLMKNQE.cjs → chunk-WRBV2FNH.cjs} +1356 -1108
- package/dist/chunk-WRBV2FNH.cjs.map +1 -0
- package/dist/chunk-XORONCV3.js +202 -0
- package/dist/chunk-XORONCV3.js.map +1 -0
- package/dist/{chunk-2Q45FAIE.js → chunk-YT2IVFAI.js} +26 -17
- package/dist/chunk-YT2IVFAI.js.map +1 -0
- package/dist/chunk-ZGVTNKTX.cjs +217 -0
- package/dist/chunk-ZGVTNKTX.cjs.map +1 -0
- package/dist/core/index.cjs +20 -20
- package/dist/core/index.d.cts +4 -4
- package/dist/core/index.d.ts +4 -4
- package/dist/core/index.js +4 -4
- package/dist/{ddl-B49O7dB_.d.ts → ddl-BvcbgzHo.d.ts} +3 -3
- package/dist/{ddl-DcZG660s.d.cts → ddl-Ufebz5q5.d.cts} +3 -3
- package/dist/graph-extension/index.d.cts +2 -4
- package/dist/graph-extension/index.d.ts +2 -4
- package/dist/graph-merge/index.cjs +140 -125
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +8 -9
- package/dist/graph-merge/index.d.ts +8 -9
- package/dist/graph-merge/index.js +42 -27
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/index.cjs +144 -143
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -12
- package/dist/index.d.ts +11 -12
- package/dist/index.js +30 -29
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.cjs +14 -12
- package/dist/indexes/index.d.cts +4 -4
- package/dist/indexes/index.d.ts +4 -4
- package/dist/indexes/index.js +7 -5
- package/dist/{ingestion-import-target-CI8OWIkM.d.ts → ingestion-import-target-CAs1OX-l.d.cts} +1 -1
- package/dist/{ingestion-import-target-DCpfM1PX.d.cts → ingestion-import-target-DCQSPfNx.d.ts} +1 -1
- package/dist/interchange/index.cjs +41 -39
- package/dist/interchange/index.cjs.map +1 -1
- package/dist/interchange/index.d.cts +8 -8
- package/dist/interchange/index.d.ts +8 -8
- package/dist/interchange/index.js +16 -14
- package/dist/interchange/index.js.map +1 -1
- package/dist/local-store-impl-6DDTFM32.cjs +77 -0
- package/dist/local-store-impl-6DDTFM32.cjs.map +1 -0
- package/dist/local-store-impl-OXTOVU2J.js +75 -0
- package/dist/local-store-impl-OXTOVU2J.js.map +1 -0
- package/dist/{manager-Cfg1ENj1.d.ts → manager-B68OrPR2.d.ts} +1 -2
- package/dist/{manager-D348fa6W.d.cts → manager-D_t7oK69.d.cts} +1 -2
- package/dist/pglite-store-impl-6EMZGL7K.js +73 -0
- package/dist/pglite-store-impl-6EMZGL7K.js.map +1 -0
- package/dist/pglite-store-impl-GJG3Y7RP.cjs +75 -0
- package/dist/pglite-store-impl-GJG3Y7RP.cjs.map +1 -0
- package/dist/{postgres-UStOycLI.d.ts → postgres-BPLSVyHM.d.ts} +1 -1
- package/dist/{postgres-CH1kkM5J.d.cts → postgres-CqvtFC2y.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 +33 -20
- 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 +24 -11
- package/dist/provenance/index.js.map +1 -1
- package/dist/{repair-validity-windows-aWX7VNvv.d.cts → repair-validity-windows-DEzCKAdy.d.cts} +7 -3
- package/dist/{repair-validity-windows-BtOEe2pS.d.ts → repair-validity-windows-GMdaS2AH.d.ts} +7 -3
- package/dist/resolve-D_H8MHtq.d.ts +1805 -0
- package/dist/resolve-WEW8gWws.d.cts +1805 -0
- package/dist/schema/index.cjs +42 -40
- package/dist/schema/index.d.cts +4 -6
- package/dist/schema/index.d.ts +4 -6
- package/dist/schema/index.js +15 -13
- package/dist/{searchable-z4BiFfHI.d.ts → searchable-C_UREI9K.d.ts} +1 -1
- package/dist/{searchable-C8-RrL3l.d.cts → searchable-ClgET_i7.d.cts} +1 -1
- package/dist/{sqlite-axLw5Lo5.d.ts → sqlite-D1mXO9Kp.d.cts} +2 -1
- package/dist/{sqlite-Cyx9j9o6.d.cts → sqlite-MZA3oZNB.d.ts} +2 -1
- package/dist/{store-CTfQ9taw.d.ts → store-CuFX7fCx.d.cts} +38 -41
- package/dist/{store-DR9J7JVB.d.cts → store-D-ZjXQpW.d.ts} +38 -41
- package/dist/{temporal-CBOrERz5.d.ts → temporal-CpyEiRY8.d.cts} +1 -1
- package/dist/{temporal-B4Ky4wzh.d.cts → temporal-y0Aep9Su.d.ts} +1 -1
- package/dist/{types-CWg4dTjj.d.ts → types-6yf0Vv-_.d.cts} +1672 -1
- package/dist/{types-CWg4dTjj.d.cts → types-6yf0Vv-_.d.ts} +1672 -1
- package/dist/{types-BScHXVM7.d.ts → types-DzJ4dlzk.d.cts} +1 -1
- package/dist/{types-BE921wRl.d.cts → types-_vVSB9k-.d.ts} +1 -1
- package/dist/{where-BWXUPV3C.d.ts → where-DuG2LCLe.d.ts} +1 -1
- package/dist/{where-CNtx1aLc.d.cts → where-Mhf_yyKX.d.cts} +1 -1
- package/package.json +5 -1
- package/dist/chunk-2CYI5HRH.js.map +0 -1
- package/dist/chunk-2GIV5X4P.js.map +0 -1
- package/dist/chunk-2Q45FAIE.js.map +0 -1
- package/dist/chunk-46UGOVRW.js.map +0 -1
- package/dist/chunk-5LKOVCPP.js.map +0 -1
- package/dist/chunk-5OWHU7Z7.cjs.map +0 -1
- package/dist/chunk-6LEOAIIB.js +0 -1160
- package/dist/chunk-6LEOAIIB.js.map +0 -1
- package/dist/chunk-7CCMCMJO.cjs.map +0 -1
- package/dist/chunk-7PRMDZIA.cjs.map +0 -1
- package/dist/chunk-C76WFIVZ.cjs.map +0 -1
- package/dist/chunk-CS6JTQQ2.cjs.map +0 -1
- package/dist/chunk-EDLKIQRI.js.map +0 -1
- package/dist/chunk-EH3JZJUM.cjs +0 -567
- package/dist/chunk-EH3JZJUM.cjs.map +0 -1
- package/dist/chunk-FX5ZW6PN.js.map +0 -1
- package/dist/chunk-GHZPZNFC.cjs +0 -132
- package/dist/chunk-GHZPZNFC.cjs.map +0 -1
- package/dist/chunk-GVYVGGPJ.js.map +0 -1
- package/dist/chunk-IHK5KA2Q.cjs +0 -262
- package/dist/chunk-IHK5KA2Q.cjs.map +0 -1
- package/dist/chunk-IRPYOHRC.js.map +0 -1
- package/dist/chunk-ISKCIQF2.cjs.map +0 -1
- package/dist/chunk-JG5XIJDY.js.map +0 -1
- package/dist/chunk-K2XYLVVB.cjs.map +0 -1
- package/dist/chunk-KWNWG4RC.cjs +0 -12
- package/dist/chunk-LLVOQOWE.cjs.map +0 -1
- package/dist/chunk-MJPZNEJZ.js.map +0 -1
- package/dist/chunk-MX7EKQPM.js.map +0 -1
- package/dist/chunk-MZ34E2GN.js.map +0 -1
- package/dist/chunk-OJHD3LXJ.cjs.map +0 -1
- package/dist/chunk-PALYTHGM.js +0 -114
- package/dist/chunk-PALYTHGM.js.map +0 -1
- package/dist/chunk-RDP6ZRSM.cjs.map +0 -1
- package/dist/chunk-S3SDEQMC.js +0 -532
- package/dist/chunk-S3SDEQMC.js.map +0 -1
- package/dist/chunk-TEC24ZDA.cjs +0 -1254
- package/dist/chunk-TEC24ZDA.cjs.map +0 -1
- package/dist/chunk-TP4NJTI3.cjs +0 -1192
- package/dist/chunk-TP4NJTI3.cjs.map +0 -1
- package/dist/chunk-TTCOPKUL.cjs.map +0 -1
- package/dist/chunk-TUVD4DFR.cjs.map +0 -1
- package/dist/chunk-TYGGUWMS.cjs.map +0 -1
- package/dist/chunk-U3Z7XKAG.js.map +0 -1
- package/dist/chunk-U5EL6JUV.js.map +0 -1
- package/dist/chunk-VTJVMP4I.js.map +0 -1
- package/dist/chunk-WCLMKNQE.cjs.map +0 -1
- package/dist/chunk-XMY2SXOH.cjs.map +0 -1
- package/dist/chunk-Y55DLLEG.js +0 -247
- package/dist/chunk-Y55DLLEG.js.map +0 -1
- package/dist/chunk-YA36ABIL.js.map +0 -1
- package/dist/chunk-ZBFZGLZE.cjs.map +0 -1
- package/dist/index-B0PrmE3K.d.cts +0 -1146
- package/dist/index-CwcXsL5R.d.ts +0 -1146
- package/dist/materialize-indexes-C9GG3O3C.d.ts +0 -266
- package/dist/materialize-indexes-CrSiW_lT.d.cts +0 -266
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkJQKMEKKW_cjs = require('./chunk-JQKMEKKW.cjs');
|
|
4
|
+
var chunkNLX5OWK7_cjs = require('./chunk-NLX5OWK7.cjs');
|
|
5
|
+
var chunkZGVTNKTX_cjs = require('./chunk-ZGVTNKTX.cjs');
|
|
6
|
+
var chunkNUQ2YFFH_cjs = require('./chunk-NUQ2YFFH.cjs');
|
|
7
|
+
var chunkCRZ56SZU_cjs = require('./chunk-CRZ56SZU.cjs');
|
|
6
8
|
var chunkM5MSP3BI_cjs = require('./chunk-M5MSP3BI.cjs');
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
+
var chunkJVA3KDEA_cjs = require('./chunk-JVA3KDEA.cjs');
|
|
10
|
+
var chunkH5IJSROF_cjs = require('./chunk-H5IJSROF.cjs');
|
|
9
11
|
var chunkRWUWTJQY_cjs = require('./chunk-RWUWTJQY.cjs');
|
|
10
12
|
var chunkX4GDXBOP_cjs = require('./chunk-X4GDXBOP.cjs');
|
|
11
13
|
var chunkN66HCGCY_cjs = require('./chunk-N66HCGCY.cjs');
|
|
@@ -59,7 +61,7 @@ function toTransferAssertion(row) {
|
|
|
59
61
|
|
|
60
62
|
// src/identity/reference.ts
|
|
61
63
|
function identityReferenceKey(ref) {
|
|
62
|
-
return
|
|
64
|
+
return chunkCRZ56SZU_cjs.encodeTupleKey([ref.kind, ref.id]);
|
|
63
65
|
}
|
|
64
66
|
function compareIdentityReferences(left, right) {
|
|
65
67
|
const kindOrder = chunkRWUWTJQY_cjs.compareCodePoints(left.kind, right.kind);
|
|
@@ -98,7 +100,7 @@ function spanningDifferentAssertion(assertions, first, second) {
|
|
|
98
100
|
// src/identity/sql-target.ts
|
|
99
101
|
var MAX_REFERENCE_CHUNK_SIZE = 200;
|
|
100
102
|
function identityChunkSize(target, input) {
|
|
101
|
-
const parameterLimit =
|
|
103
|
+
const parameterLimit = chunkJQKMEKKW_cjs.recordedBindParamBudget(target);
|
|
102
104
|
const chunkSize = Math.floor(
|
|
103
105
|
(parameterLimit - input.fixedParameters) / input.parametersPerItem
|
|
104
106
|
);
|
|
@@ -142,9 +144,9 @@ function identityWriterSlotError(cause) {
|
|
|
142
144
|
async function executeIdentityStatement(target, statement) {
|
|
143
145
|
requireStatementTarget(target);
|
|
144
146
|
try {
|
|
145
|
-
await target.executeStatement(
|
|
147
|
+
await target.executeStatement(chunkH5IJSROF_cjs.asCompiledStatementSql(statement));
|
|
146
148
|
} catch (error) {
|
|
147
|
-
if (!
|
|
149
|
+
if (!chunkNLX5OWK7_cjs.isSqliteStaleSnapshotError(error)) throw error;
|
|
148
150
|
throw identityWriterSlotError(error);
|
|
149
151
|
}
|
|
150
152
|
}
|
|
@@ -196,28 +198,50 @@ function publicNodeRef(ref) {
|
|
|
196
198
|
return ref;
|
|
197
199
|
}
|
|
198
200
|
async function lockIdentityGraph(target, graphId) {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
201
|
+
const plan = chunkNUQ2YFFH_cjs.resolveWriteFencePlan(target);
|
|
202
|
+
const fence = chunkNUQ2YFFH_cjs.requireWriteFence(plan, "identity graph lock", "advisory-lock");
|
|
203
|
+
switch (fence.kind) {
|
|
204
|
+
case "lock": {
|
|
205
|
+
await target.execute(
|
|
206
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
207
|
+
SELECT pg_advisory_xact_lock(
|
|
208
|
+
hashtext('typegraph:identity'),
|
|
209
|
+
hashtext(${graphId})
|
|
210
|
+
)
|
|
211
|
+
`)
|
|
212
|
+
);
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
case "engine-serialized": {
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
208
219
|
}
|
|
209
220
|
async function lockIdentityEnablementNodes(target, schema) {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
221
|
+
const plan = chunkNUQ2YFFH_cjs.resolveWriteFencePlan(target);
|
|
222
|
+
const fence = chunkNUQ2YFFH_cjs.requireWriteFence(
|
|
223
|
+
plan,
|
|
224
|
+
"identity enablement drain",
|
|
225
|
+
"table-lock"
|
|
226
|
+
);
|
|
227
|
+
switch (fence.kind) {
|
|
228
|
+
case "lock": {
|
|
229
|
+
await executeIdentityStatement(
|
|
230
|
+
target,
|
|
231
|
+
chunkH5IJSROF_cjs.sql`LOCK TABLE ${schema.nodesTable} IN SHARE MODE`
|
|
232
|
+
);
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
case "engine-serialized": {
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
215
239
|
}
|
|
216
240
|
async function loadNodeSnapshot(target, schema, graphId, coordinate) {
|
|
217
|
-
const sqlCoordinate =
|
|
241
|
+
const sqlCoordinate = chunkJQKMEKKW_cjs.identitySqlCoordinate(coordinate, chunkM5MSP3BI_cjs.nowIso());
|
|
218
242
|
const rows = await target.execute(
|
|
219
|
-
|
|
220
|
-
|
|
243
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(
|
|
244
|
+
chunkJQKMEKKW_cjs.identityNodeSnapshotSource(schema, graphId, sqlCoordinate)
|
|
221
245
|
)
|
|
222
246
|
);
|
|
223
247
|
return rows.map((row) => ({
|
|
@@ -243,7 +267,7 @@ async function loadCurrentStructuralClasses(target, schema, graphId, references)
|
|
|
243
267
|
});
|
|
244
268
|
if (uniqueReferences.length > chunkSize) {
|
|
245
269
|
const combined = /* @__PURE__ */ new Map();
|
|
246
|
-
for (const refChunk of
|
|
270
|
+
for (const refChunk of chunkNLX5OWK7_cjs.chunk(uniqueReferences, chunkSize)) {
|
|
247
271
|
const classes2 = await loadCurrentStructuralClasses(
|
|
248
272
|
target,
|
|
249
273
|
schema,
|
|
@@ -254,12 +278,12 @@ async function loadCurrentStructuralClasses(target, schema, graphId, references)
|
|
|
254
278
|
}
|
|
255
279
|
return combined;
|
|
256
280
|
}
|
|
257
|
-
const seedRows =
|
|
258
|
-
uniqueReferences.map((ref) =>
|
|
259
|
-
|
|
281
|
+
const seedRows = chunkH5IJSROF_cjs.sql.join(
|
|
282
|
+
uniqueReferences.map((ref) => chunkH5IJSROF_cjs.sql`(${ref.kind}, ${ref.id})`),
|
|
283
|
+
chunkH5IJSROF_cjs.sql`, `
|
|
260
284
|
);
|
|
261
285
|
const rows = await target.execute(
|
|
262
|
-
|
|
286
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
263
287
|
WITH seeds(seed_kind, seed_id) AS (
|
|
264
288
|
VALUES ${seedRows}
|
|
265
289
|
), anchors AS (
|
|
@@ -298,9 +322,9 @@ async function loadCurrentStructuralClasses(target, schema, graphId, references)
|
|
|
298
322
|
}
|
|
299
323
|
async function loadCurrentVisibleMembers(target, schema, graphId, ref) {
|
|
300
324
|
const now = chunkM5MSP3BI_cjs.nowIso();
|
|
301
|
-
const coordinate =
|
|
325
|
+
const coordinate = chunkJQKMEKKW_cjs.identitySqlCoordinate(void 0, now);
|
|
302
326
|
const rows = await target.execute(
|
|
303
|
-
|
|
327
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
304
328
|
WITH anchor AS (
|
|
305
329
|
SELECT class_kind, class_id
|
|
306
330
|
FROM ${schema.identityClosureTable}
|
|
@@ -324,7 +348,7 @@ async function loadCurrentVisibleMembers(target, schema, graphId, ref) {
|
|
|
324
348
|
WHERE n.graph_id = ${graphId}
|
|
325
349
|
AND n.kind = m.kind
|
|
326
350
|
AND n.id = m.id
|
|
327
|
-
AND ${
|
|
351
|
+
AND ${chunkJQKMEKKW_cjs.identityNodeVisibilitySql(coordinate, "n")}
|
|
328
352
|
`)
|
|
329
353
|
);
|
|
330
354
|
const members = rows.map((row) => ({ kind: row.kind, id: row.id })).toSorted((left, right) => compareReferences(left, right));
|
|
@@ -359,7 +383,7 @@ async function loadHistoricalClasses(target, schema, graphId, references, coordi
|
|
|
359
383
|
});
|
|
360
384
|
if (uniqueReferences.length > chunkSize) {
|
|
361
385
|
const combined = /* @__PURE__ */ new Map();
|
|
362
|
-
for (const refChunk of
|
|
386
|
+
for (const refChunk of chunkNLX5OWK7_cjs.chunk(uniqueReferences, chunkSize)) {
|
|
363
387
|
const classes = await loadHistoricalClasses(
|
|
364
388
|
target,
|
|
365
389
|
schema,
|
|
@@ -373,25 +397,26 @@ async function loadHistoricalClasses(target, schema, graphId, references, coordi
|
|
|
373
397
|
return combined;
|
|
374
398
|
}
|
|
375
399
|
const currentInstant = chunkM5MSP3BI_cjs.nowIso();
|
|
376
|
-
const sqlCoordinate =
|
|
377
|
-
const seeds =
|
|
378
|
-
uniqueReferences.map((ref) =>
|
|
379
|
-
|
|
400
|
+
const sqlCoordinate = chunkJQKMEKKW_cjs.identitySqlCoordinate(coordinate, currentInstant);
|
|
401
|
+
const seeds = chunkH5IJSROF_cjs.sql.join(
|
|
402
|
+
uniqueReferences.map((ref) => chunkH5IJSROF_cjs.sql`(${ref.kind}, ${ref.id})`),
|
|
403
|
+
chunkH5IJSROF_cjs.sql`, `
|
|
380
404
|
);
|
|
381
|
-
const reconstruction =
|
|
405
|
+
const reconstruction = chunkJQKMEKKW_cjs.historicalIdentityReconstructionCtes({
|
|
382
406
|
schema,
|
|
383
407
|
graphId,
|
|
384
408
|
coordinate: sqlCoordinate,
|
|
385
|
-
seedSource:
|
|
386
|
-
sameIdAcrossKinds
|
|
409
|
+
seedSource: chunkH5IJSROF_cjs.sql`VALUES ${seeds}`,
|
|
410
|
+
sameIdAcrossKinds,
|
|
411
|
+
recursiveTraversal: chunkZGVTNKTX_cjs.resolveRecursiveTraversal(target.capabilities)
|
|
387
412
|
});
|
|
388
413
|
const rows = await target.execute(
|
|
389
|
-
|
|
414
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
390
415
|
WITH RECURSIVE
|
|
391
416
|
${reconstruction}
|
|
392
417
|
SELECT member.seed_kind, member.seed_id,
|
|
393
418
|
member.kind AS member_kind, member.id AS member_id,
|
|
394
|
-
CASE WHEN ${
|
|
419
|
+
CASE WHEN ${chunkJQKMEKKW_cjs.identityNodeVisibilitySql(sqlCoordinate, "n")}
|
|
395
420
|
THEN 1 ELSE 0 END AS is_visible
|
|
396
421
|
FROM identity_members member
|
|
397
422
|
JOIN node_snapshot n ON n.kind = member.kind AND n.id = member.id
|
|
@@ -442,24 +467,24 @@ function visibleMembersAtCoordinate(ctx, ref) {
|
|
|
442
467
|
);
|
|
443
468
|
}
|
|
444
469
|
async function loadAssertions(target, schema, graphId, coordinate, currentInstant) {
|
|
445
|
-
const source =
|
|
470
|
+
const source = chunkJQKMEKKW_cjs.identityAssertionSnapshotSource(
|
|
446
471
|
schema,
|
|
447
472
|
graphId,
|
|
448
|
-
|
|
473
|
+
chunkJQKMEKKW_cjs.identitySqlCoordinate(coordinate, currentInstant),
|
|
449
474
|
void 0
|
|
450
475
|
);
|
|
451
476
|
const rows = await target.execute(
|
|
452
|
-
|
|
477
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(source)
|
|
453
478
|
);
|
|
454
479
|
return rows.map((row) => normalizeIdentityAssertionRow(row));
|
|
455
480
|
}
|
|
456
481
|
function referenceCondition(kindColumn, idColumn, references) {
|
|
457
|
-
if (references.length === 0) return
|
|
458
|
-
return
|
|
482
|
+
if (references.length === 0) return chunkH5IJSROF_cjs.sql`1 = 0`;
|
|
483
|
+
return chunkH5IJSROF_cjs.sql`(${chunkH5IJSROF_cjs.sql.join(
|
|
459
484
|
references.map(
|
|
460
|
-
(ref) =>
|
|
485
|
+
(ref) => chunkH5IJSROF_cjs.sql`(${kindColumn} = ${ref.kind} AND ${idColumn} = ${ref.id})`
|
|
461
486
|
),
|
|
462
|
-
|
|
487
|
+
chunkH5IJSROF_cjs.sql` OR `
|
|
463
488
|
)})`;
|
|
464
489
|
}
|
|
465
490
|
async function loadAssertionsTouching(target, schema, graphId, references, coordinate, relation) {
|
|
@@ -471,7 +496,7 @@ async function loadAssertionsTouching(target, schema, graphId, references, coord
|
|
|
471
496
|
});
|
|
472
497
|
if (references.length > chunkSize) {
|
|
473
498
|
const byId = /* @__PURE__ */ new Map();
|
|
474
|
-
for (const refChunk of
|
|
499
|
+
for (const refChunk of chunkNLX5OWK7_cjs.chunk(references, chunkSize)) {
|
|
475
500
|
const assertions = await loadAssertionsTouching(
|
|
476
501
|
target,
|
|
477
502
|
schema,
|
|
@@ -484,25 +509,25 @@ async function loadAssertionsTouching(target, schema, graphId, references, coord
|
|
|
484
509
|
}
|
|
485
510
|
return [...byId.values()];
|
|
486
511
|
}
|
|
487
|
-
const source =
|
|
512
|
+
const source = chunkJQKMEKKW_cjs.identityAssertionSnapshotSource(
|
|
488
513
|
schema,
|
|
489
514
|
graphId,
|
|
490
|
-
|
|
515
|
+
chunkJQKMEKKW_cjs.identitySqlCoordinate(coordinate, chunkM5MSP3BI_cjs.nowIso()),
|
|
491
516
|
relation
|
|
492
517
|
);
|
|
493
518
|
const aMatches = referenceCondition(
|
|
494
|
-
|
|
495
|
-
|
|
519
|
+
chunkH5IJSROF_cjs.sql`identity_assertions.a_kind`,
|
|
520
|
+
chunkH5IJSROF_cjs.sql`identity_assertions.a_id`,
|
|
496
521
|
references
|
|
497
522
|
);
|
|
498
523
|
const bMatches = referenceCondition(
|
|
499
|
-
|
|
500
|
-
|
|
524
|
+
chunkH5IJSROF_cjs.sql`identity_assertions.b_kind`,
|
|
525
|
+
chunkH5IJSROF_cjs.sql`identity_assertions.b_id`,
|
|
501
526
|
references
|
|
502
527
|
);
|
|
503
528
|
const rows = await target.execute(
|
|
504
|
-
|
|
505
|
-
SELECT ${
|
|
529
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
530
|
+
SELECT ${chunkJQKMEKKW_cjs.IDENTITY_ASSERTION_COLUMNS}
|
|
506
531
|
FROM (${source}) identity_assertions
|
|
507
532
|
WHERE ${aMatches} OR ${bMatches}
|
|
508
533
|
`)
|
|
@@ -523,7 +548,7 @@ async function loadSpanningDifferentAssertion(target, schema, graphId, firstClas
|
|
|
523
548
|
|
|
524
549
|
// src/identity/interchange-read.ts
|
|
525
550
|
function codePointOrderedAssertionId(target) {
|
|
526
|
-
return
|
|
551
|
+
return chunkJVA3KDEA_cjs.getDialect(target.dialect).binaryText(chunkH5IJSROF_cjs.sql`identity_assertions.id`);
|
|
527
552
|
}
|
|
528
553
|
async function readIdentityAssertionPageAtTarget(ctx, target, mode, options) {
|
|
529
554
|
if (!Number.isSafeInteger(options.limit) || options.limit <= 0) {
|
|
@@ -539,17 +564,17 @@ async function readIdentityAssertionPageAtTarget(ctx, target, mode, options) {
|
|
|
539
564
|
parametersPerItem: 2
|
|
540
565
|
});
|
|
541
566
|
const filterKindsInMemory = nodeKinds !== void 0 && nodeKinds.length > kindFilterChunkSize;
|
|
542
|
-
const kindFilter = nodeKinds === void 0 ?
|
|
543
|
-
AND identity_assertions.a_kind IN (${
|
|
544
|
-
nodeKinds.map((kind) =>
|
|
545
|
-
|
|
567
|
+
const kindFilter = nodeKinds === void 0 ? chunkH5IJSROF_cjs.sql`` : nodeKinds.length === 0 ? chunkH5IJSROF_cjs.sql`AND 1 = 0` : filterKindsInMemory ? chunkH5IJSROF_cjs.sql`` : chunkH5IJSROF_cjs.sql`
|
|
568
|
+
AND identity_assertions.a_kind IN (${chunkH5IJSROF_cjs.sql.join(
|
|
569
|
+
nodeKinds.map((kind) => chunkH5IJSROF_cjs.sql`${kind}`),
|
|
570
|
+
chunkH5IJSROF_cjs.sql`, `
|
|
546
571
|
)})
|
|
547
|
-
AND identity_assertions.b_kind IN (${
|
|
548
|
-
nodeKinds.map((kind) =>
|
|
549
|
-
|
|
572
|
+
AND identity_assertions.b_kind IN (${chunkH5IJSROF_cjs.sql.join(
|
|
573
|
+
nodeKinds.map((kind) => chunkH5IJSROF_cjs.sql`${kind}`),
|
|
574
|
+
chunkH5IJSROF_cjs.sql`, `
|
|
550
575
|
)})
|
|
551
576
|
`;
|
|
552
|
-
const liveEndpointJoins = options.includeDeleted === false ?
|
|
577
|
+
const liveEndpointJoins = options.includeDeleted === false ? chunkH5IJSROF_cjs.sql`
|
|
553
578
|
JOIN ${ctx.schema.nodesTable} identity_a_node
|
|
554
579
|
ON identity_a_node.graph_id = identity_assertions.graph_id
|
|
555
580
|
AND identity_a_node.kind = identity_assertions.a_kind
|
|
@@ -560,10 +585,10 @@ async function readIdentityAssertionPageAtTarget(ctx, target, mode, options) {
|
|
|
560
585
|
AND identity_b_node.kind = identity_assertions.b_kind
|
|
561
586
|
AND identity_b_node.id = identity_assertions.b_id
|
|
562
587
|
AND identity_b_node.deleted_at IS NULL
|
|
563
|
-
` :
|
|
588
|
+
` : chunkH5IJSROF_cjs.sql``;
|
|
564
589
|
const assertionIdKey = codePointOrderedAssertionId(target);
|
|
565
590
|
const rows = await target.execute(
|
|
566
|
-
|
|
591
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
567
592
|
SELECT identity_assertions.graph_id AS graph_id,
|
|
568
593
|
identity_assertions.id AS id,
|
|
569
594
|
identity_assertions.rel AS rel,
|
|
@@ -582,8 +607,8 @@ async function readIdentityAssertionPageAtTarget(ctx, target, mode, options) {
|
|
|
582
607
|
${liveEndpointJoins}
|
|
583
608
|
WHERE identity_assertions.graph_id = ${ctx.graphId}
|
|
584
609
|
AND identity_assertions.deleted_at IS NULL
|
|
585
|
-
${options.after === void 0 ?
|
|
586
|
-
${mode === "state" ?
|
|
610
|
+
${options.after === void 0 ? chunkH5IJSROF_cjs.sql`` : chunkH5IJSROF_cjs.sql`AND ${assertionIdKey} > ${options.after}`}
|
|
611
|
+
${mode === "state" ? chunkH5IJSROF_cjs.sql`AND identity_assertions.valid_to IS NULL` : chunkH5IJSROF_cjs.sql``}
|
|
587
612
|
${kindFilter}
|
|
588
613
|
ORDER BY ${assertionIdKey} ASC
|
|
589
614
|
LIMIT ${options.limit}
|
|
@@ -862,7 +887,7 @@ async function assertClosureMatchesComponents(target, schema, graphId, component
|
|
|
862
887
|
}
|
|
863
888
|
}
|
|
864
889
|
const rows = await target.execute(
|
|
865
|
-
|
|
890
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
866
891
|
SELECT member_kind, member_id, class_kind, class_id
|
|
867
892
|
FROM ${schema.identityClosureTable}
|
|
868
893
|
WHERE graph_id = ${graphId}
|
|
@@ -923,15 +948,15 @@ async function loadLiveReferences(target, schema, graphId, references) {
|
|
|
923
948
|
});
|
|
924
949
|
if (references.length > chunkSize) {
|
|
925
950
|
const byKey = /* @__PURE__ */ new Map();
|
|
926
|
-
for (const refChunk of
|
|
951
|
+
for (const refChunk of chunkNLX5OWK7_cjs.chunk(references, chunkSize)) {
|
|
927
952
|
const live = await loadLiveReferences(target, schema, graphId, refChunk);
|
|
928
953
|
for (const ref of live) byKey.set(refKey(ref), ref);
|
|
929
954
|
}
|
|
930
955
|
return [...byKey.values()];
|
|
931
956
|
}
|
|
932
|
-
const matches = referenceCondition(
|
|
957
|
+
const matches = referenceCondition(chunkH5IJSROF_cjs.sql`kind`, chunkH5IJSROF_cjs.sql`id`, references);
|
|
933
958
|
const rows = await target.execute(
|
|
934
|
-
|
|
959
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
935
960
|
SELECT kind, id
|
|
936
961
|
FROM ${schema.nodesTable}
|
|
937
962
|
WHERE graph_id = ${graphId}
|
|
@@ -961,10 +986,10 @@ async function requireStructuralEndpoints(target, schema, graphId, references) {
|
|
|
961
986
|
parametersPerItem: 2
|
|
962
987
|
});
|
|
963
988
|
const presentKeys = /* @__PURE__ */ new Set();
|
|
964
|
-
for (const refChunk of
|
|
965
|
-
const matches = referenceCondition(
|
|
989
|
+
for (const refChunk of chunkNLX5OWK7_cjs.chunk(unique, chunkSize)) {
|
|
990
|
+
const matches = referenceCondition(chunkH5IJSROF_cjs.sql`kind`, chunkH5IJSROF_cjs.sql`id`, refChunk);
|
|
966
991
|
const rows = await target.execute(
|
|
967
|
-
|
|
992
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
968
993
|
SELECT kind, id
|
|
969
994
|
FROM ${schema.nodesTable}
|
|
970
995
|
WHERE graph_id = ${graphId}
|
|
@@ -983,7 +1008,7 @@ async function requireStructuralEndpoints(target, schema, graphId, references) {
|
|
|
983
1008
|
// src/identity/separation.ts
|
|
984
1009
|
var MAX_SEPARATION_INSERT_CHUNK_SIZE = 100;
|
|
985
1010
|
function identityClassKey(ref) {
|
|
986
|
-
return
|
|
1011
|
+
return chunkCRZ56SZU_cjs.encodeTupleKey([ref.kind, ref.id]);
|
|
987
1012
|
}
|
|
988
1013
|
var PAIR_KEY_SEPARATOR = "\0";
|
|
989
1014
|
function pairKey(pair) {
|
|
@@ -1015,7 +1040,7 @@ function buildSeparationProjection(assertions, classKeyOf) {
|
|
|
1015
1040
|
async function deleteSeparationForGraph(target, schema, graphId) {
|
|
1016
1041
|
await executeIdentityStatement(
|
|
1017
1042
|
target,
|
|
1018
|
-
|
|
1043
|
+
chunkH5IJSROF_cjs.sql`DELETE FROM ${schema.identitySeparationTable} WHERE graph_id = ${graphId}`
|
|
1019
1044
|
);
|
|
1020
1045
|
}
|
|
1021
1046
|
async function deleteSeparationForClassKeys(target, schema, graphId, classKeys) {
|
|
@@ -1026,14 +1051,14 @@ async function deleteSeparationForClassKeys(target, schema, graphId, classKeys)
|
|
|
1026
1051
|
maxItems: MAX_REFERENCE_CHUNK_SIZE,
|
|
1027
1052
|
parametersPerItem: 2
|
|
1028
1053
|
});
|
|
1029
|
-
for (const keyChunk of
|
|
1030
|
-
const keyList =
|
|
1031
|
-
keyChunk.map((key) =>
|
|
1032
|
-
|
|
1054
|
+
for (const keyChunk of chunkNLX5OWK7_cjs.chunk(unique, chunkSize)) {
|
|
1055
|
+
const keyList = chunkH5IJSROF_cjs.sql.join(
|
|
1056
|
+
keyChunk.map((key) => chunkH5IJSROF_cjs.sql`${key}`),
|
|
1057
|
+
chunkH5IJSROF_cjs.sql`, `
|
|
1033
1058
|
);
|
|
1034
1059
|
await executeIdentityStatement(
|
|
1035
1060
|
target,
|
|
1036
|
-
|
|
1061
|
+
chunkH5IJSROF_cjs.sql`
|
|
1037
1062
|
DELETE FROM ${schema.identitySeparationTable}
|
|
1038
1063
|
WHERE graph_id = ${graphId}
|
|
1039
1064
|
AND (class_key_low IN (${keyList}) OR class_key_high IN (${keyList}))
|
|
@@ -1070,7 +1095,7 @@ function proveSeparationReadiness(registry, graphId) {
|
|
|
1070
1095
|
async function probeSeparationPair(target, schema, graphId, pair) {
|
|
1071
1096
|
try {
|
|
1072
1097
|
const rows = await target.execute(
|
|
1073
|
-
|
|
1098
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
1074
1099
|
SELECT
|
|
1075
1100
|
(
|
|
1076
1101
|
SELECT COUNT(*) FROM ${schema.identitySeparationTable}
|
|
@@ -1093,7 +1118,7 @@ async function probeSeparationPair(target, schema, graphId, pair) {
|
|
|
1093
1118
|
pairSeparated: countOf(row, "pair_rows") > 0
|
|
1094
1119
|
};
|
|
1095
1120
|
} catch (error) {
|
|
1096
|
-
if (!
|
|
1121
|
+
if (!chunkNLX5OWK7_cjs.isMissingTableError(error)) throw error;
|
|
1097
1122
|
throw separationUnreadableError(graphId, schema, error);
|
|
1098
1123
|
}
|
|
1099
1124
|
}
|
|
@@ -1141,7 +1166,7 @@ async function separationRebuildRequired(target, schema, graphId, options) {
|
|
|
1141
1166
|
}
|
|
1142
1167
|
async function hasSeparationRows(target, schema, graphId) {
|
|
1143
1168
|
const rows = await target.execute(
|
|
1144
|
-
|
|
1169
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
1145
1170
|
SELECT 1 AS present
|
|
1146
1171
|
FROM ${schema.identitySeparationTable}
|
|
1147
1172
|
WHERE graph_id = ${graphId}
|
|
@@ -1154,7 +1179,7 @@ async function hasLiveDifferentAssertions(target, schema, graphId, registry) {
|
|
|
1154
1179
|
if (!await probeAnyLiveDifferent(target, schema, graphId)) return false;
|
|
1155
1180
|
const activeKinds = [...identityActiveKinds(registry)];
|
|
1156
1181
|
if (activeKinds.length === 0) return false;
|
|
1157
|
-
const kindChunks =
|
|
1182
|
+
const kindChunks = chunkNLX5OWK7_cjs.chunk(activeKinds, owedProbeChunkSize(target));
|
|
1158
1183
|
for (const first of kindChunks) {
|
|
1159
1184
|
for (const second of kindChunks) {
|
|
1160
1185
|
if (await probeOwedSeparation(target, schema, graphId, [first, second])) {
|
|
@@ -1168,7 +1193,7 @@ var IDENTITY_SNAPSHOT_PARAMETERS = 4;
|
|
|
1168
1193
|
var OWED_SEPARATION_PROBE_PARAMETERS = IDENTITY_SNAPSHOT_PARAMETERS + 2;
|
|
1169
1194
|
async function probeAnyLiveDifferent(target, schema, graphId) {
|
|
1170
1195
|
const rows = await target.execute(
|
|
1171
|
-
|
|
1196
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
1172
1197
|
SELECT 1 AS present
|
|
1173
1198
|
FROM (${liveDifferentSource(schema, graphId)}) live_different
|
|
1174
1199
|
LIMIT 1
|
|
@@ -1178,7 +1203,7 @@ async function probeAnyLiveDifferent(target, schema, graphId) {
|
|
|
1178
1203
|
}
|
|
1179
1204
|
async function probeOwedSeparation(target, schema, graphId, kinds) {
|
|
1180
1205
|
const rows = await target.execute(
|
|
1181
|
-
|
|
1206
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
1182
1207
|
SELECT 1 AS present
|
|
1183
1208
|
FROM (${liveDifferentSource(schema, graphId)}) live_different
|
|
1184
1209
|
LEFT JOIN ${schema.identityClosureTable} class_a
|
|
@@ -1210,22 +1235,22 @@ function owedProbeChunkSize(target) {
|
|
|
1210
1235
|
});
|
|
1211
1236
|
}
|
|
1212
1237
|
function liveDifferentSource(schema, graphId) {
|
|
1213
|
-
return
|
|
1238
|
+
return chunkJQKMEKKW_cjs.identityAssertionSnapshotSource(
|
|
1214
1239
|
schema,
|
|
1215
1240
|
graphId,
|
|
1216
|
-
|
|
1241
|
+
chunkJQKMEKKW_cjs.identitySqlCoordinate(void 0, chunkM5MSP3BI_cjs.nowIso()),
|
|
1217
1242
|
"different"
|
|
1218
1243
|
);
|
|
1219
1244
|
}
|
|
1220
1245
|
function kindList(kinds) {
|
|
1221
|
-
return
|
|
1222
|
-
kinds.map((kind) =>
|
|
1223
|
-
|
|
1246
|
+
return chunkH5IJSROF_cjs.sql.join(
|
|
1247
|
+
kinds.map((kind) => chunkH5IJSROF_cjs.sql`${kind}`),
|
|
1248
|
+
chunkH5IJSROF_cjs.sql`, `
|
|
1224
1249
|
);
|
|
1225
1250
|
}
|
|
1226
1251
|
async function readSeparationForGraph(target, schema, graphId) {
|
|
1227
1252
|
const rows = await target.execute(
|
|
1228
|
-
|
|
1253
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
1229
1254
|
SELECT class_key_low, class_key_high
|
|
1230
1255
|
FROM ${schema.identitySeparationTable}
|
|
1231
1256
|
WHERE graph_id = ${graphId}
|
|
@@ -1242,17 +1267,17 @@ async function insertSeparationRows(target, schema, graphId, projection) {
|
|
|
1242
1267
|
maxItems: MAX_SEPARATION_INSERT_CHUNK_SIZE,
|
|
1243
1268
|
parametersPerItem: 3
|
|
1244
1269
|
});
|
|
1245
|
-
for (const pairChunk of
|
|
1270
|
+
for (const pairChunk of chunkNLX5OWK7_cjs.chunk(projection.pairs, chunkSize)) {
|
|
1246
1271
|
const values = pairChunk.map(
|
|
1247
|
-
(pair) =>
|
|
1272
|
+
(pair) => chunkH5IJSROF_cjs.sql`(${graphId}, ${pair.low}, ${pair.high})`
|
|
1248
1273
|
);
|
|
1249
1274
|
try {
|
|
1250
1275
|
await executeIdentityStatement(
|
|
1251
1276
|
target,
|
|
1252
|
-
|
|
1277
|
+
chunkH5IJSROF_cjs.sql`
|
|
1253
1278
|
INSERT INTO ${schema.identitySeparationTable} (
|
|
1254
1279
|
graph_id, class_key_low, class_key_high
|
|
1255
|
-
) VALUES ${
|
|
1280
|
+
) VALUES ${chunkH5IJSROF_cjs.sql.join(values, chunkH5IJSROF_cjs.sql`, `)}
|
|
1256
1281
|
`
|
|
1257
1282
|
);
|
|
1258
1283
|
} catch (error) {
|
|
@@ -1401,8 +1426,8 @@ async function validateCurrentRelation(ctx, target, relation, operation, a, b) {
|
|
|
1401
1426
|
}
|
|
1402
1427
|
async function currentAssertionForPair(target, schema, graphId, relation, a, b) {
|
|
1403
1428
|
const rows = await target.execute(
|
|
1404
|
-
|
|
1405
|
-
SELECT ${
|
|
1429
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
1430
|
+
SELECT ${chunkJQKMEKKW_cjs.IDENTITY_ASSERTION_COLUMNS}
|
|
1406
1431
|
FROM ${schema.identityAssertionsTable}
|
|
1407
1432
|
WHERE graph_id = ${graphId}
|
|
1408
1433
|
AND rel = ${relation}
|
|
@@ -1418,10 +1443,10 @@ async function currentAssertionForPair(target, schema, graphId, relation, a, b)
|
|
|
1418
1443
|
return rows[0] === void 0 ? void 0 : normalizeIdentityAssertionRow(rows[0]);
|
|
1419
1444
|
}
|
|
1420
1445
|
async function assertionForExactWindow(target, schema, graphId, relation, a, b, window) {
|
|
1421
|
-
const validToMatch = window.validTo === void 0 ?
|
|
1446
|
+
const validToMatch = window.validTo === void 0 ? chunkH5IJSROF_cjs.sql`valid_to IS NULL` : chunkH5IJSROF_cjs.sql`valid_to = ${window.validTo}`;
|
|
1422
1447
|
const rows = await target.execute(
|
|
1423
|
-
|
|
1424
|
-
SELECT ${
|
|
1448
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
1449
|
+
SELECT ${chunkJQKMEKKW_cjs.IDENTITY_ASSERTION_COLUMNS}
|
|
1425
1450
|
FROM ${schema.identityAssertionsTable}
|
|
1426
1451
|
WHERE graph_id = ${graphId}
|
|
1427
1452
|
AND rel = ${relation}
|
|
@@ -1453,7 +1478,7 @@ async function insertAssertion(target, schema, graphId, relation, a, b, operatio
|
|
|
1453
1478
|
function buildAssertionRow(graphId, relation, a, b, timestamp, options) {
|
|
1454
1479
|
return {
|
|
1455
1480
|
graph_id: graphId,
|
|
1456
|
-
id: options?.id ??
|
|
1481
|
+
id: options?.id ?? chunkJQKMEKKW_cjs.generateId(),
|
|
1457
1482
|
rel: relation,
|
|
1458
1483
|
a_kind: a.kind,
|
|
1459
1484
|
a_id: a.id,
|
|
@@ -1500,14 +1525,26 @@ async function requireEndpointsCoverIdentityWindow(target, graphId, references,
|
|
|
1500
1525
|
}
|
|
1501
1526
|
}
|
|
1502
1527
|
function windowOverlapSql(alias, lowerBoundary, upperBoundary) {
|
|
1503
|
-
const column = (name) =>
|
|
1504
|
-
return
|
|
1528
|
+
const column = (name) => chunkH5IJSROF_cjs.sql`${chunkH5IJSROF_cjs.sql.identifier(alias)}.${chunkH5IJSROF_cjs.sql.identifier(name)}`;
|
|
1529
|
+
return chunkH5IJSROF_cjs.sql`
|
|
1505
1530
|
${column("deleted_at")} IS NULL
|
|
1506
1531
|
AND ${column("valid_from")} <= ${upperBoundary}
|
|
1507
1532
|
AND (${column("valid_to")} IS NULL OR ${column("valid_to")} > ${lowerBoundary})
|
|
1508
1533
|
`;
|
|
1509
1534
|
}
|
|
1510
|
-
async function loadIdentityWindowLedger(
|
|
1535
|
+
async function loadIdentityWindowLedger(input) {
|
|
1536
|
+
chunkZGVTNKTX_cjs.assertRecursiveTraversal(
|
|
1537
|
+
input.recursiveTraversal,
|
|
1538
|
+
"identity window ledger read"
|
|
1539
|
+
);
|
|
1540
|
+
const {
|
|
1541
|
+
target,
|
|
1542
|
+
schema,
|
|
1543
|
+
graphId,
|
|
1544
|
+
requests,
|
|
1545
|
+
operationInstant,
|
|
1546
|
+
sameIdAcrossKinds
|
|
1547
|
+
} = input;
|
|
1511
1548
|
const activeRequests = requests.filter(
|
|
1512
1549
|
(request) => request.window.effective !== "empty"
|
|
1513
1550
|
);
|
|
@@ -1531,14 +1568,14 @@ async function loadIdentityWindowLedger(target, schema, graphId, requests, opera
|
|
|
1531
1568
|
parametersPerItem: 2
|
|
1532
1569
|
});
|
|
1533
1570
|
const rows = [];
|
|
1534
|
-
for (const referenceChunk of
|
|
1535
|
-
const seedRows =
|
|
1571
|
+
for (const referenceChunk of chunkNLX5OWK7_cjs.chunk(references, seedChunkSize)) {
|
|
1572
|
+
const seedRows = chunkH5IJSROF_cjs.sql.join(
|
|
1536
1573
|
referenceChunk.map(
|
|
1537
|
-
(reference) =>
|
|
1574
|
+
(reference) => chunkH5IJSROF_cjs.sql`(${reference.kind}, ${reference.id})`
|
|
1538
1575
|
),
|
|
1539
|
-
|
|
1576
|
+
chunkH5IJSROF_cjs.sql`, `
|
|
1540
1577
|
);
|
|
1541
|
-
const component = sameIdAcrossKinds === "fold" ?
|
|
1578
|
+
const component = sameIdAcrossKinds === "fold" ? chunkH5IJSROF_cjs.sql`
|
|
1542
1579
|
neighbor_modes(mode) AS (
|
|
1543
1580
|
VALUES ('assertion'), ('fold')
|
|
1544
1581
|
),
|
|
@@ -1572,7 +1609,7 @@ async function loadIdentityWindowLedger(target, schema, graphId, requests, opera
|
|
|
1572
1609
|
AND folded.id = component.id
|
|
1573
1610
|
WHERE assertion.id IS NOT NULL OR folded.id IS NOT NULL
|
|
1574
1611
|
)
|
|
1575
|
-
` :
|
|
1612
|
+
` : chunkH5IJSROF_cjs.sql`
|
|
1576
1613
|
component(kind, id) AS (
|
|
1577
1614
|
SELECT seed_kind, seed_id FROM seeds
|
|
1578
1615
|
UNION
|
|
@@ -1597,7 +1634,7 @@ async function loadIdentityWindowLedger(target, schema, graphId, requests, opera
|
|
|
1597
1634
|
`;
|
|
1598
1635
|
rows.push(
|
|
1599
1636
|
...await target.execute(
|
|
1600
|
-
|
|
1637
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
1601
1638
|
WITH RECURSIVE
|
|
1602
1639
|
seeds(seed_kind, seed_id) AS (VALUES ${seedRows}),
|
|
1603
1640
|
${component},
|
|
@@ -1610,7 +1647,7 @@ async function loadIdentityWindowLedger(target, schema, graphId, requests, opera
|
|
|
1610
1647
|
WHERE assertion.graph_id = ${graphId}
|
|
1611
1648
|
AND ${windowOverlapSql("assertion", lowerBoundary, upperBoundary)}
|
|
1612
1649
|
)
|
|
1613
|
-
SELECT 'assertion' AS row_type, ${
|
|
1650
|
+
SELECT 'assertion' AS row_type, ${chunkJQKMEKKW_cjs.IDENTITY_ASSERTION_COLUMNS},
|
|
1614
1651
|
NULL AS node_kind, NULL AS node_id,
|
|
1615
1652
|
NULL AS node_created_at, NULL AS node_deleted_at
|
|
1616
1653
|
FROM selected_assertions
|
|
@@ -1749,14 +1786,15 @@ function validateRelationAgainstLedger(ctx, nodes, assertions, relation, operati
|
|
|
1749
1786
|
}
|
|
1750
1787
|
}
|
|
1751
1788
|
async function createIdentityWindowValidator(ctx, target, requests, operationInstant, ignoredAssertionIds = /* @__PURE__ */ new Set()) {
|
|
1752
|
-
const ledger = await loadIdentityWindowLedger(
|
|
1789
|
+
const ledger = await loadIdentityWindowLedger({
|
|
1753
1790
|
target,
|
|
1754
|
-
ctx.schema,
|
|
1755
|
-
ctx.graphId,
|
|
1791
|
+
schema: ctx.schema,
|
|
1792
|
+
graphId: ctx.graphId,
|
|
1756
1793
|
requests,
|
|
1757
1794
|
operationInstant,
|
|
1758
|
-
ctx.sameIdAcrossKinds
|
|
1759
|
-
|
|
1795
|
+
sameIdAcrossKinds: ctx.sameIdAcrossKinds,
|
|
1796
|
+
recursiveTraversal: chunkZGVTNKTX_cjs.resolveRecursiveTraversal(target.capabilities)
|
|
1797
|
+
});
|
|
1760
1798
|
if (ignoredAssertionIds.size > 0) {
|
|
1761
1799
|
const retained = ledger.assertions.filter(
|
|
1762
1800
|
(assertion) => !ignoredAssertionIds.has(assertion.id)
|
|
@@ -1792,7 +1830,7 @@ async function validateRelationThroughoutIdentityWindow(ctx, target, relation, o
|
|
|
1792
1830
|
validator.validate(relation, operation, a, b, window);
|
|
1793
1831
|
}
|
|
1794
1832
|
function nullableAssertionValue(value) {
|
|
1795
|
-
return value === void 0 ?
|
|
1833
|
+
return value === void 0 ? chunkH5IJSROF_cjs.sql`NULL` : chunkH5IJSROF_cjs.sql`${value}`;
|
|
1796
1834
|
}
|
|
1797
1835
|
async function insertAssertionRows(target, schema, rows) {
|
|
1798
1836
|
if (rows.length === 0) return;
|
|
@@ -1801,9 +1839,9 @@ async function insertAssertionRows(target, schema, rows) {
|
|
|
1801
1839
|
maxItems: MAX_ASSERTION_INSERT_CHUNK_SIZE,
|
|
1802
1840
|
parametersPerItem: 14
|
|
1803
1841
|
});
|
|
1804
|
-
for (const rowChunk of
|
|
1842
|
+
for (const rowChunk of chunkNLX5OWK7_cjs.chunk(rows, chunkSize)) {
|
|
1805
1843
|
const values = rowChunk.map(
|
|
1806
|
-
(row) =>
|
|
1844
|
+
(row) => chunkH5IJSROF_cjs.sql`
|
|
1807
1845
|
(
|
|
1808
1846
|
${row.graph_id}, ${row.id}, ${row.rel}, ${row.a_kind}, ${row.a_id},
|
|
1809
1847
|
${row.b_kind}, ${row.b_id}, ${row.valid_from},
|
|
@@ -1817,8 +1855,8 @@ async function insertAssertionRows(target, schema, rows) {
|
|
|
1817
1855
|
);
|
|
1818
1856
|
await executeIdentityStatement(
|
|
1819
1857
|
target,
|
|
1820
|
-
|
|
1821
|
-
INSERT INTO ${schema.identityAssertionsTable} (${
|
|
1858
|
+
chunkH5IJSROF_cjs.sql`
|
|
1859
|
+
INSERT INTO ${schema.identityAssertionsTable} (${chunkJQKMEKKW_cjs.IDENTITY_ASSERTION_COLUMNS}) VALUES ${chunkH5IJSROF_cjs.sql.join(values, chunkH5IJSROF_cjs.sql`, `)}
|
|
1822
1860
|
`
|
|
1823
1861
|
);
|
|
1824
1862
|
}
|
|
@@ -1832,14 +1870,14 @@ async function loadAssertionsByIds(target, schema, graphId, ids) {
|
|
|
1832
1870
|
maxItems: MAX_REFERENCE_CHUNK_SIZE,
|
|
1833
1871
|
parametersPerItem: 1
|
|
1834
1872
|
});
|
|
1835
|
-
for (const idChunk of
|
|
1836
|
-
const idList =
|
|
1837
|
-
idChunk.map((id) =>
|
|
1838
|
-
|
|
1873
|
+
for (const idChunk of chunkNLX5OWK7_cjs.chunk(uniqueIds, chunkSize)) {
|
|
1874
|
+
const idList = chunkH5IJSROF_cjs.sql.join(
|
|
1875
|
+
idChunk.map((id) => chunkH5IJSROF_cjs.sql`${id}`),
|
|
1876
|
+
chunkH5IJSROF_cjs.sql`, `
|
|
1839
1877
|
);
|
|
1840
1878
|
const rows = await target.execute(
|
|
1841
|
-
|
|
1842
|
-
SELECT ${
|
|
1879
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
1880
|
+
SELECT ${chunkJQKMEKKW_cjs.IDENTITY_ASSERTION_COLUMNS}
|
|
1843
1881
|
FROM ${schema.identityAssertionsTable}
|
|
1844
1882
|
WHERE graph_id = ${graphId} AND id IN (${idList})
|
|
1845
1883
|
`)
|
|
@@ -1861,13 +1899,13 @@ async function loadCurrentClassAnchors(target, schema, graphId, references) {
|
|
|
1861
1899
|
maxItems: MAX_REFERENCE_CHUNK_SIZE,
|
|
1862
1900
|
parametersPerItem: 2
|
|
1863
1901
|
});
|
|
1864
|
-
for (const refChunk of
|
|
1865
|
-
const seedRows =
|
|
1866
|
-
refChunk.map((ref) =>
|
|
1867
|
-
|
|
1902
|
+
for (const refChunk of chunkNLX5OWK7_cjs.chunk(uniqueReferences, chunkSize)) {
|
|
1903
|
+
const seedRows = chunkH5IJSROF_cjs.sql.join(
|
|
1904
|
+
refChunk.map((ref) => chunkH5IJSROF_cjs.sql`(${ref.kind}, ${ref.id})`),
|
|
1905
|
+
chunkH5IJSROF_cjs.sql`, `
|
|
1868
1906
|
);
|
|
1869
1907
|
const rows = await target.execute(
|
|
1870
|
-
|
|
1908
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
1871
1909
|
WITH seeds(seed_kind, seed_id) AS (
|
|
1872
1910
|
VALUES ${seedRows}
|
|
1873
1911
|
)
|
|
@@ -1962,7 +2000,7 @@ async function replaceClosure(target, schema, graphId, allowedKinds, sameIdAcros
|
|
|
1962
2000
|
);
|
|
1963
2001
|
await executeIdentityStatement(
|
|
1964
2002
|
target,
|
|
1965
|
-
|
|
2003
|
+
chunkH5IJSROF_cjs.sql`DELETE FROM ${schema.identityClosureTable} WHERE graph_id = ${graphId}`
|
|
1966
2004
|
);
|
|
1967
2005
|
await insertClosureComponents(target, schema, graphId, snapshot.components);
|
|
1968
2006
|
await deleteSeparationForGraph(target, schema, graphId);
|
|
@@ -1985,7 +2023,7 @@ async function insertClosureComponents(target, schema, graphId, components) {
|
|
|
1985
2023
|
for (const member of component) {
|
|
1986
2024
|
emitted.add(refKey(member));
|
|
1987
2025
|
values.push(
|
|
1988
|
-
|
|
2026
|
+
chunkH5IJSROF_cjs.sql`(${graphId}, ${member.kind}, ${member.id}, ${canonical.kind}, ${canonical.id})`
|
|
1989
2027
|
);
|
|
1990
2028
|
}
|
|
1991
2029
|
}
|
|
@@ -1995,13 +2033,13 @@ async function insertClosureComponents(target, schema, graphId, components) {
|
|
|
1995
2033
|
maxItems: MAX_CLOSURE_INSERT_CHUNK_SIZE,
|
|
1996
2034
|
parametersPerItem: 5
|
|
1997
2035
|
});
|
|
1998
|
-
for (const valueChunk of
|
|
2036
|
+
for (const valueChunk of chunkNLX5OWK7_cjs.chunk(values, chunkSize)) {
|
|
1999
2037
|
await executeIdentityStatement(
|
|
2000
2038
|
target,
|
|
2001
|
-
|
|
2039
|
+
chunkH5IJSROF_cjs.sql`
|
|
2002
2040
|
INSERT INTO ${schema.identityClosureTable} (
|
|
2003
2041
|
graph_id, member_kind, member_id, class_kind, class_id
|
|
2004
|
-
) VALUES ${
|
|
2042
|
+
) VALUES ${chunkH5IJSROF_cjs.sql.join(valueChunk, chunkH5IJSROF_cjs.sql`, `)}
|
|
2005
2043
|
`
|
|
2006
2044
|
);
|
|
2007
2045
|
}
|
|
@@ -2040,15 +2078,15 @@ async function replaceAffectedClosure(target, schema, graphId, references, sameI
|
|
|
2040
2078
|
maxItems: MAX_REFERENCE_CHUNK_SIZE,
|
|
2041
2079
|
parametersPerItem: 2
|
|
2042
2080
|
});
|
|
2043
|
-
for (const affectedChunk of
|
|
2081
|
+
for (const affectedChunk of chunkNLX5OWK7_cjs.chunk(affected, chunkSize)) {
|
|
2044
2082
|
const matches = referenceCondition(
|
|
2045
|
-
|
|
2046
|
-
|
|
2083
|
+
chunkH5IJSROF_cjs.sql`member_kind`,
|
|
2084
|
+
chunkH5IJSROF_cjs.sql`member_id`,
|
|
2047
2085
|
affectedChunk
|
|
2048
2086
|
);
|
|
2049
2087
|
await executeIdentityStatement(
|
|
2050
2088
|
target,
|
|
2051
|
-
|
|
2089
|
+
chunkH5IJSROF_cjs.sql`
|
|
2052
2090
|
DELETE FROM ${schema.identityClosureTable}
|
|
2053
2091
|
WHERE graph_id = ${graphId} AND ${matches}
|
|
2054
2092
|
`
|
|
@@ -2084,7 +2122,7 @@ async function mergeCurrentClasses(target, schema, graphId, a, b) {
|
|
|
2084
2122
|
if (refKey(previousCanonical) === refKey(canonical)) return;
|
|
2085
2123
|
await executeIdentityStatement(
|
|
2086
2124
|
target,
|
|
2087
|
-
|
|
2125
|
+
chunkH5IJSROF_cjs.sql`
|
|
2088
2126
|
UPDATE ${schema.identityClosureTable}
|
|
2089
2127
|
SET class_kind = ${canonical.kind}, class_id = ${canonical.id}
|
|
2090
2128
|
WHERE graph_id = ${graphId}
|
|
@@ -2100,14 +2138,14 @@ async function mergeCurrentClasses(target, schema, graphId, a, b) {
|
|
|
2100
2138
|
);
|
|
2101
2139
|
if (singletonMembers.length > 0) {
|
|
2102
2140
|
const values = singletonMembers.map(
|
|
2103
|
-
(member) =>
|
|
2141
|
+
(member) => chunkH5IJSROF_cjs.sql`(${graphId}, ${member.kind}, ${member.id}, ${canonical.kind}, ${canonical.id})`
|
|
2104
2142
|
);
|
|
2105
2143
|
await executeIdentityStatement(
|
|
2106
2144
|
target,
|
|
2107
|
-
|
|
2145
|
+
chunkH5IJSROF_cjs.sql`
|
|
2108
2146
|
INSERT INTO ${schema.identityClosureTable} (
|
|
2109
2147
|
graph_id, member_kind, member_id, class_kind, class_id
|
|
2110
|
-
) VALUES ${
|
|
2148
|
+
) VALUES ${chunkH5IJSROF_cjs.sql.join(values, chunkH5IJSROF_cjs.sql`, `)}
|
|
2111
2149
|
`
|
|
2112
2150
|
);
|
|
2113
2151
|
}
|
|
@@ -2245,7 +2283,7 @@ async function assertPair(ctx, target, relation, firstInput, secondInput, touch,
|
|
|
2245
2283
|
|
|
2246
2284
|
// src/identity/assertion-key.ts
|
|
2247
2285
|
function identityAssertionSemanticKey(relation, a, b) {
|
|
2248
|
-
return
|
|
2286
|
+
return chunkCRZ56SZU_cjs.encodeTupleKey([relation, a.kind, a.id, b.kind, b.id]);
|
|
2249
2287
|
}
|
|
2250
2288
|
|
|
2251
2289
|
// src/identity/service-facade.ts
|
|
@@ -2472,8 +2510,8 @@ async function bulkAssertWindowedPairs(ctx, target, relation, pairs, touch, oper
|
|
|
2472
2510
|
}
|
|
2473
2511
|
async function findCurrentAssertionById(target, schema, graphId, id) {
|
|
2474
2512
|
const rows = await target.execute(
|
|
2475
|
-
|
|
2476
|
-
SELECT ${
|
|
2513
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
2514
|
+
SELECT ${chunkJQKMEKKW_cjs.IDENTITY_ASSERTION_COLUMNS}
|
|
2477
2515
|
FROM ${schema.identityAssertionsTable}
|
|
2478
2516
|
WHERE graph_id = ${graphId}
|
|
2479
2517
|
AND id = ${id}
|
|
@@ -2497,7 +2535,7 @@ async function retractById(ctx, target, id, touch) {
|
|
|
2497
2535
|
const ended = { ...existing, valid_to: validTo, updated_at: now };
|
|
2498
2536
|
await executeIdentityStatement(
|
|
2499
2537
|
target,
|
|
2500
|
-
|
|
2538
|
+
chunkH5IJSROF_cjs.sql`
|
|
2501
2539
|
UPDATE ${ctx.schema.identityAssertionsTable}
|
|
2502
2540
|
SET valid_to = ${validTo}, updated_at = ${now}
|
|
2503
2541
|
WHERE graph_id = ${ctx.graphId}
|
|
@@ -2517,14 +2555,14 @@ async function retractCurrentAssertions(ctx, target, ids, touch, resolveValidTo)
|
|
|
2517
2555
|
maxItems: MAX_REFERENCE_CHUNK_SIZE,
|
|
2518
2556
|
parametersPerItem: 1
|
|
2519
2557
|
});
|
|
2520
|
-
for (const idChunk of
|
|
2521
|
-
const placeholders =
|
|
2522
|
-
idChunk.map((id) =>
|
|
2523
|
-
|
|
2558
|
+
for (const idChunk of chunkNLX5OWK7_cjs.chunk(uniqueIds, readChunkSize)) {
|
|
2559
|
+
const placeholders = chunkH5IJSROF_cjs.sql.join(
|
|
2560
|
+
idChunk.map((id) => chunkH5IJSROF_cjs.sql`${id}`),
|
|
2561
|
+
chunkH5IJSROF_cjs.sql`, `
|
|
2524
2562
|
);
|
|
2525
2563
|
const rows = await target.execute(
|
|
2526
|
-
|
|
2527
|
-
SELECT ${
|
|
2564
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
2565
|
+
SELECT ${chunkJQKMEKKW_cjs.IDENTITY_ASSERTION_COLUMNS}
|
|
2528
2566
|
FROM ${ctx.schema.identityAssertionsTable}
|
|
2529
2567
|
WHERE graph_id = ${ctx.graphId}
|
|
2530
2568
|
AND id IN (${placeholders})
|
|
@@ -2551,14 +2589,14 @@ async function retractCurrentAssertions(ctx, target, ids, touch, resolveValidTo)
|
|
|
2551
2589
|
parametersPerItem: 1
|
|
2552
2590
|
});
|
|
2553
2591
|
for (const [validTo, ids2] of byValidTo) {
|
|
2554
|
-
for (const idChunk of
|
|
2555
|
-
const placeholders =
|
|
2556
|
-
idChunk.map((id) =>
|
|
2557
|
-
|
|
2592
|
+
for (const idChunk of chunkNLX5OWK7_cjs.chunk(ids2, updateChunkSize)) {
|
|
2593
|
+
const placeholders = chunkH5IJSROF_cjs.sql.join(
|
|
2594
|
+
idChunk.map((id) => chunkH5IJSROF_cjs.sql`${id}`),
|
|
2595
|
+
chunkH5IJSROF_cjs.sql`, `
|
|
2558
2596
|
);
|
|
2559
2597
|
await executeIdentityStatement(
|
|
2560
2598
|
target,
|
|
2561
|
-
|
|
2599
|
+
chunkH5IJSROF_cjs.sql`
|
|
2562
2600
|
UPDATE ${ctx.schema.identityAssertionsTable}
|
|
2563
2601
|
SET valid_to = ${validTo}, updated_at = ${operationInstant}
|
|
2564
2602
|
WHERE graph_id = ${ctx.graphId}
|
|
@@ -2625,7 +2663,7 @@ async function retractPlannedAssertions(ctx, target, retractions, touch) {
|
|
|
2625
2663
|
}
|
|
2626
2664
|
async function runIdentityMutation(ctx, fn) {
|
|
2627
2665
|
let touched = false;
|
|
2628
|
-
return
|
|
2666
|
+
return chunkJQKMEKKW_cjs.runInWriteTransaction(
|
|
2629
2667
|
{
|
|
2630
2668
|
graphId: ctx.graphId,
|
|
2631
2669
|
schemaVersion: ctx.schemaVersion,
|
|
@@ -2636,7 +2674,7 @@ async function runIdentityMutation(ctx, fn) {
|
|
|
2636
2674
|
ctx.backend,
|
|
2637
2675
|
async (target) => {
|
|
2638
2676
|
await lockIdentityGraph(target, ctx.graphId);
|
|
2639
|
-
return
|
|
2677
|
+
return chunkJQKMEKKW_cjs.withRecordedIdentityMutationTarget(
|
|
2640
2678
|
target,
|
|
2641
2679
|
(rawTarget, touch) => fn(
|
|
2642
2680
|
rawTarget,
|
|
@@ -3077,7 +3115,7 @@ function rethrowTaggedWithAssertion(error, assertionId, progress) {
|
|
|
3077
3115
|
async function importIdentityAssertionsIntoTarget(ctx, target, assertions, mode, ignoredAssertionIds = /* @__PURE__ */ new Set()) {
|
|
3078
3116
|
let created = 0;
|
|
3079
3117
|
let skipped = 0;
|
|
3080
|
-
await
|
|
3118
|
+
await chunkJQKMEKKW_cjs.withRecordedIdentityMutationTarget(target, async (rawTarget, touch) => {
|
|
3081
3119
|
const operationInstant = chunkM5MSP3BI_cjs.nowIso();
|
|
3082
3120
|
const normalized = assertions.map((assertion) => ({
|
|
3083
3121
|
assertion,
|
|
@@ -3327,7 +3365,7 @@ async function rebuildIdentityClosureForContext(ctx) {
|
|
|
3327
3365
|
requireAtomicIdentityBackend(ctx.backend, ctx.graphId);
|
|
3328
3366
|
async function rebuildAtTarget(target) {
|
|
3329
3367
|
await lockIdentityGraph(target, ctx.graphId);
|
|
3330
|
-
await
|
|
3368
|
+
await chunkJQKMEKKW_cjs.withRecordedIdentityMutationTarget(target, async (rawTarget) => {
|
|
3331
3369
|
const activeKinds = identityActiveKinds(ctx.registry);
|
|
3332
3370
|
const snapshot = await loadSnapshot(
|
|
3333
3371
|
rawTarget,
|
|
@@ -3519,7 +3557,7 @@ async function assertAffectedIdentityClassesConsistent(ctx, target, seeds) {
|
|
|
3519
3557
|
await lockIdentityGraph(target, ctx.graphId);
|
|
3520
3558
|
const observed = await findAffectedClassInconsistency(ctx, target, seeds);
|
|
3521
3559
|
if (observed === void 0) return;
|
|
3522
|
-
await
|
|
3560
|
+
await chunkJQKMEKKW_cjs.withRecordedIdentityMutationTarget(target, async (rawTarget) => {
|
|
3523
3561
|
await replaceClosure(
|
|
3524
3562
|
rawTarget,
|
|
3525
3563
|
ctx.schema,
|
|
@@ -3542,14 +3580,14 @@ async function deleteAssertionsTouchingKinds(target, schema, graphId, kinds, tou
|
|
|
3542
3580
|
maxItems: MAX_REFERENCE_CHUNK_SIZE,
|
|
3543
3581
|
parametersPerItem: 2
|
|
3544
3582
|
});
|
|
3545
|
-
for (const kindChunk of
|
|
3546
|
-
const kindList2 =
|
|
3547
|
-
kindChunk.map((kind) =>
|
|
3548
|
-
|
|
3583
|
+
for (const kindChunk of chunkNLX5OWK7_cjs.chunk(removedKinds, kindChunkSize)) {
|
|
3584
|
+
const kindList2 = chunkH5IJSROF_cjs.sql.join(
|
|
3585
|
+
kindChunk.map((kind) => chunkH5IJSROF_cjs.sql`${kind}`),
|
|
3586
|
+
chunkH5IJSROF_cjs.sql`, `
|
|
3549
3587
|
);
|
|
3550
3588
|
const rows = await target.execute(
|
|
3551
|
-
|
|
3552
|
-
SELECT ${
|
|
3589
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
3590
|
+
SELECT ${chunkJQKMEKKW_cjs.IDENTITY_ASSERTION_COLUMNS}
|
|
3553
3591
|
FROM ${schema.identityAssertionsTable}
|
|
3554
3592
|
WHERE graph_id = ${graphId}
|
|
3555
3593
|
AND (a_kind IN (${kindList2}) OR b_kind IN (${kindList2}))
|
|
@@ -3566,14 +3604,14 @@ async function deleteAssertionsTouchingKinds(target, schema, graphId, kinds, tou
|
|
|
3566
3604
|
maxItems: MAX_REFERENCE_CHUNK_SIZE,
|
|
3567
3605
|
parametersPerItem: 1
|
|
3568
3606
|
});
|
|
3569
|
-
for (const idChunk of
|
|
3570
|
-
const idList =
|
|
3571
|
-
idChunk.map((id) =>
|
|
3572
|
-
|
|
3607
|
+
for (const idChunk of chunkNLX5OWK7_cjs.chunk(ids, idChunkSize)) {
|
|
3608
|
+
const idList = chunkH5IJSROF_cjs.sql.join(
|
|
3609
|
+
idChunk.map((id) => chunkH5IJSROF_cjs.sql`${id}`),
|
|
3610
|
+
chunkH5IJSROF_cjs.sql`, `
|
|
3573
3611
|
);
|
|
3574
3612
|
await executeIdentityStatement(
|
|
3575
3613
|
target,
|
|
3576
|
-
|
|
3614
|
+
chunkH5IJSROF_cjs.sql`
|
|
3577
3615
|
DELETE FROM ${schema.identityAssertionsTable}
|
|
3578
3616
|
WHERE graph_id = ${graphId} AND id IN (${idList})
|
|
3579
3617
|
`
|
|
@@ -3590,13 +3628,13 @@ async function hasAssertionsTouchingKinds(target, schema, graphId, kinds) {
|
|
|
3590
3628
|
maxItems: MAX_REFERENCE_CHUNK_SIZE,
|
|
3591
3629
|
parametersPerItem: 2
|
|
3592
3630
|
});
|
|
3593
|
-
for (const kindChunk of
|
|
3594
|
-
const kindList2 =
|
|
3595
|
-
kindChunk.map((kind) =>
|
|
3596
|
-
|
|
3631
|
+
for (const kindChunk of chunkNLX5OWK7_cjs.chunk(probedKinds, kindChunkSize)) {
|
|
3632
|
+
const kindList2 = chunkH5IJSROF_cjs.sql.join(
|
|
3633
|
+
kindChunk.map((kind) => chunkH5IJSROF_cjs.sql`${kind}`),
|
|
3634
|
+
chunkH5IJSROF_cjs.sql`, `
|
|
3597
3635
|
);
|
|
3598
3636
|
const rows = await target.execute(
|
|
3599
|
-
|
|
3637
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
3600
3638
|
SELECT id
|
|
3601
3639
|
FROM ${schema.identityAssertionsTable}
|
|
3602
3640
|
WHERE graph_id = ${graphId}
|
|
@@ -3610,7 +3648,7 @@ async function hasAssertionsTouchingKinds(target, schema, graphId, kinds) {
|
|
|
3610
3648
|
}
|
|
3611
3649
|
async function purgeAssertionsWithUnregisteredKinds(target, schema, graphId, registeredKinds, touch) {
|
|
3612
3650
|
const pairs = await target.execute(
|
|
3613
|
-
|
|
3651
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
3614
3652
|
SELECT DISTINCT a_kind, b_kind
|
|
3615
3653
|
FROM ${schema.identityAssertionsTable}
|
|
3616
3654
|
WHERE graph_id = ${graphId}
|
|
@@ -3660,13 +3698,13 @@ async function liveNodeKindsSharingIds(ctx, target, ids) {
|
|
|
3660
3698
|
maxItems: MAX_REFERENCE_CHUNK_SIZE,
|
|
3661
3699
|
parametersPerItem: 1
|
|
3662
3700
|
});
|
|
3663
|
-
for (const idChunk of
|
|
3664
|
-
const idList =
|
|
3665
|
-
idChunk.map((id) =>
|
|
3666
|
-
|
|
3701
|
+
for (const idChunk of chunkNLX5OWK7_cjs.chunk(uniqueIds, chunkSize)) {
|
|
3702
|
+
const idList = chunkH5IJSROF_cjs.sql.join(
|
|
3703
|
+
idChunk.map((id) => chunkH5IJSROF_cjs.sql`${id}`),
|
|
3704
|
+
chunkH5IJSROF_cjs.sql`, `
|
|
3667
3705
|
);
|
|
3668
3706
|
const rows = await target.execute(
|
|
3669
|
-
|
|
3707
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
3670
3708
|
SELECT kind, id
|
|
3671
3709
|
FROM ${ctx.schema.nodesTable}
|
|
3672
3710
|
WHERE graph_id = ${ctx.graphId}
|
|
@@ -3686,7 +3724,7 @@ async function liveNodeKindsSharingIds(ctx, target, ids) {
|
|
|
3686
3724
|
async function foldIdentityForCreatedNodes(ctx, target, references) {
|
|
3687
3725
|
if (references.length === 0 || ctx.sameIdAcrossKinds === "ignore") return;
|
|
3688
3726
|
await lockIdentityGraph(target, ctx.graphId);
|
|
3689
|
-
await
|
|
3727
|
+
await chunkJQKMEKKW_cjs.withRecordedIdentityMutationTarget(target, async (rawTarget) => {
|
|
3690
3728
|
const liveKindsById = await liveNodeKindsSharingIds(
|
|
3691
3729
|
ctx,
|
|
3692
3730
|
rawTarget,
|
|
@@ -3726,7 +3764,7 @@ async function foldIdentityForCreatedNodes(ctx, target, references) {
|
|
|
3726
3764
|
}
|
|
3727
3765
|
async function hasMaterializedIdentityClass(target, schema, graphId, ref) {
|
|
3728
3766
|
const rows = await target.execute(
|
|
3729
|
-
|
|
3767
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
3730
3768
|
SELECT member_kind, member_id
|
|
3731
3769
|
FROM ${schema.identityClosureTable}
|
|
3732
3770
|
WHERE graph_id = ${graphId}
|
|
@@ -3739,7 +3777,7 @@ async function hasMaterializedIdentityClass(target, schema, graphId, ref) {
|
|
|
3739
3777
|
}
|
|
3740
3778
|
async function readNodeDeletionInstant(target, schema, graphId, ref) {
|
|
3741
3779
|
const rows = await target.execute(
|
|
3742
|
-
|
|
3780
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
3743
3781
|
SELECT deleted_at
|
|
3744
3782
|
FROM ${schema.nodesTable}
|
|
3745
3783
|
WHERE graph_id = ${graphId}
|
|
@@ -3753,8 +3791,8 @@ async function readNodeDeletionInstant(target, schema, graphId, ref) {
|
|
|
3753
3791
|
}
|
|
3754
3792
|
async function requireNodeValidityEndCompatible(ctx, target, ref, validTo) {
|
|
3755
3793
|
const rows = await target.execute(
|
|
3756
|
-
|
|
3757
|
-
SELECT ${
|
|
3794
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
3795
|
+
SELECT ${chunkJQKMEKKW_cjs.IDENTITY_ASSERTION_COLUMNS}
|
|
3758
3796
|
FROM ${ctx.schema.identityAssertionsTable}
|
|
3759
3797
|
WHERE graph_id = ${ctx.graphId}
|
|
3760
3798
|
AND deleted_at IS NULL
|
|
@@ -3781,17 +3819,17 @@ async function requireNodeValidityEndCompatible(ctx, target, ref, validTo) {
|
|
|
3781
3819
|
}
|
|
3782
3820
|
async function detachIdentityForNode(ctx, target, ref, mode) {
|
|
3783
3821
|
await lockIdentityGraph(target, ctx.graphId);
|
|
3784
|
-
await
|
|
3785
|
-
const touchesNode =
|
|
3822
|
+
await chunkJQKMEKKW_cjs.withRecordedIdentityMutationTarget(target, async (rawTarget, touch) => {
|
|
3823
|
+
const touchesNode = chunkH5IJSROF_cjs.sql`
|
|
3786
3824
|
(
|
|
3787
3825
|
(a_kind = ${ref.kind} AND a_id = ${ref.id})
|
|
3788
3826
|
OR (b_kind = ${ref.kind} AND b_id = ${ref.id})
|
|
3789
3827
|
)
|
|
3790
3828
|
`;
|
|
3791
|
-
const scope = mode === "hard" ?
|
|
3829
|
+
const scope = mode === "hard" ? chunkH5IJSROF_cjs.sql`` : chunkH5IJSROF_cjs.sql`AND valid_to IS NULL AND deleted_at IS NULL`;
|
|
3792
3830
|
const rows = await rawTarget.execute(
|
|
3793
|
-
|
|
3794
|
-
SELECT ${
|
|
3831
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
3832
|
+
SELECT ${chunkJQKMEKKW_cjs.IDENTITY_ASSERTION_COLUMNS}
|
|
3795
3833
|
FROM ${ctx.schema.identityAssertionsTable}
|
|
3796
3834
|
WHERE graph_id = ${ctx.graphId}
|
|
3797
3835
|
${scope}
|
|
@@ -3818,7 +3856,7 @@ async function detachIdentityForNode(ctx, target, ref, mode) {
|
|
|
3818
3856
|
if (mode === "hard") {
|
|
3819
3857
|
await executeIdentityStatement(
|
|
3820
3858
|
rawTarget,
|
|
3821
|
-
|
|
3859
|
+
chunkH5IJSROF_cjs.sql`
|
|
3822
3860
|
DELETE FROM ${ctx.schema.identityAssertionsTable}
|
|
3823
3861
|
WHERE graph_id = ${ctx.graphId} AND id = ${row.id}
|
|
3824
3862
|
`
|
|
@@ -3835,7 +3873,7 @@ async function detachIdentityForNode(ctx, target, ref, mode) {
|
|
|
3835
3873
|
};
|
|
3836
3874
|
await executeIdentityStatement(
|
|
3837
3875
|
rawTarget,
|
|
3838
|
-
|
|
3876
|
+
chunkH5IJSROF_cjs.sql`
|
|
3839
3877
|
UPDATE ${ctx.schema.identityAssertionsTable}
|
|
3840
3878
|
SET valid_to = ${validTo},
|
|
3841
3879
|
updated_at = ${now},
|
|
@@ -3887,5 +3925,5 @@ exports.requireNodeValidityEndCompatible = requireNodeValidityEndCompatible;
|
|
|
3887
3925
|
exports.separationRebuildRequired = separationRebuildRequired;
|
|
3888
3926
|
exports.toTransferAssertion = toTransferAssertion;
|
|
3889
3927
|
exports.validateIdentityForContext = validateIdentityForContext;
|
|
3890
|
-
//# sourceMappingURL=chunk-
|
|
3891
|
-
//# sourceMappingURL=chunk-
|
|
3928
|
+
//# sourceMappingURL=chunk-L6EVYIID.cjs.map
|
|
3929
|
+
//# sourceMappingURL=chunk-L6EVYIID.cjs.map
|