@nicia-ai/typegraph 0.49.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 +11 -9
- package/dist/backend/drizzle/indexes.d.cts +1 -1
- package/dist/backend/drizzle/indexes.d.ts +1 -1
- package/dist/backend/drizzle/indexes.js +7 -5
- package/dist/backend/index.cjs +190 -53
- package/dist/backend/index.d.cts +90 -4
- package/dist/backend/index.d.ts +90 -4
- package/dist/backend/index.js +9 -12
- package/dist/backend/postgres/index.cjs +36 -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 +19 -15
- package/dist/backend/postgres/pglite-store.cjs +7 -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 +7 -62
- package/dist/backend/postgres/pglite-store.js.map +1 -1
- package/dist/backend/postgres/pglite.cjs +21 -17
- package/dist/backend/postgres/pglite.d.cts +3 -3
- package/dist/backend/postgres/pglite.d.ts +3 -3
- package/dist/backend/postgres/pglite.js +20 -16
- package/dist/backend/sqlite/index.cjs +33 -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 +17 -13
- package/dist/backend/sqlite/libsql.cjs +24 -20
- package/dist/backend/sqlite/libsql.cjs.map +1 -1
- package/dist/backend/sqlite/libsql.d.cts +3 -3
- package/dist/backend/sqlite/libsql.d.ts +3 -3
- package/dist/backend/sqlite/libsql.js +19 -15
- package/dist/backend/sqlite/libsql.js.map +1 -1
- package/dist/backend/sqlite/local-store.cjs +9 -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 +8 -64
- package/dist/backend/sqlite/local-store.js.map +1 -1
- package/dist/backend/sqlite/local.cjs +25 -20
- package/dist/backend/sqlite/local.d.cts +3 -3
- package/dist/backend/sqlite/local.d.ts +3 -3
- package/dist/backend/sqlite/local.js +21 -16
- package/dist/chunk-2CVDZCXH.cjs +1278 -0
- package/dist/chunk-2CVDZCXH.cjs.map +1 -0
- package/dist/{chunk-MYKHJI2J.js → chunk-2DWTBNSH.js} +3 -3
- package/dist/{chunk-MYKHJI2J.js.map → chunk-2DWTBNSH.js.map} +1 -1
- package/dist/{chunk-JB6T4GLL.cjs → chunk-2KCTP3U2.cjs} +870 -528
- package/dist/chunk-2KCTP3U2.cjs.map +1 -0
- package/dist/{chunk-OORXGFL5.cjs → chunk-322TBTOQ.cjs} +48 -48
- package/dist/{chunk-OORXGFL5.cjs.map → chunk-322TBTOQ.cjs.map} +1 -1
- package/dist/{chunk-FA2AFWLP.cjs → chunk-36SX6QXP.cjs} +31 -12
- package/dist/chunk-36SX6QXP.cjs.map +1 -0
- package/dist/{chunk-SDBBMD4N.js → chunk-36VYWVQU.js} +3 -3
- package/dist/{chunk-SDBBMD4N.js.map → chunk-36VYWVQU.js.map} +1 -1
- package/dist/chunk-4DKY6RIU.js +1253 -0
- 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-WIC7DRXW.js → chunk-57JM6NW3.js} +9 -19
- package/dist/chunk-57JM6NW3.js.map +1 -0
- package/dist/chunk-5WWEYV4H.cjs +5113 -0
- package/dist/chunk-5WWEYV4H.cjs.map +1 -0
- package/dist/chunk-6KQEICJ6.cjs +12 -0
- package/dist/{chunk-MKJ4KXL5.cjs.map → chunk-6KQEICJ6.cjs.map} +1 -1
- package/dist/{chunk-DZAICA5J.js → chunk-6NKSE5AU.js} +4 -4
- package/dist/{chunk-DZAICA5J.js.map → chunk-6NKSE5AU.js.map} +1 -1
- package/dist/{chunk-KKBDXCLQ.js → chunk-6NLYIMJO.js} +4 -4
- package/dist/{chunk-KKBDXCLQ.js.map → chunk-6NLYIMJO.js.map} +1 -1
- package/dist/{chunk-BFUOME67.cjs → chunk-7B7I7YAW.cjs} +20 -11
- package/dist/chunk-7B7I7YAW.cjs.map +1 -0
- package/dist/{chunk-ZDKTPBGV.js → chunk-7G5IYROL.js} +6 -548
- package/dist/chunk-7G5IYROL.js.map +1 -0
- package/dist/{chunk-3DMMGT6S.js → chunk-7QFRK6PU.js} +4 -8
- 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-CHAOFCHV.js → chunk-AH2A74OZ.js} +3 -3
- package/dist/{chunk-CHAOFCHV.js.map → chunk-AH2A74OZ.js.map} +1 -1
- package/dist/{chunk-UGHQV7MP.cjs → chunk-B3MN7EJR.cjs} +228 -162
- package/dist/chunk-B3MN7EJR.cjs.map +1 -0
- package/dist/{chunk-TZEGUG6D.cjs → chunk-BZ5MVITP.cjs} +4 -4
- package/dist/{chunk-TZEGUG6D.cjs.map → chunk-BZ5MVITP.cjs.map} +1 -1
- package/dist/{chunk-YVF2EM7B.js → chunk-CAI6SMP6.js} +3 -3
- package/dist/{chunk-YVF2EM7B.js.map → chunk-CAI6SMP6.js.map} +1 -1
- package/dist/{chunk-JONXFAPO.js → chunk-CBOD7TXH.js} +5 -5
- package/dist/{chunk-JONXFAPO.js.map → chunk-CBOD7TXH.js.map} +1 -1
- package/dist/{chunk-FQPEMEWX.cjs → chunk-CRZ56SZU.cjs} +81 -32
- package/dist/chunk-CRZ56SZU.cjs.map +1 -0
- package/dist/{chunk-DO7SAMEK.cjs → chunk-D3GWARN7.cjs} +47 -47
- package/dist/{chunk-DO7SAMEK.cjs.map → chunk-D3GWARN7.cjs.map} +1 -1
- package/dist/{chunk-QTD6HX4O.js → chunk-D3OUDFU7.js} +5 -5
- package/dist/{chunk-QTD6HX4O.js.map → chunk-D3OUDFU7.js.map} +1 -1
- package/dist/{chunk-2QGYQBS2.cjs → chunk-DWUDZ66O.cjs} +10 -10
- package/dist/{chunk-2QGYQBS2.cjs.map → chunk-DWUDZ66O.cjs.map} +1 -1
- package/dist/chunk-EKG2UXNX.cjs +23 -0
- package/dist/chunk-EKG2UXNX.cjs.map +1 -0
- package/dist/chunk-FMMW3KX7.cjs +148 -0
- package/dist/chunk-FMMW3KX7.cjs.map +1 -0
- package/dist/{chunk-XVWOYKIK.js → chunk-FZHF5UWR.js} +3 -3
- package/dist/{chunk-XVWOYKIK.js.map → chunk-FZHF5UWR.js.map} +1 -1
- package/dist/chunk-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-EDN4Y4ZG.cjs → chunk-H5IJSROF.cjs} +9 -15
- package/dist/chunk-H5IJSROF.cjs.map +1 -0
- package/dist/chunk-HZUB5CON.js +27 -0
- package/dist/chunk-HZUB5CON.js.map +1 -0
- package/dist/{chunk-NACVVDWB.js → chunk-I5IOSA27.js} +103 -105
- package/dist/chunk-I5IOSA27.js.map +1 -0
- package/dist/{chunk-OI2GQ25X.cjs → chunk-I7YAY2VQ.cjs} +7 -7
- package/dist/{chunk-OI2GQ25X.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-7SQSZN2J.js → chunk-IZD4HTCP.js} +5 -5
- package/dist/{chunk-7SQSZN2J.js.map → chunk-IZD4HTCP.js.map} +1 -1
- package/dist/{chunk-3FPR224C.cjs → chunk-JHRUZ73O.cjs} +116 -107
- package/dist/chunk-JHRUZ73O.cjs.map +1 -0
- package/dist/{chunk-EZEEWCFJ.cjs → chunk-JQKMEKKW.cjs} +525 -298
- 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-5K2BKEBD.js → chunk-K46SDNQD.js} +10 -4
- package/dist/chunk-K46SDNQD.js.map +1 -0
- package/dist/{chunk-7LZJNLA5.js → chunk-K67P5DLL.js} +108 -42
- package/dist/chunk-K67P5DLL.js.map +1 -0
- package/dist/{chunk-3G5W2U2L.cjs → chunk-KACEYDYV.cjs} +335 -258
- package/dist/chunk-KACEYDYV.cjs.map +1 -0
- package/dist/{chunk-JFRT7S3B.cjs → chunk-L6EVYIID.cjs} +318 -478
- package/dist/chunk-L6EVYIID.cjs.map +1 -0
- package/dist/{chunk-SHFBB23Q.js → chunk-LI4K2KEJ.js} +6 -4
- package/dist/chunk-LI4K2KEJ.js.map +1 -0
- package/dist/chunk-LKZDQ2B4.js +1581 -0
- package/dist/chunk-LKZDQ2B4.js.map +1 -0
- package/dist/{chunk-WODMN3Q2.cjs → chunk-LLFPQOBA.cjs} +27 -27
- package/dist/{chunk-WODMN3Q2.cjs.map → chunk-LLFPQOBA.cjs.map} +1 -1
- package/dist/{chunk-P6YLZTRE.js → chunk-LZMQ3SFK.js} +3 -3
- package/dist/{chunk-P6YLZTRE.js.map → chunk-LZMQ3SFK.js.map} +1 -1
- package/dist/{chunk-HEV35TGT.js → chunk-M3VTS3F6.js} +13 -4
- package/dist/chunk-M3VTS3F6.js.map +1 -0
- package/dist/{chunk-TQHGE7UC.cjs → chunk-M5MSP3BI.cjs} +18 -10
- package/dist/chunk-M5MSP3BI.cjs.map +1 -0
- package/dist/{chunk-D4QLTJSM.js → chunk-NBOS7BY3.js} +63 -23
- package/dist/chunk-NBOS7BY3.js.map +1 -0
- package/dist/chunk-NGQDGL5X.js +140 -0
- package/dist/chunk-NGQDGL5X.js.map +1 -0
- package/dist/{chunk-SIT26LAZ.cjs → chunk-NLX5OWK7.cjs} +33 -5
- 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-UMGZDVOA.cjs → chunk-OGL4X4PH.cjs} +206 -208
- package/dist/chunk-OGL4X4PH.cjs.map +1 -0
- package/dist/{chunk-LRQKXRXO.cjs → chunk-OTNTGEXR.cjs} +4 -4
- package/dist/{chunk-LRQKXRXO.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-26YKDNUD.cjs → chunk-PS3TUWJM.cjs} +12 -10
- package/dist/chunk-PS3TUWJM.cjs.map +1 -0
- package/dist/{chunk-OMZ37BM2.js → chunk-PVFFH7TL.js} +5 -5
- package/dist/{chunk-OMZ37BM2.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-UGHG7PGX.js → chunk-QG5VEOKX.js} +30 -4
- package/dist/chunk-QG5VEOKX.js.map +1 -0
- package/dist/{chunk-TUNPBZY3.cjs → chunk-QLLZM5I3.cjs} +4 -4
- package/dist/{chunk-TUNPBZY3.cjs.map → chunk-QLLZM5I3.cjs.map} +1 -1
- package/dist/{chunk-BRRP76WO.js → chunk-RCBG6YMT.js} +781 -375
- package/dist/chunk-RCBG6YMT.js.map +1 -0
- package/dist/{chunk-LTXQOEIC.js → chunk-RI7RJH4G.js} +281 -204
- package/dist/chunk-RI7RJH4G.js.map +1 -0
- package/dist/{chunk-GYEG3ZLZ.cjs → chunk-RJMHU2MG.cjs} +121 -18
- package/dist/chunk-RJMHU2MG.cjs.map +1 -0
- package/dist/{chunk-GLHXM7C4.js → chunk-RVUL2HXY.js} +61 -23
- package/dist/chunk-RVUL2HXY.js.map +1 -0
- package/dist/chunk-RWUWTJQY.cjs +30 -0
- package/dist/chunk-RWUWTJQY.cjs.map +1 -0
- package/dist/{chunk-2O4PCIZ6.cjs → chunk-S5GU4LUN.cjs} +13 -13
- package/dist/{chunk-2O4PCIZ6.cjs.map → chunk-S5GU4LUN.cjs.map} +1 -1
- package/dist/{chunk-JPD2CTC3.js → chunk-SDPWO2Z5.js} +7 -7
- package/dist/{chunk-JPD2CTC3.js.map → chunk-SDPWO2Z5.js.map} +1 -1
- package/dist/{chunk-OVI7IXYX.js → chunk-SLGGT2XD.js} +3 -3
- package/dist/{chunk-OVI7IXYX.js.map → chunk-SLGGT2XD.js.map} +1 -1
- package/dist/{chunk-ROR5ZR6A.cjs → chunk-TIJUA4I6.cjs} +45 -45
- package/dist/{chunk-ROR5ZR6A.cjs.map → chunk-TIJUA4I6.cjs.map} +1 -1
- package/dist/{chunk-AOSSQDVO.cjs → chunk-TM54OBHX.cjs} +13 -13
- package/dist/{chunk-AOSSQDVO.cjs.map → chunk-TM54OBHX.cjs.map} +1 -1
- package/dist/{chunk-KF6K7TGH.js → chunk-TYEYRCXL.js} +766 -433
- package/dist/chunk-TYEYRCXL.js.map +1 -0
- package/dist/{chunk-Z2JCLZFJ.js → chunk-UKOVGCRN.js} +2151 -570
- package/dist/chunk-UKOVGCRN.js.map +1 -0
- package/dist/chunk-UYKDYE5D.cjs +12 -0
- package/dist/{chunk-CICO5GXD.cjs.map → chunk-UYKDYE5D.cjs.map} +1 -1
- package/dist/{chunk-S5TERQVW.js → chunk-VAAC7L57.js} +284 -66
- package/dist/chunk-VAAC7L57.js.map +1 -0
- package/dist/{chunk-7UOLHNWC.cjs → chunk-VKHXYVN7.cjs} +22 -33
- package/dist/chunk-VKHXYVN7.cjs.map +1 -0
- package/dist/{chunk-6NGW27EO.cjs → chunk-VLBTRXA2.cjs} +10 -10
- package/dist/{chunk-6NGW27EO.cjs.map → chunk-VLBTRXA2.cjs.map} +1 -1
- package/dist/{chunk-YIURNGXI.js → chunk-VUQZNUHU.js} +22 -6
- package/dist/chunk-VUQZNUHU.js.map +1 -0
- package/dist/{chunk-YYUHLYM2.cjs → chunk-WDM5WQK4.cjs} +183 -143
- package/dist/chunk-WDM5WQK4.cjs.map +1 -0
- package/dist/{chunk-ZFMCDJGB.js → chunk-WFSYYU4W.js} +70 -220
- package/dist/chunk-WFSYYU4W.js.map +1 -0
- package/dist/{chunk-SR725PWF.cjs → chunk-WRBV2FNH.cjs} +2065 -1659
- package/dist/chunk-WRBV2FNH.cjs.map +1 -0
- package/dist/{chunk-MRDBBHIZ.cjs → chunk-X4GDXBOP.cjs} +2 -2
- package/dist/chunk-X4GDXBOP.cjs.map +1 -0
- package/dist/chunk-XORONCV3.js +202 -0
- package/dist/chunk-XORONCV3.js.map +1 -0
- package/dist/{chunk-D5R42W5D.js → chunk-XZW2CTNO.js} +115 -12
- package/dist/chunk-XZW2CTNO.js.map +1 -0
- package/dist/{chunk-ZLONH2UD.js → chunk-YDEJQWOL.js} +2 -2
- package/dist/chunk-YDEJQWOL.js.map +1 -0
- package/dist/{chunk-2TYSSBU5.js → chunk-YT2IVFAI.js} +30 -21
- 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 +29 -28
- package/dist/core/index.d.cts +4 -4
- package/dist/core/index.d.ts +4 -4
- package/dist/core/index.js +9 -8
- package/dist/{ddl-D_oW-EVO.d.ts → ddl-BvcbgzHo.d.ts} +3 -3
- package/dist/{ddl-BL1NZLMY.d.cts → ddl-Ufebz5q5.d.cts} +3 -3
- package/dist/graph-extension/index.cjs +21 -20
- package/dist/graph-extension/index.d.cts +2 -4
- package/dist/graph-extension/index.d.ts +2 -4
- package/dist/graph-extension/index.js +5 -4
- package/dist/graph-merge/index.cjs +324 -307
- 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 +51 -34
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/index.cjs +224 -222
- 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 +38 -36
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.cjs +15 -13
- package/dist/indexes/index.d.cts +4 -4
- package/dist/indexes/index.d.ts +4 -4
- package/dist/indexes/index.js +8 -6
- package/dist/{ingestion-import-target-dNeL7iAv.d.ts → ingestion-import-target-CAs1OX-l.d.cts} +1 -1
- package/dist/{ingestion-import-target-XPxZYw89.d.cts → ingestion-import-target-DCQSPfNx.d.ts} +1 -1
- package/dist/interchange/index.cjs +57 -54
- package/dist/interchange/index.cjs.map +1 -1
- package/dist/interchange/index.d.cts +19 -8
- package/dist/interchange/index.d.ts +19 -8
- package/dist/interchange/index.js +21 -18
- 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-CYaff3n3.d.cts → manager-B68OrPR2.d.ts} +29 -2
- package/dist/{manager-D9eRT_ns.d.ts → manager-D_t7oK69.d.cts} +29 -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-CcL4bAHS.d.ts → postgres-BPLSVyHM.d.ts} +279 -2
- package/dist/{postgres-DMj39MEu.d.cts → postgres-CqvtFC2y.d.cts} +279 -2
- package/dist/profiler/index.d.cts +9 -9
- package/dist/profiler/index.d.ts +9 -9
- package/dist/provenance/index.cjs +59 -44
- package/dist/provenance/index.cjs.map +1 -1
- package/dist/provenance/index.d.cts +7 -7
- package/dist/provenance/index.d.ts +7 -7
- package/dist/provenance/index.js +28 -13
- package/dist/provenance/index.js.map +1 -1
- package/dist/{repair-validity-windows-BFNZvd_H.d.cts → repair-validity-windows-DEzCKAdy.d.cts} +7 -3
- package/dist/{repair-validity-windows-DlUSqwCg.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 +48 -46
- package/dist/schema/index.d.cts +4 -6
- package/dist/schema/index.d.ts +4 -6
- package/dist/schema/index.js +21 -19
- package/dist/{searchable-bpE1bBfc.d.ts → searchable-C_UREI9K.d.ts} +1 -1
- package/dist/{searchable-DHJMh_nj.d.cts → searchable-ClgET_i7.d.cts} +1 -1
- package/dist/{sqlite-YppHrNFb.d.cts → sqlite-D1mXO9Kp.d.cts} +310 -2
- package/dist/{sqlite-D7Oz0SQh.d.ts → sqlite-MZA3oZNB.d.ts} +310 -2
- package/dist/{store-bphCSo7z.d.cts → store-CuFX7fCx.d.cts} +117 -31
- package/dist/{store-DRrFCx5x.d.ts → store-D-ZjXQpW.d.ts} +117 -31
- package/dist/{temporal-CbnLzTmM.d.ts → temporal-CpyEiRY8.d.cts} +1 -1
- package/dist/{temporal-5GqpYCk2.d.cts → temporal-y0Aep9Su.d.ts} +1 -1
- package/dist/{types-BqFZTQmV.d.cts → types-6yf0Vv-_.d.cts} +2016 -94
- package/dist/{types-BqFZTQmV.d.ts → types-6yf0Vv-_.d.ts} +2016 -94
- package/dist/{types-Bx74kaTt.d.ts → types-DzJ4dlzk.d.cts} +1 -1
- package/dist/{types-CXAhpW-c.d.cts → types-_vVSB9k-.d.ts} +1 -1
- package/dist/{where-O-k2wgYm.d.ts → where-DuG2LCLe.d.ts} +1 -1
- package/dist/{where-DI_Fqz-X.d.cts → where-Mhf_yyKX.d.cts} +1 -1
- package/package.json +7 -2
- package/dist/chunk-26YKDNUD.cjs.map +0 -1
- package/dist/chunk-2TYSSBU5.js.map +0 -1
- package/dist/chunk-3DMMGT6S.js.map +0 -1
- package/dist/chunk-3FPR224C.cjs.map +0 -1
- package/dist/chunk-3G5W2U2L.cjs.map +0 -1
- package/dist/chunk-3KOY4FH3.cjs +0 -934
- package/dist/chunk-3KOY4FH3.cjs.map +0 -1
- package/dist/chunk-3QNZ5SAJ.cjs +0 -3502
- package/dist/chunk-3QNZ5SAJ.cjs.map +0 -1
- package/dist/chunk-3U5ABFDW.cjs +0 -259
- package/dist/chunk-3U5ABFDW.cjs.map +0 -1
- package/dist/chunk-5K2BKEBD.js.map +0 -1
- package/dist/chunk-5PRKMB24.cjs +0 -124
- package/dist/chunk-5PRKMB24.cjs.map +0 -1
- package/dist/chunk-6LN7FIVU.js +0 -107
- package/dist/chunk-6LN7FIVU.js.map +0 -1
- package/dist/chunk-6SWPJEYN.js +0 -1126
- package/dist/chunk-6SWPJEYN.js.map +0 -1
- package/dist/chunk-7LZJNLA5.js.map +0 -1
- package/dist/chunk-7UOLHNWC.cjs.map +0 -1
- package/dist/chunk-BFUOME67.cjs.map +0 -1
- package/dist/chunk-BRRP76WO.js.map +0 -1
- package/dist/chunk-CICO5GXD.cjs +0 -12
- package/dist/chunk-D4QLTJSM.js.map +0 -1
- package/dist/chunk-D5R42W5D.js.map +0 -1
- package/dist/chunk-EDN4Y4ZG.cjs.map +0 -1
- package/dist/chunk-EZEEWCFJ.cjs.map +0 -1
- package/dist/chunk-FA2AFWLP.cjs.map +0 -1
- package/dist/chunk-FQPEMEWX.cjs.map +0 -1
- package/dist/chunk-GLHXM7C4.js.map +0 -1
- package/dist/chunk-GYEG3ZLZ.cjs.map +0 -1
- package/dist/chunk-HDL2ARHX.cjs +0 -1156
- package/dist/chunk-HDL2ARHX.cjs.map +0 -1
- package/dist/chunk-HEV35TGT.js.map +0 -1
- package/dist/chunk-I4GAZH5Z.js +0 -913
- package/dist/chunk-I4GAZH5Z.js.map +0 -1
- package/dist/chunk-JB6T4GLL.cjs.map +0 -1
- package/dist/chunk-JBQQ7THH.js +0 -20
- package/dist/chunk-JBQQ7THH.js.map +0 -1
- package/dist/chunk-JFRT7S3B.cjs.map +0 -1
- package/dist/chunk-KF6K7TGH.js.map +0 -1
- package/dist/chunk-L3LQNR34.cjs +0 -1254
- package/dist/chunk-L3LQNR34.cjs.map +0 -1
- package/dist/chunk-LTXQOEIC.js.map +0 -1
- package/dist/chunk-MKJ4KXL5.cjs +0 -12
- package/dist/chunk-MRDBBHIZ.cjs.map +0 -1
- package/dist/chunk-NACVVDWB.js.map +0 -1
- package/dist/chunk-NVY5CJFP.js +0 -244
- package/dist/chunk-NVY5CJFP.js.map +0 -1
- package/dist/chunk-PWLJ77UV.cjs +0 -23
- package/dist/chunk-PWLJ77UV.cjs.map +0 -1
- package/dist/chunk-S5TERQVW.js.map +0 -1
- package/dist/chunk-SHFBB23Q.js.map +0 -1
- package/dist/chunk-SIT26LAZ.cjs.map +0 -1
- package/dist/chunk-SR725PWF.cjs.map +0 -1
- package/dist/chunk-TQHGE7UC.cjs.map +0 -1
- package/dist/chunk-UGHG7PGX.js.map +0 -1
- package/dist/chunk-UGHQV7MP.cjs.map +0 -1
- package/dist/chunk-UMGZDVOA.cjs.map +0 -1
- package/dist/chunk-WIC7DRXW.js.map +0 -1
- package/dist/chunk-YIURNGXI.js.map +0 -1
- package/dist/chunk-YYUHLYM2.cjs.map +0 -1
- package/dist/chunk-Z2JCLZFJ.js.map +0 -1
- package/dist/chunk-ZDKTPBGV.js.map +0 -1
- package/dist/chunk-ZFMCDJGB.js.map +0 -1
- package/dist/chunk-ZLONH2UD.js.map +0 -1
- package/dist/index-COs_z6nV.d.cts +0 -1132
- package/dist/index-D7d1u2gr.d.ts +0 -1132
- package/dist/materialize-indexes-DJ3ykH59.d.ts +0 -266
- package/dist/materialize-indexes-DTtAnvfY.d.cts +0 -266
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkH5IJSROF_cjs = require('./chunk-H5IJSROF.cjs');
|
|
4
|
+
|
|
5
|
+
// src/query/dialect/vector/pagination.ts
|
|
6
|
+
function vectorPageClause(limit, offset) {
|
|
7
|
+
return offset === void 0 || offset === 0 ? chunkH5IJSROF_cjs.sql`LIMIT ${limit}` : chunkH5IJSROF_cjs.sql`LIMIT ${limit} OFFSET ${offset}`;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
exports.vectorPageClause = vectorPageClause;
|
|
11
|
+
//# sourceMappingURL=chunk-UYKDYE5D.cjs.map
|
|
12
|
+
//# sourceMappingURL=chunk-UYKDYE5D.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/query/dialect/vector/pagination.ts"],"names":["sql"],"mappings":";;;;;AAcO,SAAS,gBAAA,CAAiB,OAAe,MAAA,EAA8B;AAC5E,EAAA,OAAO,MAAA,KAAW,MAAA,IAAa,MAAA,KAAW,CAAA,GACtCA,qBAAA,CAAA,MAAA,EAAY,KAAK,CAAA,CAAA,GACjBA,qBAAA,CAAA,MAAA,EAAY,KAAK,CAAA,QAAA,EAAW,MAAM,CAAA,CAAA;AACxC","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/query/dialect/vector/pagination.ts"],"names":["sql"],"mappings":";;;;;AAcO,SAAS,gBAAA,CAAiB,OAAe,MAAA,EAA8B;AAC5E,EAAA,OAAO,MAAA,KAAW,MAAA,IAAa,MAAA,KAAW,CAAA,GACtCA,qBAAA,CAAA,MAAA,EAAY,KAAK,CAAA,CAAA,GACjBA,qBAAA,CAAA,MAAA,EAAY,KAAK,CAAA,QAAA,EAAW,MAAM,CAAA,CAAA;AACxC","file":"chunk-UYKDYE5D.cjs","sourcesContent":["/**\n * Shared vector-search pagination clause.\n *\n * Every vector strategy pages its ordered relevance scan the same way: emit a\n * bare `LIMIT` for the first page (`offset` unset or `0`), and `LIMIT … OFFSET`\n * only when a non-zero offset must discard the leading rows. The three engines'\n * `buildSearch` methods each repeated this ternary verbatim; it lives here once\n * so the emitted clause can never drift between dialects.\n *\n * `limit` and `offset` ride as bound parameters (never interpolated), so the\n * clause — string and bound values alike — is identical across engines.\n */\nimport { sql, type SqlFragment } from \"../../sql-fragment\";\n\nexport function vectorPageClause(limit: number, offset?: number): SqlFragment {\n return offset === undefined || offset === 0 ?\n sql`LIMIT ${limit}`\n : sql`LIMIT ${limit} OFFSET ${offset}`;\n}\n"]}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { withRecordedRelationsPrecondition, projectGraphBackend, deriveBackend, groupBy, chunk } from './chunk-
|
|
2
|
-
import {
|
|
3
|
-
import { rowPropsToJsonText } from './chunk-
|
|
4
|
-
import { optionalRecordedInstantParts, createRecordedInstant, parseRecordedInstant, RECORDED_MAX_REVISION } from './chunk-
|
|
5
|
-
import { nowIso, canonicalizeDatabaseTimestamp } from './chunk-
|
|
6
|
-
import {
|
|
1
|
+
import { withRecordedRelationsPrecondition, projectGraphBackend, deriveBackend, groupBy, chunk } from './chunk-QG5VEOKX.js';
|
|
2
|
+
import { statementExecutionVerdict, recordedRevisionOriginsVerdict, assertRecursiveTraversal, batchPointReadVerdict } from './chunk-XORONCV3.js';
|
|
3
|
+
import { resolveWriteFencePlan, requireWriteFence, recordedRevisionOriginsMembers, bindExtraIfReachable, BATCH_POINT_READ, runOptionallyInTransaction, createSqlSchema, rowPropsToJsonText } from './chunk-LKZDQ2B4.js';
|
|
4
|
+
import { optionalRecordedInstantParts, createRecordedInstant, parseRecordedInstant, RECORDED_MAX_REVISION } from './chunk-6NKSE5AU.js';
|
|
5
|
+
import { nowIso, canonicalizeDatabaseTimestamp } from './chunk-K46SDNQD.js';
|
|
6
|
+
import { likeEscapeClause, LIKE_ESCAPE_CHARACTER } from './chunk-4QKOZYMV.js';
|
|
7
|
+
import { sql, asCompiledRowsSql, asCompiledStatementSql } from './chunk-7QFRK6PU.js';
|
|
7
8
|
import { resolveFieldTypeInfoAtJsonPointer } from './chunk-W6OG3HDG.js';
|
|
8
|
-
import { ConfigurationError, UnsupportedPredicateError, CompilerInvariantError } from './chunk-
|
|
9
|
+
import { ConfigurationError, UnsupportedPredicateError, CompilerInvariantError, ValidationError } from './chunk-YDEJQWOL.js';
|
|
9
10
|
import { normalizeJsonPointer, joinJsonPointers, jsonPointer } from './chunk-FWJKWH6U.js';
|
|
10
11
|
import { requireDefined, isPresent } from './chunk-DYATYRY4.js';
|
|
11
12
|
import { nanoid } from 'nanoid';
|
|
@@ -780,7 +781,7 @@ function assertCapturableBackend(backend) {
|
|
|
780
781
|
}
|
|
781
782
|
);
|
|
782
783
|
}
|
|
783
|
-
if (backend.
|
|
784
|
+
if (!statementExecutionVerdict(backend).supported) {
|
|
784
785
|
throw new ConfigurationError(
|
|
785
786
|
"history: true requires a backend that supports executeStatement.",
|
|
786
787
|
{ dialect: backend.dialect },
|
|
@@ -818,7 +819,7 @@ function assertRevisionTrackableBackend(backend) {
|
|
|
818
819
|
}
|
|
819
820
|
);
|
|
820
821
|
}
|
|
821
|
-
if (backend.
|
|
822
|
+
if (!statementExecutionVerdict(backend).supported) {
|
|
822
823
|
throw new ConfigurationError(
|
|
823
824
|
"revisionTracking: true requires a backend that supports executeStatement.",
|
|
824
825
|
{ dialect: backend.dialect },
|
|
@@ -836,7 +837,7 @@ function assertRevisionTrackableBackend(backend) {
|
|
|
836
837
|
}
|
|
837
838
|
);
|
|
838
839
|
}
|
|
839
|
-
if (backend.
|
|
840
|
+
if (!recordedRevisionOriginsVerdict(backend).supported) {
|
|
840
841
|
throw new ConfigurationError(
|
|
841
842
|
"revisionTracking: true requires a backend that can bootstrap revision origins.",
|
|
842
843
|
{ dialect: backend.dialect },
|
|
@@ -852,10 +853,6 @@ var RECORDED_MIN_REVISION = 0;
|
|
|
852
853
|
var RECORDED_MIN_TIME = "1970-01-01T00:00:00.000Z";
|
|
853
854
|
var RECORDED_CLOCK_ADVISORY_LOCK_NAMESPACE = "typegraph:recorded-clock";
|
|
854
855
|
var RECORDED_GRAPH_WRITE_ADVISORY_LOCK_NAMESPACE = "typegraph:recorded-graph-write";
|
|
855
|
-
var USES_RECORDED_GRAPH_ADVISORY_LOCK = {
|
|
856
|
-
postgres: true,
|
|
857
|
-
sqlite: false
|
|
858
|
-
};
|
|
859
856
|
function graphAdvisoryLockSql(namespace, graphId) {
|
|
860
857
|
return sql`
|
|
861
858
|
SELECT pg_advisory_xact_lock(
|
|
@@ -893,8 +890,16 @@ async function acquireRecordedGraphWriteLock(target, graphId) {
|
|
|
893
890
|
);
|
|
894
891
|
}
|
|
895
892
|
async function lockRecordedGraphWrite(target, graphId, memo) {
|
|
896
|
-
|
|
897
|
-
|
|
893
|
+
const plan = resolveWriteFencePlan(target);
|
|
894
|
+
const fence = requireWriteFence(
|
|
895
|
+
plan,
|
|
896
|
+
"recorded graph write",
|
|
897
|
+
"advisory-lock"
|
|
898
|
+
);
|
|
899
|
+
switch (fence.kind) {
|
|
900
|
+
case "engine-serialized": {
|
|
901
|
+
return graphWriteLockEvidence();
|
|
902
|
+
}
|
|
898
903
|
}
|
|
899
904
|
const effectiveMemo = memo ?? recordedGraphLockMemos.get(target);
|
|
900
905
|
if (effectiveMemo === void 0) {
|
|
@@ -989,9 +994,8 @@ async function readRevisionOrigin(target, schema, graphId) {
|
|
|
989
994
|
}
|
|
990
995
|
return first.origin;
|
|
991
996
|
}
|
|
992
|
-
async function ensureRevisionOrigin(target, schema, graphId) {
|
|
993
|
-
|
|
994
|
-
if (ensureTable === void 0) {
|
|
997
|
+
async function ensureRevisionOrigin(target, verdict, schema, graphId) {
|
|
998
|
+
if (!verdict.supported) {
|
|
995
999
|
throw new ConfigurationError(
|
|
996
1000
|
"Revision tracking requires a backend that can bootstrap revision origins.",
|
|
997
1001
|
{ dialect: target.dialect },
|
|
@@ -1000,6 +1004,7 @@ async function ensureRevisionOrigin(target, schema, graphId) {
|
|
|
1000
1004
|
}
|
|
1001
1005
|
);
|
|
1002
1006
|
}
|
|
1007
|
+
const { ensureRevisionOriginsTable: ensureTable } = recordedRevisionOriginsMembers(target, verdict);
|
|
1003
1008
|
await ensureTable();
|
|
1004
1009
|
const existing = await readRevisionOrigin(target, schema, graphId);
|
|
1005
1010
|
if (existing !== void 0) return existing;
|
|
@@ -1042,14 +1047,20 @@ async function assertRecordedClockAdvanced(target, schema, graphId, revision) {
|
|
|
1042
1047
|
);
|
|
1043
1048
|
}
|
|
1044
1049
|
async function lockRecordedClock(target, schema, graphId, ownsWriteLock) {
|
|
1045
|
-
|
|
1046
|
-
|
|
1050
|
+
const plan = resolveWriteFencePlan(target);
|
|
1051
|
+
const fence = requireWriteFence(
|
|
1052
|
+
plan,
|
|
1053
|
+
"recorded clock allocation",
|
|
1054
|
+
"advisory-lock"
|
|
1055
|
+
);
|
|
1056
|
+
switch (fence.kind) {
|
|
1057
|
+
case "lock": {
|
|
1047
1058
|
await target.execute(
|
|
1048
1059
|
asCompiledRowsSql(recordedClockAdvisoryLockSql(graphId))
|
|
1049
1060
|
);
|
|
1050
1061
|
return;
|
|
1051
1062
|
}
|
|
1052
|
-
case "
|
|
1063
|
+
case "engine-serialized": {
|
|
1053
1064
|
if (ownsWriteLock) return;
|
|
1054
1065
|
await executeStatement(
|
|
1055
1066
|
target,
|
|
@@ -1061,9 +1072,6 @@ async function lockRecordedClock(target, schema, graphId, ownsWriteLock) {
|
|
|
1061
1072
|
);
|
|
1062
1073
|
return;
|
|
1063
1074
|
}
|
|
1064
|
-
default: {
|
|
1065
|
-
target.dialect;
|
|
1066
|
-
}
|
|
1067
1075
|
}
|
|
1068
1076
|
}
|
|
1069
1077
|
async function allocateRecordedCommit(target, schema, graphId, ownsWriteLock, previousRevision) {
|
|
@@ -1241,6 +1249,10 @@ function identityAssertionSnapshotSource(schema, graphId, coordinate, relation)
|
|
|
1241
1249
|
`;
|
|
1242
1250
|
}
|
|
1243
1251
|
function historicalIdentityReconstructionCtes(input) {
|
|
1252
|
+
assertRecursiveTraversal(
|
|
1253
|
+
input.recursiveTraversal,
|
|
1254
|
+
"historical identity class read"
|
|
1255
|
+
);
|
|
1244
1256
|
const nodes = identityNodeSnapshotSource(
|
|
1245
1257
|
input.schema,
|
|
1246
1258
|
input.graphId,
|
|
@@ -1297,6 +1309,10 @@ var IDENTITY_PEER_CLASS_COLUMNS = sql.raw(
|
|
|
1297
1309
|
["seed_kind", "seed_id", "kind", "id"].join(", ")
|
|
1298
1310
|
);
|
|
1299
1311
|
function historicalIdentityPeerClassQuery(input) {
|
|
1312
|
+
assertRecursiveTraversal(
|
|
1313
|
+
input.recursiveTraversal,
|
|
1314
|
+
"historical identity expansion"
|
|
1315
|
+
);
|
|
1300
1316
|
const reconstruction = historicalIdentityReconstructionCtes({
|
|
1301
1317
|
...input,
|
|
1302
1318
|
seedSource: sql`SELECT DISTINCT a_kind, a_id FROM identity_edges`
|
|
@@ -1514,6 +1530,22 @@ function compileParameterizedStringPattern(op, parameter) {
|
|
|
1514
1530
|
}
|
|
1515
1531
|
}
|
|
1516
1532
|
}
|
|
1533
|
+
function requireRecursiveTraversalVerdict(ctx, operation) {
|
|
1534
|
+
const verdict = ctx.recursiveTraversal;
|
|
1535
|
+
if (verdict === void 0) {
|
|
1536
|
+
throw new CompilerInvariantError(
|
|
1537
|
+
"recursive traversal verdict missing from compiler context",
|
|
1538
|
+
{ operation }
|
|
1539
|
+
);
|
|
1540
|
+
}
|
|
1541
|
+
return verdict;
|
|
1542
|
+
}
|
|
1543
|
+
function assertRecursiveTraversalSupported(ctx, operation) {
|
|
1544
|
+
assertRecursiveTraversal(
|
|
1545
|
+
requireRecursiveTraversalVerdict(ctx, operation),
|
|
1546
|
+
operation
|
|
1547
|
+
);
|
|
1548
|
+
}
|
|
1517
1549
|
function compilePredicateExpression(expr, ctx) {
|
|
1518
1550
|
const { dialect } = ctx;
|
|
1519
1551
|
const cteColumnPrefix = ctx.cteColumnPrefix;
|
|
@@ -2032,17 +2064,27 @@ async function getRowsByIds(ids, policy) {
|
|
|
2032
2064
|
}
|
|
2033
2065
|
|
|
2034
2066
|
// src/store/edge-fetch.ts
|
|
2035
|
-
async function getEdgeRowsByIds(backend, graphId, ids) {
|
|
2067
|
+
async function getEdgeRowsByIds(backend, verdict, graphId, ids) {
|
|
2068
|
+
const bound = bindExtraIfReachable(
|
|
2069
|
+
backend,
|
|
2070
|
+
verdict.extras.getEdges,
|
|
2071
|
+
BATCH_POINT_READ.id
|
|
2072
|
+
);
|
|
2036
2073
|
return getRowsByIds(ids, {
|
|
2037
|
-
batch:
|
|
2074
|
+
batch: bound === void 0 ? void 0 : ((batchIds) => bound.getEdges(graphId, batchIds)),
|
|
2038
2075
|
one: (id) => backend.getEdge(graphId, id)
|
|
2039
2076
|
});
|
|
2040
2077
|
}
|
|
2041
2078
|
|
|
2042
2079
|
// src/store/node-fetch.ts
|
|
2043
|
-
async function getNodeRowsByIds(backend, graphId, kind, ids) {
|
|
2080
|
+
async function getNodeRowsByIds(backend, verdict, graphId, kind, ids) {
|
|
2081
|
+
const bound = bindExtraIfReachable(
|
|
2082
|
+
backend,
|
|
2083
|
+
verdict.extras.getNodes,
|
|
2084
|
+
BATCH_POINT_READ.id
|
|
2085
|
+
);
|
|
2044
2086
|
return getRowsByIds(ids, {
|
|
2045
|
-
batch:
|
|
2087
|
+
batch: bound === void 0 ? void 0 : ((batchIds) => bound.getNodes(graphId, kind, batchIds)),
|
|
2046
2088
|
one: (id) => backend.getNode(graphId, kind, id)
|
|
2047
2089
|
});
|
|
2048
2090
|
}
|
|
@@ -2320,7 +2362,7 @@ function recordedInsertsFor(afterById, closed) {
|
|
|
2320
2362
|
operation: recordedOp(closed.has(row.id), closed.get(row.id) ?? false, row)
|
|
2321
2363
|
}));
|
|
2322
2364
|
}
|
|
2323
|
-
async function flushNodes(target, schema, graphId, entities, recordedRevision) {
|
|
2365
|
+
async function flushNodes(target, batchPointRead, schema, graphId, entities, recordedRevision) {
|
|
2324
2366
|
const chunkSize = recordedNodeChunkSize(target);
|
|
2325
2367
|
for (const [kind, group] of groupNodesByKind(entities)) {
|
|
2326
2368
|
for (const entityChunk of chunk(group, chunkSize)) {
|
|
@@ -2335,7 +2377,7 @@ async function flushNodes(target, schema, graphId, entities, recordedRevision) {
|
|
|
2335
2377
|
);
|
|
2336
2378
|
const afterById = await resolveAfterImages(
|
|
2337
2379
|
entityChunk,
|
|
2338
|
-
(missing) => getNodeRowsByIds(target, graphId, kind, missing)
|
|
2380
|
+
(missing) => getNodeRowsByIds(target, batchPointRead, graphId, kind, missing)
|
|
2339
2381
|
);
|
|
2340
2382
|
await insertRecordedNodeRows(
|
|
2341
2383
|
target,
|
|
@@ -2346,7 +2388,7 @@ async function flushNodes(target, schema, graphId, entities, recordedRevision) {
|
|
|
2346
2388
|
}
|
|
2347
2389
|
}
|
|
2348
2390
|
}
|
|
2349
|
-
async function flushEdges(target, schema, graphId, entities, recordedRevision) {
|
|
2391
|
+
async function flushEdges(target, batchPointRead, schema, graphId, entities, recordedRevision) {
|
|
2350
2392
|
const chunkSize = recordedEdgeChunkSize(target);
|
|
2351
2393
|
for (const entityChunk of chunk(entities, chunkSize)) {
|
|
2352
2394
|
const ids = entityChunk.map((entity) => entity.id);
|
|
@@ -2359,7 +2401,7 @@ async function flushEdges(target, schema, graphId, entities, recordedRevision) {
|
|
|
2359
2401
|
);
|
|
2360
2402
|
const afterById = await resolveAfterImages(
|
|
2361
2403
|
entityChunk,
|
|
2362
|
-
(missing) => getEdgeRowsByIds(target, graphId, missing)
|
|
2404
|
+
(missing) => getEdgeRowsByIds(target, batchPointRead, graphId, missing)
|
|
2363
2405
|
);
|
|
2364
2406
|
await insertRecordedEdgeRows(
|
|
2365
2407
|
target,
|
|
@@ -2675,7 +2717,7 @@ function createRecordedCaptureSession() {
|
|
|
2675
2717
|
if (sealed) throw recordedCaptureSealedError({ graphId });
|
|
2676
2718
|
forcedGraphRevisions.add(graphId);
|
|
2677
2719
|
},
|
|
2678
|
-
async flush(target, schema, ownsWriteLock) {
|
|
2720
|
+
async flush(target, batchPointRead, schema, ownsWriteLock) {
|
|
2679
2721
|
if (sealed) {
|
|
2680
2722
|
throw new ConfigurationError(
|
|
2681
2723
|
"Recorded-time capture session was already flushed.",
|
|
@@ -2712,6 +2754,7 @@ function createRecordedCaptureSession() {
|
|
|
2712
2754
|
);
|
|
2713
2755
|
await flushNodes(
|
|
2714
2756
|
target,
|
|
2757
|
+
batchPointRead,
|
|
2715
2758
|
schema,
|
|
2716
2759
|
graphId,
|
|
2717
2760
|
nodes,
|
|
@@ -2719,6 +2762,7 @@ function createRecordedCaptureSession() {
|
|
|
2719
2762
|
);
|
|
2720
2763
|
await flushEdges(
|
|
2721
2764
|
target,
|
|
2765
|
+
batchPointRead,
|
|
2722
2766
|
schema,
|
|
2723
2767
|
graphId,
|
|
2724
2768
|
edges,
|
|
@@ -2947,7 +2991,7 @@ function createRecordedTransactionBackend(target, session, schema) {
|
|
|
2947
2991
|
recordedRevisionBindings.set(overlay, session);
|
|
2948
2992
|
return overlay;
|
|
2949
2993
|
}
|
|
2950
|
-
function createRecordedTransactionScope(target, schema, ownsWriteLock = false) {
|
|
2994
|
+
function createRecordedTransactionScope(target, batchPointRead, schema, ownsWriteLock = false) {
|
|
2951
2995
|
requireCaptureStatements(target);
|
|
2952
2996
|
const session = createRecordedCaptureSession();
|
|
2953
2997
|
const resolvedSchema = schema ?? requireRecordedSchema(target);
|
|
@@ -2955,17 +2999,22 @@ function createRecordedTransactionScope(target, schema, ownsWriteLock = false) {
|
|
|
2955
2999
|
backend: createRecordedTransactionBackend(target, session, resolvedSchema),
|
|
2956
3000
|
async flush() {
|
|
2957
3001
|
return withRecordedRelationsPrecondition(
|
|
2958
|
-
session.flush(target, resolvedSchema, ownsWriteLock),
|
|
3002
|
+
session.flush(target, batchPointRead, resolvedSchema, ownsWriteLock),
|
|
2959
3003
|
{ dialect: target.dialect, surface: "capture-flush" }
|
|
2960
3004
|
);
|
|
2961
3005
|
}
|
|
2962
3006
|
};
|
|
2963
3007
|
}
|
|
2964
|
-
async function runCapturedAutocommit(backend, schema, fn, options) {
|
|
3008
|
+
async function runCapturedAutocommit(backend, schema, batchPointRead, fn, options) {
|
|
2965
3009
|
assertRequestedRecordedIsolation(backend, options);
|
|
2966
3010
|
return backend.transaction(async (target) => {
|
|
2967
3011
|
await assertRecordedCaptureTransactionIsolation(target);
|
|
2968
|
-
const scope = createRecordedTransactionScope(
|
|
3012
|
+
const scope = createRecordedTransactionScope(
|
|
3013
|
+
target,
|
|
3014
|
+
batchPointRead,
|
|
3015
|
+
schema,
|
|
3016
|
+
true
|
|
3017
|
+
);
|
|
2969
3018
|
const result = await fn(scope.backend);
|
|
2970
3019
|
await scope.flush();
|
|
2971
3020
|
return result;
|
|
@@ -2973,7 +3022,8 @@ async function runCapturedAutocommit(backend, schema, fn, options) {
|
|
|
2973
3022
|
}
|
|
2974
3023
|
function createRecordedBackend(backend, schema) {
|
|
2975
3024
|
assertCapturableBackend(backend);
|
|
2976
|
-
const
|
|
3025
|
+
const batchPointRead = batchPointReadVerdict(backend);
|
|
3026
|
+
const capture = (fn) => runCapturedAutocommit(backend, schema, batchPointRead, fn);
|
|
2977
3027
|
const projectedBackend = projectGraphBackend(backend);
|
|
2978
3028
|
return deriveBackend(projectedBackend, {
|
|
2979
3029
|
...rawWriteGuards(backend, "backend"),
|
|
@@ -3078,7 +3128,12 @@ function createRecordedBackend(backend, schema) {
|
|
|
3078
3128
|
return backend.transaction(async (target) => {
|
|
3079
3129
|
await assertRecordedCaptureTransactionIsolation(target, backendOptions);
|
|
3080
3130
|
const readOnly = backendOptions?.accessMode === "read_only";
|
|
3081
|
-
const scope = createRecordedTransactionScope(
|
|
3131
|
+
const scope = createRecordedTransactionScope(
|
|
3132
|
+
target,
|
|
3133
|
+
batchPointRead,
|
|
3134
|
+
schema,
|
|
3135
|
+
!readOnly
|
|
3136
|
+
);
|
|
3082
3137
|
const result = await fn(scope.backend);
|
|
3083
3138
|
const instants = await scope.flush();
|
|
3084
3139
|
observer?.(instants);
|
|
@@ -3088,33 +3143,196 @@ function createRecordedBackend(backend, schema) {
|
|
|
3088
3143
|
});
|
|
3089
3144
|
}
|
|
3090
3145
|
|
|
3091
|
-
// src/
|
|
3092
|
-
function
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3146
|
+
// src/errors/validation.ts
|
|
3147
|
+
function zodIssuesToValidationIssues(error) {
|
|
3148
|
+
return error.issues.map((issue) => ({
|
|
3149
|
+
path: issue.path.join("."),
|
|
3150
|
+
message: issue.message,
|
|
3151
|
+
code: issue.code
|
|
3152
|
+
}));
|
|
3153
|
+
}
|
|
3154
|
+
function buildLocationString(context) {
|
|
3155
|
+
if (context.id) {
|
|
3156
|
+
return `${context.kind}/${context.id}`;
|
|
3157
|
+
}
|
|
3158
|
+
return `new ${context.kind}`;
|
|
3159
|
+
}
|
|
3160
|
+
function validateProps(schema, props, context) {
|
|
3161
|
+
const result = schema.safeParse(props);
|
|
3162
|
+
if (result.success) {
|
|
3163
|
+
return result.data;
|
|
3164
|
+
}
|
|
3165
|
+
const issues = zodIssuesToValidationIssues(result.error);
|
|
3166
|
+
const location = buildLocationString(context);
|
|
3167
|
+
throw new ValidationError(
|
|
3168
|
+
`Invalid ${context.entityType} props for ${location}: ${result.error.message}`,
|
|
3169
|
+
{
|
|
3170
|
+
entityType: context.entityType,
|
|
3171
|
+
kind: context.kind,
|
|
3172
|
+
operation: context.operation,
|
|
3173
|
+
...context.id !== void 0 && { id: context.id },
|
|
3174
|
+
issues
|
|
3175
|
+
},
|
|
3176
|
+
{ cause: result.error }
|
|
3177
|
+
);
|
|
3178
|
+
}
|
|
3179
|
+
function validateNodeProps(schema, props, context) {
|
|
3180
|
+
return validateProps(schema, props, {
|
|
3181
|
+
entityType: "node",
|
|
3182
|
+
...context
|
|
3183
|
+
});
|
|
3184
|
+
}
|
|
3185
|
+
function validateEdgeProps(schema, props, context) {
|
|
3186
|
+
return validateProps(schema, props, {
|
|
3187
|
+
entityType: "edge",
|
|
3188
|
+
...context
|
|
3189
|
+
});
|
|
3190
|
+
}
|
|
3191
|
+
function wrapZodError(error, context) {
|
|
3192
|
+
const issues = zodIssuesToValidationIssues(error);
|
|
3193
|
+
const location = buildLocationString(context);
|
|
3194
|
+
return new ValidationError(
|
|
3195
|
+
`Validation failed for ${context.entityType} ${location}: ${error.message}`,
|
|
3196
|
+
{
|
|
3197
|
+
entityType: context.entityType,
|
|
3198
|
+
kind: context.kind,
|
|
3199
|
+
operation: context.operation,
|
|
3200
|
+
...context.id !== void 0 && { id: context.id },
|
|
3201
|
+
issues
|
|
3202
|
+
},
|
|
3203
|
+
{ cause: error }
|
|
3204
|
+
);
|
|
3205
|
+
}
|
|
3206
|
+
function createValidationError(message, issues, context) {
|
|
3207
|
+
return new ValidationError(message, {
|
|
3208
|
+
...context?.entityType !== void 0 && {
|
|
3209
|
+
entityType: context.entityType
|
|
3210
|
+
},
|
|
3211
|
+
...context?.kind !== void 0 && { kind: context.kind },
|
|
3212
|
+
...context?.operation !== void 0 && { operation: context.operation },
|
|
3213
|
+
...context?.id !== void 0 && { id: context.id },
|
|
3214
|
+
issues
|
|
3215
|
+
});
|
|
3111
3216
|
}
|
|
3112
3217
|
|
|
3113
|
-
// src/
|
|
3114
|
-
|
|
3115
|
-
|
|
3218
|
+
// src/store/operations/write-transaction.ts
|
|
3219
|
+
var writeTransactionSessions = /* @__PURE__ */ new WeakMap();
|
|
3220
|
+
function forceWriteTransactionRevision(target) {
|
|
3221
|
+
const session = writeTransactionSessions.get(target);
|
|
3222
|
+
if (session === void 0) return false;
|
|
3223
|
+
session.wrote = true;
|
|
3224
|
+
return true;
|
|
3225
|
+
}
|
|
3226
|
+
var heldGraphWriteLocks = /* @__PURE__ */ new WeakMap();
|
|
3227
|
+
async function withWriteTransactionSession(target, ctx, fn) {
|
|
3228
|
+
const session = {
|
|
3229
|
+
lock: void 0,
|
|
3230
|
+
wrote: false
|
|
3231
|
+
};
|
|
3232
|
+
writeTransactionSessions.set(target, session);
|
|
3233
|
+
try {
|
|
3234
|
+
const result = await fn();
|
|
3235
|
+
if (session.wrote && ctx.revisionTrackingEnabled && !ctx.historyEnabled) {
|
|
3236
|
+
await advanceRevisionClock(target, ctx.revisionSchema, ctx.graphId, true);
|
|
3237
|
+
}
|
|
3238
|
+
return result;
|
|
3239
|
+
} finally {
|
|
3240
|
+
writeTransactionSessions.delete(target);
|
|
3241
|
+
}
|
|
3242
|
+
}
|
|
3243
|
+
async function lockSchemaVersionForStoreWrite(ctx, backend) {
|
|
3244
|
+
const expectedVersion = ctx.schemaVersion;
|
|
3245
|
+
if (expectedVersion === void 0) return;
|
|
3246
|
+
if ("transaction" in backend && !backend.capabilities.transactions) {
|
|
3247
|
+
throw new ConfigurationError(
|
|
3248
|
+
"Schema-managed Store writes require a transactional backend so schema changes and entity writes can share one fence.",
|
|
3249
|
+
{
|
|
3250
|
+
code: "SCHEMA_WRITE_FENCE_UNSUPPORTED",
|
|
3251
|
+
graphId: ctx.graphId
|
|
3252
|
+
}
|
|
3253
|
+
);
|
|
3254
|
+
}
|
|
3255
|
+
const lockSchemaVersionForWrite = backend.lockSchemaVersionForWrite;
|
|
3256
|
+
if (lockSchemaVersionForWrite === void 0) {
|
|
3257
|
+
throw new ConfigurationError(
|
|
3258
|
+
"This backend cannot fence schema-managed Store writes against a concurrent schema change.",
|
|
3259
|
+
{
|
|
3260
|
+
code: "SCHEMA_WRITE_FENCE_UNSUPPORTED",
|
|
3261
|
+
graphId: ctx.graphId
|
|
3262
|
+
}
|
|
3263
|
+
);
|
|
3264
|
+
}
|
|
3265
|
+
await lockSchemaVersionForWrite({
|
|
3266
|
+
graphId: ctx.graphId,
|
|
3267
|
+
expectedVersion
|
|
3268
|
+
});
|
|
3269
|
+
}
|
|
3270
|
+
var CONSTRAINT_FENCE_ADVICE = {
|
|
3271
|
+
edgeCardinality: 'declare the edge `cardinality: "many"` and enforce the limit in application code',
|
|
3272
|
+
edgeMatchKeyConvergence: "use `create` with a caller-chosen id, whose uniqueness the edges primary key enforces, instead of `getOrCreateByEndpoints`",
|
|
3273
|
+
nodeDisjointness: "drop the `disjointWith` axiom and keep ids distinct across those kinds yourself",
|
|
3274
|
+
nodeUniquenessClaim: "drop the unique constraint \u2014 its reservation row and the node row must commit or roll back together",
|
|
3275
|
+
nodeUniquenessScope: 'scope the unique constraint to `"kind"`, which the uniques primary key enforces on its own'
|
|
3276
|
+
};
|
|
3277
|
+
function constraintFenceRefusal(ctx, backend, reason) {
|
|
3278
|
+
if (!("transaction" in backend) || backend.capabilities.transactions) {
|
|
3279
|
+
return void 0;
|
|
3280
|
+
}
|
|
3281
|
+
return new ConfigurationError(
|
|
3282
|
+
"This backend cannot fence a constrained write: enforcing a declared constraint requires a transaction \u2014 to scope the per-graph write lock to, and to commit a reservation row together with the row it gates \u2014 and this backend has no transactions.",
|
|
3283
|
+
{
|
|
3284
|
+
code: "CONSTRAINT_WRITE_FENCE_UNSUPPORTED",
|
|
3285
|
+
graphId: ctx.graphId,
|
|
3286
|
+
constraint: reason
|
|
3287
|
+
},
|
|
3288
|
+
{
|
|
3289
|
+
suggestion: `Use a transactional backend, or ${CONSTRAINT_FENCE_ADVICE[reason]}. Unconstrained writes need no fence and keep working on this backend.`
|
|
3290
|
+
}
|
|
3291
|
+
);
|
|
3292
|
+
}
|
|
3293
|
+
function runInWriteTransaction(ctx, backend, fn, options) {
|
|
3294
|
+
const ownsWriteLock = "transaction" in backend && backend.capabilities.transactions;
|
|
3295
|
+
const fenceReason = options?.fencesConstraintProbe;
|
|
3296
|
+
const refusal = fenceReason === void 0 ? void 0 : constraintFenceRefusal(ctx, backend, fenceReason);
|
|
3297
|
+
if (refusal !== void 0) return Promise.reject(refusal);
|
|
3298
|
+
const needsGraphWriteLock = ctx.historyEnabled || ctx.revisionTrackingEnabled || fenceReason !== void 0;
|
|
3299
|
+
return runOptionallyInTransaction(backend, async (target) => {
|
|
3300
|
+
await lockSchemaVersionForStoreWrite(ctx, target);
|
|
3301
|
+
const session = needsGraphWriteLock ? writeTransactionSessions.get(target) : void 0;
|
|
3302
|
+
const held = heldGraphWriteLocks.get(target) ?? /* @__PURE__ */ new Set();
|
|
3303
|
+
heldGraphWriteLocks.set(target, held);
|
|
3304
|
+
const acquiresLock = needsGraphWriteLock && session?.lock === void 0 && !held.has(ctx.graphId);
|
|
3305
|
+
if (acquiresLock) held.add(ctx.graphId);
|
|
3306
|
+
const lock = acquiresLock ? await lockRecordedGraphWrite(target, ctx.graphId).catch(
|
|
3307
|
+
(error) => {
|
|
3308
|
+
held.delete(ctx.graphId);
|
|
3309
|
+
throw error;
|
|
3310
|
+
}
|
|
3311
|
+
) : session?.lock ?? uncapturedGraphWriteLock();
|
|
3312
|
+
if (session !== void 0) session.lock = lock;
|
|
3313
|
+
const result = await (acquiresLock ? fn(target, lock).finally(() => held.delete(ctx.graphId)) : fn(target, lock));
|
|
3314
|
+
if (session !== void 0) {
|
|
3315
|
+
session.wrote ||= options?.didWrite?.(result) ?? true;
|
|
3316
|
+
return result;
|
|
3317
|
+
}
|
|
3318
|
+
if (ctx.revisionTrackingEnabled && !ctx.historyEnabled && (options?.didWrite?.(result) ?? true)) {
|
|
3319
|
+
await advanceRevisionClock(
|
|
3320
|
+
target,
|
|
3321
|
+
ctx.revisionSchema,
|
|
3322
|
+
ctx.graphId,
|
|
3323
|
+
ownsWriteLock
|
|
3324
|
+
);
|
|
3325
|
+
}
|
|
3326
|
+
return result;
|
|
3327
|
+
});
|
|
3328
|
+
}
|
|
3329
|
+
function runHookedWriteOperation(ctx, opContext, backend, body, options) {
|
|
3330
|
+
return ctx.withOperationHooks(
|
|
3331
|
+
opContext,
|
|
3332
|
+
() => runInWriteTransaction(ctx, backend, body, options)
|
|
3333
|
+
);
|
|
3116
3334
|
}
|
|
3117
3335
|
|
|
3118
|
-
export { CURRENT_READ_INSTANT_PLACEHOLDER, IDENTITY_ASSERTION_COLUMNS, IDENTITY_PEER_CLASS_COLUMNS, advanceRevisionClock, arrayField, assertCurrentRecordedSchema, assertRecordedCaptureTransactionIsolation, assertRevisionTrackableBackend, baseField, buildFieldBuilderForTypeInfo, buildPredicateIndex, closeRecordedHardDeletedKind,
|
|
3119
|
-
//# sourceMappingURL=chunk-
|
|
3120
|
-
//# sourceMappingURL=chunk-
|
|
3336
|
+
export { CURRENT_READ_INSTANT_PLACEHOLDER, IDENTITY_ASSERTION_COLUMNS, IDENTITY_PEER_CLASS_COLUMNS, advanceRevisionClock, arrayField, assertCurrentRecordedSchema, assertRecordedCaptureTransactionIsolation, assertRecursiveTraversalSupported, assertRevisionTrackableBackend, baseField, buildFieldBuilderForTypeInfo, buildPredicateIndex, closeRecordedHardDeletedKind, compileFieldValue, compileKindFilter, compilePredicateClauses, compilePredicateExpression, compileTemporalFilter, constraintFenceRefusal, createFulltextAccessor, createRecordedBackend, createRecordedTransactionScope, createValidationError, currentReadInstant, currentReadInstantFor, dateField, edgeInsertDispatch, ensureRevisionOrigin, exists, extractFulltextMatchPredicates, extractTemporalOptions, extractVectorSimilarityPredicates, fieldRef, forceRecordedGraphRevision, forceWriteTransactionRevision, generateId, getEdgeRowsByIds, getFieldPointer, getHybridTargetAlias, getNodeKindsForAlias, getNodeRowsByIds, getPredicatesForAlias, historicalIdentityPeerClassQuery, historicalIdentityReconstructionCtes, identityAssertionSnapshotSource, identityNodeSnapshotSource, identityNodeVisibilitySql, identitySqlCoordinate, inSubquery, isParameterRef, lockRecordedGraphWrite, lockSchemaVersionForStoreWrite, nodeInsertDispatch, notExists, notInSubquery, numberField, objectField, param, readRecordedClock, readRevisionOrigin, recordedBindParamBudget, recordedCaptureRequiresCallbackTransactionError, requireRecursiveTraversalVerdict, resolveParameterValueType, runHookedWriteOperation, runInWriteTransaction, runInsertBatch, runInsertBatchReturning, runInsertNoReturn, sqlValueList, stringField, throwHistoryUnsafeSqlAccess, throwRevisionTrackingUnsafeSqlAccess, validateEdgeProps, validateNodeProps, validateProps, withPinnedReadInstant, withRecordedFlushObserver, withRecordedIdentityMutationTarget, withWriteTransactionSession, wrapZodError };
|
|
3337
|
+
//# sourceMappingURL=chunk-VAAC7L57.js.map
|
|
3338
|
+
//# sourceMappingURL=chunk-VAAC7L57.js.map
|