@nicia-ai/typegraph 0.50.0 → 0.51.1
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-WCLMKNQE.cjs → chunk-5FVZSE3B.cjs} +1356 -1108
- package/dist/chunk-5FVZSE3B.cjs.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-7CCMCMJO.cjs → chunk-AOGOC6JF.cjs} +77 -68
- package/dist/chunk-AOGOC6JF.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-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-2Q45FAIE.js → chunk-EVYW3532.js} +28 -19
- package/dist/chunk-EVYW3532.js.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-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-MX7EKQPM.js → chunk-K6OZIHKI.js} +345 -97
- package/dist/chunk-K6OZIHKI.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-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-MM3JHVKZ.cjs → chunk-TUWSVL6I.cjs} +4 -4
- package/dist/{chunk-MM3JHVKZ.cjs.map → chunk-TUWSVL6I.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-R7MRFE5P.js → chunk-WS5MT2UJ.js} +3 -3
- package/dist/{chunk-R7MRFE5P.js.map → chunk-WS5MT2UJ.js.map} +1 -1
- package/dist/chunk-XORONCV3.js +202 -0
- package/dist/chunk-XORONCV3.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-JC7OBRAW.js +75 -0
- package/dist/local-store-impl-JC7OBRAW.js.map +1 -0
- package/dist/local-store-impl-UOS2LUIG.cjs +77 -0
- package/dist/local-store-impl-UOS2LUIG.cjs.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-J5J5AA52.cjs +75 -0
- package/dist/pglite-store-impl-J5J5AA52.cjs.map +1 -0
- package/dist/pglite-store-impl-LDRH2DUH.js +73 -0
- package/dist/pglite-store-impl-LDRH2DUH.js.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,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkNLX5OWK7_cjs = require('./chunk-NLX5OWK7.cjs');
|
|
4
|
+
var chunkZGVTNKTX_cjs = require('./chunk-ZGVTNKTX.cjs');
|
|
5
|
+
var chunkNUQ2YFFH_cjs = require('./chunk-NUQ2YFFH.cjs');
|
|
6
6
|
var chunkDWUDZ66O_cjs = require('./chunk-DWUDZ66O.cjs');
|
|
7
7
|
var chunkM5MSP3BI_cjs = require('./chunk-M5MSP3BI.cjs');
|
|
8
|
-
var
|
|
8
|
+
var chunkA4C4NJ5U_cjs = require('./chunk-A4C4NJ5U.cjs');
|
|
9
|
+
var chunkH5IJSROF_cjs = require('./chunk-H5IJSROF.cjs');
|
|
9
10
|
var chunkRT5ZY4XA_cjs = require('./chunk-RT5ZY4XA.cjs');
|
|
10
11
|
var chunkX4GDXBOP_cjs = require('./chunk-X4GDXBOP.cjs');
|
|
11
12
|
var chunkA7J2YDDI_cjs = require('./chunk-A7J2YDDI.cjs');
|
|
@@ -24,11 +25,11 @@ function withPinnedReadInstant(emit) {
|
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
27
|
function currentReadInstant() {
|
|
27
|
-
return
|
|
28
|
+
return chunkH5IJSROF_cjs.sql`${pinnedReadInstant ?? chunkM5MSP3BI_cjs.nowIso()}`;
|
|
28
29
|
}
|
|
29
30
|
var CURRENT_READ_INSTANT_PLACEHOLDER = "__typegraph_current_read_instant__";
|
|
30
31
|
function currentReadInstantPlaceholder() {
|
|
31
|
-
return
|
|
32
|
+
return chunkH5IJSROF_cjs.sql`${chunkH5IJSROF_cjs.sql.placeholder(CURRENT_READ_INSTANT_PLACEHOLDER)}`;
|
|
32
33
|
}
|
|
33
34
|
function currentReadInstantFor(mode) {
|
|
34
35
|
return mode === "placeholder" ? currentReadInstantPlaceholder() : currentReadInstant();
|
|
@@ -36,15 +37,15 @@ function currentReadInstantFor(mode) {
|
|
|
36
37
|
function compileTemporalFilter(options) {
|
|
37
38
|
const { mode, asOf, tableAlias, currentTimestamp, recordedAsOf } = options;
|
|
38
39
|
const recorded = chunkDWUDZ66O_cjs.optionalRecordedInstantParts(recordedAsOf, "recordedAsOf");
|
|
39
|
-
const prefix = tableAlias ?
|
|
40
|
-
const deletedAt =
|
|
41
|
-
const validFrom =
|
|
42
|
-
const validTo =
|
|
40
|
+
const prefix = tableAlias ? chunkH5IJSROF_cjs.sql.raw(`${tableAlias}.`) : chunkH5IJSROF_cjs.sql.raw("");
|
|
41
|
+
const deletedAt = chunkH5IJSROF_cjs.sql`${prefix}deleted_at`;
|
|
42
|
+
const validFrom = chunkH5IJSROF_cjs.sql`${prefix}valid_from`;
|
|
43
|
+
const validTo = chunkH5IJSROF_cjs.sql`${prefix}valid_to`;
|
|
43
44
|
const validFilter = (() => {
|
|
44
45
|
switch (mode) {
|
|
45
46
|
case "current": {
|
|
46
|
-
const now = recorded === void 0 ? currentTimestamp ?? currentReadInstant() :
|
|
47
|
-
return
|
|
47
|
+
const now = recorded === void 0 ? currentTimestamp ?? currentReadInstant() : chunkH5IJSROF_cjs.sql`${recorded.recordedAt}`;
|
|
48
|
+
return chunkH5IJSROF_cjs.sql`${deletedAt} IS NULL AND (${validFrom} IS NULL OR ${validFrom} <= ${now}) AND (${validTo} IS NULL OR ${validTo} > ${now})`;
|
|
48
49
|
}
|
|
49
50
|
case "asOf": {
|
|
50
51
|
if (asOf === void 0) {
|
|
@@ -53,21 +54,21 @@ function compileTemporalFilter(options) {
|
|
|
53
54
|
);
|
|
54
55
|
}
|
|
55
56
|
const timestamp = asOf;
|
|
56
|
-
return
|
|
57
|
+
return chunkH5IJSROF_cjs.sql`${deletedAt} IS NULL AND (${validFrom} IS NULL OR ${validFrom} <= ${timestamp}) AND (${validTo} IS NULL OR ${validTo} > ${timestamp})`;
|
|
57
58
|
}
|
|
58
59
|
case "includeEnded": {
|
|
59
|
-
return
|
|
60
|
+
return chunkH5IJSROF_cjs.sql`${deletedAt} IS NULL`;
|
|
60
61
|
}
|
|
61
62
|
case "includeTombstones": {
|
|
62
|
-
return
|
|
63
|
+
return chunkH5IJSROF_cjs.sql.raw("1=1");
|
|
63
64
|
}
|
|
64
65
|
}
|
|
65
66
|
})();
|
|
66
67
|
if (recorded === void 0) return validFilter;
|
|
67
|
-
const recordedFrom =
|
|
68
|
-
const recordedTo =
|
|
68
|
+
const recordedFrom = chunkH5IJSROF_cjs.sql`${prefix}recorded_from`;
|
|
69
|
+
const recordedTo = chunkH5IJSROF_cjs.sql`${prefix}recorded_to`;
|
|
69
70
|
const { revision } = recorded;
|
|
70
|
-
return
|
|
71
|
+
return chunkH5IJSROF_cjs.sql`(${validFilter}) AND ${recordedFrom} <= ${revision} AND ${revision} < ${recordedTo}`;
|
|
71
72
|
}
|
|
72
73
|
function extractTemporalOptions(ast, tableAlias) {
|
|
73
74
|
return {
|
|
@@ -660,7 +661,7 @@ function requireRecordedSchema(target) {
|
|
|
660
661
|
}
|
|
661
662
|
);
|
|
662
663
|
}
|
|
663
|
-
return
|
|
664
|
+
return chunkNUQ2YFFH_cjs.createSqlSchema(target.tableNames);
|
|
664
665
|
}
|
|
665
666
|
function requireCaptureStatements(target) {
|
|
666
667
|
if (target.executeStatement === void 0) {
|
|
@@ -675,7 +676,7 @@ function requireCaptureStatements(target) {
|
|
|
675
676
|
}
|
|
676
677
|
async function executeStatement(target, query) {
|
|
677
678
|
requireCaptureStatements(target);
|
|
678
|
-
await target.executeStatement(
|
|
679
|
+
await target.executeStatement(chunkH5IJSROF_cjs.asCompiledStatementSql(query));
|
|
679
680
|
}
|
|
680
681
|
function unsupportedPostgresIsolationError(isolationLevel) {
|
|
681
682
|
return new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
@@ -704,7 +705,7 @@ async function assertRecordedCaptureTransactionIsolation(target, options) {
|
|
|
704
705
|
if (!RECORDED_ISOLATION_REQUIRES_POSTGRES_CHECK[target.dialect]) return;
|
|
705
706
|
if (options?.accessMode === "read_only") return;
|
|
706
707
|
const rows = await target.execute(
|
|
707
|
-
|
|
708
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
708
709
|
SELECT current_setting('transaction_isolation') AS transaction_isolation
|
|
709
710
|
`)
|
|
710
711
|
);
|
|
@@ -782,7 +783,7 @@ function assertCapturableBackend(backend) {
|
|
|
782
783
|
}
|
|
783
784
|
);
|
|
784
785
|
}
|
|
785
|
-
if (backend.
|
|
786
|
+
if (!chunkZGVTNKTX_cjs.statementExecutionVerdict(backend).supported) {
|
|
786
787
|
throw new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
787
788
|
"history: true requires a backend that supports executeStatement.",
|
|
788
789
|
{ dialect: backend.dialect },
|
|
@@ -820,7 +821,7 @@ function assertRevisionTrackableBackend(backend) {
|
|
|
820
821
|
}
|
|
821
822
|
);
|
|
822
823
|
}
|
|
823
|
-
if (backend.
|
|
824
|
+
if (!chunkZGVTNKTX_cjs.statementExecutionVerdict(backend).supported) {
|
|
824
825
|
throw new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
825
826
|
"revisionTracking: true requires a backend that supports executeStatement.",
|
|
826
827
|
{ dialect: backend.dialect },
|
|
@@ -838,7 +839,7 @@ function assertRevisionTrackableBackend(backend) {
|
|
|
838
839
|
}
|
|
839
840
|
);
|
|
840
841
|
}
|
|
841
|
-
if (backend.
|
|
842
|
+
if (!chunkZGVTNKTX_cjs.recordedRevisionOriginsVerdict(backend).supported) {
|
|
842
843
|
throw new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
843
844
|
"revisionTracking: true requires a backend that can bootstrap revision origins.",
|
|
844
845
|
{ dialect: backend.dialect },
|
|
@@ -854,12 +855,8 @@ var RECORDED_MIN_REVISION = 0;
|
|
|
854
855
|
var RECORDED_MIN_TIME = "1970-01-01T00:00:00.000Z";
|
|
855
856
|
var RECORDED_CLOCK_ADVISORY_LOCK_NAMESPACE = "typegraph:recorded-clock";
|
|
856
857
|
var RECORDED_GRAPH_WRITE_ADVISORY_LOCK_NAMESPACE = "typegraph:recorded-graph-write";
|
|
857
|
-
var USES_RECORDED_GRAPH_ADVISORY_LOCK = {
|
|
858
|
-
postgres: true,
|
|
859
|
-
sqlite: false
|
|
860
|
-
};
|
|
861
858
|
function graphAdvisoryLockSql(namespace, graphId) {
|
|
862
|
-
return
|
|
859
|
+
return chunkH5IJSROF_cjs.sql`
|
|
863
860
|
SELECT pg_advisory_xact_lock(
|
|
864
861
|
hashtext(${namespace}),
|
|
865
862
|
hashtext(${graphId})
|
|
@@ -891,12 +888,20 @@ function registerRecordedGraphLockMemo(backend, memo) {
|
|
|
891
888
|
}
|
|
892
889
|
async function acquireRecordedGraphWriteLock(target, graphId) {
|
|
893
890
|
await target.execute(
|
|
894
|
-
|
|
891
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(recordedGraphWriteAdvisoryLockSql(graphId))
|
|
895
892
|
);
|
|
896
893
|
}
|
|
897
894
|
async function lockRecordedGraphWrite(target, graphId, memo) {
|
|
898
|
-
|
|
899
|
-
|
|
895
|
+
const plan = chunkNUQ2YFFH_cjs.resolveWriteFencePlan(target);
|
|
896
|
+
const fence = chunkNUQ2YFFH_cjs.requireWriteFence(
|
|
897
|
+
plan,
|
|
898
|
+
"recorded graph write",
|
|
899
|
+
"advisory-lock"
|
|
900
|
+
);
|
|
901
|
+
switch (fence.kind) {
|
|
902
|
+
case "engine-serialized": {
|
|
903
|
+
return graphWriteLockEvidence();
|
|
904
|
+
}
|
|
900
905
|
}
|
|
901
906
|
const effectiveMemo = memo ?? recordedGraphLockMemos.get(target);
|
|
902
907
|
if (effectiveMemo === void 0) {
|
|
@@ -964,7 +969,7 @@ async function readRecordedClock(target, schema, graphId) {
|
|
|
964
969
|
}
|
|
965
970
|
async function readRecordedClockParts(target, schema, graphId) {
|
|
966
971
|
const rows = await target.execute(
|
|
967
|
-
|
|
972
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
968
973
|
SELECT revision, recorded_at
|
|
969
974
|
FROM ${schema.recordedClockTable}
|
|
970
975
|
WHERE graph_id = ${graphId}
|
|
@@ -975,7 +980,7 @@ async function readRecordedClockParts(target, schema, graphId) {
|
|
|
975
980
|
}
|
|
976
981
|
async function readRevisionOrigin(target, schema, graphId) {
|
|
977
982
|
const rows = await target.execute(
|
|
978
|
-
|
|
983
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
979
984
|
SELECT origin
|
|
980
985
|
FROM ${schema.revisionOriginsTable}
|
|
981
986
|
WHERE graph_id = ${graphId}
|
|
@@ -991,9 +996,8 @@ async function readRevisionOrigin(target, schema, graphId) {
|
|
|
991
996
|
}
|
|
992
997
|
return first.origin;
|
|
993
998
|
}
|
|
994
|
-
async function ensureRevisionOrigin(target, schema, graphId) {
|
|
995
|
-
|
|
996
|
-
if (ensureTable === void 0) {
|
|
999
|
+
async function ensureRevisionOrigin(target, verdict, schema, graphId) {
|
|
1000
|
+
if (!verdict.supported) {
|
|
997
1001
|
throw new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
998
1002
|
"Revision tracking requires a backend that can bootstrap revision origins.",
|
|
999
1003
|
{ dialect: target.dialect },
|
|
@@ -1002,12 +1006,13 @@ async function ensureRevisionOrigin(target, schema, graphId) {
|
|
|
1002
1006
|
}
|
|
1003
1007
|
);
|
|
1004
1008
|
}
|
|
1009
|
+
const { ensureRevisionOriginsTable: ensureTable } = chunkNUQ2YFFH_cjs.recordedRevisionOriginsMembers(target, verdict);
|
|
1005
1010
|
await ensureTable();
|
|
1006
1011
|
const existing = await readRevisionOrigin(target, schema, graphId);
|
|
1007
1012
|
if (existing !== void 0) return existing;
|
|
1008
1013
|
await executeStatement(
|
|
1009
1014
|
target,
|
|
1010
|
-
|
|
1015
|
+
chunkH5IJSROF_cjs.sql`
|
|
1011
1016
|
INSERT INTO ${schema.revisionOriginsTable} (graph_id, origin)
|
|
1012
1017
|
VALUES (${graphId}, ${generateId()})
|
|
1013
1018
|
ON CONFLICT (graph_id) DO NOTHING
|
|
@@ -1023,7 +1028,7 @@ async function ensureRevisionOrigin(target, schema, graphId) {
|
|
|
1023
1028
|
async function writeRecordedClock(target, schema, graphId, parts) {
|
|
1024
1029
|
await executeStatement(
|
|
1025
1030
|
target,
|
|
1026
|
-
|
|
1031
|
+
chunkH5IJSROF_cjs.sql`
|
|
1027
1032
|
INSERT INTO ${schema.recordedClockTable} (graph_id, revision, recorded_at)
|
|
1028
1033
|
VALUES (${graphId}, ${parts.revision}, ${parts.recordedAt})
|
|
1029
1034
|
ON CONFLICT (graph_id) DO UPDATE
|
|
@@ -1044,18 +1049,24 @@ async function assertRecordedClockAdvanced(target, schema, graphId, revision) {
|
|
|
1044
1049
|
);
|
|
1045
1050
|
}
|
|
1046
1051
|
async function lockRecordedClock(target, schema, graphId, ownsWriteLock) {
|
|
1047
|
-
|
|
1048
|
-
|
|
1052
|
+
const plan = chunkNUQ2YFFH_cjs.resolveWriteFencePlan(target);
|
|
1053
|
+
const fence = chunkNUQ2YFFH_cjs.requireWriteFence(
|
|
1054
|
+
plan,
|
|
1055
|
+
"recorded clock allocation",
|
|
1056
|
+
"advisory-lock"
|
|
1057
|
+
);
|
|
1058
|
+
switch (fence.kind) {
|
|
1059
|
+
case "lock": {
|
|
1049
1060
|
await target.execute(
|
|
1050
|
-
|
|
1061
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(recordedClockAdvisoryLockSql(graphId))
|
|
1051
1062
|
);
|
|
1052
1063
|
return;
|
|
1053
1064
|
}
|
|
1054
|
-
case "
|
|
1065
|
+
case "engine-serialized": {
|
|
1055
1066
|
if (ownsWriteLock) return;
|
|
1056
1067
|
await executeStatement(
|
|
1057
1068
|
target,
|
|
1058
|
-
|
|
1069
|
+
chunkH5IJSROF_cjs.sql`
|
|
1059
1070
|
INSERT INTO ${schema.recordedClockTable} (graph_id, revision, recorded_at)
|
|
1060
1071
|
VALUES (${graphId}, ${RECORDED_MIN_REVISION}, ${RECORDED_MIN_TIME})
|
|
1061
1072
|
ON CONFLICT (graph_id) DO UPDATE SET revision = revision
|
|
@@ -1063,9 +1074,6 @@ async function lockRecordedClock(target, schema, graphId, ownsWriteLock) {
|
|
|
1063
1074
|
);
|
|
1064
1075
|
return;
|
|
1065
1076
|
}
|
|
1066
|
-
default: {
|
|
1067
|
-
target.dialect;
|
|
1068
|
-
}
|
|
1069
1077
|
}
|
|
1070
1078
|
}
|
|
1071
1079
|
async function allocateRecordedCommit(target, schema, graphId, ownsWriteLock, previousRevision) {
|
|
@@ -1146,7 +1154,7 @@ async function runInsertBatchReturning(dispatch, params) {
|
|
|
1146
1154
|
}
|
|
1147
1155
|
|
|
1148
1156
|
// src/identity/historical-sql.ts
|
|
1149
|
-
var IDENTITY_ASSERTION_COLUMNS =
|
|
1157
|
+
var IDENTITY_ASSERTION_COLUMNS = chunkH5IJSROF_cjs.sql.raw(
|
|
1150
1158
|
[
|
|
1151
1159
|
"graph_id",
|
|
1152
1160
|
"id",
|
|
@@ -1172,31 +1180,31 @@ function identitySqlCoordinate(coordinate, currentInstant) {
|
|
|
1172
1180
|
coordinate?.recorded?.asOf,
|
|
1173
1181
|
"recorded.asOf"
|
|
1174
1182
|
),
|
|
1175
|
-
currentInstant: typeof currentInstant === "string" ?
|
|
1183
|
+
currentInstant: typeof currentInstant === "string" ? chunkH5IJSROF_cjs.sql`${currentInstant}` : currentInstant
|
|
1176
1184
|
};
|
|
1177
1185
|
}
|
|
1178
1186
|
function validityInstant(coordinate) {
|
|
1179
1187
|
if (coordinate.validMode === "asOf" && coordinate.validAsOf !== void 0) {
|
|
1180
|
-
return
|
|
1188
|
+
return chunkH5IJSROF_cjs.sql`${coordinate.validAsOf}`;
|
|
1181
1189
|
}
|
|
1182
1190
|
if (coordinate.recorded !== void 0) {
|
|
1183
|
-
return
|
|
1191
|
+
return chunkH5IJSROF_cjs.sql`${coordinate.recorded.recordedAt}`;
|
|
1184
1192
|
}
|
|
1185
1193
|
return coordinate.currentInstant;
|
|
1186
1194
|
}
|
|
1187
1195
|
function qualifiedColumn(alias, column) {
|
|
1188
|
-
return
|
|
1196
|
+
return chunkH5IJSROF_cjs.sql`${chunkH5IJSROF_cjs.sql.identifier(alias)}.${chunkH5IJSROF_cjs.sql.identifier(column)}`;
|
|
1189
1197
|
}
|
|
1190
1198
|
function identityNodeVisibilitySql(coordinate, alias) {
|
|
1191
1199
|
const deletedAt = qualifiedColumn(alias, "deleted_at");
|
|
1192
|
-
if (coordinate.validMode === "includeTombstones") return
|
|
1200
|
+
if (coordinate.validMode === "includeTombstones") return chunkH5IJSROF_cjs.sql`1 = 1`;
|
|
1193
1201
|
if (coordinate.validMode === "includeEnded") {
|
|
1194
|
-
return
|
|
1202
|
+
return chunkH5IJSROF_cjs.sql`${deletedAt} IS NULL`;
|
|
1195
1203
|
}
|
|
1196
1204
|
const validFrom = qualifiedColumn(alias, "valid_from");
|
|
1197
1205
|
const validTo = qualifiedColumn(alias, "valid_to");
|
|
1198
1206
|
const instant = validityInstant(coordinate);
|
|
1199
|
-
return
|
|
1207
|
+
return chunkH5IJSROF_cjs.sql`
|
|
1200
1208
|
${deletedAt} IS NULL
|
|
1201
1209
|
AND (${validFrom} IS NULL OR ${validFrom} <= ${instant})
|
|
1202
1210
|
AND (${validTo} IS NULL OR ${validTo} > ${instant})
|
|
@@ -1204,19 +1212,19 @@ function identityNodeVisibilitySql(coordinate, alias) {
|
|
|
1204
1212
|
}
|
|
1205
1213
|
function structuralFoldVisibilitySql(coordinate, alias) {
|
|
1206
1214
|
const deletedAt = qualifiedColumn(alias, "deleted_at");
|
|
1207
|
-
if (coordinate.recorded !== void 0) return
|
|
1208
|
-
if (coordinate.validMode !== "asOf") return
|
|
1215
|
+
if (coordinate.recorded !== void 0) return chunkH5IJSROF_cjs.sql`${deletedAt} IS NULL`;
|
|
1216
|
+
if (coordinate.validMode !== "asOf") return chunkH5IJSROF_cjs.sql`${deletedAt} IS NULL`;
|
|
1209
1217
|
const createdAt = qualifiedColumn(alias, "created_at");
|
|
1210
1218
|
const instant = validityInstant(coordinate);
|
|
1211
|
-
return
|
|
1219
|
+
return chunkH5IJSROF_cjs.sql`${createdAt} <= ${instant} AND (${deletedAt} IS NULL OR ${deletedAt} > ${instant})`;
|
|
1212
1220
|
}
|
|
1213
1221
|
function identityNodeSnapshotSource(schema, graphId, coordinate) {
|
|
1214
1222
|
const table = coordinate.recorded === void 0 ? schema.nodesTable : schema.recordedNodesTable;
|
|
1215
|
-
const recordedFilter = coordinate.recorded === void 0 ?
|
|
1223
|
+
const recordedFilter = coordinate.recorded === void 0 ? chunkH5IJSROF_cjs.sql`` : chunkH5IJSROF_cjs.sql`
|
|
1216
1224
|
AND recorded_from <= ${coordinate.recorded.revision}
|
|
1217
1225
|
AND recorded_to > ${coordinate.recorded.revision}
|
|
1218
1226
|
`;
|
|
1219
|
-
return
|
|
1227
|
+
return chunkH5IJSROF_cjs.sql`
|
|
1220
1228
|
SELECT kind, id, valid_from, valid_to, created_at, deleted_at
|
|
1221
1229
|
FROM ${table}
|
|
1222
1230
|
WHERE graph_id = ${graphId}
|
|
@@ -1225,13 +1233,13 @@ function identityNodeSnapshotSource(schema, graphId, coordinate) {
|
|
|
1225
1233
|
}
|
|
1226
1234
|
function identityAssertionSnapshotSource(schema, graphId, coordinate, relation) {
|
|
1227
1235
|
const table = coordinate.recorded === void 0 ? schema.identityAssertionsTable : schema.recordedIdentityAssertionsTable;
|
|
1228
|
-
const recordedFilter = coordinate.recorded === void 0 ?
|
|
1236
|
+
const recordedFilter = coordinate.recorded === void 0 ? chunkH5IJSROF_cjs.sql`` : chunkH5IJSROF_cjs.sql`
|
|
1229
1237
|
AND recorded_from <= ${coordinate.recorded.revision}
|
|
1230
1238
|
AND recorded_to > ${coordinate.recorded.revision}
|
|
1231
1239
|
`;
|
|
1232
|
-
const relationFilter = relation === void 0 ?
|
|
1240
|
+
const relationFilter = relation === void 0 ? chunkH5IJSROF_cjs.sql`` : chunkH5IJSROF_cjs.sql`AND rel = ${relation}`;
|
|
1233
1241
|
const instant = validityInstant(coordinate);
|
|
1234
|
-
return
|
|
1242
|
+
return chunkH5IJSROF_cjs.sql`
|
|
1235
1243
|
SELECT ${IDENTITY_ASSERTION_COLUMNS}
|
|
1236
1244
|
FROM ${table}
|
|
1237
1245
|
WHERE graph_id = ${graphId}
|
|
@@ -1243,6 +1251,10 @@ function identityAssertionSnapshotSource(schema, graphId, coordinate, relation)
|
|
|
1243
1251
|
`;
|
|
1244
1252
|
}
|
|
1245
1253
|
function historicalIdentityReconstructionCtes(input) {
|
|
1254
|
+
chunkZGVTNKTX_cjs.assertRecursiveTraversal(
|
|
1255
|
+
input.recursiveTraversal,
|
|
1256
|
+
"historical identity class read"
|
|
1257
|
+
);
|
|
1246
1258
|
const nodes = identityNodeSnapshotSource(
|
|
1247
1259
|
input.schema,
|
|
1248
1260
|
input.graphId,
|
|
@@ -1254,7 +1266,7 @@ function historicalIdentityReconstructionCtes(input) {
|
|
|
1254
1266
|
input.coordinate,
|
|
1255
1267
|
"same"
|
|
1256
1268
|
);
|
|
1257
|
-
const sameIdEdges = input.sameIdAcrossKinds === "fold" ?
|
|
1269
|
+
const sameIdEdges = input.sameIdAcrossKinds === "fold" ? chunkH5IJSROF_cjs.sql`
|
|
1258
1270
|
UNION ALL
|
|
1259
1271
|
SELECT left_node.kind, left_node.id, right_node.kind, right_node.id
|
|
1260
1272
|
FROM node_snapshot left_node
|
|
@@ -1263,8 +1275,8 @@ function historicalIdentityReconstructionCtes(input) {
|
|
|
1263
1275
|
AND right_node.kind <> left_node.kind
|
|
1264
1276
|
WHERE ${structuralFoldVisibilitySql(input.coordinate, "left_node")}
|
|
1265
1277
|
AND ${structuralFoldVisibilitySql(input.coordinate, "right_node")}
|
|
1266
|
-
` :
|
|
1267
|
-
return
|
|
1278
|
+
` : chunkH5IJSROF_cjs.sql``;
|
|
1279
|
+
return chunkH5IJSROF_cjs.sql`
|
|
1268
1280
|
node_snapshot(kind, id, valid_from, valid_to, created_at, deleted_at) AS (
|
|
1269
1281
|
${nodes}
|
|
1270
1282
|
),
|
|
@@ -1295,15 +1307,19 @@ function historicalIdentityReconstructionCtes(input) {
|
|
|
1295
1307
|
)
|
|
1296
1308
|
`;
|
|
1297
1309
|
}
|
|
1298
|
-
var IDENTITY_PEER_CLASS_COLUMNS =
|
|
1310
|
+
var IDENTITY_PEER_CLASS_COLUMNS = chunkH5IJSROF_cjs.sql.raw(
|
|
1299
1311
|
["seed_kind", "seed_id", "kind", "id"].join(", ")
|
|
1300
1312
|
);
|
|
1301
1313
|
function historicalIdentityPeerClassQuery(input) {
|
|
1314
|
+
chunkZGVTNKTX_cjs.assertRecursiveTraversal(
|
|
1315
|
+
input.recursiveTraversal,
|
|
1316
|
+
"historical identity expansion"
|
|
1317
|
+
);
|
|
1302
1318
|
const reconstruction = historicalIdentityReconstructionCtes({
|
|
1303
1319
|
...input,
|
|
1304
|
-
seedSource:
|
|
1320
|
+
seedSource: chunkH5IJSROF_cjs.sql`SELECT DISTINCT a_kind, a_id FROM identity_edges`
|
|
1305
1321
|
});
|
|
1306
|
-
return
|
|
1322
|
+
return chunkH5IJSROF_cjs.sql`
|
|
1307
1323
|
WITH RECURSIVE
|
|
1308
1324
|
${reconstruction}
|
|
1309
1325
|
SELECT member.seed_kind, member.seed_id, member.kind, member.id
|
|
@@ -1326,28 +1342,28 @@ function compileFieldColumn(field, cteAlias, cteColumnPrefix) {
|
|
|
1326
1342
|
if (cteColumnPrefix !== void 0) {
|
|
1327
1343
|
const qualifier2 = cteColumnPrefix === "" ? "" : `${cteColumnPrefix}.`;
|
|
1328
1344
|
if (field.path.length === 1 && field.path[0] === "id") {
|
|
1329
|
-
return
|
|
1345
|
+
return chunkH5IJSROF_cjs.sql.raw(`${qualifier2}id`);
|
|
1330
1346
|
}
|
|
1331
1347
|
if (field.path.length === 1 && field.path[0] === "kind") {
|
|
1332
|
-
return
|
|
1348
|
+
return chunkH5IJSROF_cjs.sql.raw(`${qualifier2}kind`);
|
|
1333
1349
|
}
|
|
1334
1350
|
if (field.path.length > 0 && field.path[0] === "props") {
|
|
1335
|
-
return
|
|
1351
|
+
return chunkH5IJSROF_cjs.sql.raw(`${qualifier2}props`);
|
|
1336
1352
|
}
|
|
1337
|
-
return
|
|
1353
|
+
return chunkH5IJSROF_cjs.sql.raw(`${qualifier2}${field.path.join("_")}`);
|
|
1338
1354
|
}
|
|
1339
1355
|
const prefix = field.alias;
|
|
1340
1356
|
const qualifier = cteAlias ? `${cteAlias}.` : "";
|
|
1341
1357
|
if (field.path.length === 1 && field.path[0] === "id") {
|
|
1342
|
-
return
|
|
1358
|
+
return chunkH5IJSROF_cjs.sql.raw(`${qualifier}${prefix}_id`);
|
|
1343
1359
|
}
|
|
1344
1360
|
if (field.path.length === 1 && field.path[0] === "kind") {
|
|
1345
|
-
return
|
|
1361
|
+
return chunkH5IJSROF_cjs.sql.raw(`${qualifier}${prefix}_kind`);
|
|
1346
1362
|
}
|
|
1347
1363
|
if (field.path.length > 0 && field.path[0] === "props") {
|
|
1348
|
-
return
|
|
1364
|
+
return chunkH5IJSROF_cjs.sql.raw(`${qualifier}${prefix}_props`);
|
|
1349
1365
|
}
|
|
1350
|
-
return
|
|
1366
|
+
return chunkH5IJSROF_cjs.sql.raw(`${qualifier}${prefix}_${field.path.join("_")}`);
|
|
1351
1367
|
}
|
|
1352
1368
|
function getFieldPointer(field) {
|
|
1353
1369
|
if (field.jsonPointer !== void 0) {
|
|
@@ -1467,9 +1483,9 @@ function convertValueForSql(value, dialect) {
|
|
|
1467
1483
|
}
|
|
1468
1484
|
function compileStringPattern(op, pattern) {
|
|
1469
1485
|
const escaped = pattern.replaceAll(
|
|
1470
|
-
|
|
1471
|
-
`${
|
|
1472
|
-
).replaceAll("%", `${
|
|
1486
|
+
chunkA4C4NJ5U_cjs.LIKE_ESCAPE_CHARACTER,
|
|
1487
|
+
`${chunkA4C4NJ5U_cjs.LIKE_ESCAPE_CHARACTER}${chunkA4C4NJ5U_cjs.LIKE_ESCAPE_CHARACTER}`
|
|
1488
|
+
).replaceAll("%", `${chunkA4C4NJ5U_cjs.LIKE_ESCAPE_CHARACTER}%`).replaceAll("_", `${chunkA4C4NJ5U_cjs.LIKE_ESCAPE_CHARACTER}_`);
|
|
1473
1489
|
switch (op) {
|
|
1474
1490
|
case "contains": {
|
|
1475
1491
|
return `%${escaped}%`;
|
|
@@ -1490,22 +1506,22 @@ function compileStringPattern(op, pattern) {
|
|
|
1490
1506
|
}
|
|
1491
1507
|
}
|
|
1492
1508
|
function escapeLikePatternParameter(parameter) {
|
|
1493
|
-
const doubledEscape = `${
|
|
1494
|
-
return
|
|
1509
|
+
const doubledEscape = `${chunkA4C4NJ5U_cjs.LIKE_ESCAPE_CHARACTER}${chunkA4C4NJ5U_cjs.LIKE_ESCAPE_CHARACTER}`;
|
|
1510
|
+
return chunkH5IJSROF_cjs.sql`REPLACE(REPLACE(REPLACE(${parameter}, ${chunkA4C4NJ5U_cjs.LIKE_ESCAPE_CHARACTER}, ${doubledEscape}), '%', ${`${chunkA4C4NJ5U_cjs.LIKE_ESCAPE_CHARACTER}%`}), '_', ${`${chunkA4C4NJ5U_cjs.LIKE_ESCAPE_CHARACTER}_`})`;
|
|
1495
1511
|
}
|
|
1496
1512
|
function compileParameterizedStringPattern(op, parameter) {
|
|
1497
1513
|
switch (op) {
|
|
1498
1514
|
case "contains": {
|
|
1499
1515
|
const escaped = escapeLikePatternParameter(parameter);
|
|
1500
|
-
return
|
|
1516
|
+
return chunkH5IJSROF_cjs.sql`'%' || ${escaped} || '%'`;
|
|
1501
1517
|
}
|
|
1502
1518
|
case "startsWith": {
|
|
1503
1519
|
const escaped = escapeLikePatternParameter(parameter);
|
|
1504
|
-
return
|
|
1520
|
+
return chunkH5IJSROF_cjs.sql`${escaped} || '%'`;
|
|
1505
1521
|
}
|
|
1506
1522
|
case "endsWith": {
|
|
1507
1523
|
const escaped = escapeLikePatternParameter(parameter);
|
|
1508
|
-
return
|
|
1524
|
+
return chunkH5IJSROF_cjs.sql`'%' || ${escaped}`;
|
|
1509
1525
|
}
|
|
1510
1526
|
case "like":
|
|
1511
1527
|
case "ilike": {
|
|
@@ -1516,6 +1532,22 @@ function compileParameterizedStringPattern(op, parameter) {
|
|
|
1516
1532
|
}
|
|
1517
1533
|
}
|
|
1518
1534
|
}
|
|
1535
|
+
function requireRecursiveTraversalVerdict(ctx, operation) {
|
|
1536
|
+
const verdict = ctx.recursiveTraversal;
|
|
1537
|
+
if (verdict === void 0) {
|
|
1538
|
+
throw new chunkX4GDXBOP_cjs.CompilerInvariantError(
|
|
1539
|
+
"recursive traversal verdict missing from compiler context",
|
|
1540
|
+
{ operation }
|
|
1541
|
+
);
|
|
1542
|
+
}
|
|
1543
|
+
return verdict;
|
|
1544
|
+
}
|
|
1545
|
+
function assertRecursiveTraversalSupported(ctx, operation) {
|
|
1546
|
+
chunkZGVTNKTX_cjs.assertRecursiveTraversal(
|
|
1547
|
+
requireRecursiveTraversalVerdict(ctx, operation),
|
|
1548
|
+
operation
|
|
1549
|
+
);
|
|
1550
|
+
}
|
|
1519
1551
|
function compilePredicateExpression(expr, ctx) {
|
|
1520
1552
|
const { dialect } = ctx;
|
|
1521
1553
|
const cteColumnPrefix = ctx.cteColumnPrefix;
|
|
@@ -1532,18 +1564,18 @@ function compilePredicateExpression(expr, ctx) {
|
|
|
1532
1564
|
cteColumnPrefix
|
|
1533
1565
|
);
|
|
1534
1566
|
if (isParameterRef(expr.pattern)) {
|
|
1535
|
-
const placeholder =
|
|
1567
|
+
const placeholder = chunkH5IJSROF_cjs.sql`${chunkH5IJSROF_cjs.sql.placeholder(expr.pattern.name)}`;
|
|
1536
1568
|
const pattern2 = compileParameterizedStringPattern(expr.op, placeholder);
|
|
1537
1569
|
if (expr.op === "ilike" || expr.op === "contains" || expr.op === "startsWith" || expr.op === "endsWith") {
|
|
1538
1570
|
return dialect.ilike(field, pattern2);
|
|
1539
1571
|
}
|
|
1540
|
-
return
|
|
1572
|
+
return chunkH5IJSROF_cjs.sql`${field} LIKE ${pattern2} ${chunkA4C4NJ5U_cjs.likeEscapeClause}`;
|
|
1541
1573
|
}
|
|
1542
1574
|
const pattern = compileStringPattern(expr.op, expr.pattern);
|
|
1543
1575
|
if (expr.op === "ilike" || expr.op === "contains" || expr.op === "startsWith" || expr.op === "endsWith") {
|
|
1544
1576
|
return dialect.ilike(field, pattern);
|
|
1545
1577
|
}
|
|
1546
|
-
return
|
|
1578
|
+
return chunkH5IJSROF_cjs.sql`${field} LIKE ${pattern} ${chunkA4C4NJ5U_cjs.likeEscapeClause}`;
|
|
1547
1579
|
}
|
|
1548
1580
|
case "null_check": {
|
|
1549
1581
|
const field = compileFieldTextValue(
|
|
@@ -1553,7 +1585,7 @@ function compilePredicateExpression(expr, ctx) {
|
|
|
1553
1585
|
void 0,
|
|
1554
1586
|
cteColumnPrefix
|
|
1555
1587
|
);
|
|
1556
|
-
return expr.op === "isNull" ?
|
|
1588
|
+
return expr.op === "isNull" ? chunkH5IJSROF_cjs.sql`${field} IS NULL` : chunkH5IJSROF_cjs.sql`${field} IS NOT NULL`;
|
|
1557
1589
|
}
|
|
1558
1590
|
case "between": {
|
|
1559
1591
|
const lowerIsParam = isParameterRef(expr.lower);
|
|
@@ -1575,25 +1607,25 @@ function compilePredicateExpression(expr, ctx) {
|
|
|
1575
1607
|
void 0,
|
|
1576
1608
|
cteColumnPrefix
|
|
1577
1609
|
);
|
|
1578
|
-
const lower = lowerIsParam ?
|
|
1579
|
-
const upper = upperIsParam ?
|
|
1580
|
-
return
|
|
1610
|
+
const lower = lowerIsParam ? chunkH5IJSROF_cjs.sql.placeholder(expr.lower.name) : convertValueForSql(expr.lower.value, dialect);
|
|
1611
|
+
const upper = upperIsParam ? chunkH5IJSROF_cjs.sql.placeholder(expr.upper.name) : convertValueForSql(expr.upper.value, dialect);
|
|
1612
|
+
return chunkH5IJSROF_cjs.sql`${field} BETWEEN ${lower} AND ${upper}`;
|
|
1581
1613
|
}
|
|
1582
1614
|
case "and": {
|
|
1583
1615
|
const parts = expr.predicates.map(
|
|
1584
1616
|
(p) => compilePredicateExpression(p, ctx)
|
|
1585
1617
|
);
|
|
1586
|
-
return
|
|
1618
|
+
return chunkH5IJSROF_cjs.sql`(${chunkH5IJSROF_cjs.sql.join(parts, chunkH5IJSROF_cjs.sql` AND `)})`;
|
|
1587
1619
|
}
|
|
1588
1620
|
case "or": {
|
|
1589
1621
|
const parts = expr.predicates.map(
|
|
1590
1622
|
(p) => compilePredicateExpression(p, ctx)
|
|
1591
1623
|
);
|
|
1592
|
-
return
|
|
1624
|
+
return chunkH5IJSROF_cjs.sql`(${chunkH5IJSROF_cjs.sql.join(parts, chunkH5IJSROF_cjs.sql` OR `)})`;
|
|
1593
1625
|
}
|
|
1594
1626
|
case "not": {
|
|
1595
1627
|
const inner = compilePredicateExpression(expr.predicate, ctx);
|
|
1596
|
-
return
|
|
1628
|
+
return chunkH5IJSROF_cjs.sql`NOT (${inner})`;
|
|
1597
1629
|
}
|
|
1598
1630
|
case "array_op": {
|
|
1599
1631
|
return compileArrayPredicate(expr, dialect, cteColumnPrefix);
|
|
@@ -1616,7 +1648,7 @@ function compilePredicateExpression(expr, ctx) {
|
|
|
1616
1648
|
}
|
|
1617
1649
|
}
|
|
1618
1650
|
}
|
|
1619
|
-
var STRUCTURAL_PREDICATE_NOOP =
|
|
1651
|
+
var STRUCTURAL_PREDICATE_NOOP = chunkH5IJSROF_cjs.sql.raw("1=1");
|
|
1620
1652
|
function compileComparisonPredicate(expr, dialect, cteColumnPrefix) {
|
|
1621
1653
|
if (isParameterRef(expr.right)) {
|
|
1622
1654
|
const parameterValueType = resolveParameterValueType(expr.left, expr.right);
|
|
@@ -1643,7 +1675,7 @@ function compileComparisonPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1643
1675
|
`Comparison operation "${expr.op}" is not supported for parameterized predicates`
|
|
1644
1676
|
);
|
|
1645
1677
|
}
|
|
1646
|
-
return
|
|
1678
|
+
return chunkH5IJSROF_cjs.sql`${left2} ${chunkH5IJSROF_cjs.sql.raw(opSql2)} ${chunkH5IJSROF_cjs.sql.placeholder(expr.right.name)}`;
|
|
1647
1679
|
}
|
|
1648
1680
|
const valueType = resolveComparisonValueType(expr.left, expr.right);
|
|
1649
1681
|
if (valueType === "array" || valueType === "object") {
|
|
@@ -1662,7 +1694,7 @@ function compileComparisonPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1662
1694
|
if (expr.op === "in" || expr.op === "notIn") {
|
|
1663
1695
|
const values = Array.isArray(expr.right) ? expr.right : [expr.right];
|
|
1664
1696
|
if (values.length === 0) {
|
|
1665
|
-
return expr.op === "in" ?
|
|
1697
|
+
return expr.op === "in" ? chunkH5IJSROF_cjs.sql.raw("1=0") : chunkH5IJSROF_cjs.sql.raw("1=1");
|
|
1666
1698
|
}
|
|
1667
1699
|
const convertedValues = values.map(
|
|
1668
1700
|
(value) => convertValueForSql(value.value, dialect)
|
|
@@ -1678,7 +1710,7 @@ function compileComparisonPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1678
1710
|
`Comparison operation "${expr.op}" is not supported`
|
|
1679
1711
|
);
|
|
1680
1712
|
}
|
|
1681
|
-
return
|
|
1713
|
+
return chunkH5IJSROF_cjs.sql`${left} ${chunkH5IJSROF_cjs.sql.raw(opSql)} ${convertedRight}`;
|
|
1682
1714
|
}
|
|
1683
1715
|
function compileListParameterPredicate(left, parameterName, elementType, negated, dialect) {
|
|
1684
1716
|
if (elementType === "array" || elementType === "object" || elementType === "embedding") {
|
|
@@ -1690,7 +1722,7 @@ function compileListParameterPredicate(left, parameterName, elementType, negated
|
|
|
1690
1722
|
}
|
|
1691
1723
|
);
|
|
1692
1724
|
}
|
|
1693
|
-
return dialect.inListParameter(left,
|
|
1725
|
+
return dialect.inListParameter(left, chunkH5IJSROF_cjs.sql.placeholder(parameterName), {
|
|
1694
1726
|
negated,
|
|
1695
1727
|
elementType
|
|
1696
1728
|
});
|
|
@@ -1706,30 +1738,30 @@ function compileArrayPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1706
1738
|
const values = expr.values?.map((v) => convertValueForSql(v.value, dialect)) ?? [];
|
|
1707
1739
|
switch (expr.op) {
|
|
1708
1740
|
case "isEmpty": {
|
|
1709
|
-
return
|
|
1741
|
+
return chunkH5IJSROF_cjs.sql`(${field} IS NULL OR ${dialect.jsonArrayLength(field)} = 0)`;
|
|
1710
1742
|
}
|
|
1711
1743
|
case "isNotEmpty": {
|
|
1712
|
-
return
|
|
1744
|
+
return chunkH5IJSROF_cjs.sql`(${field} IS NOT NULL AND ${dialect.jsonArrayLength(field)} > 0)`;
|
|
1713
1745
|
}
|
|
1714
1746
|
case "lengthEq": {
|
|
1715
|
-
return
|
|
1747
|
+
return chunkH5IJSROF_cjs.sql`${dialect.jsonArrayLength(field)} = ${expr.length}`;
|
|
1716
1748
|
}
|
|
1717
1749
|
case "lengthGt": {
|
|
1718
|
-
return
|
|
1750
|
+
return chunkH5IJSROF_cjs.sql`${dialect.jsonArrayLength(field)} > ${expr.length}`;
|
|
1719
1751
|
}
|
|
1720
1752
|
case "lengthGte": {
|
|
1721
|
-
return
|
|
1753
|
+
return chunkH5IJSROF_cjs.sql`${dialect.jsonArrayLength(field)} >= ${expr.length}`;
|
|
1722
1754
|
}
|
|
1723
1755
|
case "lengthLt": {
|
|
1724
|
-
return
|
|
1756
|
+
return chunkH5IJSROF_cjs.sql`${dialect.jsonArrayLength(field)} < ${expr.length}`;
|
|
1725
1757
|
}
|
|
1726
1758
|
case "lengthLte": {
|
|
1727
|
-
return
|
|
1759
|
+
return chunkH5IJSROF_cjs.sql`${dialect.jsonArrayLength(field)} <= ${expr.length}`;
|
|
1728
1760
|
}
|
|
1729
1761
|
case "contains": {
|
|
1730
1762
|
const value = values[0];
|
|
1731
1763
|
if (value === void 0) {
|
|
1732
|
-
return
|
|
1764
|
+
return chunkH5IJSROF_cjs.sql.raw("1=0");
|
|
1733
1765
|
}
|
|
1734
1766
|
return dialect.jsonArrayContains(field, value);
|
|
1735
1767
|
}
|
|
@@ -1770,7 +1802,7 @@ function compileObjectPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1770
1802
|
pointer,
|
|
1771
1803
|
cteColumnPrefix
|
|
1772
1804
|
);
|
|
1773
|
-
return
|
|
1805
|
+
return chunkH5IJSROF_cjs.sql`${left} = ${convertValueForSql(expr.value.value, dialect)}`;
|
|
1774
1806
|
}
|
|
1775
1807
|
case "pathContains": {
|
|
1776
1808
|
if (!expr.value) {
|
|
@@ -1807,7 +1839,7 @@ function compileAggregatePredicate(expr, dialect) {
|
|
|
1807
1839
|
);
|
|
1808
1840
|
}
|
|
1809
1841
|
const convertedValue = convertValueForSql(expr.value.value, dialect);
|
|
1810
|
-
return
|
|
1842
|
+
return chunkH5IJSROF_cjs.sql`${aggregate} ${chunkH5IJSROF_cjs.sql.raw(op)} ${convertedValue}`;
|
|
1811
1843
|
}
|
|
1812
1844
|
function compileAggregateExpr(expr, dialect) {
|
|
1813
1845
|
const cteAlias = `cte_${expr.field.alias}`;
|
|
@@ -1819,22 +1851,22 @@ function compileAggregateExpr(expr, dialect) {
|
|
|
1819
1851
|
);
|
|
1820
1852
|
switch (expr.function) {
|
|
1821
1853
|
case "count": {
|
|
1822
|
-
return
|
|
1854
|
+
return chunkH5IJSROF_cjs.sql`COUNT(${field})`;
|
|
1823
1855
|
}
|
|
1824
1856
|
case "countDistinct": {
|
|
1825
|
-
return
|
|
1857
|
+
return chunkH5IJSROF_cjs.sql`COUNT(DISTINCT ${field})`;
|
|
1826
1858
|
}
|
|
1827
1859
|
case "sum": {
|
|
1828
|
-
return
|
|
1860
|
+
return chunkH5IJSROF_cjs.sql`SUM(${field})`;
|
|
1829
1861
|
}
|
|
1830
1862
|
case "avg": {
|
|
1831
|
-
return
|
|
1863
|
+
return chunkH5IJSROF_cjs.sql`AVG(${field})`;
|
|
1832
1864
|
}
|
|
1833
1865
|
case "min": {
|
|
1834
|
-
return
|
|
1866
|
+
return chunkH5IJSROF_cjs.sql`MIN(${field})`;
|
|
1835
1867
|
}
|
|
1836
1868
|
case "max": {
|
|
1837
|
-
return
|
|
1869
|
+
return chunkH5IJSROF_cjs.sql`MAX(${field})`;
|
|
1838
1870
|
}
|
|
1839
1871
|
default: {
|
|
1840
1872
|
throw new chunkX4GDXBOP_cjs.UnsupportedPredicateError(
|
|
@@ -1848,7 +1880,7 @@ function compileExistsSubquery(expr, ctx) {
|
|
|
1848
1880
|
throw new chunkX4GDXBOP_cjs.UnsupportedPredicateError("EXISTS subquery must have a graphId");
|
|
1849
1881
|
}
|
|
1850
1882
|
const subSql = ctx.compileQuery(expr.subquery, expr.subquery.graphId);
|
|
1851
|
-
return expr.negated ?
|
|
1883
|
+
return expr.negated ? chunkH5IJSROF_cjs.sql`NOT EXISTS (${subSql})` : chunkH5IJSROF_cjs.sql`EXISTS (${subSql})`;
|
|
1852
1884
|
}
|
|
1853
1885
|
function compileInSubquery(expr, ctx) {
|
|
1854
1886
|
const subqueryColumnCount = getSubqueryColumnCount(expr.subquery);
|
|
@@ -1891,7 +1923,7 @@ function compileInSubquery(expr, ctx) {
|
|
|
1891
1923
|
ctx.cteColumnPrefix
|
|
1892
1924
|
);
|
|
1893
1925
|
const subSql = ctx.compileQuery(expr.subquery, expr.subquery.graphId);
|
|
1894
|
-
return expr.negated ?
|
|
1926
|
+
return expr.negated ? chunkH5IJSROF_cjs.sql`${fieldSql} NOT IN (${subSql})` : chunkH5IJSROF_cjs.sql`${fieldSql} IN (${subSql})`;
|
|
1895
1927
|
}
|
|
1896
1928
|
function extractStructuralPredicates(predicates, isMatch, rejectionMessage) {
|
|
1897
1929
|
const results = [];
|
|
@@ -1952,9 +1984,9 @@ function extractFulltextMatchPredicates(predicates) {
|
|
|
1952
1984
|
// src/query/compiler/predicate-utils.ts
|
|
1953
1985
|
var EMPTY_PREDICATES = [];
|
|
1954
1986
|
function sqlValueList(values) {
|
|
1955
|
-
return
|
|
1956
|
-
values.map((value) =>
|
|
1957
|
-
|
|
1987
|
+
return chunkH5IJSROF_cjs.sql.join(
|
|
1988
|
+
values.map((value) => chunkH5IJSROF_cjs.sql`${value}`),
|
|
1989
|
+
chunkH5IJSROF_cjs.sql`, `
|
|
1958
1990
|
);
|
|
1959
1991
|
}
|
|
1960
1992
|
function buildPredicateIndexKey(alias, targetType) {
|
|
@@ -1991,12 +2023,12 @@ function compilePredicateClauses(predicates, predicateContext) {
|
|
|
1991
2023
|
}
|
|
1992
2024
|
function compileKindFilter(column, kinds) {
|
|
1993
2025
|
if (kinds.length === 0) {
|
|
1994
|
-
return
|
|
2026
|
+
return chunkH5IJSROF_cjs.sql`1 = 0`;
|
|
1995
2027
|
}
|
|
1996
2028
|
if (kinds.length === 1) {
|
|
1997
|
-
return
|
|
2029
|
+
return chunkH5IJSROF_cjs.sql`${column} = ${kinds[0]}`;
|
|
1998
2030
|
}
|
|
1999
|
-
return
|
|
2031
|
+
return chunkH5IJSROF_cjs.sql`${column} IN (${sqlValueList(kinds)})`;
|
|
2000
2032
|
}
|
|
2001
2033
|
function getNodeKindsForAlias(ast, alias) {
|
|
2002
2034
|
if (alias === ast.start.alias) {
|
|
@@ -2034,17 +2066,27 @@ async function getRowsByIds(ids, policy) {
|
|
|
2034
2066
|
}
|
|
2035
2067
|
|
|
2036
2068
|
// src/store/edge-fetch.ts
|
|
2037
|
-
async function getEdgeRowsByIds(backend, graphId, ids) {
|
|
2069
|
+
async function getEdgeRowsByIds(backend, verdict, graphId, ids) {
|
|
2070
|
+
const bound = chunkNUQ2YFFH_cjs.bindExtraIfReachable(
|
|
2071
|
+
backend,
|
|
2072
|
+
verdict.extras.getEdges,
|
|
2073
|
+
chunkNUQ2YFFH_cjs.BATCH_POINT_READ.id
|
|
2074
|
+
);
|
|
2038
2075
|
return getRowsByIds(ids, {
|
|
2039
|
-
batch:
|
|
2076
|
+
batch: bound === void 0 ? void 0 : ((batchIds) => bound.getEdges(graphId, batchIds)),
|
|
2040
2077
|
one: (id) => backend.getEdge(graphId, id)
|
|
2041
2078
|
});
|
|
2042
2079
|
}
|
|
2043
2080
|
|
|
2044
2081
|
// src/store/node-fetch.ts
|
|
2045
|
-
async function getNodeRowsByIds(backend, graphId, kind, ids) {
|
|
2082
|
+
async function getNodeRowsByIds(backend, verdict, graphId, kind, ids) {
|
|
2083
|
+
const bound = chunkNUQ2YFFH_cjs.bindExtraIfReachable(
|
|
2084
|
+
backend,
|
|
2085
|
+
verdict.extras.getNodes,
|
|
2086
|
+
chunkNUQ2YFFH_cjs.BATCH_POINT_READ.id
|
|
2087
|
+
);
|
|
2046
2088
|
return getRowsByIds(ids, {
|
|
2047
|
-
batch:
|
|
2089
|
+
batch: bound === void 0 ? void 0 : ((batchIds) => bound.getNodes(graphId, kind, batchIds)),
|
|
2048
2090
|
one: (id) => backend.getNode(graphId, kind, id)
|
|
2049
2091
|
});
|
|
2050
2092
|
}
|
|
@@ -2112,9 +2154,9 @@ var RECORDED_IDENTITY_ASSERTION_COLUMNS = [
|
|
|
2112
2154
|
"recorded_to",
|
|
2113
2155
|
"op"
|
|
2114
2156
|
];
|
|
2115
|
-
var RECORDED_NODE_COLUMN_LIST =
|
|
2116
|
-
var RECORDED_EDGE_COLUMN_LIST =
|
|
2117
|
-
var RECORDED_IDENTITY_ASSERTION_COLUMN_LIST =
|
|
2157
|
+
var RECORDED_NODE_COLUMN_LIST = chunkH5IJSROF_cjs.sql.raw(RECORDED_NODE_COLUMNS.join(", "));
|
|
2158
|
+
var RECORDED_EDGE_COLUMN_LIST = chunkH5IJSROF_cjs.sql.raw(RECORDED_EDGE_COLUMNS.join(", "));
|
|
2159
|
+
var RECORDED_IDENTITY_ASSERTION_COLUMN_LIST = chunkH5IJSROF_cjs.sql.raw(
|
|
2118
2160
|
RECORDED_IDENTITY_ASSERTION_COLUMNS.join(", ")
|
|
2119
2161
|
);
|
|
2120
2162
|
var RECORDED_BIND_PARAM_BUDGET = 900;
|
|
@@ -2137,64 +2179,64 @@ function recordedChunkSize(target, columnCount) {
|
|
|
2137
2179
|
return Math.max(1, Math.floor(budget / columnCount));
|
|
2138
2180
|
}
|
|
2139
2181
|
function sqlNull(value) {
|
|
2140
|
-
return value === void 0 ?
|
|
2182
|
+
return value === void 0 ? chunkH5IJSROF_cjs.sql.raw("NULL") : chunkH5IJSROF_cjs.sql`${value}`;
|
|
2141
2183
|
}
|
|
2142
2184
|
function recordedCommonCells() {
|
|
2143
2185
|
return {
|
|
2144
|
-
history_id: () =>
|
|
2145
|
-
graph_id: (row) =>
|
|
2146
|
-
id: (row) =>
|
|
2147
|
-
kind: (row) =>
|
|
2148
|
-
props: (row) =>
|
|
2149
|
-
valid_from: (row) =>
|
|
2150
|
-
valid_to: (row) =>
|
|
2151
|
-
created_at: (row) =>
|
|
2152
|
-
updated_at: (row) =>
|
|
2153
|
-
deleted_at: (row) =>
|
|
2154
|
-
recorded_from: (_row, recordedRevision) =>
|
|
2155
|
-
recorded_to: () =>
|
|
2156
|
-
op: (_row, _recordedCommit, operation) =>
|
|
2157
|
-
schema_version: () =>
|
|
2158
|
-
tx_id: () =>
|
|
2159
|
-
meta: () =>
|
|
2186
|
+
history_id: () => chunkH5IJSROF_cjs.sql`${generateId()}`,
|
|
2187
|
+
graph_id: (row) => chunkH5IJSROF_cjs.sql`${row.graph_id}`,
|
|
2188
|
+
id: (row) => chunkH5IJSROF_cjs.sql`${row.id}`,
|
|
2189
|
+
kind: (row) => chunkH5IJSROF_cjs.sql`${row.kind}`,
|
|
2190
|
+
props: (row) => chunkH5IJSROF_cjs.sql`${chunkNUQ2YFFH_cjs.rowPropsToJsonText(row.props)}`,
|
|
2191
|
+
valid_from: (row) => chunkH5IJSROF_cjs.sql`${sqlNull(row.valid_from)}`,
|
|
2192
|
+
valid_to: (row) => chunkH5IJSROF_cjs.sql`${sqlNull(row.valid_to)}`,
|
|
2193
|
+
created_at: (row) => chunkH5IJSROF_cjs.sql`${row.created_at}`,
|
|
2194
|
+
updated_at: (row) => chunkH5IJSROF_cjs.sql`${row.updated_at}`,
|
|
2195
|
+
deleted_at: (row) => chunkH5IJSROF_cjs.sql`${sqlNull(row.deleted_at)}`,
|
|
2196
|
+
recorded_from: (_row, recordedRevision) => chunkH5IJSROF_cjs.sql`${recordedRevision}`,
|
|
2197
|
+
recorded_to: () => chunkH5IJSROF_cjs.sql`${chunkDWUDZ66O_cjs.RECORDED_MAX_REVISION}`,
|
|
2198
|
+
op: (_row, _recordedCommit, operation) => chunkH5IJSROF_cjs.sql`${operation}`,
|
|
2199
|
+
schema_version: () => chunkH5IJSROF_cjs.sql`NULL`,
|
|
2200
|
+
tx_id: () => chunkH5IJSROF_cjs.sql`NULL`,
|
|
2201
|
+
meta: () => chunkH5IJSROF_cjs.sql`${RECORDED_HISTORY_META}`
|
|
2160
2202
|
};
|
|
2161
2203
|
}
|
|
2162
2204
|
var recordedNodeCells = {
|
|
2163
2205
|
...recordedCommonCells(),
|
|
2164
|
-
version: (row) =>
|
|
2206
|
+
version: (row) => chunkH5IJSROF_cjs.sql`${row.version}`
|
|
2165
2207
|
};
|
|
2166
2208
|
var recordedEdgeCells = {
|
|
2167
2209
|
...recordedCommonCells(),
|
|
2168
|
-
from_kind: (row) =>
|
|
2169
|
-
from_id: (row) =>
|
|
2170
|
-
to_kind: (row) =>
|
|
2171
|
-
to_id: (row) =>
|
|
2210
|
+
from_kind: (row) => chunkH5IJSROF_cjs.sql`${row.from_kind}`,
|
|
2211
|
+
from_id: (row) => chunkH5IJSROF_cjs.sql`${row.from_id}`,
|
|
2212
|
+
to_kind: (row) => chunkH5IJSROF_cjs.sql`${row.to_kind}`,
|
|
2213
|
+
to_id: (row) => chunkH5IJSROF_cjs.sql`${row.to_id}`
|
|
2172
2214
|
};
|
|
2173
2215
|
var recordedIdentityAssertionCells = {
|
|
2174
|
-
history_id: () =>
|
|
2175
|
-
graph_id: (row) =>
|
|
2176
|
-
id: (row) =>
|
|
2177
|
-
rel: (row) =>
|
|
2178
|
-
a_kind: (row) =>
|
|
2179
|
-
a_id: (row) =>
|
|
2180
|
-
b_kind: (row) =>
|
|
2181
|
-
b_id: (row) =>
|
|
2182
|
-
valid_from: (row) =>
|
|
2183
|
-
valid_to: (row) =>
|
|
2184
|
-
created_at: (row) =>
|
|
2185
|
-
updated_at: (row) =>
|
|
2186
|
-
deleted_at: (row) =>
|
|
2187
|
-
ended_by_kind: (row) =>
|
|
2188
|
-
ended_by_id: (row) =>
|
|
2189
|
-
recorded_from: (_row, recordedRevision) =>
|
|
2190
|
-
recorded_to: () =>
|
|
2191
|
-
op: (_row, _recordedRevision, operation) =>
|
|
2216
|
+
history_id: () => chunkH5IJSROF_cjs.sql`${generateId()}`,
|
|
2217
|
+
graph_id: (row) => chunkH5IJSROF_cjs.sql`${row.graph_id}`,
|
|
2218
|
+
id: (row) => chunkH5IJSROF_cjs.sql`${row.id}`,
|
|
2219
|
+
rel: (row) => chunkH5IJSROF_cjs.sql`${row.rel}`,
|
|
2220
|
+
a_kind: (row) => chunkH5IJSROF_cjs.sql`${row.a_kind}`,
|
|
2221
|
+
a_id: (row) => chunkH5IJSROF_cjs.sql`${row.a_id}`,
|
|
2222
|
+
b_kind: (row) => chunkH5IJSROF_cjs.sql`${row.b_kind}`,
|
|
2223
|
+
b_id: (row) => chunkH5IJSROF_cjs.sql`${row.b_id}`,
|
|
2224
|
+
valid_from: (row) => chunkH5IJSROF_cjs.sql`${row.valid_from}`,
|
|
2225
|
+
valid_to: (row) => chunkH5IJSROF_cjs.sql`${row.valid_to ?? chunkH5IJSROF_cjs.sql.raw("NULL")}`,
|
|
2226
|
+
created_at: (row) => chunkH5IJSROF_cjs.sql`${row.created_at}`,
|
|
2227
|
+
updated_at: (row) => chunkH5IJSROF_cjs.sql`${row.updated_at}`,
|
|
2228
|
+
deleted_at: (row) => chunkH5IJSROF_cjs.sql`${row.deleted_at ?? chunkH5IJSROF_cjs.sql.raw("NULL")}`,
|
|
2229
|
+
ended_by_kind: (row) => chunkH5IJSROF_cjs.sql`${row.ended_by_kind ?? chunkH5IJSROF_cjs.sql.raw("NULL")}`,
|
|
2230
|
+
ended_by_id: (row) => chunkH5IJSROF_cjs.sql`${row.ended_by_id ?? chunkH5IJSROF_cjs.sql.raw("NULL")}`,
|
|
2231
|
+
recorded_from: (_row, recordedRevision) => chunkH5IJSROF_cjs.sql`${recordedRevision}`,
|
|
2232
|
+
recorded_to: () => chunkH5IJSROF_cjs.sql`${chunkDWUDZ66O_cjs.RECORDED_MAX_REVISION}`,
|
|
2233
|
+
op: (_row, _recordedRevision, operation) => chunkH5IJSROF_cjs.sql`${operation}`
|
|
2192
2234
|
};
|
|
2193
2235
|
function recordedValuesTuple(columns, cells, row, recordedRevision, operation) {
|
|
2194
2236
|
const tuple = columns.map(
|
|
2195
2237
|
(column) => cells[column](row, recordedRevision, operation)
|
|
2196
2238
|
);
|
|
2197
|
-
return
|
|
2239
|
+
return chunkH5IJSROF_cjs.sql`(${chunkH5IJSROF_cjs.sql.join(tuple, chunkH5IJSROF_cjs.sql`, `)})`;
|
|
2198
2240
|
}
|
|
2199
2241
|
async function insertRecordedRows(target, table, columnList, columns, cells, inserts, recordedRevision) {
|
|
2200
2242
|
if (inserts.length === 0) return;
|
|
@@ -2209,9 +2251,9 @@ async function insertRecordedRows(target, table, columnList, columns, cells, ins
|
|
|
2209
2251
|
);
|
|
2210
2252
|
await executeStatement(
|
|
2211
2253
|
target,
|
|
2212
|
-
|
|
2254
|
+
chunkH5IJSROF_cjs.sql`
|
|
2213
2255
|
INSERT INTO ${table} (${columnList})
|
|
2214
|
-
VALUES ${
|
|
2256
|
+
VALUES ${chunkH5IJSROF_cjs.sql.join(values, chunkH5IJSROF_cjs.sql`, `)}
|
|
2215
2257
|
`
|
|
2216
2258
|
);
|
|
2217
2259
|
}
|
|
@@ -2273,9 +2315,9 @@ function entityKey(entity) {
|
|
|
2273
2315
|
}
|
|
2274
2316
|
}
|
|
2275
2317
|
async function closeOpenReturning(target, table, graphId, ids, recordedRevision, kind) {
|
|
2276
|
-
const kindFilter = kind === void 0 ?
|
|
2318
|
+
const kindFilter = kind === void 0 ? chunkH5IJSROF_cjs.sql`` : chunkH5IJSROF_cjs.sql`AND kind = ${kind}`;
|
|
2277
2319
|
const rows = await target.execute(
|
|
2278
|
-
|
|
2320
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
2279
2321
|
UPDATE ${table}
|
|
2280
2322
|
SET recorded_to = ${recordedRevision}
|
|
2281
2323
|
WHERE graph_id = ${graphId}
|
|
@@ -2322,10 +2364,10 @@ function recordedInsertsFor(afterById, closed) {
|
|
|
2322
2364
|
operation: recordedOp(closed.has(row.id), closed.get(row.id) ?? false, row)
|
|
2323
2365
|
}));
|
|
2324
2366
|
}
|
|
2325
|
-
async function flushNodes(target, schema, graphId, entities, recordedRevision) {
|
|
2367
|
+
async function flushNodes(target, batchPointRead, schema, graphId, entities, recordedRevision) {
|
|
2326
2368
|
const chunkSize = recordedNodeChunkSize(target);
|
|
2327
2369
|
for (const [kind, group] of groupNodesByKind(entities)) {
|
|
2328
|
-
for (const entityChunk of
|
|
2370
|
+
for (const entityChunk of chunkNLX5OWK7_cjs.chunk(group, chunkSize)) {
|
|
2329
2371
|
const ids = entityChunk.map((entity) => entity.id);
|
|
2330
2372
|
const closed = await closeOpenReturning(
|
|
2331
2373
|
target,
|
|
@@ -2337,7 +2379,7 @@ async function flushNodes(target, schema, graphId, entities, recordedRevision) {
|
|
|
2337
2379
|
);
|
|
2338
2380
|
const afterById = await resolveAfterImages(
|
|
2339
2381
|
entityChunk,
|
|
2340
|
-
(missing) => getNodeRowsByIds(target, graphId, kind, missing)
|
|
2382
|
+
(missing) => getNodeRowsByIds(target, batchPointRead, graphId, kind, missing)
|
|
2341
2383
|
);
|
|
2342
2384
|
await insertRecordedNodeRows(
|
|
2343
2385
|
target,
|
|
@@ -2348,9 +2390,9 @@ async function flushNodes(target, schema, graphId, entities, recordedRevision) {
|
|
|
2348
2390
|
}
|
|
2349
2391
|
}
|
|
2350
2392
|
}
|
|
2351
|
-
async function flushEdges(target, schema, graphId, entities, recordedRevision) {
|
|
2393
|
+
async function flushEdges(target, batchPointRead, schema, graphId, entities, recordedRevision) {
|
|
2352
2394
|
const chunkSize = recordedEdgeChunkSize(target);
|
|
2353
|
-
for (const entityChunk of
|
|
2395
|
+
for (const entityChunk of chunkNLX5OWK7_cjs.chunk(entities, chunkSize)) {
|
|
2354
2396
|
const ids = entityChunk.map((entity) => entity.id);
|
|
2355
2397
|
const closed = await closeOpenReturning(
|
|
2356
2398
|
target,
|
|
@@ -2361,7 +2403,7 @@ async function flushEdges(target, schema, graphId, entities, recordedRevision) {
|
|
|
2361
2403
|
);
|
|
2362
2404
|
const afterById = await resolveAfterImages(
|
|
2363
2405
|
entityChunk,
|
|
2364
|
-
(missing) => getEdgeRowsByIds(target, graphId, missing)
|
|
2406
|
+
(missing) => getEdgeRowsByIds(target, batchPointRead, graphId, missing)
|
|
2365
2407
|
);
|
|
2366
2408
|
await insertRecordedEdgeRows(
|
|
2367
2409
|
target,
|
|
@@ -2374,7 +2416,7 @@ async function flushEdges(target, schema, graphId, entities, recordedRevision) {
|
|
|
2374
2416
|
async function getIdentityAssertionRowsByIds(target, schema, graphId, ids) {
|
|
2375
2417
|
if (ids.length === 0) return /* @__PURE__ */ new Map();
|
|
2376
2418
|
const rows = await target.execute(
|
|
2377
|
-
|
|
2419
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
2378
2420
|
SELECT ${IDENTITY_ASSERTION_COLUMNS}
|
|
2379
2421
|
FROM ${schema.identityAssertionsTable}
|
|
2380
2422
|
WHERE graph_id = ${graphId}
|
|
@@ -2386,7 +2428,7 @@ async function getIdentityAssertionRowsByIds(target, schema, graphId, ids) {
|
|
|
2386
2428
|
async function flushIdentityAssertions(target, schema, graphId, entities, recordedRevision) {
|
|
2387
2429
|
if (entities.length === 0) return;
|
|
2388
2430
|
const chunkSize = recordedIdentityAssertionChunkSize(target);
|
|
2389
|
-
for (const entityChunk of
|
|
2431
|
+
for (const entityChunk of chunkNLX5OWK7_cjs.chunk(entities, chunkSize)) {
|
|
2390
2432
|
const ids = entityChunk.map((entity) => entity.id);
|
|
2391
2433
|
const closed = await closeOpenReturning(
|
|
2392
2434
|
target,
|
|
@@ -2410,7 +2452,7 @@ async function flushIdentityAssertions(target, schema, graphId, entities, record
|
|
|
2410
2452
|
async function closeOpenByKind(target, table, graphId, kind, recordedRevision) {
|
|
2411
2453
|
await executeStatement(
|
|
2412
2454
|
target,
|
|
2413
|
-
|
|
2455
|
+
chunkH5IJSROF_cjs.sql`
|
|
2414
2456
|
UPDATE ${table}
|
|
2415
2457
|
SET recorded_to = ${recordedRevision}
|
|
2416
2458
|
WHERE graph_id = ${graphId}
|
|
@@ -2422,7 +2464,7 @@ async function closeOpenByKind(target, table, graphId, kind, recordedRevision) {
|
|
|
2422
2464
|
async function closeOpenEdgesByNodeKind(target, schema, graphId, nodeKind, recordedRevision) {
|
|
2423
2465
|
await executeStatement(
|
|
2424
2466
|
target,
|
|
2425
|
-
|
|
2467
|
+
chunkH5IJSROF_cjs.sql`
|
|
2426
2468
|
UPDATE ${schema.recordedEdgesTable}
|
|
2427
2469
|
SET recorded_to = ${recordedRevision}
|
|
2428
2470
|
WHERE graph_id = ${graphId}
|
|
@@ -2465,7 +2507,7 @@ async function closeRecordedHardDeletedKind(target, schema, graphId, removal, ow
|
|
|
2465
2507
|
}
|
|
2466
2508
|
async function queryConnectedEdgeIds(target, schema, params) {
|
|
2467
2509
|
const rows = await target.execute(
|
|
2468
|
-
|
|
2510
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
2469
2511
|
SELECT id
|
|
2470
2512
|
FROM ${schema.edgesTable}
|
|
2471
2513
|
WHERE graph_id = ${params.graphId}
|
|
@@ -2486,9 +2528,9 @@ function normalizedColumnType(value) {
|
|
|
2486
2528
|
}
|
|
2487
2529
|
async function readColumnTypes(backend, table) {
|
|
2488
2530
|
const rows = backend.dialect === "sqlite" ? await backend.execute(
|
|
2489
|
-
|
|
2531
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`PRAGMA table_info(${chunkH5IJSROF_cjs.sql.identifier(table)})`)
|
|
2490
2532
|
) : await backend.execute(
|
|
2491
|
-
|
|
2533
|
+
chunkH5IJSROF_cjs.asCompiledRowsSql(chunkH5IJSROF_cjs.sql`
|
|
2492
2534
|
SELECT column_name AS name, data_type AS type
|
|
2493
2535
|
FROM information_schema.columns
|
|
2494
2536
|
WHERE table_schema = current_schema()
|
|
@@ -2677,7 +2719,7 @@ function createRecordedCaptureSession() {
|
|
|
2677
2719
|
if (sealed) throw recordedCaptureSealedError({ graphId });
|
|
2678
2720
|
forcedGraphRevisions.add(graphId);
|
|
2679
2721
|
},
|
|
2680
|
-
async flush(target, schema, ownsWriteLock) {
|
|
2722
|
+
async flush(target, batchPointRead, schema, ownsWriteLock) {
|
|
2681
2723
|
if (sealed) {
|
|
2682
2724
|
throw new chunkX4GDXBOP_cjs.ConfigurationError(
|
|
2683
2725
|
"Recorded-time capture session was already flushed.",
|
|
@@ -2691,7 +2733,7 @@ function createRecordedCaptureSession() {
|
|
|
2691
2733
|
if (touched.size === 0 && forcedGraphRevisions.size === 0)
|
|
2692
2734
|
return /* @__PURE__ */ new Map();
|
|
2693
2735
|
const recordedByGraph = /* @__PURE__ */ new Map();
|
|
2694
|
-
const byGraph =
|
|
2736
|
+
const byGraph = chunkNLX5OWK7_cjs.groupBy(touched.values(), (entity) => entity.graphId);
|
|
2695
2737
|
for (const graphId of forcedGraphRevisions) {
|
|
2696
2738
|
if (!byGraph.has(graphId)) byGraph.set(graphId, []);
|
|
2697
2739
|
}
|
|
@@ -2714,6 +2756,7 @@ function createRecordedCaptureSession() {
|
|
|
2714
2756
|
);
|
|
2715
2757
|
await flushNodes(
|
|
2716
2758
|
target,
|
|
2759
|
+
batchPointRead,
|
|
2717
2760
|
schema,
|
|
2718
2761
|
graphId,
|
|
2719
2762
|
nodes,
|
|
@@ -2721,6 +2764,7 @@ function createRecordedCaptureSession() {
|
|
|
2721
2764
|
);
|
|
2722
2765
|
await flushEdges(
|
|
2723
2766
|
target,
|
|
2767
|
+
batchPointRead,
|
|
2724
2768
|
schema,
|
|
2725
2769
|
graphId,
|
|
2726
2770
|
edges,
|
|
@@ -2776,7 +2820,7 @@ function createRecordedTransactionBackend(target, session, schema) {
|
|
|
2776
2820
|
await lockRecordedGraphWrite(target, graphId, graphLocks);
|
|
2777
2821
|
}
|
|
2778
2822
|
}
|
|
2779
|
-
const overlay =
|
|
2823
|
+
const overlay = chunkNLX5OWK7_cjs.deriveBackend(target, {
|
|
2780
2824
|
...rawWriteGuards(target, "tx.backend"),
|
|
2781
2825
|
async insertNode(params) {
|
|
2782
2826
|
session.assertOpen();
|
|
@@ -2949,25 +2993,30 @@ function createRecordedTransactionBackend(target, session, schema) {
|
|
|
2949
2993
|
recordedRevisionBindings.set(overlay, session);
|
|
2950
2994
|
return overlay;
|
|
2951
2995
|
}
|
|
2952
|
-
function createRecordedTransactionScope(target, schema, ownsWriteLock = false) {
|
|
2996
|
+
function createRecordedTransactionScope(target, batchPointRead, schema, ownsWriteLock = false) {
|
|
2953
2997
|
requireCaptureStatements(target);
|
|
2954
2998
|
const session = createRecordedCaptureSession();
|
|
2955
2999
|
const resolvedSchema = schema ?? requireRecordedSchema(target);
|
|
2956
3000
|
return {
|
|
2957
3001
|
backend: createRecordedTransactionBackend(target, session, resolvedSchema),
|
|
2958
3002
|
async flush() {
|
|
2959
|
-
return
|
|
2960
|
-
session.flush(target, resolvedSchema, ownsWriteLock),
|
|
3003
|
+
return chunkNLX5OWK7_cjs.withRecordedRelationsPrecondition(
|
|
3004
|
+
session.flush(target, batchPointRead, resolvedSchema, ownsWriteLock),
|
|
2961
3005
|
{ dialect: target.dialect, surface: "capture-flush" }
|
|
2962
3006
|
);
|
|
2963
3007
|
}
|
|
2964
3008
|
};
|
|
2965
3009
|
}
|
|
2966
|
-
async function runCapturedAutocommit(backend, schema, fn, options) {
|
|
3010
|
+
async function runCapturedAutocommit(backend, schema, batchPointRead, fn, options) {
|
|
2967
3011
|
assertRequestedRecordedIsolation(backend, options);
|
|
2968
3012
|
return backend.transaction(async (target) => {
|
|
2969
3013
|
await assertRecordedCaptureTransactionIsolation(target);
|
|
2970
|
-
const scope = createRecordedTransactionScope(
|
|
3014
|
+
const scope = createRecordedTransactionScope(
|
|
3015
|
+
target,
|
|
3016
|
+
batchPointRead,
|
|
3017
|
+
schema,
|
|
3018
|
+
true
|
|
3019
|
+
);
|
|
2971
3020
|
const result = await fn(scope.backend);
|
|
2972
3021
|
await scope.flush();
|
|
2973
3022
|
return result;
|
|
@@ -2975,9 +3024,10 @@ async function runCapturedAutocommit(backend, schema, fn, options) {
|
|
|
2975
3024
|
}
|
|
2976
3025
|
function createRecordedBackend(backend, schema) {
|
|
2977
3026
|
assertCapturableBackend(backend);
|
|
2978
|
-
const
|
|
2979
|
-
const
|
|
2980
|
-
|
|
3027
|
+
const batchPointRead = chunkZGVTNKTX_cjs.batchPointReadVerdict(backend);
|
|
3028
|
+
const capture = (fn) => runCapturedAutocommit(backend, schema, batchPointRead, fn);
|
|
3029
|
+
const projectedBackend = chunkNLX5OWK7_cjs.projectGraphBackend(backend);
|
|
3030
|
+
return chunkNLX5OWK7_cjs.deriveBackend(projectedBackend, {
|
|
2981
3031
|
...rawWriteGuards(backend, "backend"),
|
|
2982
3032
|
async insertNode(params) {
|
|
2983
3033
|
return capture((target) => target.insertNode(params));
|
|
@@ -3080,7 +3130,12 @@ function createRecordedBackend(backend, schema) {
|
|
|
3080
3130
|
return backend.transaction(async (target) => {
|
|
3081
3131
|
await assertRecordedCaptureTransactionIsolation(target, backendOptions);
|
|
3082
3132
|
const readOnly = backendOptions?.accessMode === "read_only";
|
|
3083
|
-
const scope = createRecordedTransactionScope(
|
|
3133
|
+
const scope = createRecordedTransactionScope(
|
|
3134
|
+
target,
|
|
3135
|
+
batchPointRead,
|
|
3136
|
+
schema,
|
|
3137
|
+
!readOnly
|
|
3138
|
+
);
|
|
3084
3139
|
const result = await fn(scope.backend);
|
|
3085
3140
|
const instants = await scope.flush();
|
|
3086
3141
|
observer?.(instants);
|
|
@@ -3243,7 +3298,7 @@ function runInWriteTransaction(ctx, backend, fn, options) {
|
|
|
3243
3298
|
const refusal = fenceReason === void 0 ? void 0 : constraintFenceRefusal(ctx, backend, fenceReason);
|
|
3244
3299
|
if (refusal !== void 0) return Promise.reject(refusal);
|
|
3245
3300
|
const needsGraphWriteLock = ctx.historyEnabled || ctx.revisionTrackingEnabled || fenceReason !== void 0;
|
|
3246
|
-
return
|
|
3301
|
+
return chunkNUQ2YFFH_cjs.runOptionallyInTransaction(backend, async (target) => {
|
|
3247
3302
|
await lockSchemaVersionForStoreWrite(ctx, target);
|
|
3248
3303
|
const session = needsGraphWriteLock ? writeTransactionSessions.get(target) : void 0;
|
|
3249
3304
|
const held = heldGraphWriteLocks.get(target) ?? /* @__PURE__ */ new Set();
|
|
@@ -3287,6 +3342,7 @@ exports.advanceRevisionClock = advanceRevisionClock;
|
|
|
3287
3342
|
exports.arrayField = arrayField;
|
|
3288
3343
|
exports.assertCurrentRecordedSchema = assertCurrentRecordedSchema;
|
|
3289
3344
|
exports.assertRecordedCaptureTransactionIsolation = assertRecordedCaptureTransactionIsolation;
|
|
3345
|
+
exports.assertRecursiveTraversalSupported = assertRecursiveTraversalSupported;
|
|
3290
3346
|
exports.assertRevisionTrackableBackend = assertRevisionTrackableBackend;
|
|
3291
3347
|
exports.baseField = baseField;
|
|
3292
3348
|
exports.buildFieldBuilderForTypeInfo = buildFieldBuilderForTypeInfo;
|
|
@@ -3341,6 +3397,7 @@ exports.readRecordedClock = readRecordedClock;
|
|
|
3341
3397
|
exports.readRevisionOrigin = readRevisionOrigin;
|
|
3342
3398
|
exports.recordedBindParamBudget = recordedBindParamBudget;
|
|
3343
3399
|
exports.recordedCaptureRequiresCallbackTransactionError = recordedCaptureRequiresCallbackTransactionError;
|
|
3400
|
+
exports.requireRecursiveTraversalVerdict = requireRecursiveTraversalVerdict;
|
|
3344
3401
|
exports.resolveParameterValueType = resolveParameterValueType;
|
|
3345
3402
|
exports.runHookedWriteOperation = runHookedWriteOperation;
|
|
3346
3403
|
exports.runInWriteTransaction = runInWriteTransaction;
|
|
@@ -3359,5 +3416,5 @@ exports.withRecordedFlushObserver = withRecordedFlushObserver;
|
|
|
3359
3416
|
exports.withRecordedIdentityMutationTarget = withRecordedIdentityMutationTarget;
|
|
3360
3417
|
exports.withWriteTransactionSession = withWriteTransactionSession;
|
|
3361
3418
|
exports.wrapZodError = wrapZodError;
|
|
3362
|
-
//# sourceMappingURL=chunk-
|
|
3363
|
-
//# sourceMappingURL=chunk-
|
|
3419
|
+
//# sourceMappingURL=chunk-JQKMEKKW.cjs.map
|
|
3420
|
+
//# sourceMappingURL=chunk-JQKMEKKW.cjs.map
|