@nicia-ai/typegraph 0.46.2 → 0.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -1
- package/dist/backend/drizzle/indexes.cjs +9 -9
- package/dist/backend/drizzle/indexes.d.cts +1 -1
- package/dist/backend/drizzle/indexes.d.ts +1 -1
- package/dist/backend/drizzle/indexes.js +5 -5
- package/dist/backend/index.cjs +50 -49
- package/dist/backend/index.d.cts +3 -3
- package/dist/backend/index.d.ts +3 -3
- package/dist/backend/index.js +11 -10
- package/dist/backend/postgres/index.cjs +27 -26
- package/dist/backend/postgres/index.d.cts +6 -6
- package/dist/backend/postgres/index.d.ts +6 -6
- package/dist/backend/postgres/index.js +14 -13
- package/dist/backend/postgres/pglite-store.cjs +34 -33
- package/dist/backend/postgres/pglite-store.cjs.map +1 -1
- package/dist/backend/postgres/pglite-store.d.cts +8 -8
- package/dist/backend/postgres/pglite-store.d.ts +8 -8
- package/dist/backend/postgres/pglite-store.js +30 -29
- package/dist/backend/postgres/pglite-store.js.map +1 -1
- package/dist/backend/postgres/pglite.cjs +16 -15
- package/dist/backend/postgres/pglite.d.cts +3 -3
- package/dist/backend/postgres/pglite.d.ts +3 -3
- package/dist/backend/postgres/pglite.js +15 -14
- package/dist/backend/sqlite/index.cjs +24 -23
- package/dist/backend/sqlite/index.d.cts +6 -6
- package/dist/backend/sqlite/index.d.ts +6 -6
- package/dist/backend/sqlite/index.js +12 -11
- package/dist/backend/sqlite/libsql.cjs +19 -18
- package/dist/backend/sqlite/libsql.cjs.map +1 -1
- package/dist/backend/sqlite/libsql.d.cts +3 -3
- package/dist/backend/sqlite/libsql.d.ts +3 -3
- package/dist/backend/sqlite/libsql.js +14 -13
- package/dist/backend/sqlite/libsql.js.map +1 -1
- package/dist/backend/sqlite/local-store.cjs +35 -34
- package/dist/backend/sqlite/local-store.cjs.map +1 -1
- package/dist/backend/sqlite/local-store.d.cts +8 -8
- package/dist/backend/sqlite/local-store.d.ts +8 -8
- package/dist/backend/sqlite/local-store.js +31 -30
- package/dist/backend/sqlite/local-store.js.map +1 -1
- package/dist/backend/sqlite/local.cjs +17 -16
- package/dist/backend/sqlite/local.d.cts +3 -3
- package/dist/backend/sqlite/local.d.ts +3 -3
- package/dist/backend/sqlite/local.js +15 -14
- package/dist/{chunk-TCT66A7N.cjs → chunk-26YKDNUD.cjs} +10 -10
- package/dist/{chunk-TCT66A7N.cjs.map → chunk-26YKDNUD.cjs.map} +1 -1
- package/dist/{chunk-QOJ2L2AD.js → chunk-3DMMGT6S.js} +3 -3
- package/dist/{chunk-QOJ2L2AD.js.map → chunk-3DMMGT6S.js.map} +1 -1
- package/dist/{chunk-ANKOXPCC.cjs → chunk-3HGRTCDU.cjs} +6 -4
- package/dist/chunk-3HGRTCDU.cjs.map +1 -0
- package/dist/{chunk-QU7QLJA4.cjs → chunk-3U5ABFDW.cjs} +26 -26
- package/dist/{chunk-QU7QLJA4.cjs.map → chunk-3U5ABFDW.cjs.map} +1 -1
- package/dist/{chunk-5PDSCELM.cjs → chunk-425IZOQ5.cjs} +11 -164
- package/dist/chunk-425IZOQ5.cjs.map +1 -0
- package/dist/{chunk-S7WIRFNS.cjs → chunk-5FBRVORR.cjs} +12 -12
- package/dist/{chunk-S7WIRFNS.cjs.map → chunk-5FBRVORR.cjs.map} +1 -1
- package/dist/{chunk-GWXXHOLU.js → chunk-5FT3TLPK.js} +11 -11
- package/dist/{chunk-GWXXHOLU.js.map → chunk-5FT3TLPK.js.map} +1 -1
- package/dist/{chunk-S3G5VLSW.js → chunk-5UMTUOM5.js} +6 -6
- package/dist/{chunk-S3G5VLSW.js.map → chunk-5UMTUOM5.js.map} +1 -1
- package/dist/{chunk-RFDEYLIK.js → chunk-6FWSNSRE.js} +7 -7
- package/dist/{chunk-RFDEYLIK.js.map → chunk-6FWSNSRE.js.map} +1 -1
- package/dist/{chunk-F36KZDFX.cjs → chunk-6JVZSOHQ.cjs} +91 -91
- package/dist/{chunk-F36KZDFX.cjs.map → chunk-6JVZSOHQ.cjs.map} +1 -1
- package/dist/chunk-6KFLYYOC.cjs +161 -0
- package/dist/chunk-6KFLYYOC.cjs.map +1 -0
- package/dist/{chunk-D6GCNNMK.cjs → chunk-6NGW27EO.cjs} +10 -10
- package/dist/{chunk-D6GCNNMK.cjs.map → chunk-6NGW27EO.cjs.map} +1 -1
- package/dist/{chunk-WHS2Y43J.js → chunk-6SWPJEYN.js} +5 -5
- package/dist/{chunk-WHS2Y43J.js.map → chunk-6SWPJEYN.js.map} +1 -1
- package/dist/{chunk-7TKNK32B.js → chunk-7SQSZN2J.js} +5 -5
- package/dist/{chunk-7TKNK32B.js.map → chunk-7SQSZN2J.js.map} +1 -1
- package/dist/{chunk-BEB4OFZF.cjs → chunk-AMMWA76F.cjs} +51 -59
- package/dist/chunk-AMMWA76F.cjs.map +1 -0
- package/dist/{chunk-PYKF7UIL.cjs → chunk-AOSSQDVO.cjs} +13 -13
- package/dist/{chunk-PYKF7UIL.cjs.map → chunk-AOSSQDVO.cjs.map} +1 -1
- package/dist/{chunk-EDHV4CBU.js → chunk-AVGUJWVX.js} +30 -10
- package/dist/chunk-AVGUJWVX.js.map +1 -0
- package/dist/{chunk-C2ZP5YS6.cjs → chunk-BCQ76AXA.cjs} +258 -153
- package/dist/chunk-BCQ76AXA.cjs.map +1 -0
- package/dist/{chunk-WA64ZSCA.cjs → chunk-BFUOME67.cjs} +11 -11
- package/dist/{chunk-WA64ZSCA.cjs.map → chunk-BFUOME67.cjs.map} +1 -1
- package/dist/{chunk-C6KE2HSQ.cjs → chunk-BR7SHKGM.cjs} +1611 -1382
- package/dist/chunk-BR7SHKGM.cjs.map +1 -0
- package/dist/{chunk-FCIZNUW5.js → chunk-CHAOFCHV.js} +3 -3
- package/dist/{chunk-FCIZNUW5.js.map → chunk-CHAOFCHV.js.map} +1 -1
- package/dist/chunk-CICO5GXD.cjs +12 -0
- package/dist/{chunk-73MWKDFK.cjs.map → chunk-CICO5GXD.cjs.map} +1 -1
- package/dist/{chunk-SXWLLQ3D.js → chunk-D5R42W5D.js} +4 -4
- package/dist/{chunk-SXWLLQ3D.js.map → chunk-D5R42W5D.js.map} +1 -1
- package/dist/{chunk-YQ4JONWE.js → chunk-DJZTXBWY.js} +342 -113
- package/dist/chunk-DJZTXBWY.js.map +1 -0
- package/dist/{chunk-BZZI7B43.cjs → chunk-DO7SAMEK.cjs} +47 -47
- package/dist/{chunk-BZZI7B43.cjs.map → chunk-DO7SAMEK.cjs.map} +1 -1
- package/dist/{chunk-2ZWM2RFH.cjs → chunk-EDN4Y4ZG.cjs} +9 -9
- package/dist/{chunk-2ZWM2RFH.cjs.map → chunk-EDN4Y4ZG.cjs.map} +1 -1
- package/dist/{chunk-E4OSGBCM.cjs → chunk-EMIB2RXD.cjs} +131 -131
- package/dist/{chunk-E4OSGBCM.cjs.map → chunk-EMIB2RXD.cjs.map} +1 -1
- package/dist/{chunk-GWUWRZXW.js → chunk-EP4RUYD6.js} +3 -3
- package/dist/{chunk-GWUWRZXW.js.map → chunk-EP4RUYD6.js.map} +1 -1
- package/dist/{chunk-LHYSY6SE.js → chunk-FNOMT74T.js} +10 -8
- package/dist/chunk-FNOMT74T.js.map +1 -0
- package/dist/{chunk-ZBVZ7HXD.cjs → chunk-FQPEMEWX.cjs} +12 -12
- package/dist/{chunk-ZBVZ7HXD.cjs.map → chunk-FQPEMEWX.cjs.map} +1 -1
- package/dist/{chunk-LNIWCQR4.js → chunk-GLHXM7C4.js} +3 -3
- package/dist/{chunk-LNIWCQR4.js.map → chunk-GLHXM7C4.js.map} +1 -1
- package/dist/{chunk-6BD6ZBKT.cjs → chunk-GYEG3ZLZ.cjs} +10 -10
- package/dist/{chunk-6BD6ZBKT.cjs.map → chunk-GYEG3ZLZ.cjs.map} +1 -1
- package/dist/{chunk-XBHRKLZU.cjs → chunk-GYUJZARH.cjs} +4 -4
- package/dist/{chunk-XBHRKLZU.cjs.map → chunk-GYUJZARH.cjs.map} +1 -1
- package/dist/{chunk-A7NMUYEL.cjs → chunk-HDL2ARHX.cjs} +27 -27
- package/dist/{chunk-A7NMUYEL.cjs.map → chunk-HDL2ARHX.cjs.map} +1 -1
- package/dist/{chunk-5ZJOB5YS.js → chunk-HEV35TGT.js} +4 -4
- package/dist/{chunk-5ZJOB5YS.js.map → chunk-HEV35TGT.js.map} +1 -1
- package/dist/{chunk-UTVQPZPN.cjs → chunk-I4G3SQPF.cjs} +20 -20
- package/dist/{chunk-UTVQPZPN.cjs.map → chunk-I4G3SQPF.cjs.map} +1 -1
- package/dist/{chunk-JCNTKRAK.js → chunk-JONXFAPO.js} +5 -5
- package/dist/{chunk-JCNTKRAK.js.map → chunk-JONXFAPO.js.map} +1 -1
- package/dist/{chunk-GVAMRRZR.cjs → chunk-JR6SX5RH.cjs} +4 -4
- package/dist/{chunk-GVAMRRZR.cjs.map → chunk-JR6SX5RH.cjs.map} +1 -1
- package/dist/{chunk-N3QTGPC7.cjs → chunk-KABFHAL7.cjs} +100 -99
- package/dist/chunk-KABFHAL7.cjs.map +1 -0
- package/dist/{chunk-KXSMF6PL.js → chunk-KH7XW7VV.js} +20 -12
- package/dist/chunk-KH7XW7VV.js.map +1 -0
- package/dist/{chunk-EDJDDY6H.js → chunk-KKBDXCLQ.js} +4 -4
- package/dist/{chunk-EDJDDY6H.js.map → chunk-KKBDXCLQ.js.map} +1 -1
- package/dist/{chunk-ZHOAZD7Q.cjs → chunk-L3LQNR34.cjs} +161 -161
- package/dist/{chunk-ZHOAZD7Q.cjs.map → chunk-L3LQNR34.cjs.map} +1 -1
- package/dist/{chunk-IHRDX7K6.js → chunk-LEWHMOUY.js} +46 -56
- package/dist/chunk-LEWHMOUY.js.map +1 -0
- package/dist/{chunk-AF3TWL5C.cjs → chunk-LRQKXRXO.cjs} +4 -4
- package/dist/{chunk-AF3TWL5C.cjs.map → chunk-LRQKXRXO.cjs.map} +1 -1
- package/dist/{chunk-WYFB7BN3.js → chunk-M35DF33T.js} +143 -38
- package/dist/chunk-M35DF33T.js.map +1 -0
- package/dist/{chunk-32UETY6S.cjs → chunk-MFZR4QKM.cjs} +30 -28
- package/dist/chunk-MFZR4QKM.cjs.map +1 -0
- package/dist/chunk-MKJ4KXL5.cjs +12 -0
- package/dist/{chunk-6LAXM4J2.cjs.map → chunk-MKJ4KXL5.cjs.map} +1 -1
- package/dist/{chunk-KCH7WQA5.cjs → chunk-MRDBBHIZ.cjs} +48 -2
- package/dist/chunk-MRDBBHIZ.cjs.map +1 -0
- package/dist/{chunk-QPOQX2DI.cjs → chunk-MX4DHSQP.cjs} +1023 -360
- package/dist/chunk-MX4DHSQP.cjs.map +1 -0
- package/dist/{chunk-FXNHZFZV.js → chunk-MYKHJI2J.js} +3 -3
- package/dist/{chunk-FXNHZFZV.js.map → chunk-MYKHJI2J.js.map} +1 -1
- package/dist/{chunk-DSAWGCMP.js → chunk-NAZ2RA4L.js} +3 -3
- package/dist/{chunk-DSAWGCMP.js.map → chunk-NAZ2RA4L.js.map} +1 -1
- package/dist/{chunk-R7EWHKID.js → chunk-NG2RB5WL.js} +4 -145
- package/dist/chunk-NG2RB5WL.js.map +1 -0
- package/dist/{chunk-A2LJG5GM.js → chunk-NNQ6A3RM.js} +803 -143
- package/dist/chunk-NNQ6A3RM.js.map +1 -0
- package/dist/{chunk-72WUT4GG.js → chunk-NVY5CJFP.js} +4 -4
- package/dist/{chunk-72WUT4GG.js.map → chunk-NVY5CJFP.js.map} +1 -1
- package/dist/{chunk-ZIH42CRX.cjs → chunk-OI2GQ25X.cjs} +7 -7
- package/dist/{chunk-ZIH42CRX.cjs.map → chunk-OI2GQ25X.cjs.map} +1 -1
- package/dist/{chunk-A4R3H7RU.cjs → chunk-OIFSOPSR.cjs} +259 -238
- package/dist/chunk-OIFSOPSR.cjs.map +1 -0
- package/dist/{chunk-AU3IJNNP.js → chunk-OMZ37BM2.js} +5 -5
- package/dist/{chunk-AU3IJNNP.js.map → chunk-OMZ37BM2.js.map} +1 -1
- package/dist/{chunk-C4DYN2SD.cjs → chunk-OORXGFL5.cjs} +48 -48
- package/dist/{chunk-C4DYN2SD.cjs.map → chunk-OORXGFL5.cjs.map} +1 -1
- package/dist/{chunk-BRN3RGD2.js → chunk-OVI7IXYX.js} +3 -3
- package/dist/{chunk-BRN3RGD2.js.map → chunk-OVI7IXYX.js.map} +1 -1
- package/dist/{chunk-WMKEGJG4.js → chunk-P6YLZTRE.js} +3 -3
- package/dist/{chunk-WMKEGJG4.js.map → chunk-P6YLZTRE.js.map} +1 -1
- package/dist/{chunk-AT3MLMJV.js → chunk-QS3NQZVC.js} +82 -16
- package/dist/chunk-QS3NQZVC.js.map +1 -0
- package/dist/{chunk-EJSYWAEV.js → chunk-QTD6HX4O.js} +5 -5
- package/dist/{chunk-EJSYWAEV.js.map → chunk-QTD6HX4O.js.map} +1 -1
- package/dist/{chunk-JL5UEBWT.cjs → chunk-ROR5ZR6A.cjs} +45 -45
- package/dist/{chunk-JL5UEBWT.cjs.map → chunk-ROR5ZR6A.cjs.map} +1 -1
- package/dist/{chunk-FSLTU57P.js → chunk-SDBBMD4N.js} +3 -3
- package/dist/{chunk-FSLTU57P.js.map → chunk-SDBBMD4N.js.map} +1 -1
- package/dist/{chunk-WEJHA7AD.js → chunk-SE6EGQSD.js} +78 -16
- package/dist/chunk-SE6EGQSD.js.map +1 -0
- package/dist/{chunk-36LIJXWC.js → chunk-SHFBB23Q.js} +4 -4
- package/dist/{chunk-36LIJXWC.js.map → chunk-SHFBB23Q.js.map} +1 -1
- package/dist/{chunk-FA6Z7B5L.js → chunk-SHSSRCFR.js} +5 -3
- package/dist/chunk-SHSSRCFR.js.map +1 -0
- package/dist/{chunk-KOAI3KIV.cjs → chunk-TZEGUG6D.cjs} +4 -4
- package/dist/{chunk-KOAI3KIV.cjs.map → chunk-TZEGUG6D.cjs.map} +1 -1
- package/dist/{chunk-HNYLMPQQ.cjs → chunk-U5EDAVOJ.cjs} +140 -74
- package/dist/chunk-U5EDAVOJ.cjs.map +1 -0
- package/dist/{chunk-RHDOAQCT.cjs → chunk-UPAJHMW3.cjs} +122 -114
- package/dist/chunk-UPAJHMW3.cjs.map +1 -0
- package/dist/{chunk-BQM5P2NO.cjs → chunk-WGX7JH7E.cjs} +235 -170
- package/dist/chunk-WGX7JH7E.cjs.map +1 -0
- package/dist/{chunk-DYPRZ53S.cjs → chunk-WODMN3Q2.cjs} +27 -27
- package/dist/{chunk-DYPRZ53S.cjs.map → chunk-WODMN3Q2.cjs.map} +1 -1
- package/dist/{chunk-OZJCH7ZS.js → chunk-XVWOYKIK.js} +3 -3
- package/dist/{chunk-OZJCH7ZS.js.map → chunk-XVWOYKIK.js.map} +1 -1
- package/dist/chunk-XY5OMOJD.js +147 -0
- package/dist/chunk-XY5OMOJD.js.map +1 -0
- package/dist/{chunk-KA4L2NZ3.js → chunk-XYBQI6LE.js} +14 -14
- package/dist/{chunk-KA4L2NZ3.js.map → chunk-XYBQI6LE.js.map} +1 -1
- package/dist/{chunk-EAMVXR5B.js → chunk-ZDKTPBGV.js} +4 -4
- package/dist/{chunk-EAMVXR5B.js.map → chunk-ZDKTPBGV.js.map} +1 -1
- package/dist/{chunk-Z43KWLZF.js → chunk-ZHNXLS3C.js} +9 -8
- package/dist/chunk-ZHNXLS3C.js.map +1 -0
- package/dist/{chunk-62ZXBMSD.js → chunk-ZLONH2UD.js} +46 -3
- package/dist/chunk-ZLONH2UD.js.map +1 -0
- package/dist/core/index.cjs +28 -27
- package/dist/core/index.d.cts +4 -4
- package/dist/core/index.d.ts +4 -4
- package/dist/core/index.js +8 -7
- package/dist/{ddl-opIn8DfX.d.ts → ddl-CprnMXJ-.d.ts} +3 -3
- package/dist/{ddl-mE07h_EM.d.cts → ddl-DJA7Lci5.d.cts} +3 -3
- package/dist/graph-extension/index.cjs +20 -20
- package/dist/graph-extension/index.d.cts +4 -4
- package/dist/graph-extension/index.d.ts +4 -4
- package/dist/graph-extension/index.js +4 -4
- package/dist/graph-merge/index.cjs +3204 -635
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +502 -60
- package/dist/graph-merge/index.d.ts +502 -60
- package/dist/graph-merge/index.js +2979 -427
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/{index-Deyu8IXL.d.ts → index-CHTv4XMZ.d.cts} +47 -3
- package/dist/{index-DrRS51Ld.d.cts → index-CzoJ3MUw.d.ts} +47 -3
- package/dist/index.cjs +229 -216
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +35 -34
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.cjs +13 -13
- package/dist/indexes/index.d.cts +4 -4
- package/dist/indexes/index.d.ts +4 -4
- package/dist/indexes/index.js +6 -6
- package/dist/interchange/index.cjs +53 -52
- package/dist/interchange/index.cjs.map +1 -1
- package/dist/interchange/index.d.cts +17 -13
- package/dist/interchange/index.d.ts +17 -13
- package/dist/interchange/index.js +17 -16
- package/dist/interchange/index.js.map +1 -1
- package/dist/{manager-DX983gJ0.d.ts → manager-B6sOQzcQ.d.ts} +2 -2
- package/dist/{manager-ptr3JLRP.d.cts → manager-DlY1vlla.d.cts} +2 -2
- package/dist/{materialize-indexes-CpXoggWU.d.ts → materialize-indexes-DQL4xcpf.d.ts} +1 -1
- package/dist/{materialize-indexes-BXz77YqO.d.cts → materialize-indexes-sskhp-c_.d.cts} +1 -1
- package/dist/{postgres-DwgEXSPI.d.cts → postgres-B6YOUcaK.d.ts} +1 -1
- package/dist/{postgres-QdOMHTBz.d.ts → postgres-BXy_nyMs.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 +43 -42
- 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 +10 -9
- package/dist/provenance/index.js.map +1 -1
- package/dist/schema/index.cjs +45 -44
- package/dist/schema/index.d.cts +6 -6
- package/dist/schema/index.d.ts +6 -6
- package/dist/schema/index.js +18 -17
- package/dist/{searchable-BrUh0pdc.d.cts → searchable-0Cn_lY8U.d.cts} +1 -1
- package/dist/{searchable-BOUuA83f.d.ts → searchable-D9gMiwcS.d.ts} +1 -1
- package/dist/{sqlite-BfYcV61E.d.cts → sqlite-ClXuBYAj.d.ts} +1 -1
- package/dist/{sqlite-DK40XVR1.d.ts → sqlite-DioSxaPe.d.cts} +1 -1
- package/dist/{store-Bo1psfVZ.d.ts → store-5j-w5onJ.d.ts} +120 -71
- package/dist/{store-FTqBpuJD.d.cts → store-CFedKGU5.d.cts} +120 -71
- package/dist/{temporal-CXewwLTB.d.cts → temporal-Ce1pG0S1.d.cts} +1 -1
- package/dist/{temporal-DPtn0HOu.d.ts → temporal-CjO9FH1l.d.ts} +1 -1
- package/dist/{types-CeT7xM4M.d.ts → types-BrdOFu48.d.ts} +1 -1
- package/dist/{types-Du78EvpN.d.ts → types-DKkMJZjR.d.cts} +32 -6
- package/dist/{types-Du78EvpN.d.cts → types-DKkMJZjR.d.ts} +32 -6
- package/dist/{types-XR1nHERK.d.cts → types-oj_OGAaZ.d.cts} +1 -1
- package/dist/{where-CMbFiWwp.d.ts → where-C8w2627G.d.ts} +1 -1
- package/dist/{where-CJsp-YUf.d.cts → where-D1wKCJ4Q.d.cts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-32UETY6S.cjs.map +0 -1
- package/dist/chunk-5PDSCELM.cjs.map +0 -1
- package/dist/chunk-62ZXBMSD.js.map +0 -1
- package/dist/chunk-6LAXM4J2.cjs +0 -12
- package/dist/chunk-73MWKDFK.cjs +0 -12
- package/dist/chunk-A2LJG5GM.js.map +0 -1
- package/dist/chunk-A4R3H7RU.cjs.map +0 -1
- package/dist/chunk-ANKOXPCC.cjs.map +0 -1
- package/dist/chunk-AT3MLMJV.js.map +0 -1
- package/dist/chunk-BEB4OFZF.cjs.map +0 -1
- package/dist/chunk-BQM5P2NO.cjs.map +0 -1
- package/dist/chunk-C2ZP5YS6.cjs.map +0 -1
- package/dist/chunk-C6KE2HSQ.cjs.map +0 -1
- package/dist/chunk-EDHV4CBU.js.map +0 -1
- package/dist/chunk-FA6Z7B5L.js.map +0 -1
- package/dist/chunk-HNYLMPQQ.cjs.map +0 -1
- package/dist/chunk-IHRDX7K6.js.map +0 -1
- package/dist/chunk-KCH7WQA5.cjs.map +0 -1
- package/dist/chunk-KXSMF6PL.js.map +0 -1
- package/dist/chunk-LHYSY6SE.js.map +0 -1
- package/dist/chunk-N3QTGPC7.cjs.map +0 -1
- package/dist/chunk-QPOQX2DI.cjs.map +0 -1
- package/dist/chunk-R7EWHKID.js.map +0 -1
- package/dist/chunk-RHDOAQCT.cjs.map +0 -1
- package/dist/chunk-WEJHA7AD.js.map +0 -1
- package/dist/chunk-WYFB7BN3.js.map +0 -1
- package/dist/chunk-YQ4JONWE.js.map +0 -1
- package/dist/chunk-Z43KWLZF.js.map +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkMFZR4QKM_cjs = require('./chunk-MFZR4QKM.cjs');
|
|
4
|
+
var chunkMX4DHSQP_cjs = require('./chunk-MX4DHSQP.cjs');
|
|
5
|
+
var chunkOIFSOPSR_cjs = require('./chunk-OIFSOPSR.cjs');
|
|
6
6
|
var chunkPWLJ77UV_cjs = require('./chunk-PWLJ77UV.cjs');
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
7
|
+
var chunk3U5ABFDW_cjs = require('./chunk-3U5ABFDW.cjs');
|
|
8
|
+
var chunk3HGRTCDU_cjs = require('./chunk-3HGRTCDU.cjs');
|
|
9
|
+
var chunkFQPEMEWX_cjs = require('./chunk-FQPEMEWX.cjs');
|
|
10
|
+
var chunk425IZOQ5_cjs = require('./chunk-425IZOQ5.cjs');
|
|
11
|
+
var chunkL3LQNR34_cjs = require('./chunk-L3LQNR34.cjs');
|
|
12
|
+
var chunkEDN4Y4ZG_cjs = require('./chunk-EDN4Y4ZG.cjs');
|
|
13
13
|
var chunkHAHNRASW_cjs = require('./chunk-HAHNRASW.cjs');
|
|
14
|
-
var
|
|
15
|
-
var
|
|
14
|
+
var chunk6NGW27EO_cjs = require('./chunk-6NGW27EO.cjs');
|
|
15
|
+
var chunkMRDBBHIZ_cjs = require('./chunk-MRDBBHIZ.cjs');
|
|
16
16
|
var chunkA7J2YDDI_cjs = require('./chunk-A7J2YDDI.cjs');
|
|
17
17
|
var chunkN66HCGCY_cjs = require('./chunk-N66HCGCY.cjs');
|
|
18
18
|
|
|
@@ -21,8 +21,8 @@ function nullToUndefined(value) {
|
|
|
21
21
|
return value === null ? void 0 : value;
|
|
22
22
|
}
|
|
23
23
|
function rowToNode(row) {
|
|
24
|
-
const rawProps =
|
|
25
|
-
const props =
|
|
24
|
+
const rawProps = chunk3HGRTCDU_cjs.rowPropsToObject(row.props);
|
|
25
|
+
const props = chunk6NGW27EO_cjs.filterReservedKeys(rawProps, chunk6NGW27EO_cjs.RESERVED_NODE_KEYS);
|
|
26
26
|
return {
|
|
27
27
|
kind: row.kind,
|
|
28
28
|
id: row.id,
|
|
@@ -41,8 +41,8 @@ function rowToNodeMeta(row) {
|
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
function rowToEdge(row) {
|
|
44
|
-
const rawProps =
|
|
45
|
-
const props =
|
|
44
|
+
const rawProps = chunk3HGRTCDU_cjs.rowPropsToObject(row.props);
|
|
45
|
+
const props = chunk6NGW27EO_cjs.filterReservedKeys(rawProps, chunk6NGW27EO_cjs.RESERVED_EDGE_KEYS);
|
|
46
46
|
return {
|
|
47
47
|
id: row.id,
|
|
48
48
|
kind: row.kind,
|
|
@@ -73,7 +73,7 @@ function nodeWriteNeedsConstraintFence(registry, kind, uniqueConstraints, operat
|
|
|
73
73
|
return "nodeDisjointness";
|
|
74
74
|
}
|
|
75
75
|
const sharedScope = uniqueConstraints.some(
|
|
76
|
-
(constraint) =>
|
|
76
|
+
(constraint) => chunkFQPEMEWX_cjs.getKindsForUniquenessCheck(kind, constraint.scope, registry).length > 1
|
|
77
77
|
);
|
|
78
78
|
return sharedScope ? "nodeUniquenessScope" : void 0;
|
|
79
79
|
}
|
|
@@ -82,7 +82,7 @@ async function checkDisjointnessConstraint(ctx, kind, id) {
|
|
|
82
82
|
for (const disjointKind of disjointKinds) {
|
|
83
83
|
const existing = await ctx.backend.getNode(ctx.graphId, disjointKind, id);
|
|
84
84
|
if (existing && !existing.deleted_at) {
|
|
85
|
-
const error =
|
|
85
|
+
const error = chunkFQPEMEWX_cjs.checkDisjointness(id, kind, [disjointKind], ctx.registry);
|
|
86
86
|
if (error) throw error;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
@@ -99,7 +99,7 @@ async function checkCardinalityConstraint(ctx, edgeKind, cardinality, fromKind,
|
|
|
99
99
|
fromKind,
|
|
100
100
|
fromId
|
|
101
101
|
});
|
|
102
|
-
const error =
|
|
102
|
+
const error = chunkFQPEMEWX_cjs.checkCardinality(
|
|
103
103
|
edgeKind,
|
|
104
104
|
fromKind,
|
|
105
105
|
fromId,
|
|
@@ -119,7 +119,7 @@ async function checkCardinalityConstraint(ctx, edgeKind, cardinality, fromKind,
|
|
|
119
119
|
toKind,
|
|
120
120
|
toId
|
|
121
121
|
});
|
|
122
|
-
const error =
|
|
122
|
+
const error = chunkFQPEMEWX_cjs.checkUniqueEdge(
|
|
123
123
|
edgeKind,
|
|
124
124
|
fromKind,
|
|
125
125
|
fromId,
|
|
@@ -141,7 +141,7 @@ async function checkCardinalityConstraint(ctx, edgeKind, cardinality, fromKind,
|
|
|
141
141
|
fromId,
|
|
142
142
|
activeOnly: true
|
|
143
143
|
});
|
|
144
|
-
const error =
|
|
144
|
+
const error = chunkFQPEMEWX_cjs.checkCardinality(
|
|
145
145
|
edgeKind,
|
|
146
146
|
fromKind,
|
|
147
147
|
fromId,
|
|
@@ -155,6 +155,38 @@ async function checkCardinalityConstraint(ctx, edgeKind, cardinality, fromKind,
|
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
+
// src/store/validity-end.ts
|
|
159
|
+
function assertValidityEndMutation(input, context) {
|
|
160
|
+
if (input.validTo === void 0 || input.clearValidTo !== true) return;
|
|
161
|
+
throw new chunkMRDBBHIZ_cjs.ValidationError(
|
|
162
|
+
'"validTo" and "clearValidTo" are mutually exclusive',
|
|
163
|
+
{
|
|
164
|
+
...context,
|
|
165
|
+
operation: "update",
|
|
166
|
+
issues: [
|
|
167
|
+
{
|
|
168
|
+
path: "clearValidTo",
|
|
169
|
+
message: 'Pass either "validTo" or "clearValidTo", not both'
|
|
170
|
+
}
|
|
171
|
+
]
|
|
172
|
+
}
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
function validityEndAfterMutation(input, current) {
|
|
176
|
+
if (input.clearValidTo === true) return void 0;
|
|
177
|
+
return input.validTo ?? current;
|
|
178
|
+
}
|
|
179
|
+
function assertClearValidToSupported(backend, entityType) {
|
|
180
|
+
if (backend.capabilities.clearValidTo === true) return;
|
|
181
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
182
|
+
`This backend does not support clearing ${entityType} validTo`,
|
|
183
|
+
{
|
|
184
|
+
code: "CLEAR_VALID_TO_UNSUPPORTED",
|
|
185
|
+
entityType
|
|
186
|
+
}
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
|
|
158
190
|
// src/store/operations/already-exists.ts
|
|
159
191
|
var ENTITY_LABELS = {
|
|
160
192
|
node: { title: "Node", article: "A node" },
|
|
@@ -162,7 +194,7 @@ var ENTITY_LABELS = {
|
|
|
162
194
|
};
|
|
163
195
|
function alreadyExistsError(entity, kind, id, detail, cause) {
|
|
164
196
|
const label = ENTITY_LABELS[entity];
|
|
165
|
-
return new
|
|
197
|
+
return new chunkMRDBBHIZ_cjs.ValidationError(
|
|
166
198
|
`${label.title} already exists: ${detail}`,
|
|
167
199
|
{
|
|
168
200
|
entityType: entity,
|
|
@@ -172,7 +204,7 @@ function alreadyExistsError(entity, kind, id, detail, cause) {
|
|
|
172
204
|
issues: [
|
|
173
205
|
{
|
|
174
206
|
path: "id",
|
|
175
|
-
code:
|
|
207
|
+
code: chunkMRDBBHIZ_cjs.ENTITY_ALREADY_EXISTS_CODE,
|
|
176
208
|
message: `${label.article} with this ID already exists`
|
|
177
209
|
}
|
|
178
210
|
]
|
|
@@ -187,7 +219,7 @@ function createAlreadyExistsError(entity, kind, id) {
|
|
|
187
219
|
return alreadyExistsError(entity, kind, id, `${kind}/${id}`, void 0);
|
|
188
220
|
}
|
|
189
221
|
function isDuplicateKeyInsertError(error, entity) {
|
|
190
|
-
return error instanceof
|
|
222
|
+
return error instanceof chunkMRDBBHIZ_cjs.DatabaseOperationError && error.details.operation === "insert" && error.details.entity === entity && error.details.reason === "duplicate_key";
|
|
191
223
|
}
|
|
192
224
|
function rethrowAsAlreadyExists(error, entity) {
|
|
193
225
|
if (!isDuplicateKeyInsertError(error, entity)) throw error;
|
|
@@ -221,9 +253,9 @@ async function withAlreadyExistsTranslation(entity, run) {
|
|
|
221
253
|
|
|
222
254
|
// src/store/operations/node-operations.ts
|
|
223
255
|
function getNodeRegistration(graph, kind) {
|
|
224
|
-
if (!chunkN66HCGCY_cjs.hasOwnKey(graph.nodes, kind)) throw new
|
|
256
|
+
if (!chunkN66HCGCY_cjs.hasOwnKey(graph.nodes, kind)) throw new chunkMRDBBHIZ_cjs.KindNotFoundError(kind, "node");
|
|
225
257
|
const registration = graph.nodes[kind];
|
|
226
|
-
if (registration === void 0) throw new
|
|
258
|
+
if (registration === void 0) throw new chunkMRDBBHIZ_cjs.KindNotFoundError(kind, "node");
|
|
227
259
|
return registration;
|
|
228
260
|
}
|
|
229
261
|
function nodeFencesConstraintProbe(ctx, kind, operation) {
|
|
@@ -243,10 +275,10 @@ function nodeBatchFencesConstraintProbe(ctx, inputs, operation) {
|
|
|
243
275
|
return void 0;
|
|
244
276
|
}
|
|
245
277
|
function buildNodeCacheKey(graphId, kind, id) {
|
|
246
|
-
return
|
|
278
|
+
return chunkMX4DHSQP_cjs.encodeTupleKey([graphId, kind, id]);
|
|
247
279
|
}
|
|
248
280
|
function buildUniqueCacheKey(graphId, nodeKind, constraintName, key) {
|
|
249
|
-
return
|
|
281
|
+
return chunkMX4DHSQP_cjs.encodeTupleKey([graphId, nodeKind, constraintName, key]);
|
|
250
282
|
}
|
|
251
283
|
function buildInsertNodeParams(graphId, kind, id, props, validFrom, validTo) {
|
|
252
284
|
const insertParams = {
|
|
@@ -277,7 +309,7 @@ function resolveConstraint(graph, kind, constraintName) {
|
|
|
277
309
|
(candidate) => candidate.name === constraintName
|
|
278
310
|
);
|
|
279
311
|
if (constraint === void 0) {
|
|
280
|
-
throw new
|
|
312
|
+
throw new chunkMRDBBHIZ_cjs.NodeConstraintNotFoundError(constraintName, kind);
|
|
281
313
|
}
|
|
282
314
|
return constraint;
|
|
283
315
|
}
|
|
@@ -338,8 +370,8 @@ function createNodeBatchValidationBackend(graphId, registry, backend) {
|
|
|
338
370
|
}
|
|
339
371
|
function registerPendingUniqueEntries(kind, id, props, constraints) {
|
|
340
372
|
for (const constraint of constraints) {
|
|
341
|
-
if (!
|
|
342
|
-
const key =
|
|
373
|
+
if (!chunkFQPEMEWX_cjs.checkWherePredicate(constraint, props)) continue;
|
|
374
|
+
const key = chunkFQPEMEWX_cjs.computeUniqueKey(
|
|
343
375
|
props,
|
|
344
376
|
constraint.fields,
|
|
345
377
|
constraint.collation
|
|
@@ -352,7 +384,7 @@ function createNodeBatchValidationBackend(graphId, registry, backend) {
|
|
|
352
384
|
);
|
|
353
385
|
pendingUniqueOwners.set(concreteEntryKey, id);
|
|
354
386
|
if (constraint.scope !== "kind") {
|
|
355
|
-
const kindsToCheck =
|
|
387
|
+
const kindsToCheck = chunkFQPEMEWX_cjs.getKindsForUniquenessCheck(
|
|
356
388
|
kind,
|
|
357
389
|
constraint.scope,
|
|
358
390
|
registry
|
|
@@ -371,12 +403,12 @@ function createNodeBatchValidationBackend(graphId, registry, backend) {
|
|
|
371
403
|
}
|
|
372
404
|
function registerAppliedNodeUpdate(kind, id, oldProps, newProps, constraints) {
|
|
373
405
|
for (const constraint of constraints) {
|
|
374
|
-
const oldApplies =
|
|
375
|
-
const newApplies =
|
|
376
|
-
const oldKey = oldApplies ?
|
|
377
|
-
const newKey = newApplies ?
|
|
406
|
+
const oldApplies = chunkFQPEMEWX_cjs.checkWherePredicate(constraint, oldProps);
|
|
407
|
+
const newApplies = chunkFQPEMEWX_cjs.checkWherePredicate(constraint, newProps);
|
|
408
|
+
const oldKey = oldApplies ? chunkFQPEMEWX_cjs.computeUniqueKey(oldProps, constraint.fields, constraint.collation) : void 0;
|
|
409
|
+
const newKey = newApplies ? chunkFQPEMEWX_cjs.computeUniqueKey(newProps, constraint.fields, constraint.collation) : void 0;
|
|
378
410
|
if (oldKey === newKey) continue;
|
|
379
|
-
const kindsToCheck =
|
|
411
|
+
const kindsToCheck = chunkFQPEMEWX_cjs.getKindsForUniquenessCheck(
|
|
380
412
|
kind,
|
|
381
413
|
constraint.scope,
|
|
382
414
|
registry
|
|
@@ -416,7 +448,7 @@ function createNodeBatchValidationBackend(graphId, registry, backend) {
|
|
|
416
448
|
if (uniqueCache.has(cacheKey)) return;
|
|
417
449
|
uniqueCache.set(cacheKey, row);
|
|
418
450
|
}
|
|
419
|
-
const validationBackend =
|
|
451
|
+
const validationBackend = chunk3HGRTCDU_cjs.createBackendOverlay(backend, {
|
|
420
452
|
getNode: getNodeCached,
|
|
421
453
|
checkUnique: checkUniqueCached
|
|
422
454
|
});
|
|
@@ -433,16 +465,16 @@ function draftNodeCreate(ctx, input, id, options) {
|
|
|
433
465
|
const kind = input.kind;
|
|
434
466
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
435
467
|
const nodeKind = registration.type;
|
|
436
|
-
const validatedProps = options?.propsPreValidated === true ? input.props :
|
|
468
|
+
const validatedProps = options?.propsPreValidated === true ? input.props : chunkMX4DHSQP_cjs.validateNodeProps(nodeKind.schema, input.props, {
|
|
437
469
|
kind,
|
|
438
470
|
operation: "create"
|
|
439
471
|
});
|
|
440
|
-
const validFrom =
|
|
472
|
+
const validFrom = chunk425IZOQ5_cjs.validateOptionalCanonicalIsoDate(
|
|
441
473
|
input.validFrom,
|
|
442
474
|
"validFrom"
|
|
443
475
|
);
|
|
444
|
-
const validTo =
|
|
445
|
-
|
|
476
|
+
const validTo = chunk425IZOQ5_cjs.validateOptionalCanonicalIsoDate(input.validTo, "validTo");
|
|
477
|
+
chunk425IZOQ5_cjs.assertOrderedValidityWindow(`${kind} "${id}"`, validFrom, validTo);
|
|
446
478
|
return {
|
|
447
479
|
kind,
|
|
448
480
|
id,
|
|
@@ -466,8 +498,8 @@ async function finishNodeCreatePreparation(ctx, draft, backend) {
|
|
|
466
498
|
backend
|
|
467
499
|
};
|
|
468
500
|
await checkDisjointnessConstraint(constraintContext, kind, id);
|
|
469
|
-
await
|
|
470
|
-
|
|
501
|
+
await chunkMFZR4QKM_cjs.checkUniquenessConstraints(
|
|
502
|
+
chunkMFZR4QKM_cjs.createUniquenessContext(ctx.graphId, ctx.registry, backend),
|
|
471
503
|
kind,
|
|
472
504
|
id,
|
|
473
505
|
validatedProps,
|
|
@@ -499,8 +531,8 @@ async function validateAndPrepareNodeCreate(ctx, input, id, backend, options) {
|
|
|
499
531
|
);
|
|
500
532
|
}
|
|
501
533
|
async function finalizeNodeCreateBatch(ctx, preparedCreates, backend, lock) {
|
|
502
|
-
await
|
|
503
|
-
|
|
534
|
+
await chunkMFZR4QKM_cjs.applyNodeInsertSideEffectsBatch(
|
|
535
|
+
chunkMFZR4QKM_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
|
|
504
536
|
preparedCreates.map((prepared) => ({
|
|
505
537
|
kind: prepared.kind,
|
|
506
538
|
id: prepared.id,
|
|
@@ -515,8 +547,8 @@ function foldReferences(preparedCreates) {
|
|
|
515
547
|
return preparedCreates.filter((prepared) => prepared.idProvided).map((prepared) => ({ kind: prepared.kind, id: prepared.id }));
|
|
516
548
|
}
|
|
517
549
|
async function finalizeNodeCreate(ctx, prepared, backend, lock) {
|
|
518
|
-
await
|
|
519
|
-
|
|
550
|
+
await chunkMFZR4QKM_cjs.applyNodeInsertSideEffects(
|
|
551
|
+
chunkMFZR4QKM_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
|
|
520
552
|
{
|
|
521
553
|
kind: prepared.kind,
|
|
522
554
|
id: prepared.id,
|
|
@@ -529,7 +561,7 @@ async function finalizeNodeCreate(ctx, prepared, backend, lock) {
|
|
|
529
561
|
}
|
|
530
562
|
function computeNodeUpdate(ctx, kind, id, existingProps, inputProps) {
|
|
531
563
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
532
|
-
const validatedProps =
|
|
564
|
+
const validatedProps = chunkMX4DHSQP_cjs.validateNodeProps(
|
|
533
565
|
registration.type.schema,
|
|
534
566
|
{ ...existingProps, ...inputProps },
|
|
535
567
|
{ kind, operation: "update", id }
|
|
@@ -537,7 +569,7 @@ function computeNodeUpdate(ctx, kind, id, existingProps, inputProps) {
|
|
|
537
569
|
return { registration, validatedProps };
|
|
538
570
|
}
|
|
539
571
|
function resolveNodeUpdateProps(ctx, existing, inputProps) {
|
|
540
|
-
const existingProps =
|
|
572
|
+
const existingProps = chunk3HGRTCDU_cjs.rowPropsToObject(existing.props);
|
|
541
573
|
const { registration, validatedProps } = computeNodeUpdate(
|
|
542
574
|
ctx,
|
|
543
575
|
existing.kind,
|
|
@@ -562,23 +594,24 @@ function nodeUpsertDirtyCheck(ctx, kind, id, existingProps, inputProps) {
|
|
|
562
594
|
}
|
|
563
595
|
async function performNodeUpdate(ctx, input, backend, lock, options) {
|
|
564
596
|
const { kind, id } = input;
|
|
597
|
+
assertValidityEndMutation(input, { entityType: "node", kind, id });
|
|
565
598
|
const existing = await backend.getNode(ctx.graphId, kind, id);
|
|
566
|
-
if (!existing) throw new
|
|
599
|
+
if (!existing) throw new chunkMRDBBHIZ_cjs.NodeNotFoundError(kind, id);
|
|
567
600
|
const { registration, validatedProps } = resolveNodeUpdateProps(
|
|
568
601
|
ctx,
|
|
569
602
|
existing,
|
|
570
603
|
input.props
|
|
571
604
|
);
|
|
572
605
|
const nodeKind = registration.type;
|
|
573
|
-
const validTo =
|
|
574
|
-
const resurrectionInstant = options?.clearDeleted === true && existing.deleted_at !== void 0 ?
|
|
575
|
-
const preservesLiveLowerBound = resurrectionInstant === void 0 &&
|
|
576
|
-
const statedValidFrom =
|
|
606
|
+
const validTo = chunk425IZOQ5_cjs.validateOptionalCanonicalIsoDate(input.validTo, "validTo");
|
|
607
|
+
const resurrectionInstant = options?.clearDeleted === true && existing.deleted_at !== void 0 ? chunk425IZOQ5_cjs.nowIso() : void 0;
|
|
608
|
+
const preservesLiveLowerBound = resurrectionInstant === void 0 && chunk425IZOQ5_cjs.preservesImmutableLowerBound(input.onImmutableLowerBound);
|
|
609
|
+
const statedValidFrom = chunk425IZOQ5_cjs.validateOptionalCanonicalIsoDate(
|
|
577
610
|
input.validFrom,
|
|
578
611
|
"validFrom"
|
|
579
612
|
);
|
|
580
613
|
const validFrom = preservesLiveLowerBound ? void 0 : statedValidFrom;
|
|
581
|
-
const windowVerdict =
|
|
614
|
+
const windowVerdict = chunk425IZOQ5_cjs.assertWritableValidityWindow(
|
|
582
615
|
`${kind} "${id}"`,
|
|
583
616
|
validFrom,
|
|
584
617
|
resurrectionInstant === void 0 ? {
|
|
@@ -593,7 +626,7 @@ async function performNodeUpdate(ctx, input, backend, lock, options) {
|
|
|
593
626
|
},
|
|
594
627
|
validTo
|
|
595
628
|
);
|
|
596
|
-
const writeContext =
|
|
629
|
+
const writeContext = chunkMFZR4QKM_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock);
|
|
597
630
|
const effectiveValidFrom = validFrom ?? resurrectionInstant;
|
|
598
631
|
const shared = {
|
|
599
632
|
schema: nodeKind.schema,
|
|
@@ -601,6 +634,7 @@ async function performNodeUpdate(ctx, input, backend, lock, options) {
|
|
|
601
634
|
uniqueConstraints: registration.unique ?? [],
|
|
602
635
|
...effectiveValidFrom !== void 0 && { validFrom: effectiveValidFrom },
|
|
603
636
|
...validTo !== void 0 && { validTo },
|
|
637
|
+
...input.clearValidTo === true && { clearValidTo: true },
|
|
604
638
|
// The bound the verdict above READ, carried into the UPDATE's own `WHERE`
|
|
605
639
|
// so the row this writes is the row that was judged. The verdict hands over
|
|
606
640
|
// the predicate rather than a flag, so both conditions that decide it — did
|
|
@@ -614,15 +648,15 @@ async function performNodeUpdate(ctx, input, backend, lock, options) {
|
|
|
614
648
|
...windowVerdict.storedLowerBoundFence
|
|
615
649
|
};
|
|
616
650
|
if (options?.clearDeleted) {
|
|
617
|
-
const row2 = await
|
|
651
|
+
const row2 = await chunkMFZR4QKM_cjs.applyNodeUpdate(
|
|
618
652
|
writeContext,
|
|
619
653
|
{ ...shared, existing, clearDeleted: true },
|
|
620
654
|
backend
|
|
621
655
|
);
|
|
622
656
|
return rowToNode(row2);
|
|
623
657
|
}
|
|
624
|
-
if (!
|
|
625
|
-
const row = await
|
|
658
|
+
if (!chunk3HGRTCDU_cjs.isLiveNodeRow(existing)) throw new chunkMRDBBHIZ_cjs.NodeNotFoundError(kind, id);
|
|
659
|
+
const row = await chunkMFZR4QKM_cjs.applyNodeUpdate(
|
|
626
660
|
writeContext,
|
|
627
661
|
{ ...shared, existing },
|
|
628
662
|
backend
|
|
@@ -646,15 +680,15 @@ async function performNodeUpdateWithResurrectionRecovery(ctx, input, target, loc
|
|
|
646
680
|
}
|
|
647
681
|
const current = await target.getNode(ctx.graphId, input.kind, input.id);
|
|
648
682
|
if (current === void 0 || current.deleted_at !== void 0) {
|
|
649
|
-
throw new
|
|
683
|
+
throw new chunkMRDBBHIZ_cjs.NodeNotFoundError(input.kind, input.id);
|
|
650
684
|
}
|
|
651
685
|
}
|
|
652
686
|
}
|
|
653
|
-
throw new
|
|
687
|
+
throw new chunkMRDBBHIZ_cjs.NodeNotFoundError(input.kind, input.id);
|
|
654
688
|
}
|
|
655
689
|
function nodeUpdateRaceError(input, error) {
|
|
656
690
|
if (!isNodeUpdateNoRowError(error)) return error;
|
|
657
|
-
return new
|
|
691
|
+
return new chunkMRDBBHIZ_cjs.DatabaseOperationError(
|
|
658
692
|
`Node update for ${input.kind} "${input.id}" could not be applied to a stable row after ${NODE_UPDATE_ATTEMPTS} attempts: the row was removed and recreated between each read and its write. A concurrent writer is replacing this node faster than it can be read; serialize the writers, or retry.`,
|
|
659
693
|
{
|
|
660
694
|
operation: "update",
|
|
@@ -685,19 +719,19 @@ async function primeBatchValidationCaches(ctx, drafts, backend, seams) {
|
|
|
685
719
|
const groups = /* @__PURE__ */ new Map();
|
|
686
720
|
for (const draft of drafts) {
|
|
687
721
|
for (const constraint of draft.uniqueConstraints) {
|
|
688
|
-
if (!
|
|
689
|
-
const key =
|
|
722
|
+
if (!chunkFQPEMEWX_cjs.checkWherePredicate(constraint, draft.validatedProps)) continue;
|
|
723
|
+
const key = chunkFQPEMEWX_cjs.computeUniqueKey(
|
|
690
724
|
draft.validatedProps,
|
|
691
725
|
constraint.fields,
|
|
692
726
|
constraint.collation
|
|
693
727
|
);
|
|
694
|
-
const kindsToCheck =
|
|
728
|
+
const kindsToCheck = chunkFQPEMEWX_cjs.getKindsForUniquenessCheck(
|
|
695
729
|
draft.kind,
|
|
696
730
|
constraint.scope,
|
|
697
731
|
ctx.registry
|
|
698
732
|
);
|
|
699
733
|
for (const kindToCheck of kindsToCheck) {
|
|
700
|
-
const groupKey =
|
|
734
|
+
const groupKey = chunkMX4DHSQP_cjs.encodeTupleKey([kindToCheck, constraint.name]);
|
|
701
735
|
const group = groups.get(groupKey) ?? {
|
|
702
736
|
nodeKind: kindToCheck,
|
|
703
737
|
constraintName: constraint.name,
|
|
@@ -737,7 +771,7 @@ async function prepareBatchCreates(ctx, inputs, backend, options) {
|
|
|
737
771
|
seedUniqueRow
|
|
738
772
|
} = createNodeBatchValidationBackend(ctx.graphId, ctx.registry, backend);
|
|
739
773
|
const drafts = inputs.map(
|
|
740
|
-
(input) => draftNodeCreate(ctx, input, input.id ??
|
|
774
|
+
(input) => draftNodeCreate(ctx, input, input.id ?? chunkOIFSOPSR_cjs.generateId(), options)
|
|
741
775
|
);
|
|
742
776
|
await primeBatchValidationCaches(ctx, drafts, backend, {
|
|
743
777
|
seedNodeRow,
|
|
@@ -774,12 +808,12 @@ function partitionCreates(preparedCreates) {
|
|
|
774
808
|
return { inserts, resurrections };
|
|
775
809
|
}
|
|
776
810
|
function isNodeUpdateNoRowError(error) {
|
|
777
|
-
return error instanceof
|
|
811
|
+
return error instanceof chunkMRDBBHIZ_cjs.DatabaseOperationError && error.details.operation === "update" && error.details.entity === "node" && error.details.reason === "no_row_returned";
|
|
778
812
|
}
|
|
779
813
|
async function resurrectPreparedNode(ctx, target, lock, prepared) {
|
|
780
814
|
const current = await target.getNode(ctx.graphId, prepared.kind, prepared.id);
|
|
781
815
|
if (current === void 0) {
|
|
782
|
-
throw new
|
|
816
|
+
throw new chunkMRDBBHIZ_cjs.DatabaseOperationError(
|
|
783
817
|
`Node tombstone disappeared before resurrection: ${prepared.kind} ${prepared.id}`,
|
|
784
818
|
{ operation: "update", entity: "node" }
|
|
785
819
|
);
|
|
@@ -788,8 +822,8 @@ async function resurrectPreparedNode(ctx, target, lock, prepared) {
|
|
|
788
822
|
throw createAlreadyExistsError("node", prepared.kind, prepared.id);
|
|
789
823
|
}
|
|
790
824
|
try {
|
|
791
|
-
return await
|
|
792
|
-
|
|
825
|
+
return await chunkMFZR4QKM_cjs.applyNodeUpdate(
|
|
826
|
+
chunkMFZR4QKM_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
|
|
793
827
|
{
|
|
794
828
|
existing: current,
|
|
795
829
|
clearDeleted: true,
|
|
@@ -863,10 +897,10 @@ async function batchCheckUniqueAcrossKinds(backend, graphId, constraintName, uni
|
|
|
863
897
|
}
|
|
864
898
|
async function executeNodeCreateInternal(ctx, input, backend, options) {
|
|
865
899
|
const kind = input.kind;
|
|
866
|
-
const id = input.id ??
|
|
900
|
+
const id = input.id ?? chunkOIFSOPSR_cjs.generateId();
|
|
867
901
|
const opContext = ctx.createOperationContext("create", "node", kind, id);
|
|
868
902
|
const shouldReturnRow = options?.returnRow ?? true;
|
|
869
|
-
return
|
|
903
|
+
return chunkMX4DHSQP_cjs.runHookedWriteOperation(
|
|
870
904
|
ctx,
|
|
871
905
|
opContext,
|
|
872
906
|
backend,
|
|
@@ -895,8 +929,8 @@ async function executeNodeCreateInternal(ctx, input, backend, options) {
|
|
|
895
929
|
}
|
|
896
930
|
const row = await withAlreadyExistsTranslation("node", async () => {
|
|
897
931
|
if (shouldReturnRow) return target.insertNode(prepared.insertParams);
|
|
898
|
-
await
|
|
899
|
-
|
|
932
|
+
await chunkOIFSOPSR_cjs.runInsertNoReturn(
|
|
933
|
+
chunkOIFSOPSR_cjs.nodeInsertDispatch(target),
|
|
900
934
|
prepared.insertParams
|
|
901
935
|
);
|
|
902
936
|
return;
|
|
@@ -919,7 +953,7 @@ async function executeNodeCreate(ctx, input, backend, options) {
|
|
|
919
953
|
...options
|
|
920
954
|
});
|
|
921
955
|
if (!result) {
|
|
922
|
-
throw new
|
|
956
|
+
throw new chunkMRDBBHIZ_cjs.DatabaseOperationError(
|
|
923
957
|
"Node create failed: expected created node row",
|
|
924
958
|
{ operation: "insert", entity: "node" }
|
|
925
959
|
);
|
|
@@ -928,7 +962,7 @@ async function executeNodeCreate(ctx, input, backend, options) {
|
|
|
928
962
|
}
|
|
929
963
|
async function executeNodeCreateNoReturnBatch(ctx, inputs, backend) {
|
|
930
964
|
if (inputs.length === 0) return;
|
|
931
|
-
await
|
|
965
|
+
await chunkMX4DHSQP_cjs.runInWriteTransaction(
|
|
932
966
|
ctx,
|
|
933
967
|
backend,
|
|
934
968
|
async (target, lock) => {
|
|
@@ -938,8 +972,8 @@ async function executeNodeCreateNoReturnBatch(ctx, inputs, backend) {
|
|
|
938
972
|
const partition = partitionCreates(preparedCreates);
|
|
939
973
|
await withAlreadyExistsTranslation(
|
|
940
974
|
"node",
|
|
941
|
-
() =>
|
|
942
|
-
|
|
975
|
+
() => chunkOIFSOPSR_cjs.runInsertBatch(
|
|
976
|
+
chunkOIFSOPSR_cjs.nodeInsertDispatch(target),
|
|
943
977
|
partition.inserts.map((prepared) => prepared.insertParams)
|
|
944
978
|
)
|
|
945
979
|
);
|
|
@@ -962,7 +996,7 @@ async function executeNodeCreateNoReturnBatch(ctx, inputs, backend) {
|
|
|
962
996
|
}
|
|
963
997
|
async function executeNodeCreateBatch(ctx, inputs, backend, options) {
|
|
964
998
|
if (inputs.length === 0) return [];
|
|
965
|
-
return
|
|
999
|
+
return chunkMX4DHSQP_cjs.runInWriteTransaction(
|
|
966
1000
|
ctx,
|
|
967
1001
|
backend,
|
|
968
1002
|
async (target, lock) => {
|
|
@@ -977,8 +1011,8 @@ async function executeNodeCreateBatch(ctx, inputs, backend, options) {
|
|
|
977
1011
|
const partition = partitionCreates(preparedCreates);
|
|
978
1012
|
const inserted = await withAlreadyExistsTranslation(
|
|
979
1013
|
"node",
|
|
980
|
-
() =>
|
|
981
|
-
|
|
1014
|
+
() => chunkOIFSOPSR_cjs.runInsertBatchReturning(
|
|
1015
|
+
chunkOIFSOPSR_cjs.nodeInsertDispatch(target),
|
|
982
1016
|
partition.inserts.map((prepared) => prepared.insertParams)
|
|
983
1017
|
)
|
|
984
1018
|
);
|
|
@@ -991,13 +1025,13 @@ async function executeNodeCreateBatch(ctx, inputs, backend, options) {
|
|
|
991
1025
|
await finalizeNodeCreateBatch(ctx, partition.inserts, target, lock);
|
|
992
1026
|
const byReference = new Map(
|
|
993
1027
|
[...inserted, ...resurrected].map((row) => [
|
|
994
|
-
|
|
1028
|
+
chunkMX4DHSQP_cjs.refKey({ kind: row.kind, id: row.id }),
|
|
995
1029
|
row
|
|
996
1030
|
])
|
|
997
1031
|
);
|
|
998
1032
|
const rows = preparedCreates.map(
|
|
999
1033
|
(prepared) => chunkN66HCGCY_cjs.requireDefined(
|
|
1000
|
-
byReference.get(
|
|
1034
|
+
byReference.get(chunkMX4DHSQP_cjs.refKey({ kind: prepared.kind, id: prepared.id })),
|
|
1001
1035
|
`Missing written row for ${prepared.kind} ${prepared.id}`
|
|
1002
1036
|
)
|
|
1003
1037
|
);
|
|
@@ -1022,15 +1056,29 @@ async function executeNodeUpdate(ctx, input, backend, options) {
|
|
|
1022
1056
|
input.kind,
|
|
1023
1057
|
input.id
|
|
1024
1058
|
);
|
|
1025
|
-
return
|
|
1059
|
+
return chunkMX4DHSQP_cjs.runHookedWriteOperation(
|
|
1026
1060
|
ctx,
|
|
1027
1061
|
opContext,
|
|
1028
1062
|
backend,
|
|
1029
1063
|
async (target, lock) => {
|
|
1064
|
+
if (input.clearValidTo === true) {
|
|
1065
|
+
assertClearValidToSupported(backend, "node");
|
|
1066
|
+
}
|
|
1067
|
+
const validTo = chunk425IZOQ5_cjs.validateOptionalCanonicalIsoDate(
|
|
1068
|
+
input.validTo,
|
|
1069
|
+
"validTo"
|
|
1070
|
+
);
|
|
1030
1071
|
const identity = ctx.identity;
|
|
1031
|
-
if (options?.clearDeleted
|
|
1072
|
+
if (identity !== void 0 && (options?.clearDeleted === true || input.validTo !== void 0)) {
|
|
1032
1073
|
await identity.lock(target);
|
|
1033
1074
|
}
|
|
1075
|
+
if (identity !== void 0 && validTo !== void 0) {
|
|
1076
|
+
await identity.requireValidityEndCompatible(
|
|
1077
|
+
target,
|
|
1078
|
+
{ kind: input.kind, id: input.id },
|
|
1079
|
+
validTo
|
|
1080
|
+
);
|
|
1081
|
+
}
|
|
1034
1082
|
const node = await performNodeUpdateWithResurrectionRecovery(
|
|
1035
1083
|
ctx,
|
|
1036
1084
|
input,
|
|
@@ -1059,19 +1107,19 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1059
1107
|
const schema = registration.type.schema;
|
|
1060
1108
|
const uniqueConstraints = registration.unique ?? [];
|
|
1061
1109
|
if (!backend.capabilities.transactions) {
|
|
1062
|
-
throw new
|
|
1110
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
1063
1111
|
"updateWhere() requires a transactional backend so validation and sidecars are atomic",
|
|
1064
1112
|
{ code: "SET_UPDATE_TRANSACTIONS_REQUIRED", kind }
|
|
1065
1113
|
);
|
|
1066
1114
|
}
|
|
1067
1115
|
if (backend.updateNodeSet === void 0) {
|
|
1068
|
-
throw new
|
|
1116
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
1069
1117
|
"This backend does not support set-based node updates",
|
|
1070
1118
|
{ code: "SET_UPDATE_UNSUPPORTED", kind }
|
|
1071
1119
|
);
|
|
1072
1120
|
}
|
|
1073
1121
|
if (Object.keys(inputPatch).length === 0) {
|
|
1074
|
-
throw new
|
|
1122
|
+
throw new chunkMRDBBHIZ_cjs.ValidationError("updateWhere() patch must not be empty", {
|
|
1075
1123
|
entityType: "node",
|
|
1076
1124
|
kind,
|
|
1077
1125
|
operation: "update",
|
|
@@ -1082,7 +1130,7 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1082
1130
|
(property) => !Object.hasOwn(schema.shape, property)
|
|
1083
1131
|
);
|
|
1084
1132
|
if (unknownProperty !== void 0) {
|
|
1085
|
-
throw new
|
|
1133
|
+
throw new chunkMRDBBHIZ_cjs.ValidationError(
|
|
1086
1134
|
`Unknown ${kind} property in updateWhere() patch: ${unknownProperty}`,
|
|
1087
1135
|
{
|
|
1088
1136
|
entityType: "node",
|
|
@@ -1097,7 +1145,7 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1097
1145
|
}
|
|
1098
1146
|
);
|
|
1099
1147
|
}
|
|
1100
|
-
const parsedPatch =
|
|
1148
|
+
const parsedPatch = chunkMX4DHSQP_cjs.validateNodeProps(schema.partial(), inputPatch, {
|
|
1101
1149
|
kind,
|
|
1102
1150
|
operation: "update"
|
|
1103
1151
|
});
|
|
@@ -1108,11 +1156,11 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1108
1156
|
unsetProperties.push(property);
|
|
1109
1157
|
continue;
|
|
1110
1158
|
}
|
|
1111
|
-
|
|
1159
|
+
chunk6NGW27EO_cjs.assertJsonValue(value, property, `Node "${kind}" updateWhere patch`);
|
|
1112
1160
|
patch[property] = value;
|
|
1113
1161
|
}
|
|
1114
1162
|
if (Object.keys(patch).length === 0 && unsetProperties.length === 0) {
|
|
1115
|
-
throw new
|
|
1163
|
+
throw new chunkMRDBBHIZ_cjs.ValidationError(
|
|
1116
1164
|
"updateWhere() patch has no recognized properties",
|
|
1117
1165
|
{
|
|
1118
1166
|
entityType: "node",
|
|
@@ -1125,19 +1173,19 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1125
1173
|
);
|
|
1126
1174
|
}
|
|
1127
1175
|
if (uniqueConstraints.length > 0 && (backend.hardDeleteUniquesByNodeIds === void 0 || backend.insertUniqueBatch === void 0 || backend.checkUniqueBatch === void 0)) {
|
|
1128
|
-
throw new
|
|
1176
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
1129
1177
|
"updateWhere() requires batched uniqueness sidecar operations for constrained nodes",
|
|
1130
1178
|
{ code: "SET_UPDATE_UNIQUENESS_UNSUPPORTED", kind }
|
|
1131
1179
|
);
|
|
1132
1180
|
}
|
|
1133
1181
|
if (chunkHAHNRASW_cjs.getSearchableFields(schema).length > 0 && (backend.upsertFulltext === void 0 || backend.deleteFulltext === void 0 || backend.upsertFulltextBatch === void 0 || backend.deleteFulltextBatch === void 0)) {
|
|
1134
|
-
throw new
|
|
1182
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
1135
1183
|
"updateWhere() requires batched fulltext sidecar operations for searchable nodes",
|
|
1136
1184
|
{ code: "SET_UPDATE_FULLTEXT_UNSUPPORTED", kind }
|
|
1137
1185
|
);
|
|
1138
1186
|
}
|
|
1139
|
-
if (
|
|
1140
|
-
throw new
|
|
1187
|
+
if (chunkMFZR4QKM_cjs.getEmbeddingFields(schema).length > 0 && (backend.upsertEmbedding === void 0 || backend.deleteEmbedding === void 0 || backend.upsertEmbeddingBatch === void 0 || backend.deleteEmbeddingBatch === void 0)) {
|
|
1188
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
1141
1189
|
"updateWhere() requires batched vector sidecar operations for embedded nodes",
|
|
1142
1190
|
{ code: "SET_UPDATE_VECTOR_UNSUPPORTED", kind }
|
|
1143
1191
|
);
|
|
@@ -1145,32 +1193,32 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1145
1193
|
const hookContext = ctx.createBulkOperationContext("updateWhere", kind);
|
|
1146
1194
|
return ctx.withBulkOperationHooks(
|
|
1147
1195
|
hookContext,
|
|
1148
|
-
() =>
|
|
1196
|
+
() => chunkMX4DHSQP_cjs.runInWriteTransaction(
|
|
1149
1197
|
ctx,
|
|
1150
1198
|
backend,
|
|
1151
1199
|
async (target, lock) => {
|
|
1152
1200
|
const updateNodeSet = target.updateNodeSet;
|
|
1153
1201
|
if (updateNodeSet === void 0) {
|
|
1154
|
-
throw new
|
|
1202
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
1155
1203
|
"The transaction backend does not support set-based node updates",
|
|
1156
1204
|
{ code: "SET_UPDATE_UNSUPPORTED", kind }
|
|
1157
1205
|
);
|
|
1158
1206
|
}
|
|
1159
1207
|
const hardDeleteUniquesByNodeIds = target.hardDeleteUniquesByNodeIds;
|
|
1160
1208
|
if (uniqueConstraints.length > 0 && (hardDeleteUniquesByNodeIds === void 0 || target.insertUniqueBatch === void 0 || target.checkUniqueBatch === void 0)) {
|
|
1161
|
-
throw new
|
|
1209
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
1162
1210
|
"The transaction backend lacks batched uniqueness operations",
|
|
1163
1211
|
{ code: "SET_UPDATE_UNIQUENESS_UNSUPPORTED", kind }
|
|
1164
1212
|
);
|
|
1165
1213
|
}
|
|
1166
1214
|
if (chunkHAHNRASW_cjs.getSearchableFields(schema).length > 0 && (target.upsertFulltext === void 0 || target.deleteFulltext === void 0 || target.upsertFulltextBatch === void 0 || target.deleteFulltextBatch === void 0)) {
|
|
1167
|
-
throw new
|
|
1215
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
1168
1216
|
"The transaction backend lacks batched fulltext operations",
|
|
1169
1217
|
{ code: "SET_UPDATE_FULLTEXT_UNSUPPORTED", kind }
|
|
1170
1218
|
);
|
|
1171
1219
|
}
|
|
1172
|
-
if (
|
|
1173
|
-
throw new
|
|
1220
|
+
if (chunkMFZR4QKM_cjs.getEmbeddingFields(schema).length > 0 && (target.upsertEmbedding === void 0 || target.deleteEmbedding === void 0 || target.upsertEmbeddingBatch === void 0 || target.deleteEmbeddingBatch === void 0)) {
|
|
1221
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
1174
1222
|
"The transaction backend lacks batched vector operations",
|
|
1175
1223
|
{ code: "SET_UPDATE_VECTOR_UNSUPPORTED", kind }
|
|
1176
1224
|
);
|
|
@@ -1185,14 +1233,14 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1185
1233
|
});
|
|
1186
1234
|
if (result.affectedCount === 0) return { affectedCount: 0 };
|
|
1187
1235
|
const sidecarItems = result.rows.map((row) => {
|
|
1188
|
-
const props =
|
|
1189
|
-
const validatedProps =
|
|
1236
|
+
const props = chunk3HGRTCDU_cjs.rowPropsToObject(row.props);
|
|
1237
|
+
const validatedProps = chunkMX4DHSQP_cjs.validateNodeProps(schema, props, {
|
|
1190
1238
|
kind,
|
|
1191
1239
|
operation: "update",
|
|
1192
1240
|
id: row.id
|
|
1193
1241
|
});
|
|
1194
1242
|
if (!chunkPWLJ77UV_cjs.canonicalEqual(validatedProps, props)) {
|
|
1195
|
-
throw new
|
|
1243
|
+
throw new chunkMRDBBHIZ_cjs.ValidationError(
|
|
1196
1244
|
`Set update would persist a non-canonical ${kind} row`,
|
|
1197
1245
|
{
|
|
1198
1246
|
entityType: "node",
|
|
@@ -1221,15 +1269,15 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1221
1269
|
for (const constraint of uniqueConstraints) {
|
|
1222
1270
|
const keyToId = /* @__PURE__ */ new Map();
|
|
1223
1271
|
for (const item of sidecarItems) {
|
|
1224
|
-
if (!
|
|
1225
|
-
const key =
|
|
1272
|
+
if (!chunkFQPEMEWX_cjs.checkWherePredicate(constraint, item.props)) continue;
|
|
1273
|
+
const key = chunkFQPEMEWX_cjs.computeUniqueKey(
|
|
1226
1274
|
item.props,
|
|
1227
1275
|
constraint.fields,
|
|
1228
1276
|
constraint.collation
|
|
1229
1277
|
);
|
|
1230
1278
|
const priorId = keyToId.get(key);
|
|
1231
1279
|
if (priorId !== void 0 && priorId !== item.id) {
|
|
1232
|
-
throw new
|
|
1280
|
+
throw new chunkMRDBBHIZ_cjs.UniquenessError({
|
|
1233
1281
|
constraintName: constraint.name,
|
|
1234
1282
|
kind,
|
|
1235
1283
|
existingId: priorId,
|
|
@@ -1241,7 +1289,7 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1241
1289
|
}
|
|
1242
1290
|
const keys = [...keyToId.keys()];
|
|
1243
1291
|
if (keys.length === 0) continue;
|
|
1244
|
-
for (const kindToCheck of
|
|
1292
|
+
for (const kindToCheck of chunkFQPEMEWX_cjs.getKindsForUniquenessCheck(
|
|
1245
1293
|
kind,
|
|
1246
1294
|
constraint.scope,
|
|
1247
1295
|
ctx.registry
|
|
@@ -1258,7 +1306,7 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1258
1306
|
if (existing.concrete_kind === kind && affectedIds.has(existing.node_id)) {
|
|
1259
1307
|
continue;
|
|
1260
1308
|
}
|
|
1261
|
-
throw new
|
|
1309
|
+
throw new chunkMRDBBHIZ_cjs.UniquenessError({
|
|
1262
1310
|
constraintName: constraint.name,
|
|
1263
1311
|
kind: kindToCheck,
|
|
1264
1312
|
existingId: existing.node_id,
|
|
@@ -1274,8 +1322,8 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1274
1322
|
nodeIds: result.rows.map((row) => row.id)
|
|
1275
1323
|
});
|
|
1276
1324
|
}
|
|
1277
|
-
await
|
|
1278
|
-
|
|
1325
|
+
await chunkMFZR4QKM_cjs.applyNodeInsertSideEffectsBatch(
|
|
1326
|
+
chunkMFZR4QKM_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
|
|
1279
1327
|
sidecarItems,
|
|
1280
1328
|
target
|
|
1281
1329
|
);
|
|
@@ -1292,14 +1340,28 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1292
1340
|
);
|
|
1293
1341
|
}
|
|
1294
1342
|
async function executeNodeUpsertUpdate(ctx, input, backend, options) {
|
|
1295
|
-
|
|
1343
|
+
if (input.clearValidTo === true) {
|
|
1344
|
+
assertClearValidToSupported(backend, "node");
|
|
1345
|
+
}
|
|
1346
|
+
return chunkMX4DHSQP_cjs.runInWriteTransaction(
|
|
1296
1347
|
ctx,
|
|
1297
1348
|
backend,
|
|
1298
1349
|
async (target, lock) => {
|
|
1350
|
+
const validTo = chunk425IZOQ5_cjs.validateOptionalCanonicalIsoDate(
|
|
1351
|
+
input.validTo,
|
|
1352
|
+
"validTo"
|
|
1353
|
+
);
|
|
1299
1354
|
const identity = ctx.identity;
|
|
1300
|
-
if (options?.clearDeleted
|
|
1355
|
+
if (identity !== void 0 && (options?.clearDeleted === true || input.validTo !== void 0)) {
|
|
1301
1356
|
await identity.lock(target);
|
|
1302
1357
|
}
|
|
1358
|
+
if (identity !== void 0 && validTo !== void 0) {
|
|
1359
|
+
await identity.requireValidityEndCompatible(
|
|
1360
|
+
target,
|
|
1361
|
+
{ kind: input.kind, id: input.id },
|
|
1362
|
+
validTo
|
|
1363
|
+
);
|
|
1364
|
+
}
|
|
1303
1365
|
const node = await performNodeUpdateWithResurrectionRecovery(
|
|
1304
1366
|
ctx,
|
|
1305
1367
|
input,
|
|
@@ -1327,7 +1389,7 @@ async function executeNodeDelete(ctx, kind, id, backend) {
|
|
|
1327
1389
|
const gate = await backend.getNode(ctx.graphId, kind, id);
|
|
1328
1390
|
if (!gate || gate.deleted_at) return;
|
|
1329
1391
|
const opContext = ctx.createOperationContext("delete", "node", kind, id);
|
|
1330
|
-
return
|
|
1392
|
+
return chunkMX4DHSQP_cjs.runHookedWriteOperation(
|
|
1331
1393
|
ctx,
|
|
1332
1394
|
opContext,
|
|
1333
1395
|
backend,
|
|
@@ -1336,9 +1398,9 @@ async function executeNodeDelete(ctx, kind, id, backend) {
|
|
|
1336
1398
|
if (identity !== void 0) await identity.lock(target);
|
|
1337
1399
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
1338
1400
|
const preflight = await target.getNode(ctx.graphId, kind, id);
|
|
1339
|
-
if (!preflight || !
|
|
1340
|
-
await
|
|
1341
|
-
|
|
1401
|
+
if (!preflight || !chunk3HGRTCDU_cjs.isLiveNodeRow(preflight)) return;
|
|
1402
|
+
await chunkMFZR4QKM_cjs.applyNodeSoftDelete(
|
|
1403
|
+
chunkMFZR4QKM_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
|
|
1342
1404
|
{
|
|
1343
1405
|
existing: preflight,
|
|
1344
1406
|
schema: registration.type.schema,
|
|
@@ -1354,14 +1416,14 @@ async function executeNodeDelete(ctx, kind, id, backend) {
|
|
|
1354
1416
|
);
|
|
1355
1417
|
}
|
|
1356
1418
|
async function executeNodeDeleteBatch(ctx, kind, ids, backend) {
|
|
1357
|
-
await
|
|
1419
|
+
await chunkMX4DHSQP_cjs.runInWriteTransaction(
|
|
1358
1420
|
ctx,
|
|
1359
1421
|
backend,
|
|
1360
1422
|
async (target, lock) => {
|
|
1361
1423
|
const identity = ctx.identity;
|
|
1362
1424
|
if (identity !== void 0) await identity.lock(target);
|
|
1363
1425
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
1364
|
-
const writeContext =
|
|
1426
|
+
const writeContext = chunkMFZR4QKM_cjs.createNodeWriteContext(
|
|
1365
1427
|
ctx.graphId,
|
|
1366
1428
|
ctx.registry,
|
|
1367
1429
|
lock
|
|
@@ -1369,8 +1431,8 @@ async function executeNodeDeleteBatch(ctx, kind, ids, backend) {
|
|
|
1369
1431
|
let affectedCount = 0;
|
|
1370
1432
|
for (const id of ids) {
|
|
1371
1433
|
const preflight = await target.getNode(ctx.graphId, kind, id);
|
|
1372
|
-
if (!preflight || !
|
|
1373
|
-
await
|
|
1434
|
+
if (!preflight || !chunk3HGRTCDU_cjs.isLiveNodeRow(preflight)) continue;
|
|
1435
|
+
await chunkMFZR4QKM_cjs.applyNodeSoftDelete(
|
|
1374
1436
|
writeContext,
|
|
1375
1437
|
{
|
|
1376
1438
|
existing: preflight,
|
|
@@ -1394,7 +1456,7 @@ async function executeNodeHardDelete(ctx, kind, id, backend) {
|
|
|
1394
1456
|
const gate = await backend.getNode(ctx.graphId, kind, id);
|
|
1395
1457
|
if (!gate) return;
|
|
1396
1458
|
const opContext = ctx.createOperationContext("delete", "node", kind, id);
|
|
1397
|
-
return
|
|
1459
|
+
return chunkMX4DHSQP_cjs.runHookedWriteOperation(
|
|
1398
1460
|
ctx,
|
|
1399
1461
|
opContext,
|
|
1400
1462
|
backend,
|
|
@@ -1402,8 +1464,8 @@ async function executeNodeHardDelete(ctx, kind, id, backend) {
|
|
|
1402
1464
|
const identity = ctx.identity;
|
|
1403
1465
|
if (identity !== void 0) await identity.lock(target);
|
|
1404
1466
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
1405
|
-
await
|
|
1406
|
-
|
|
1467
|
+
await chunkMFZR4QKM_cjs.applyNodeHardDelete(
|
|
1468
|
+
chunkMFZR4QKM_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
|
|
1407
1469
|
{
|
|
1408
1470
|
kind,
|
|
1409
1471
|
id,
|
|
@@ -1422,12 +1484,12 @@ async function executeNodeGetOrCreateByConstraint(ctx, kind, constraintName, pro
|
|
|
1422
1484
|
const ifExists = options?.ifExists ?? "return";
|
|
1423
1485
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
1424
1486
|
const nodeKind = registration.type;
|
|
1425
|
-
const validatedProps =
|
|
1487
|
+
const validatedProps = chunkMX4DHSQP_cjs.validateNodeProps(nodeKind.schema, props, {
|
|
1426
1488
|
kind,
|
|
1427
1489
|
operation: "create"
|
|
1428
1490
|
});
|
|
1429
1491
|
const constraint = resolveConstraint(ctx.graph, kind, constraintName);
|
|
1430
|
-
if (!
|
|
1492
|
+
if (!chunkFQPEMEWX_cjs.checkWherePredicate(constraint, validatedProps)) {
|
|
1431
1493
|
const node = await executeNodeCreate(
|
|
1432
1494
|
ctx,
|
|
1433
1495
|
{ kind, props: validatedProps },
|
|
@@ -1436,12 +1498,12 @@ async function executeNodeGetOrCreateByConstraint(ctx, kind, constraintName, pro
|
|
|
1436
1498
|
);
|
|
1437
1499
|
return { node, action: "created" };
|
|
1438
1500
|
}
|
|
1439
|
-
const key =
|
|
1501
|
+
const key = chunkFQPEMEWX_cjs.computeUniqueKey(
|
|
1440
1502
|
validatedProps,
|
|
1441
1503
|
constraint.fields,
|
|
1442
1504
|
constraint.collation
|
|
1443
1505
|
);
|
|
1444
|
-
const kindsToCheck =
|
|
1506
|
+
const kindsToCheck = chunkFQPEMEWX_cjs.getKindsForUniquenessCheck(
|
|
1445
1507
|
kind,
|
|
1446
1508
|
constraint.scope,
|
|
1447
1509
|
ctx.registry
|
|
@@ -1498,25 +1560,25 @@ async function executeNodeGetOrCreateByConstraint(ctx, kind, constraintName, pro
|
|
|
1498
1560
|
try {
|
|
1499
1561
|
return await attempt();
|
|
1500
1562
|
} catch (error) {
|
|
1501
|
-
if (!(error instanceof
|
|
1563
|
+
if (!(error instanceof chunkMRDBBHIZ_cjs.UniquenessError)) throw error;
|
|
1502
1564
|
return attempt();
|
|
1503
1565
|
}
|
|
1504
1566
|
}
|
|
1505
1567
|
async function executeNodeFindByConstraint(ctx, kind, constraintName, props, backend) {
|
|
1506
1568
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
1507
1569
|
const nodeKind = registration.type;
|
|
1508
|
-
const validatedProps =
|
|
1570
|
+
const validatedProps = chunkMX4DHSQP_cjs.validateNodeProps(nodeKind.schema, props, {
|
|
1509
1571
|
kind,
|
|
1510
1572
|
operation: "create"
|
|
1511
1573
|
});
|
|
1512
1574
|
const constraint = resolveConstraint(ctx.graph, kind, constraintName);
|
|
1513
|
-
if (!
|
|
1514
|
-
const key =
|
|
1575
|
+
if (!chunkFQPEMEWX_cjs.checkWherePredicate(constraint, validatedProps)) return void 0;
|
|
1576
|
+
const key = chunkFQPEMEWX_cjs.computeUniqueKey(
|
|
1515
1577
|
validatedProps,
|
|
1516
1578
|
constraint.fields,
|
|
1517
1579
|
constraint.collation
|
|
1518
1580
|
);
|
|
1519
|
-
const kindsToCheck =
|
|
1581
|
+
const kindsToCheck = chunkFQPEMEWX_cjs.getKindsForUniquenessCheck(
|
|
1520
1582
|
kind,
|
|
1521
1583
|
constraint.scope,
|
|
1522
1584
|
ctx.registry
|
|
@@ -1542,12 +1604,12 @@ async function executeNodeFindByConstraint(ctx, kind, constraintName, props, bac
|
|
|
1542
1604
|
function validateAndComputeKeys(nodeKind, kind, constraint, items) {
|
|
1543
1605
|
const validated = [];
|
|
1544
1606
|
for (const item of items) {
|
|
1545
|
-
const validatedProps =
|
|
1607
|
+
const validatedProps = chunkMX4DHSQP_cjs.validateNodeProps(nodeKind.schema, item.props, {
|
|
1546
1608
|
kind,
|
|
1547
1609
|
operation: "create"
|
|
1548
1610
|
});
|
|
1549
|
-
const applies =
|
|
1550
|
-
const key = applies ?
|
|
1611
|
+
const applies = chunkFQPEMEWX_cjs.checkWherePredicate(constraint, validatedProps);
|
|
1612
|
+
const key = applies ? chunkFQPEMEWX_cjs.computeUniqueKey(
|
|
1551
1613
|
validatedProps,
|
|
1552
1614
|
constraint.fields,
|
|
1553
1615
|
constraint.collation
|
|
@@ -1570,7 +1632,7 @@ async function executeNodeBulkFindByConstraint(ctx, kind, constraintName, items,
|
|
|
1570
1632
|
const constraint = resolveConstraint(ctx.graph, kind, constraintName);
|
|
1571
1633
|
const validated = validateAndComputeKeys(nodeKind, kind, constraint, items);
|
|
1572
1634
|
const uniqueKeys = collectUniqueKeys(validated);
|
|
1573
|
-
const kindsToCheck =
|
|
1635
|
+
const kindsToCheck = chunkFQPEMEWX_cjs.getKindsForUniquenessCheck(
|
|
1574
1636
|
kind,
|
|
1575
1637
|
constraint.scope,
|
|
1576
1638
|
ctx.registry
|
|
@@ -1620,10 +1682,10 @@ function resolveNodeIndex(graph, kind, indexName) {
|
|
|
1620
1682
|
(candidate) => candidate.entity === "node" && candidate.kind === kind && candidate.name === indexName
|
|
1621
1683
|
);
|
|
1622
1684
|
if (declaration?.entity !== "node") {
|
|
1623
|
-
throw new
|
|
1685
|
+
throw new chunkMRDBBHIZ_cjs.NodeIndexNotFoundError(indexName, kind);
|
|
1624
1686
|
}
|
|
1625
1687
|
if (declaration.method !== void 0) {
|
|
1626
|
-
throw new
|
|
1688
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
1627
1689
|
`bulkFindByIndex cannot probe index "${indexName}" (method "${declaration.method}"): only btree indexes serve equality probes.`,
|
|
1628
1690
|
{ indexName, kind, method: declaration.method }
|
|
1629
1691
|
);
|
|
@@ -1661,7 +1723,7 @@ function validateIndexProbeValue(value, valueType, pointer, kind) {
|
|
|
1661
1723
|
}
|
|
1662
1724
|
}
|
|
1663
1725
|
function indexProbeTypeError(pointer, kind, expected, value) {
|
|
1664
|
-
return new
|
|
1726
|
+
return new chunkMRDBBHIZ_cjs.ValidationError(
|
|
1665
1727
|
`Index probe value for "${pointer}" on node kind "${kind}" has an incompatible type`,
|
|
1666
1728
|
{
|
|
1667
1729
|
entityType: "node",
|
|
@@ -1695,7 +1757,7 @@ async function executeNodeBulkFindByIndex(ctx, kind, indexName, items, backend,
|
|
|
1695
1757
|
if (items.length === 0) return [];
|
|
1696
1758
|
const index = resolveNodeIndex(ctx.graph, kind, indexName);
|
|
1697
1759
|
if (index.fields.length === 0) {
|
|
1698
|
-
throw new
|
|
1760
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
1699
1761
|
`bulkFindByIndex requires an index with at least one prop-based field on index "${indexName}" (node kind "${kind}")`,
|
|
1700
1762
|
{ indexName, kind },
|
|
1701
1763
|
{
|
|
@@ -1704,7 +1766,7 @@ async function executeNodeBulkFindByIndex(ctx, kind, indexName, items, backend,
|
|
|
1704
1766
|
);
|
|
1705
1767
|
}
|
|
1706
1768
|
if (index.fieldValueTypes.includes("date")) {
|
|
1707
|
-
throw new
|
|
1769
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
1708
1770
|
`bulkFindByIndex does not support date-typed key fields on index "${indexName}" (node kind "${kind}")`,
|
|
1709
1771
|
{ indexName, kind },
|
|
1710
1772
|
{
|
|
@@ -1714,7 +1776,7 @@ async function executeNodeBulkFindByIndex(ctx, kind, indexName, items, backend,
|
|
|
1714
1776
|
}
|
|
1715
1777
|
const limitPerInput = options?.limitPerInput;
|
|
1716
1778
|
if (limitPerInput !== void 0 && (!Number.isInteger(limitPerInput) || limitPerInput <= 0)) {
|
|
1717
|
-
throw new
|
|
1779
|
+
throw new chunkMRDBBHIZ_cjs.ValidationError(
|
|
1718
1780
|
"bulkFindByIndex limitPerInput must be a positive integer",
|
|
1719
1781
|
{
|
|
1720
1782
|
entityType: "node",
|
|
@@ -1729,7 +1791,7 @@ async function executeNodeBulkFindByIndex(ctx, kind, indexName, items, backend,
|
|
|
1729
1791
|
}
|
|
1730
1792
|
);
|
|
1731
1793
|
}
|
|
1732
|
-
const adapter =
|
|
1794
|
+
const adapter = chunkL3LQNR34_cjs.getDialect(backend.dialect);
|
|
1733
1795
|
const probes = items.map(
|
|
1734
1796
|
(item) => index.fields.map((pointer, position) => {
|
|
1735
1797
|
const value = chunkA7J2YDDI_cjs.resolveJsonPointer(item.props, pointer);
|
|
@@ -1756,47 +1818,47 @@ async function executeNodeBulkFindByIndex(ctx, kind, indexName, items, backend,
|
|
|
1756
1818
|
}
|
|
1757
1819
|
groupToInputs[existing]?.push(inputIndex);
|
|
1758
1820
|
}
|
|
1759
|
-
const schema = backend.tableNames ?
|
|
1821
|
+
const schema = backend.tableNames ? chunk3U5ABFDW_cjs.createSqlSchema(backend.tableNames) : chunk3U5ABFDW_cjs.DEFAULT_SQL_SCHEMA;
|
|
1760
1822
|
const compileContext = {
|
|
1761
1823
|
dialect: backend.dialect,
|
|
1762
|
-
propsColumn:
|
|
1763
|
-
systemColumn: (column) =>
|
|
1824
|
+
propsColumn: chunkEDN4Y4ZG_cjs.sql.raw(`"props"`),
|
|
1825
|
+
systemColumn: (column) => chunkEDN4Y4ZG_cjs.sql.raw(`"${column}"`)
|
|
1764
1826
|
};
|
|
1765
|
-
const fieldKeys =
|
|
1827
|
+
const fieldKeys = chunkL3LQNR34_cjs.compileNodeIndexFieldKeys(index, compileContext);
|
|
1766
1828
|
const groupPredicates = groupProbes.map(
|
|
1767
|
-
(probe) =>
|
|
1829
|
+
(probe) => chunkEDN4Y4ZG_cjs.sql`(${chunkEDN4Y4ZG_cjs.sql.join(
|
|
1768
1830
|
fieldKeys.map((fieldKey, position) => {
|
|
1769
1831
|
const value = probe[position];
|
|
1770
1832
|
if (value === void 0 || value === null) {
|
|
1771
|
-
return
|
|
1833
|
+
return chunkEDN4Y4ZG_cjs.sql`${fieldKey} IS NULL`;
|
|
1772
1834
|
}
|
|
1773
1835
|
return adapter.nullSafeEquals(
|
|
1774
1836
|
fieldKey,
|
|
1775
|
-
|
|
1837
|
+
chunkEDN4Y4ZG_cjs.sql`${coerceIndexProbeBind(value, adapter)}`
|
|
1776
1838
|
);
|
|
1777
1839
|
}),
|
|
1778
|
-
|
|
1840
|
+
chunkEDN4Y4ZG_cjs.sql` AND `
|
|
1779
1841
|
)})`
|
|
1780
1842
|
);
|
|
1781
1843
|
const caseBranches = groupPredicates.map(
|
|
1782
|
-
(predicate, group) =>
|
|
1844
|
+
(predicate, group) => chunkEDN4Y4ZG_cjs.sql`WHEN ${predicate} THEN ${chunkEDN4Y4ZG_cjs.sql.raw(String(group))}`
|
|
1783
1845
|
);
|
|
1784
|
-
const probeIndexExpr =
|
|
1846
|
+
const probeIndexExpr = chunkEDN4Y4ZG_cjs.sql`CASE ${chunkEDN4Y4ZG_cjs.sql.join(caseBranches, chunkEDN4Y4ZG_cjs.sql` `)} ELSE NULL END`;
|
|
1785
1847
|
const conditions = [
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1848
|
+
chunkEDN4Y4ZG_cjs.sql`"graph_id" = ${ctx.graphId}`,
|
|
1849
|
+
chunkEDN4Y4ZG_cjs.sql`"kind" = ${kind}`,
|
|
1850
|
+
chunkEDN4Y4ZG_cjs.sql`"deleted_at" IS NULL`
|
|
1789
1851
|
];
|
|
1790
1852
|
if (index.where !== void 0) {
|
|
1791
|
-
conditions.push(
|
|
1853
|
+
conditions.push(chunkL3LQNR34_cjs.compileIndexWhere(compileContext, index.where));
|
|
1792
1854
|
}
|
|
1793
|
-
conditions.push(
|
|
1794
|
-
const whereClause =
|
|
1795
|
-
const probedSelect =
|
|
1855
|
+
conditions.push(chunkEDN4Y4ZG_cjs.sql`(${chunkEDN4Y4ZG_cjs.sql.join(groupPredicates, chunkEDN4Y4ZG_cjs.sql` OR `)})`);
|
|
1856
|
+
const whereClause = chunkEDN4Y4ZG_cjs.sql.join(conditions, chunkEDN4Y4ZG_cjs.sql` AND `);
|
|
1857
|
+
const probedSelect = chunkEDN4Y4ZG_cjs.sql`SELECT "id", ${probeIndexExpr} AS probe_idx FROM ${schema.nodesTable} WHERE ${whereClause}`;
|
|
1796
1858
|
const capInSql = limitPerInput !== void 0 && backend.capabilities.windowFunctions;
|
|
1797
|
-
const query = capInSql ?
|
|
1859
|
+
const query = capInSql ? chunkEDN4Y4ZG_cjs.sql`SELECT "id", probe_idx FROM (SELECT "id", probe_idx, ROW_NUMBER() OVER (PARTITION BY probe_idx ORDER BY "id") AS probe_rank FROM (${probedSelect}) AS probed) AS ranked WHERE probe_rank <= ${limitPerInput} ORDER BY probe_idx, "id"` : chunkEDN4Y4ZG_cjs.sql`${probedSelect} ORDER BY probe_idx, "id"`;
|
|
1798
1860
|
const rawMatches = await backend.execute(
|
|
1799
|
-
|
|
1861
|
+
chunkEDN4Y4ZG_cjs.asCompiledRowsSql(query)
|
|
1800
1862
|
);
|
|
1801
1863
|
const matches = limitPerInput !== void 0 && !capInSql ? capMatchesPerGroup(rawMatches, limitPerInput) : rawMatches;
|
|
1802
1864
|
const nodesById = await hydrateNodesById(
|
|
@@ -1829,7 +1891,7 @@ function capMatchesPerGroup(matches, limitPerInput) {
|
|
|
1829
1891
|
return capped;
|
|
1830
1892
|
}
|
|
1831
1893
|
async function hydrateNodesById(backend, graphId, kind, ids) {
|
|
1832
|
-
const rowsById = await
|
|
1894
|
+
const rowsById = await chunkOIFSOPSR_cjs.getNodeRowsByIds(backend, graphId, kind, ids);
|
|
1833
1895
|
const nodesById = /* @__PURE__ */ new Map();
|
|
1834
1896
|
for (const [id, row] of rowsById) {
|
|
1835
1897
|
if (row.deleted_at !== void 0) continue;
|
|
@@ -1845,7 +1907,7 @@ async function executeNodeBulkGetOrCreateByConstraint(ctx, kind, constraintName,
|
|
|
1845
1907
|
const constraint = resolveConstraint(ctx.graph, kind, constraintName);
|
|
1846
1908
|
const validated = validateAndComputeKeys(nodeKind, kind, constraint, items);
|
|
1847
1909
|
const uniqueKeys = collectUniqueKeys(validated);
|
|
1848
|
-
const kindsToCheck =
|
|
1910
|
+
const kindsToCheck = chunkFQPEMEWX_cjs.getKindsForUniquenessCheck(
|
|
1849
1911
|
kind,
|
|
1850
1912
|
constraint.scope,
|
|
1851
1913
|
ctx.registry
|
|
@@ -1948,11 +2010,13 @@ async function executeNodeBulkGetOrCreateByConstraint(ctx, kind, constraintName,
|
|
|
1948
2010
|
try {
|
|
1949
2011
|
return await attempt();
|
|
1950
2012
|
} catch (error) {
|
|
1951
|
-
if (!(error instanceof
|
|
2013
|
+
if (!(error instanceof chunkMRDBBHIZ_cjs.UniquenessError)) throw error;
|
|
1952
2014
|
return attempt();
|
|
1953
2015
|
}
|
|
1954
2016
|
}
|
|
1955
2017
|
|
|
2018
|
+
exports.assertClearValidToSupported = assertClearValidToSupported;
|
|
2019
|
+
exports.assertValidityEndMutation = assertValidityEndMutation;
|
|
1956
2020
|
exports.checkCardinalityConstraint = checkCardinalityConstraint;
|
|
1957
2021
|
exports.createNodeBatchValidationBackend = createNodeBatchValidationBackend;
|
|
1958
2022
|
exports.edgeWriteNeedsConstraintFence = edgeWriteNeedsConstraintFence;
|
|
@@ -1976,6 +2040,7 @@ exports.rowToEdge = rowToEdge;
|
|
|
1976
2040
|
exports.rowToEdgeMeta = rowToEdgeMeta;
|
|
1977
2041
|
exports.rowToNode = rowToNode;
|
|
1978
2042
|
exports.rowToNodeMeta = rowToNodeMeta;
|
|
2043
|
+
exports.validityEndAfterMutation = validityEndAfterMutation;
|
|
1979
2044
|
exports.withAlreadyExistsTranslation = withAlreadyExistsTranslation;
|
|
1980
|
-
//# sourceMappingURL=chunk-
|
|
1981
|
-
//# sourceMappingURL=chunk-
|
|
2045
|
+
//# sourceMappingURL=chunk-WGX7JH7E.cjs.map
|
|
2046
|
+
//# sourceMappingURL=chunk-WGX7JH7E.cjs.map
|