viborm 1.1.0 → 1.2.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.
Files changed (293) hide show
  1. package/dist/{adapter-namespace-DMhEF6my.mjs → adapter-namespace-DqkJQdrD.mjs} +2 -2
  2. package/dist/{adapter-namespace-DMhEF6my.mjs.map → adapter-namespace-DqkJQdrD.mjs.map} +1 -1
  3. package/dist/adapters.d.mts +1 -1
  4. package/dist/adapters.mjs +1 -1
  5. package/dist/{array-literal-DcEm5tt_.mjs → array-literal-BsbbSLw3.mjs} +1 -1
  6. package/dist/{array-literal-DcEm5tt_.mjs.map → array-literal-BsbbSLw3.mjs.map} +1 -1
  7. package/dist/base-AdXAoy6l.mjs +2 -0
  8. package/dist/base-AdXAoy6l.mjs.map +1 -0
  9. package/dist/batch-refs-4L8ECdPU.mjs +2 -0
  10. package/dist/batch-refs-4L8ECdPU.mjs.map +1 -0
  11. package/dist/bind-parameter-capacity-CjPgqnmx.mjs +2 -0
  12. package/dist/{bind-parameter-capacity-DzMcIB95.mjs.map → bind-parameter-capacity-CjPgqnmx.mjs.map} +1 -1
  13. package/dist/builder-Ycvq3ETg.mjs +2 -0
  14. package/dist/builder-Ycvq3ETg.mjs.map +1 -0
  15. package/dist/bun-sql.d.mts +19 -2
  16. package/dist/bun-sql.mjs +1 -1
  17. package/dist/bun-sql.mjs.map +1 -1
  18. package/dist/bun-sqlite.d.mts +9 -8
  19. package/dist/bun-sqlite.mjs +1 -1
  20. package/dist/bun-sqlite.mjs.map +1 -1
  21. package/dist/cache/cloudflare-kv.d.mts +1 -1
  22. package/dist/cache/cloudflare-kv.mjs +1 -1
  23. package/dist/cache/memory.d.mts +1 -1
  24. package/dist/cache/memory.mjs +1 -1
  25. package/dist/cache/memory.mjs.map +1 -1
  26. package/dist/cache-BO57X0TT.mjs +2 -0
  27. package/dist/cache-BO57X0TT.mjs.map +1 -0
  28. package/dist/cache.d.mts +1 -1
  29. package/dist/cache.mjs +1 -1
  30. package/dist/cache.mjs.map +1 -1
  31. package/dist/canonical-json-rfC2Dg0X.mjs +2 -0
  32. package/dist/canonical-json-rfC2Dg0X.mjs.map +1 -0
  33. package/dist/chain-Dh0FV72b.mjs +2 -0
  34. package/dist/chain-Dh0FV72b.mjs.map +1 -0
  35. package/dist/cli.mjs +5 -6
  36. package/dist/cli.mjs.map +1 -1
  37. package/dist/client-BLiBmykn.mjs +2 -0
  38. package/dist/client-BLiBmykn.mjs.map +1 -0
  39. package/dist/client-CCgfcp5A.mjs +52 -0
  40. package/dist/client-CCgfcp5A.mjs.map +1 -0
  41. package/dist/client-CRBo95D0.d.mts +610 -0
  42. package/dist/client.d.mts +1 -1
  43. package/dist/client.mjs +1 -1
  44. package/dist/{clock-W8H2Khng.mjs → clock-CK41KO7t.mjs} +1 -1
  45. package/dist/{clock-W8H2Khng.mjs.map → clock-CK41KO7t.mjs.map} +1 -1
  46. package/dist/config.d.mts +3 -3
  47. package/dist/config.mjs +1 -1
  48. package/dist/controls-DXgIn4zh.mjs +2 -0
  49. package/dist/controls-DXgIn4zh.mjs.map +1 -0
  50. package/dist/d1.d.mts +1 -1
  51. package/dist/d1.mjs +1 -1
  52. package/dist/d1.mjs.map +1 -1
  53. package/dist/datetime-physical-codec-oIhiYZEP.mjs +2 -0
  54. package/dist/{datetime-physical-codec-BK93pJGW.mjs.map → datetime-physical-codec-oIhiYZEP.mjs.map} +1 -1
  55. package/dist/driver-B19QlFqn.mjs +2 -0
  56. package/dist/{driver-ZIbkciaz.mjs.map → driver-B19QlFqn.mjs.map} +1 -1
  57. package/dist/driver-BlnKXPFF.mjs +2 -0
  58. package/dist/driver-BlnKXPFF.mjs.map +1 -0
  59. package/dist/driver.d.mts +2 -2
  60. package/dist/driver.mjs +1 -1
  61. package/dist/error-mapping-CnPCv1dm.mjs +2 -0
  62. package/dist/error-mapping-CnPCv1dm.mjs.map +1 -0
  63. package/dist/every-4KE0p2Gw.mjs +2 -0
  64. package/dist/every-4KE0p2Gw.mjs.map +1 -0
  65. package/dist/{execution-context-Bm_qTp1i.mjs → execution-context-BKR3bgES.mjs} +1 -1
  66. package/dist/{execution-context-Bm_qTp1i.mjs.map → execution-context-BKR3bgES.mjs.map} +1 -1
  67. package/dist/fs-estate-CAhDg7nY.mjs +2 -0
  68. package/dist/fs-estate-CAhDg7nY.mjs.map +1 -0
  69. package/dist/{geo-area-codec-B4DRInvA.mjs → geo-area-codec-1SY9im7O.mjs} +2 -2
  70. package/dist/{geo-area-codec-B4DRInvA.mjs.map → geo-area-codec-1SY9im7O.mjs.map} +1 -1
  71. package/dist/geo-point-codec-lhxH42SK.mjs +2 -0
  72. package/dist/geo-point-codec-lhxH42SK.mjs.map +1 -0
  73. package/dist/{hydration-D6JICBQG.mjs → hydration-CAxOL4aI.mjs} +2 -2
  74. package/dist/{hydration-D6JICBQG.mjs.map → hydration-CAxOL4aI.mjs.map} +1 -1
  75. package/dist/identifier-conversion-GgbwHc2G.mjs +2 -0
  76. package/dist/identifier-conversion-GgbwHc2G.mjs.map +1 -0
  77. package/dist/{identifier-EsWKVHXi.mjs → identifier-hQCs8M1n.mjs} +2 -2
  78. package/dist/{identifier-EsWKVHXi.mjs.map → identifier-hQCs8M1n.mjs.map} +1 -1
  79. package/dist/identity-CLFhCTZx.mjs +2 -0
  80. package/dist/identity-CLFhCTZx.mjs.map +1 -0
  81. package/dist/{index-BbcE-gyl.d.mts → index-C_XLSTy2.d.mts} +624 -351
  82. package/dist/index.d.mts +2 -2
  83. package/dist/index.mjs +1 -1
  84. package/dist/index.mjs.map +1 -1
  85. package/dist/instrumentation.d.mts +1 -1
  86. package/dist/instrumentation.mjs +1 -1
  87. package/dist/instrumentation.mjs.map +1 -1
  88. package/dist/{invariant-DCsftyml.mjs → invariant-BnLYqsHO.mjs} +1 -1
  89. package/dist/{invariant-DCsftyml.mjs.map → invariant-BnLYqsHO.mjs.map} +1 -1
  90. package/dist/{json-number-TpD-pfqt.mjs → json-number-CGXpPu4D.mjs} +1 -1
  91. package/dist/{json-number-TpD-pfqt.mjs.map → json-number-CGXpPu4D.mjs.map} +1 -1
  92. package/dist/key-BeoOwGr3.mjs +2 -0
  93. package/dist/key-BeoOwGr3.mjs.map +1 -0
  94. package/dist/libsql-Bu_IdFU1.mjs +11 -0
  95. package/dist/libsql-Bu_IdFU1.mjs.map +1 -0
  96. package/dist/libsql.d.mts +1 -1
  97. package/dist/libsql.mjs +1 -1
  98. package/dist/libsql.mjs.map +1 -1
  99. package/dist/memory-D4yxtCPK.mjs +2 -0
  100. package/dist/memory-D4yxtCPK.mjs.map +1 -0
  101. package/dist/migrations/mysql.d.mts +6 -0
  102. package/dist/migrations/mysql.mjs +2 -0
  103. package/dist/migrations/mysql.mjs.map +1 -0
  104. package/dist/migrations/postgres.d.mts +6 -0
  105. package/dist/migrations/postgres.mjs +2 -0
  106. package/dist/migrations/postgres.mjs.map +1 -0
  107. package/dist/migrations/sqlite.d.mts +6 -0
  108. package/dist/migrations/sqlite.mjs +2 -0
  109. package/dist/migrations/sqlite.mjs.map +1 -0
  110. package/dist/migrations/storage/durable-object.d.mts +17 -0
  111. package/dist/migrations/storage/durable-object.mjs +2 -0
  112. package/dist/migrations/storage/durable-object.mjs.map +1 -0
  113. package/dist/migrations/storage/fs.d.mts +6 -1
  114. package/dist/migrations/storage/fs.mjs +1 -1
  115. package/dist/migrations/storage/r2.d.mts +14 -0
  116. package/dist/migrations/storage/r2.mjs +2 -0
  117. package/dist/migrations/storage/r2.mjs.map +1 -0
  118. package/dist/migrations/tenant.d.mts +92 -0
  119. package/dist/migrations/tenant.mjs +2 -0
  120. package/dist/migrations/tenant.mjs.map +1 -0
  121. package/dist/{migrations-BWZSBMZh.mjs → migrations-DTObIjAm.mjs} +2 -2
  122. package/dist/migrations-DTObIjAm.mjs.map +1 -0
  123. package/dist/migrations.d.mts +6 -561
  124. package/dist/migrations.mjs +1 -1
  125. package/dist/migrations.mjs.map +1 -1
  126. package/dist/mysql-CibPaHSp.mjs +99 -0
  127. package/dist/mysql-CibPaHSp.mjs.map +1 -0
  128. package/dist/mysql-adapter-DkJPfoGf.mjs +2 -0
  129. package/dist/mysql-adapter-DkJPfoGf.mjs.map +1 -0
  130. package/dist/mysql2.d.mts +1 -3
  131. package/dist/mysql2.mjs +1 -1
  132. package/dist/mysql2.mjs.map +1 -1
  133. package/dist/neon-http.d.mts +1 -1
  134. package/dist/neon-http.mjs +1 -1
  135. package/dist/neon-http.mjs.map +1 -1
  136. package/dist/object-store-DQR6bTBY.mjs +2 -0
  137. package/dist/object-store-DQR6bTBY.mjs.map +1 -0
  138. package/dist/object-store-DyYOCtmX.d.mts +156 -0
  139. package/dist/observation-DUSm7oXK.mjs +2 -0
  140. package/dist/observation-DUSm7oXK.mjs.map +1 -0
  141. package/dist/pg.d.mts +37 -12
  142. package/dist/pg.mjs +1 -1
  143. package/dist/pg.mjs.map +1 -1
  144. package/dist/pglite.d.mts +2 -1
  145. package/dist/pglite.mjs +1 -1
  146. package/dist/pglite.mjs.map +1 -1
  147. package/dist/physical-6V_LNU3L.mjs +2 -0
  148. package/dist/{physical-BkelResN.mjs.map → physical-6V_LNU3L.mjs.map} +1 -1
  149. package/dist/pinned-session-CLxj5M5e.mjs +2 -0
  150. package/dist/pinned-session-CLxj5M5e.mjs.map +1 -0
  151. package/dist/planetscale.d.mts +1 -1
  152. package/dist/planetscale.mjs +1 -1
  153. package/dist/planetscale.mjs.map +1 -1
  154. package/dist/{planner-Bbw8W81b.d.mts → planner-C6Lfsasx.d.mts} +57 -3
  155. package/dist/postgres-adapter-B3SQvcV1.mjs +2 -0
  156. package/dist/postgres-adapter-B3SQvcV1.mjs.map +1 -0
  157. package/dist/postgres-adapter-CQD2oGuD.mjs +2 -0
  158. package/dist/postgres-adapter-CQD2oGuD.mjs.map +1 -0
  159. package/dist/postgres-oqNW9xqo.mjs +415 -0
  160. package/dist/postgres-oqNW9xqo.mjs.map +1 -0
  161. package/dist/{postgres-result-Dc_iW3Hb.mjs → postgres-result-7F0DllQe.mjs} +2 -2
  162. package/dist/{postgres-result-Dc_iW3Hb.mjs.map → postgres-result-7F0DllQe.mjs.map} +1 -1
  163. package/dist/postgres.d.mts +11 -1
  164. package/dist/postgres.mjs +1 -1
  165. package/dist/postgres.mjs.map +1 -1
  166. package/dist/{provider-limits-DXj_pOT0.mjs → provider-limits-BHATED_m.mjs} +2 -2
  167. package/dist/{provider-limits-DXj_pOT0.mjs.map → provider-limits-BHATED_m.mjs.map} +1 -1
  168. package/dist/registration-preflight-DEjv050M.mjs +4 -0
  169. package/dist/registration-preflight-DEjv050M.mjs.map +1 -0
  170. package/dist/result-shape-CTNdNSW3.mjs +2 -0
  171. package/dist/result-shape-CTNdNSW3.mjs.map +1 -0
  172. package/dist/scalar-U0wD5bKy.mjs +2 -0
  173. package/dist/{scalar-BTktMqvO.mjs.map → scalar-U0wD5bKy.mjs.map} +1 -1
  174. package/dist/schema/json.d.mts +1 -1
  175. package/dist/schema/json.mjs +1 -1
  176. package/dist/schema/json.mjs.map +1 -1
  177. package/dist/schema-Cjem1-0f.mjs +2 -0
  178. package/dist/{schema-BFNcMdO6.mjs.map → schema-Cjem1-0f.mjs.map} +1 -1
  179. package/dist/schema-introspection-DEYGC2qg.mjs +6 -0
  180. package/dist/schema-introspection-DEYGC2qg.mjs.map +1 -0
  181. package/dist/schema.d.mts +1 -1
  182. package/dist/schema.mjs +1 -1
  183. package/dist/{select-assembly-BgqlrePH.mjs → select-assembly-f1UGoblh.mjs} +2 -2
  184. package/dist/select-assembly-f1UGoblh.mjs.map +1 -0
  185. package/dist/settle-B9Vg1FnP.mjs +2 -0
  186. package/dist/settle-B9Vg1FnP.mjs.map +1 -0
  187. package/dist/soft-delete.d.mts +1 -1
  188. package/dist/{sql--69HUgel.mjs → sql-Bp7jicEX.mjs} +1 -1
  189. package/dist/{sql--69HUgel.mjs.map → sql-Bp7jicEX.mjs.map} +1 -1
  190. package/dist/{sql-statement-tokens-CykxFmOJ.mjs → sql-statement-tokens-BBcoGmJb.mjs} +1 -1
  191. package/dist/{sql-statement-tokens-CykxFmOJ.mjs.map → sql-statement-tokens-BBcoGmJb.mjs.map} +1 -1
  192. package/dist/sql.d.mts +1 -1
  193. package/dist/sql.mjs +1 -1
  194. package/dist/sqlite-adapter-CW_3l6ea.mjs +2 -0
  195. package/dist/sqlite-adapter-CW_3l6ea.mjs.map +1 -0
  196. package/dist/sqlite-utils-DlgokMJN.mjs +2 -0
  197. package/dist/sqlite-utils-DlgokMJN.mjs.map +1 -0
  198. package/dist/sqlite3.d.mts +2 -8
  199. package/dist/sqlite3.mjs +1 -1
  200. package/dist/sqlite3.mjs.map +1 -1
  201. package/dist/standard-sql-Bk4RZPqJ.mjs +6 -0
  202. package/dist/standard-sql-Bk4RZPqJ.mjs.map +1 -0
  203. package/dist/{suppressed-failure-BPxfHTMc.mjs → suppressed-failure-BwULh-8h.mjs} +1 -1
  204. package/dist/{suppressed-failure-BPxfHTMc.mjs.map → suppressed-failure-BwULh-8h.mjs.map} +1 -1
  205. package/dist/{terminal-BbRi0CNZ.mjs → terminal-C8cq1WWX.mjs} +2 -2
  206. package/dist/{terminal-BbRi0CNZ.mjs.map → terminal-C8cq1WWX.mjs.map} +1 -1
  207. package/dist/{transaction-oskVwmsf.mjs → transaction-Bnl6ULTw.mjs} +2 -2
  208. package/dist/transaction-Bnl6ULTw.mjs.map +1 -0
  209. package/dist/{transaction-operation-BC7aua5V.mjs → transaction-operation-CKK3l_9x.mjs} +2 -2
  210. package/dist/{transaction-operation-BC7aua5V.mjs.map → transaction-operation-CKK3l_9x.mjs.map} +1 -1
  211. package/dist/{utils-CRFUUfNn.mjs → utils-CZNaOZR7.mjs} +4 -3
  212. package/dist/utils-CZNaOZR7.mjs.map +1 -0
  213. package/dist/v-D5Z06FKN.mjs +2 -0
  214. package/dist/v-D5Z06FKN.mjs.map +1 -0
  215. package/dist/validation-Dk9Q_-C7.mjs +2 -0
  216. package/dist/validation-Dk9Q_-C7.mjs.map +1 -0
  217. package/dist/validation-PF9-_nKd.mjs +2 -0
  218. package/dist/{validation-tgjL_9n8.mjs.map → validation-PF9-_nKd.mjs.map} +1 -1
  219. package/dist/validation.d.mts +1 -1
  220. package/dist/validation.mjs +1 -1
  221. package/dist/validator-X9-bwtRo.mjs +2 -0
  222. package/dist/{validator-DMlEScV3.mjs.map → validator-X9-bwtRo.mjs.map} +1 -1
  223. package/dist/value-guards-CK9guf2Z.mjs +2 -0
  224. package/dist/value-guards-CK9guf2Z.mjs.map +1 -0
  225. package/dist/version-JDaZht4U.mjs +2 -0
  226. package/dist/{version-De1l_ZMF.mjs.map → version-JDaZht4U.mjs.map} +1 -1
  227. package/package.json +75 -33
  228. package/dist/base-vfur-DaU.mjs +0 -2
  229. package/dist/base-vfur-DaU.mjs.map +0 -1
  230. package/dist/batch-refs-Op1fx9Bo.mjs +0 -6
  231. package/dist/batch-refs-Op1fx9Bo.mjs.map +0 -1
  232. package/dist/bind-parameter-capacity-DzMcIB95.mjs +0 -2
  233. package/dist/builder-DkWfNHEV.mjs +0 -2
  234. package/dist/builder-DkWfNHEV.mjs.map +0 -1
  235. package/dist/chain-uIFlkkXS.mjs +0 -2
  236. package/dist/chain-uIFlkkXS.mjs.map +0 -1
  237. package/dist/client-C8gXvWIA.mjs +0 -2
  238. package/dist/client-C8gXvWIA.mjs.map +0 -1
  239. package/dist/client-z9mcpRtA.mjs +0 -435
  240. package/dist/client-z9mcpRtA.mjs.map +0 -1
  241. package/dist/controls-BhxRnPYS.mjs +0 -2
  242. package/dist/controls-BhxRnPYS.mjs.map +0 -1
  243. package/dist/datetime-physical-codec-BK93pJGW.mjs +0 -2
  244. package/dist/driver-CHclfK3q.mjs +0 -2
  245. package/dist/driver-CHclfK3q.mjs.map +0 -1
  246. package/dist/driver-ZIbkciaz.mjs +0 -2
  247. package/dist/driver-options-DVxWlZ0s.mjs +0 -2
  248. package/dist/driver-options-DVxWlZ0s.mjs.map +0 -1
  249. package/dist/error-mapping-LKqxnw-b.mjs +0 -2
  250. package/dist/error-mapping-LKqxnw-b.mjs.map +0 -1
  251. package/dist/fs-estate-3Bu_K9mk.d.mts +0 -7
  252. package/dist/fs-estate-BLqNdigQ.mjs +0 -2
  253. package/dist/fs-estate-BLqNdigQ.mjs.map +0 -1
  254. package/dist/geo-point-codec-DUTTtlav.mjs +0 -2
  255. package/dist/geo-point-codec-DUTTtlav.mjs.map +0 -1
  256. package/dist/key-DKaqPb8w.mjs +0 -2
  257. package/dist/key-DKaqPb8w.mjs.map +0 -1
  258. package/dist/migrations-BWZSBMZh.mjs.map +0 -1
  259. package/dist/mysql-adapter-DtZdwqzc.mjs +0 -2
  260. package/dist/mysql-adapter-DtZdwqzc.mjs.map +0 -1
  261. package/dist/observation-CLp8ylmL.mjs +0 -2
  262. package/dist/observation-CLp8ylmL.mjs.map +0 -1
  263. package/dist/physical-BkelResN.mjs +0 -2
  264. package/dist/pinned-session-CNANv7bv.mjs +0 -2
  265. package/dist/pinned-session-CNANv7bv.mjs.map +0 -1
  266. package/dist/postgres-adapter-ButxrmEa.mjs +0 -2
  267. package/dist/postgres-adapter-ButxrmEa.mjs.map +0 -1
  268. package/dist/registration-preflight-BrA3EWvq.mjs +0 -4
  269. package/dist/registration-preflight-BrA3EWvq.mjs.map +0 -1
  270. package/dist/result-shape-CKLOBSKl.mjs +0 -2
  271. package/dist/result-shape-CKLOBSKl.mjs.map +0 -1
  272. package/dist/scalar-BTktMqvO.mjs +0 -2
  273. package/dist/schema-BFNcMdO6.mjs +0 -2
  274. package/dist/schema-introspection-C7P7lwIs.mjs +0 -6
  275. package/dist/schema-introspection-C7P7lwIs.mjs.map +0 -1
  276. package/dist/select-assembly-BgqlrePH.mjs.map +0 -1
  277. package/dist/sqlite-adapter-1krz0OXw.mjs +0 -2
  278. package/dist/sqlite-adapter-1krz0OXw.mjs.map +0 -1
  279. package/dist/sqlite-utils-D26BFuJJ.mjs +0 -2
  280. package/dist/sqlite-utils-D26BFuJJ.mjs.map +0 -1
  281. package/dist/transaction-oskVwmsf.mjs.map +0 -1
  282. package/dist/transactions-gjmrWN5W.mjs +0 -2
  283. package/dist/transactions-gjmrWN5W.mjs.map +0 -1
  284. package/dist/utils-CRFUUfNn.mjs.map +0 -1
  285. package/dist/v-B2WwtcRz.mjs +0 -2
  286. package/dist/v-B2WwtcRz.mjs.map +0 -1
  287. package/dist/validation-Du6j0Q38.mjs +0 -2
  288. package/dist/validation-Du6j0Q38.mjs.map +0 -1
  289. package/dist/validation-tgjL_9n8.mjs +0 -2
  290. package/dist/validator-DMlEScV3.mjs +0 -2
  291. package/dist/version-De1l_ZMF.mjs +0 -2
  292. /package/dist/{contract-BHUOUAZ-.d.mts → contract-CIIqgFyb.d.mts} +0 -0
  293. /package/dist/{sql--yhoVvRM.d.mts → sql-BvfwUKIh.d.mts} +0 -0
@@ -1,4 +1,4 @@
1
- import { c as sqlTag, n as Sql } from "./sql--yhoVvRM.mjs";
1
+ import { c as sqlTag, n as Sql } from "./sql-BvfwUKIh.mjs";
2
2
  import { StandardSchemaV1 } from "@standard-schema/spec";
3
3
 
4
4
  //#region src/schema/scalars/native-types.d.ts
@@ -765,6 +765,7 @@ declare enum VibORMErrorCode {
765
765
  MIGRATION_AMBIGUOUS_COMMIT = "V11020",
766
766
  MIGRATION_UNSUPPORTED_PROVIDER = "V11021",
767
767
  MIGRATION_CORRUPTION = "V11022",
768
+ MIGRATION_INVALID_INDEX = "V11023",
768
769
  OPERATION_ALREADY_EXECUTED = "V12001",
769
770
  OPERATION_EXECUTION_CONFLICT = "V12002",
770
771
  OPERATION_CLIENT_MISMATCH = "V12003",
@@ -812,6 +813,12 @@ interface VibORMErrorMeta {
812
813
  /** Additional context */
813
814
  [key: string]: unknown;
814
815
  }
816
+ /** The options every VibORM error constructor forwards to {@link VibORMError}. */
817
+ interface VibORMErrorOptions {
818
+ cause?: Error | undefined;
819
+ diagnostics?: DiagnosticDisclosure | undefined;
820
+ meta?: VibORMErrorMeta | undefined;
821
+ }
815
822
  /**
816
823
  * Base error class for all VibORM errors
817
824
  */
@@ -826,10 +833,7 @@ declare class VibORMError extends Error {
826
833
  readonly meta: VibORMErrorMeta;
827
834
  /** Timestamp when error occurred */
828
835
  readonly timestamp: Date;
829
- constructor(message: string, code: VibORMErrorCode, options?: {
830
- cause?: Error | undefined;
831
- meta?: VibORMErrorMeta | undefined;
832
- diagnostics?: DiagnosticDisclosure | undefined;
836
+ constructor(message: string, code: VibORMErrorCode, options?: VibORMErrorOptions & {
833
837
  /** Internal validation boundary evidence, snapshotted with the error. */
834
838
  validation?: {
835
839
  source: unknown;
@@ -923,15 +927,7 @@ declare class UniqueConstraintError extends VibORMError {
923
927
  static readonly diagnosticName = "UniqueConstraintError";
924
928
  /** Literal discriminant: this class always carries `UNIQUE_CONSTRAINT`. */
925
929
  readonly code: typeof VibORMErrorCode.UNIQUE_CONSTRAINT;
926
- constructor(message: string, options?: {
927
- cause?: Error | undefined;
928
- diagnostics?: DiagnosticDisclosure | undefined;
929
- meta?: VibORMErrorMeta & {
930
- constraint?: string;
931
- table?: string;
932
- columns?: string[];
933
- };
934
- });
930
+ constructor(message: string, options?: VibORMErrorOptions);
935
931
  }
936
932
  /**
937
933
  * Foreign key constraint violation
@@ -940,13 +936,7 @@ declare class ForeignKeyError extends VibORMError {
940
936
  static readonly diagnosticName = "ForeignKeyError";
941
937
  /** Literal discriminant: this class always carries `FOREIGN_KEY_CONSTRAINT`. */
942
938
  readonly code: typeof VibORMErrorCode.FOREIGN_KEY_CONSTRAINT;
943
- constructor(message: string, options?: {
944
- cause?: Error | undefined;
945
- diagnostics?: DiagnosticDisclosure | undefined;
946
- meta?: VibORMErrorMeta & {
947
- constraint?: string;
948
- };
949
- });
939
+ constructor(message: string, options?: VibORMErrorOptions);
950
940
  }
951
941
  /**
952
942
  * Not-null constraint violation
@@ -955,14 +945,7 @@ declare class NotNullConstraintError extends VibORMError {
955
945
  static readonly diagnosticName = "NotNullConstraintError";
956
946
  /** Literal discriminant: this class always carries `NOT_NULL_CONSTRAINT`. */
957
947
  readonly code: typeof VibORMErrorCode.NOT_NULL_CONSTRAINT;
958
- constructor(message: string, options?: {
959
- cause?: Error | undefined;
960
- diagnostics?: DiagnosticDisclosure | undefined;
961
- meta?: VibORMErrorMeta & {
962
- table?: string;
963
- columns?: string[];
964
- };
965
- });
948
+ constructor(message: string, options?: VibORMErrorOptions);
966
949
  }
967
950
  /**
968
951
  * Check constraint violation
@@ -971,13 +954,7 @@ declare class CheckConstraintError extends VibORMError {
971
954
  static readonly diagnosticName = "CheckConstraintError";
972
955
  /** Literal discriminant: this class always carries `CHECK_CONSTRAINT`. */
973
956
  readonly code: typeof VibORMErrorCode.CHECK_CONSTRAINT;
974
- constructor(message: string, options?: {
975
- cause?: Error | undefined;
976
- diagnostics?: DiagnosticDisclosure | undefined;
977
- meta?: VibORMErrorMeta & {
978
- constraint?: string;
979
- };
980
- });
957
+ constructor(message: string, options?: VibORMErrorOptions);
981
958
  }
982
959
  /**
983
960
  * Value too long for the column's declared type (Prisma P2000)
@@ -997,14 +974,7 @@ declare class ValueTooLongError extends VibORMError {
997
974
  static readonly diagnosticName = "ValueTooLongError";
998
975
  /** Literal discriminant: this class always carries `VALUE_TOO_LONG`. */
999
976
  readonly code: typeof VibORMErrorCode.VALUE_TOO_LONG;
1000
- constructor(message: string, options?: {
1001
- cause?: Error | undefined;
1002
- diagnostics?: DiagnosticDisclosure | undefined;
1003
- meta?: VibORMErrorMeta & {
1004
- table?: string;
1005
- columns?: string[];
1006
- };
1007
- });
977
+ constructor(message: string, options?: VibORMErrorOptions);
1008
978
  }
1009
979
  /**
1010
980
  * Type guard for unique constraint errors
@@ -1050,6 +1020,13 @@ interface MigrationErrorMeta extends VibORMErrorMeta {
1050
1020
  stateId?: string;
1051
1021
  /** Push plan digest involved in the refusal */
1052
1022
  planHash?: string;
1023
+ /** Origin state of the edge (absent for the empty root) */
1024
+ fromState?: string;
1025
+ /** Destination state of the edge */
1026
+ toState?: string;
1027
+ /** Operation and dispatch the failure names */
1028
+ operationId?: string;
1029
+ dispatchId?: string;
1053
1030
  /** Honest effect classification after a non-transactional failure */
1054
1031
  effectState?: "none" | "committed" | "partial" | "may-have-committed";
1055
1032
  /** True when some provider work may already have committed */
@@ -1064,7 +1041,7 @@ interface MigrationErrorMeta extends VibORMErrorMeta {
1064
1041
  * `DRIVER_NOT_SUPPORTED` (`drivers/index.ts`) and `INTERNAL_ERROR` (unreachable operation
1065
1042
  * kinds). A code outside this union is a compile error at the construction site.
1066
1043
  */
1067
- type MigrationErrorCode = typeof VibORMErrorCode.MIGRATION_FAILED | typeof VibORMErrorCode.MIGRATION_NOT_FOUND | typeof VibORMErrorCode.MIGRATION_CHECKSUM_MISMATCH | typeof VibORMErrorCode.MIGRATION_DIALECT_MISMATCH | typeof VibORMErrorCode.MIGRATION_LOCK_FAILED | typeof VibORMErrorCode.MIGRATION_ALREADY_APPLIED | typeof VibORMErrorCode.MIGRATION_OUT_OF_ORDER | typeof VibORMErrorCode.MIGRATION_FILE_NOT_FOUND | typeof VibORMErrorCode.MIGRATION_INVALID_STATE | typeof VibORMErrorCode.MIGRATION_DESTRUCTIVE_REJECTED | typeof VibORMErrorCode.MIGRATION_STORAGE_REQUIRED | typeof VibORMErrorCode.MIGRATION_INVALID_ESTATE | typeof VibORMErrorCode.MIGRATION_PATH_REQUIRED | typeof VibORMErrorCode.MIGRATION_DRIFT | typeof VibORMErrorCode.MIGRATION_MARKER_CONFLICT | typeof VibORMErrorCode.MIGRATION_UNFINISHED_ATTEMPT | typeof VibORMErrorCode.MIGRATION_CONSENT_REQUIRED | typeof VibORMErrorCode.MIGRATION_CONSENT_MISMATCH | typeof VibORMErrorCode.MIGRATION_PARTIAL_EFFECT | typeof VibORMErrorCode.MIGRATION_AMBIGUOUS_COMMIT | typeof VibORMErrorCode.MIGRATION_UNSUPPORTED_PROVIDER | typeof VibORMErrorCode.MIGRATION_CORRUPTION | typeof VibORMErrorCode.INVALID_INPUT | typeof VibORMErrorCode.FEATURE_NOT_SUPPORTED | typeof VibORMErrorCode.DRIVER_NOT_SUPPORTED | typeof VibORMErrorCode.INTERNAL_ERROR;
1044
+ type MigrationErrorCode = typeof VibORMErrorCode.MIGRATION_FAILED | typeof VibORMErrorCode.MIGRATION_NOT_FOUND | typeof VibORMErrorCode.MIGRATION_CHECKSUM_MISMATCH | typeof VibORMErrorCode.MIGRATION_DIALECT_MISMATCH | typeof VibORMErrorCode.MIGRATION_LOCK_FAILED | typeof VibORMErrorCode.MIGRATION_ALREADY_APPLIED | typeof VibORMErrorCode.MIGRATION_OUT_OF_ORDER | typeof VibORMErrorCode.MIGRATION_FILE_NOT_FOUND | typeof VibORMErrorCode.MIGRATION_INVALID_STATE | typeof VibORMErrorCode.MIGRATION_DESTRUCTIVE_REJECTED | typeof VibORMErrorCode.MIGRATION_STORAGE_REQUIRED | typeof VibORMErrorCode.MIGRATION_INVALID_ESTATE | typeof VibORMErrorCode.MIGRATION_PATH_REQUIRED | typeof VibORMErrorCode.MIGRATION_DRIFT | typeof VibORMErrorCode.MIGRATION_MARKER_CONFLICT | typeof VibORMErrorCode.MIGRATION_UNFINISHED_ATTEMPT | typeof VibORMErrorCode.MIGRATION_CONSENT_REQUIRED | typeof VibORMErrorCode.MIGRATION_CONSENT_MISMATCH | typeof VibORMErrorCode.MIGRATION_PARTIAL_EFFECT | typeof VibORMErrorCode.MIGRATION_AMBIGUOUS_COMMIT | typeof VibORMErrorCode.MIGRATION_UNSUPPORTED_PROVIDER | typeof VibORMErrorCode.MIGRATION_CORRUPTION | typeof VibORMErrorCode.MIGRATION_INVALID_INDEX | typeof VibORMErrorCode.INVALID_INPUT | typeof VibORMErrorCode.FEATURE_NOT_SUPPORTED | typeof VibORMErrorCode.DRIVER_NOT_SUPPORTED | typeof VibORMErrorCode.INTERNAL_ERROR;
1068
1045
  /**
1069
1046
  * Migration-related errors
1070
1047
  */
@@ -1095,10 +1072,7 @@ declare class ConnectionError extends VibORMError {
1095
1072
  static readonly diagnosticName = "ConnectionError";
1096
1073
  /** Discriminant: one of {@link ConnectionErrorCode}, never a code outside the family. */
1097
1074
  readonly code: ConnectionErrorCode;
1098
- constructor(message: string, options?: {
1099
- cause?: Error | undefined;
1100
- diagnostics?: DiagnosticDisclosure | undefined;
1101
- meta?: VibORMErrorMeta | undefined;
1075
+ constructor(message: string, options?: VibORMErrorOptions & {
1102
1076
  code?: ConnectionErrorCode | undefined;
1103
1077
  });
1104
1078
  }
@@ -1119,11 +1093,7 @@ declare class ClientInitializationError extends VibORMError {
1119
1093
  static readonly diagnosticName = "ClientInitializationError";
1120
1094
  /** Literal discriminant: this class always carries `CLIENT_INITIALIZATION`. */
1121
1095
  readonly code: typeof VibORMErrorCode.CLIENT_INITIALIZATION;
1122
- constructor(message: string, options?: {
1123
- cause?: Error | undefined;
1124
- diagnostics?: DiagnosticDisclosure | undefined;
1125
- meta?: VibORMErrorMeta | undefined;
1126
- });
1096
+ constructor(message: string, options?: VibORMErrorOptions);
1127
1097
  }
1128
1098
  /**
1129
1099
  * Type guard for client initialization errors
@@ -1146,10 +1116,7 @@ declare class QueryError extends VibORMError {
1146
1116
  static readonly diagnosticName = "QueryError";
1147
1117
  /** Discriminant: one of {@link QueryErrorCode}, never a code outside the family. */
1148
1118
  readonly code: QueryErrorCode;
1149
- constructor(message: string, options?: {
1150
- cause?: Error | undefined;
1151
- diagnostics?: DiagnosticDisclosure | undefined;
1152
- meta?: VibORMErrorMeta | undefined;
1119
+ constructor(message: string, options?: VibORMErrorOptions & {
1153
1120
  code?: QueryErrorCode | undefined;
1154
1121
  });
1155
1122
  }
@@ -1182,10 +1149,7 @@ declare class NestedWriteError extends VibORMError {
1182
1149
  static readonly diagnosticName = "NestedWriteError";
1183
1150
  /** Discriminant: one of {@link NestedWriteErrorCode}, never a code outside the family. */
1184
1151
  readonly code: NestedWriteErrorCode;
1185
- constructor(message: string, relation: string, options?: {
1186
- cause?: Error | undefined;
1187
- diagnostics?: DiagnosticDisclosure | undefined;
1188
- meta?: VibORMErrorMeta | undefined;
1152
+ constructor(message: string, relation: string, options?: VibORMErrorOptions & {
1189
1153
  code?: NestedWriteErrorCode | undefined;
1190
1154
  });
1191
1155
  }
@@ -1202,11 +1166,7 @@ declare class NestedWriteAssertionError extends VibORMError {
1202
1166
  static readonly diagnosticName = "NestedWriteAssertionError";
1203
1167
  /** Literal discriminant: this class always carries `NESTED_WRITE_ASSERTION_FAILED`. */
1204
1168
  readonly code: typeof VibORMErrorCode.NESTED_WRITE_ASSERTION_FAILED;
1205
- constructor(message: string, options?: {
1206
- cause?: Error | undefined;
1207
- diagnostics?: DiagnosticDisclosure | undefined;
1208
- meta?: VibORMErrorMeta | undefined;
1209
- });
1169
+ constructor(message: string, options?: VibORMErrorOptions);
1210
1170
  }
1211
1171
  /**
1212
1172
  * Feature not supported errors
@@ -1330,10 +1290,7 @@ declare class TransactionError extends VibORMError {
1330
1290
  static readonly diagnosticName = "TransactionError";
1331
1291
  /** Discriminant: one of {@link TransactionErrorCode}, never a code outside the family. */
1332
1292
  readonly code: TransactionErrorCode;
1333
- constructor(message: string, options?: {
1334
- cause?: Error | undefined;
1335
- diagnostics?: DiagnosticDisclosure | undefined;
1336
- meta?: VibORMErrorMeta | undefined;
1293
+ constructor(message: string, options?: VibORMErrorOptions & {
1337
1294
  code?: TransactionErrorCode | undefined;
1338
1295
  });
1339
1296
  }
@@ -1375,11 +1332,6 @@ type ValidationErrorSource = {
1375
1332
  readonly target?: string | undefined;
1376
1333
  readonly schemaType?: string | undefined;
1377
1334
  };
1378
- interface ValidationErrorOptions {
1379
- cause?: Error | undefined;
1380
- diagnostics?: DiagnosticDisclosure | undefined;
1381
- meta?: VibORMErrorMeta | undefined;
1382
- }
1383
1335
  /**
1384
1336
  * Input validation errors
1385
1337
  */
@@ -1397,7 +1349,7 @@ declare class ValidationError extends VibORMError {
1397
1349
  * name the caller used (see {@link publicOperationName}).
1398
1350
  */
1399
1351
  readonly operation?: Operation | undefined;
1400
- constructor(sourceOrOperation: Operation | ValidationErrorSource, issues: ValidationIssue$1[], options?: ValidationErrorOptions);
1352
+ constructor(sourceOrOperation: Operation | ValidationErrorSource, issues: ValidationIssue$1[], options?: VibORMErrorOptions);
1401
1353
  }
1402
1354
  /**
1403
1355
  * Type guard for validation errors
@@ -1650,6 +1602,7 @@ interface JsonSchema$1 {
1650
1602
  prefixItems?: JsonSchema$1[];
1651
1603
  minItems?: number;
1652
1604
  maxItems?: number;
1605
+ uniqueItems?: boolean;
1653
1606
  anyOf?: JsonSchema$1[];
1654
1607
  oneOf?: JsonSchema$1[];
1655
1608
  allOf?: JsonSchema$1[];
@@ -2025,12 +1978,13 @@ interface ObjectOptions<T$1 = unknown, TKeys extends string = string> {
2025
1978
  * So one hook: it runs after every member validated, over the validated
2026
1979
  * output (a key spelled `undefined` is already absent there, which is the
2027
1980
  * `{ f: undefined }` ≡ `{}` rule the whole surface follows), and returns the
2028
- * refusal sentence or `undefined`. It is deliberately NOT part of the
1981
+ * refusal sentence, an issue carrying the path of the key that is wrong, or
1982
+ * `undefined`. It is deliberately NOT part of the
2029
1983
  * inferred input type: these are runtime completeness facts about a
2030
1984
  * recursive filter surface, and distributing them into the type would turn
2031
1985
  * every filter object into a union of one variant per operator.
2032
1986
  */
2033
- refuse?: (value: Record<string, unknown>) => string | undefined;
1987
+ refuse?: (value: Record<string, unknown>) => string | ValidationIssue | undefined;
2034
1988
  }
2035
1989
  /**
2036
1990
  * Omit specific keys from a type entirely.
@@ -2224,7 +2178,14 @@ declare function vector<const Opts extends ScalarOptions<number[], any> | undefi
2224
2178
  };
2225
2179
  //#endregion
2226
2180
  //#region src/validation/index.d.ts
2227
- declare function parse<const S$1 extends StandardSchemaV1>(schema: S$1, value: unknown): ParseResult<S$1>;
2181
+ /**
2182
+ * Validate `value` against `schema`. `allIssues: true` reports every issue of
2183
+ * the value — each object member, each list item, every unknown or missing
2184
+ * key — instead of stopping at the first.
2185
+ */
2186
+ declare function parse<const S$1 extends StandardSchemaV1>(schema: S$1, value: unknown, options?: {
2187
+ readonly allIssues?: boolean | undefined;
2188
+ }): ParseResult<S$1>;
2228
2189
  //#endregion
2229
2190
  //#region src/validation/primitives/transform.d.ts
2230
2191
  /**
@@ -2521,7 +2482,8 @@ type FromObjectOptions<T$1 = unknown> = ObjectOptions<T$1>;
2521
2482
  */
2522
2483
  type ComputeEntries<TObject extends Record<string, any>, TPath extends string> = { [K in keyof TObject]: SchemaAtPath<TObject, TPath, K> };
2523
2484
  /**
2524
- * FromObject schema type (alias for ObjectSchema with computed entries).
2485
+ * Project entries without constructing an object validator that a composer
2486
+ * would immediately discard. The public builder uses this same path boundary.
2525
2487
  */
2526
2488
 
2527
2489
  /**
@@ -3015,6 +2977,14 @@ declare function createModelFieldRefs<TName extends string, M$1 extends Model$1<
3015
2977
  *
3016
2978
  * `sql` is the ordinary tagged template; interpolations inside a fragment ride
3017
2979
  * along as bound parameters (see {@link file://../../sql/sql.ts}).
2980
+ *
2981
+ * PURITY IS THE CONTRACT for the callback handed this context. Validation may
2982
+ * run a payload's callbacks more than once — `upsert` re-parses its taken arm
2983
+ * (the C2 residue), so a callback under `upsert.update` can be invoked twice
2984
+ * for one call. A callback that counts its calls, mutates outer state, or
2985
+ * returns a different fragment each time gets exactly what it asks for; a pure
2986
+ * one is indistinguishable from a literal token, which is the whole point of
2987
+ * the sugar.
3018
2988
  */
3019
2989
  interface OperandCtx<TModel> {
3020
2990
  readonly fields: ModelFieldRefs<string, TModel>;
@@ -3287,6 +3257,14 @@ interface UnionSchema<TOptions extends readonly VibSchema<any, any>[], TInput =
3287
3257
  * Create a union schema that validates against multiple options.
3288
3258
  * Returns the result of the first matching schema.
3289
3259
  *
3260
+ * A refusal names the member the value was written for. In a tagged union
3261
+ * (every member an object with its own literal at one key) that is the member
3262
+ * its tag names, and only that member runs. Otherwise it is the member whose
3263
+ * first issue reads DEEPEST into the value (`{ gt: "3" }` is refused at `gt`
3264
+ * by the operator object, not at the root by the shorthand). Members that
3265
+ * refused equally deep leave no such member, and the refusal lists what each
3266
+ * one said, once (one issue, path kept, when they all said the same).
3267
+ *
3290
3268
  * @example
3291
3269
  * const stringOrNumber = v.union([v.string(), v.number()]);
3292
3270
  */
@@ -3678,8 +3656,13 @@ type IsSingleKey<Union> = [Union] extends [never] ? false : [Union] extends [Uni
3678
3656
  /** Only omission or one literal label is evidence for static pairing. */
3679
3657
  type IsProvableRelationName<Name$1> = [Name$1] extends [undefined] ? true : [Name$1] extends [string] ? string extends Name$1 ? false : IsSingleKey<Name$1> : false;
3680
3658
  type IsExactly<Union, Value> = [Union] extends [Value] ? [Value] extends [Union] ? true : false : false;
3681
- /** Type IDENTITY, the strictest test TypeScript exposes to a conditional. */
3682
- type Equal<Left, Right> = (<T$1>() => T$1 extends Left ? 1 : 2) extends (<T$1>() => T$1 extends Right ? 1 : 2) ? true : false;
3659
+ /**
3660
+ * Type IDENTITY, the strictest test TypeScript exposes to a conditional.
3661
+ * `NoInfer` keeps the signature comparison from inferring through both sides:
3662
+ * a client's relinked model state is a mapped type, so that inference would
3663
+ * walk its whole relation graph even when both sides are the same type.
3664
+ */
3665
+ type Equal<Left, Right> = (<T$1>() => T$1 extends NoInfer<Left> ? 1 : 2) extends (<T$1>() => T$1 extends NoInfer<Right> ? 1 : 2) ? true : false;
3683
3666
  type IsSameModel<Left, Right> = Equal<ModelStateOf$8<Left>, ModelStateOf$8<Right>>;
3684
3667
  /**
3685
3668
  * Does `R`'s target domain NAME `Source`? A model target names one getter; a
@@ -3711,8 +3694,12 @@ type VariantPointsAt<Entries$1, Source> = true extends { [Key in keyof Entries$1
3711
3694
  * Steps 2-4. The keys of `Relations` that point at `Source`, carry the same
3712
3695
  * relation-name claim as the asker (an unnamed slot pairs only with an unnamed
3713
3696
  * candidate), and are not the excluded slot.
3697
+ *
3698
+ * The name test runs before the target test: comparing two literals rejects
3699
+ * nearly every slot of a hub model, while `PointsAt` must materialize each
3700
+ * slot's target model to compare identities.
3714
3701
  */
3715
- type CandidateKeys<Relations, Source, AskingName, ExcludedKey> = { [Key in keyof Relations]: IsProvableRelationName<AskingName> extends true ? Key extends ExcludedKey ? never : PointsAt<Relations[Key], Source> extends true ? IsProvableRelationName<RelationName$1<Relations[Key]>> extends true ? IsExactly<RelationName$1<Relations[Key]>, AskingName> extends true ? Key : never : never : never : never }[keyof Relations];
3702
+ type CandidateKeys<Relations, Source, AskingName, ExcludedKey> = { [Key in keyof Relations]: IsProvableRelationName<AskingName> extends true ? Key extends ExcludedKey ? never : IsProvableRelationName<RelationName$1<Relations[Key]>> extends true ? IsExactly<RelationName$1<Relations[Key]>, AskingName> extends true ? PointsAt<Relations[Key], Source> extends true ? Key : never : never : never : never }[keyof Relations];
3716
3703
  type ForwardCandidates<SourceModel, FieldKey, R$1> = CandidateKeys<RelationsOf<TargetModelOf<R$1>>, SourceModel, RelationName$1<R$1>, IsSameModel<TargetModelOf<R$1>, SourceModel> extends true ? FieldKey : never>;
3717
3704
  /**
3718
3705
  * Step 5's reverse half, asked from the source model.
@@ -4037,25 +4024,73 @@ type ToManyCreateSchema<Source extends AnyModel, Key$1, S$1 extends RelationStat
4037
4024
  interface NormalizedRecurrence {
4038
4025
  readonly depth: number | false;
4039
4026
  readonly cycles: "reject" | "prevent" | "allow";
4027
+ /** A projection's own output budget, when its caller set one. */
4028
+ readonly maxOccurrences?: number;
4040
4029
  }
4041
4030
  /**
4042
4031
  * A foreign-key traversal has no cycle policy to choose: it rejects every
4043
4032
  * cycle it reaches. `preventCycles` is therefore refused by the bag's own type,
4044
4033
  * so no downstream guard has to know which topology a nested bag belongs to.
4045
4034
  */
4046
- type ForeignKeyRecurse = true | {
4035
+ type ForeignKeyFilterRecurse = true | {
4047
4036
  readonly depth?: number | false;
4048
4037
  readonly preventCycles?: undefined;
4049
4038
  };
4050
- type GraphRecurse = true | {
4039
+ type GraphFilterRecurse = true | {
4051
4040
  readonly depth?: number;
4052
4041
  readonly preventCycles?: boolean;
4053
4042
  } | {
4054
4043
  readonly depth: false;
4055
4044
  readonly preventCycles?: true;
4056
4045
  };
4046
+ /**
4047
+ * A projection's bag adds the output budget. A `where` filter reads the
4048
+ * closure as a set and decodes no occurrence, so it has nothing to bound and
4049
+ * refuses the key by its own type.
4050
+ */
4051
+ type OutputBudget = {
4052
+ readonly maxOccurrences?: number;
4053
+ };
4054
+ type ForeignKeyRecurse = true | (Exclude<ForeignKeyFilterRecurse, true> & OutputBudget);
4055
+ type GraphRecurse = true | (Exclude<GraphFilterRecurse, true> & OutputBudget);
4057
4056
  type ForeignKeyRecurrenceSchema = V$1.Schema<ForeignKeyRecurse, NormalizedRecurrence>;
4058
4057
  type GraphRecurrenceSchema = V$1.Schema<GraphRecurse, NormalizedRecurrence>;
4058
+ type ForeignKeyFilterRecurrenceSchema = V$1.Schema<ForeignKeyFilterRecurse, NormalizedRecurrence>;
4059
+ type GraphFilterRecurrenceSchema = V$1.Schema<GraphFilterRecurse, NormalizedRecurrence>;
4060
+ /**
4061
+ * The two placements of one recurrence language. A `select`/`include` node
4062
+ * bounds what it decodes; a `where` filter reads the closure as a set, decodes
4063
+ * no occurrence, and so takes no budget.
4064
+ */
4065
+ interface RecurrenceLanguages {
4066
+ readonly projection: {
4067
+ readonly foreignKey: ForeignKeyRecurrenceSchema;
4068
+ readonly junction: GraphRecurrenceSchema;
4069
+ };
4070
+ readonly filter: {
4071
+ readonly foreignKey: ForeignKeyFilterRecurrenceSchema;
4072
+ readonly junction: GraphFilterRecurrenceSchema;
4073
+ };
4074
+ }
4075
+ /**
4076
+ * The runtime eligibility reader: the recurrence language a resolved slot
4077
+ * admits in its placement, or `undefined` when the slot cannot recurse.
4078
+ *
4079
+ * It reads three facts, each from its owner. The model's complete primary row
4080
+ * key comes from the key catalog. The edge kind comes from the resolved slot:
4081
+ * only an ordinary foreign-key or junction edge recurses, never a variant
4082
+ * carrier or an inverse bound to variant storage. Self-identity is the edge's
4083
+ * two endpoints sharing one model object, which is runtime identity rather
4084
+ * than structural agreement.
4085
+ *
4086
+ * The remaining conditions of the contract are already facts of a resolved
4087
+ * ordinary edge, so they are not asked again: only `s.toOne` declares a
4088
+ * foreign key, so a collection never owns one; the resolver publishes an
4089
+ * edge's `unique` exactly when both endpoints are singular, so a singular
4090
+ * inverse is always the proven one-to-one side; and a junction edge is
4091
+ * resolved only between two collections.
4092
+ */
4093
+
4059
4094
  declare const unavailableRecurrence: () => OptionalSchema<VibSchema<never, never>, undefined, undefined, undefined>;
4060
4095
  type UnavailableRecurrenceSchema = ReturnType<typeof unavailableRecurrence>;
4061
4096
  declare const unavailableRecursiveClause: (clause: string) => OptionalSchema<VibSchema<never, never>, undefined, undefined, undefined>;
@@ -4065,7 +4100,7 @@ type UnavailableRecursiveClauseSchema = ReturnType<typeof unavailableRecursiveCl
4065
4100
  * `never` when it cannot recurse, so a recursive form whose `recurse` is
4066
4101
  * required is uninhabitable there.
4067
4102
  */
4068
- type RecurrenceFor<Source extends AnyModel, Key$1, S$1 extends RelationState> = StaticRecursiveMembership<Source, Key$1, S$1> extends StaticForeignKeyMembership ? ForeignKeyRecurrenceSchema : StaticRecursiveMembership<Source, Key$1, S$1> extends StaticJunctionMembership ? GraphRecurrenceSchema : never;
4103
+ type RecurrenceFor<Source extends AnyModel, Key$1, S$1 extends RelationState, Placement extends keyof RecurrenceLanguages = "projection"> = StaticRecursiveMembership<Source, Key$1, S$1> extends StaticForeignKeyMembership ? RecurrenceLanguages[Placement]["foreignKey"] : StaticRecursiveMembership<Source, Key$1, S$1> extends StaticJunctionMembership ? RecurrenceLanguages[Placement]["junction"] : never;
4069
4104
  //#endregion
4070
4105
  //#region src/validation/relations/filter.d.ts
4071
4106
  /**
@@ -4125,15 +4160,15 @@ type Quantifiers<S$1 extends RelationState> = {
4125
4160
  };
4126
4161
  /**
4127
4162
  * The recursive filter: a quantifier over the slot's transitive closure from
4128
- * the filtered row, `self` adding that row itself. `recurse` is the very
4129
- * language `select`/`include` admit on the slot, so eligibility, bounds and
4130
- * normalization have one owner. Where the slot cannot recurse the required
4131
- * `recurse` is `never` and the form is uninhabitable; eligibility stays inside
4132
- * the required key, as on the select side, so no ordinary filter compares the
4133
- * cyclic model graph eagerly.
4163
+ * the filtered row, `self` adding that row itself. `recurse` is the language
4164
+ * `select`/`include` admit on the slot without its output budget, so
4165
+ * eligibility, bounds and normalization have one owner. Where the slot cannot
4166
+ * recurse the required `recurse` is `never` and the form is uninhabitable;
4167
+ * eligibility stays inside the required key, as on the select side, so no
4168
+ * ordinary filter compares the cyclic model graph eagerly.
4134
4169
  */
4135
4170
  type RecursiveFilterSchema<Source extends AnyModel, Key$1, S$1 extends RelationState> = V$1.Object<{
4136
- recurse: RecurrenceFor<Source, Key$1, S$1>;
4171
+ recurse: RecurrenceFor<Source, Key$1, S$1, "filter">;
4137
4172
  self: V$1.Boolean;
4138
4173
  is: UnavailableRecursiveClauseSchema;
4139
4174
  isNot: UnavailableRecursiveClauseSchema;
@@ -4171,22 +4206,6 @@ type ToOneFilterSchema<Source extends AnyModel, Key$1, S$1 extends RelationState
4171
4206
  */
4172
4207
  type ToManyFilterSchema<Source extends AnyModel, Key$1, S$1 extends RelationState> = V$1.Union<readonly [V$1.Object<Quantifiers<S$1> & NoClosure>, RecursiveFilterSchema<Source, Key$1, S$1>]>;
4173
4208
  //#endregion
4174
- //#region src/drivers/shared/sqlite-utils.d.ts
4175
- /**
4176
- * Shared result parser for the SQLite drivers. It speaks about ROW VALUES only:
4177
- * - Boolean integer parsing (0/1 -> false/true)
4178
- * - `json` columns, which SQLite stores as TEXT
4179
- *
4180
- * It says nothing about a RESULT (Arnaud's D-35). A SQLite transport answers a
4181
- * `count`/`exist` in the shape the engine's own projection asked for — the
4182
- * engine aliases that column `_count` and reads `_count` back — so the meaning
4183
- * of a count and an exists answer has one authority, the engine's decoder, and
4184
- * this middleware has nothing to add at the result boundary. Recovering a count
4185
- * from a provider that did NOT preserve the alias is a dialect fact, stated
4186
- * once at the adapter seam by the provider that needs it (MySQL).
4187
- */
4188
- declare const sqliteResultParser: DriverResultParser;
4189
- //#endregion
4190
4209
  //#region src/drivers/types.d.ts
4191
4210
  /**
4192
4211
  * Driver Types
@@ -4242,25 +4261,6 @@ interface BatchQuery {
4242
4261
  /** Internal acknowledgement fired after a native batch commits, before decoding. */
4243
4262
  type CommittedBatchNotification = () => Promise<void>;
4244
4263
  //#endregion
4245
- //#region src/extensions/official-facts.d.ts
4246
- /** One native-batch member as the statement log attributes it. */
4247
- interface StatementMember {
4248
- readonly context: QueryExecutionContext;
4249
- readonly params: unknown[];
4250
- readonly sql: string;
4251
- }
4252
- /** What a statement's provider dispatch publishes, after transform and acquisition. */
4253
- interface StatementExecution {
4254
- readonly context: QueryExecutionContext;
4255
- readonly sql: string;
4256
- /** The one pre-dispatch parameter snapshot, or empty when nothing discloses it. */
4257
- readonly params: unknown[];
4258
- readonly forceErrorContext: boolean;
4259
- /** Native batch: each member's own context, SQL and parameters. */
4260
- readonly members?: readonly StatementMember[];
4261
- }
4262
- type LifecycleBoundary = "connect" | "disconnect" | "savepoint" | "transaction";
4263
- //#endregion
4264
4264
  //#region src/clock.d.ts
4265
4265
  /**
4266
4266
  * The time seam.
@@ -4298,6 +4298,115 @@ interface Clock {
4298
4298
  setTimeout(callback: () => void, ms: number): ClockTimer;
4299
4299
  }
4300
4300
  //#endregion
4301
+ //#region src/drivers/shared/transaction-options.d.ts
4302
+ /** Prisma's isolation-level spellings, exactly. */
4303
+ declare const TRANSACTION_ISOLATION_LEVELS: readonly ["ReadUncommitted", "ReadCommitted", "RepeatableRead", "Serializable"];
4304
+ type TransactionIsolationLevel = (typeof TRANSACTION_ISOLATION_LEVELS)[number];
4305
+ /** Options accepted by the interactive (callback) `$transaction` form. */
4306
+ interface TransactionOptions {
4307
+ /** Isolation level for the transaction. */
4308
+ isolationLevel?: TransactionIsolationLevel;
4309
+ /** Milliseconds the callback body may run before rollback. */
4310
+ timeout?: number;
4311
+ /** Milliseconds to wait for a transaction slot before giving up. */
4312
+ maxWait?: number;
4313
+ }
4314
+ /**
4315
+ * Options accepted by the sequential (array) `$transaction` form. Prisma's
4316
+ * sequential API takes `isolationLevel` only: an array has no interactive
4317
+ * window for `timeout` to bound, so neither client offers it there.
4318
+ */
4319
+ interface BatchTransactionOptions {
4320
+ isolationLevel?: TransactionIsolationLevel;
4321
+ }
4322
+ /** Where a driver must emit `SET TRANSACTION ISOLATION LEVEL`, if anywhere. */
4323
+ type IsolationLevelPlacement = /** PostgreSQL family: first statement *inside* the open transaction. */
4324
+ "provider" | "post-begin"
4325
+ /** MySQL family: on the transaction's own connection *before* BEGIN. */ | "pre-begin"
4326
+ /** SQLite family: serializable by construction; nothing to emit. */ | "serializable-only"
4327
+ /** No transaction is opened, so there is nothing to configure. */ | "unsupported";
4328
+ /** How a driver can bound the wait for a transaction slot. */
4329
+ type MaxWaitSupport = /** The driver serializes transactions through a queue we can bound. */
4330
+ "queue"
4331
+ /** The driver acquires a pooled connection it can abandon and release. */ | "acquisition"
4332
+ /** No wait we own, or no wait at all. */ | "unsupported";
4333
+ /**
4334
+ * A driver's honest answer for each option. Every advertised driver declares
4335
+ * one; `tests/drivers/transaction-portability.test.ts` pins every cell.
4336
+ */
4337
+ interface TransactionOptionSupport {
4338
+ readonly isolationLevel: IsolationLevelPlacement;
4339
+ /**
4340
+ * Why this driver cannot honor the levels it refuses. Required whenever
4341
+ * `isolationLevel` is not `"post-begin"` or `"pre-begin"`, so a refusal
4342
+ * always names its reason instead of just saying "no".
4343
+ */
4344
+ readonly isolationLevelReason?: string;
4345
+ /** Whether the callback body can be raced against a timer and rolled back. */
4346
+ readonly timeout: boolean;
4347
+ /** Why `timeout` cannot be honored. Required when `timeout` is false. */
4348
+ readonly timeoutReason?: string;
4349
+ readonly maxWait: MaxWaitSupport;
4350
+ /** Why `maxWait` cannot be honored. Required when `maxWait` is unsupported. */
4351
+ readonly maxWaitReason?: string;
4352
+ }
4353
+ /** The `$transaction` form the options were passed to. */
4354
+ type TransactionForm = "callback" | "batch";
4355
+ /** What the driver layer must act on. `timeout` never reaches a driver. */
4356
+ interface DriverTransactionOptions {
4357
+ /** Set only when the driver's placement is `"pre-begin"`. */
4358
+ readonly isolationLevel?: TransactionIsolationLevel;
4359
+ /** Set only when the driver's max-wait mode is `"acquisition"`. */
4360
+ readonly maxWaitMs?: number;
4361
+ }
4362
+ /** The honored shape of a validated, driver-accepted options object. */
4363
+ interface TransactionPlan {
4364
+ readonly isolationLevel?: TransactionIsolationLevel;
4365
+ /** `SET TRANSACTION ISOLATION LEVEL ...`, when the driver emits SQL. */
4366
+ readonly isolationStatement?: string;
4367
+ readonly isolationPlacement: IsolationLevelPlacement;
4368
+ readonly timeoutMs?: number;
4369
+ readonly maxWaitMs?: number;
4370
+ readonly maxWaitMode: MaxWaitSupport;
4371
+ /** The subset the driver's own `transaction()` must act on. */
4372
+ readonly driverOptions?: DriverTransactionOptions;
4373
+ }
4374
+ //#endregion
4375
+ //#region src/drivers/shared/sqlite-utils.d.ts
4376
+ /**
4377
+ * Shared result parser for the SQLite drivers. It speaks about ROW VALUES only:
4378
+ * - Boolean integer parsing (0/1 -> false/true)
4379
+ * - `json` columns, which SQLite stores as TEXT
4380
+ *
4381
+ * It says nothing about a RESULT (Arnaud's D-35). A SQLite transport answers a
4382
+ * `count`/`exist` in the shape the engine's own projection asked for — the
4383
+ * engine aliases that column `_count` and reads `_count` back — so the meaning
4384
+ * of a count and an exists answer has one authority, the engine's decoder, and
4385
+ * this middleware has nothing to add at the result boundary. Recovering a count
4386
+ * from a provider that did NOT preserve the alias is a dialect fact, stated
4387
+ * once at the adapter seam by the provider that needs it (MySQL).
4388
+ */
4389
+ declare const sqliteResultParser: DriverResultParser;
4390
+ //#endregion
4391
+ //#region src/extensions/official-facts.d.ts
4392
+ /** One native-batch member as the statement log attributes it. */
4393
+ interface StatementMember {
4394
+ readonly context: QueryExecutionContext;
4395
+ readonly params: unknown[];
4396
+ readonly sql: string;
4397
+ }
4398
+ /** What a statement's provider dispatch publishes, after transform and acquisition. */
4399
+ interface StatementExecution {
4400
+ readonly context: QueryExecutionContext;
4401
+ readonly sql: string;
4402
+ /** The one pre-dispatch parameter snapshot, or empty when nothing discloses it. */
4403
+ readonly params: unknown[];
4404
+ readonly forceErrorContext: boolean;
4405
+ /** Native batch: each member's own context, SQL and parameters. */
4406
+ readonly members?: readonly StatementMember[];
4407
+ }
4408
+ type LifecycleBoundary = "connect" | "disconnect" | "savepoint" | "transaction";
4409
+ //#endregion
4301
4410
  //#region src/cache/schema.d.ts
4302
4411
  type CacheInvalidationSchemaEntries = {
4303
4412
  invalidate: V$1.String<{
@@ -4639,7 +4748,7 @@ interface ExtensionResultConsumerState {
4639
4748
  readonly [extensionResultConsumerState]: true;
4640
4749
  }
4641
4750
  /** The only static facts accumulated while extensions are chained. */
4642
- interface ClientExtensionState<ClientMethods extends object = NoMethods, ModelMethods extends object = NoMethods, CacheState extends ExtensionCacheState | undefined = undefined, ResultConsumerState extends ExtensionResultConsumerState | undefined = undefined, Controls$1 extends object = NoControls, RowModels extends string = never, Data = never> {
4751
+ interface ClientExtensionState<ClientMethods extends object = NoMethods, ModelMethods extends object = NoMethods, CacheState extends ExtensionCacheState | undefined = undefined, ResultConsumerState extends ExtensionResultConsumerState | undefined = undefined, Controls$1 extends object = NoControls, RowModels extends string = never, Data$1 = never> {
4643
4752
  readonly client: ClientMethods;
4644
4753
  readonly models: ModelMethods;
4645
4754
  readonly cache: CacheState;
@@ -4649,7 +4758,7 @@ interface ClientExtensionState<ClientMethods extends object = NoMethods, ModelMe
4649
4758
  /** The models the chain's `rows` can hide from a relation read. */
4650
4759
  readonly rows: RowModels;
4651
4760
  /** The fields the chain's `data` writes, which a caller no longer writes. */
4652
- readonly data: Data;
4761
+ readonly data: Data$1;
4653
4762
  }
4654
4763
  type EmptyClientExtensionState = ClientExtensionState;
4655
4764
  /** Internal constraint for either the absent or enabled nominal cache bit. */
@@ -4735,14 +4844,14 @@ type ResultConsumerContextOf<Definition$1> = Definition$1 extends {
4735
4844
  readonly query: infer Query;
4736
4845
  } ? Query extends CallableFunction ? "result-independent" : "result-consuming" : "result-independent";
4737
4846
  /** Incoming facts keep their nominal bit derivation inside this named state. */
4738
- interface ExtensionContributionState<ClientMethods extends object, ModelMethods extends object, Controls$1 extends object, RowModels extends string, Data, ConsumerContext extends string> extends ExtensionStateConstraint {
4847
+ interface ExtensionContributionState<ClientMethods extends object, ModelMethods extends object, Controls$1 extends object, RowModels extends string, Data$1, ConsumerContext extends string> extends ExtensionStateConstraint {
4739
4848
  readonly client: ClientMethods;
4740
4849
  readonly models: ModelMethods;
4741
4850
  readonly cache: undefined;
4742
4851
  readonly resultConsumer: ConsumerContext extends "result-consuming" ? ExtensionResultConsumerState : undefined;
4743
4852
  readonly controls: Controls$1;
4744
4853
  readonly rows: RowModels;
4745
- readonly data: Data;
4854
+ readonly data: Data$1;
4746
4855
  }
4747
4856
  /** Retain contribution facts, never the factory's contextual argument surface. */
4748
4857
  type ExtensionStateContributionOf<Definition$1> = [Definition$1] extends [unknown] ? ExtensionContributionState<ClientMethodsOf<Definition$1>, ModelMethodsOf<Definition$1>, DefinitionControls<Definition$1>, RowsModels<Definition$1>, DefinitionData<Definition$1>, ResultConsumerContextOf<Definition$1>> : never;
@@ -5070,7 +5179,7 @@ type DefinitionData<Definition$1> = Definition$1 extends {
5070
5179
  };
5071
5180
  } ? string extends keyof Models ? never : { [Model in keyof Models]: CreateStamps<Model, Models[Model]> }[keyof Models] : never;
5072
5181
  /** The fields a chain writes on every create of one model. */
5073
- type StampedFieldNames<Data, ModelName$1> = Data extends StampedFields<infer Models, infer Fields extends PropertyKey> ? ModelName$1 extends Models ? Fields : never : never;
5182
+ type StampedFieldNames<Data$1, ModelName$1> = Data$1 extends StampedFields<infer Models, infer Fields extends PropertyKey> ? ModelName$1 extends Models ? Fields : never : never;
5074
5183
  /**
5075
5184
  * The controls one call admitted, by name. A `rows` control is resolved to its
5076
5185
  * mode, so an absent one reads as its default; an absent plain control is not
@@ -5080,6 +5189,7 @@ type AdmittedControls = Readonly<Record<string, unknown>>;
5080
5189
  //#endregion
5081
5190
  //#region src/extensions/query.d.ts
5082
5191
  type QueryInterceptionMode = "direct" | "transaction" | "array";
5192
+ type RawQueryKind = "queryRaw" | "executeRaw" | "queryRawUnsafe" | "executeRawUnsafe";
5083
5193
  type WriteOutcome = Readonly<{
5084
5194
  certainty: "committed" | "may-have-committed";
5085
5195
  }>;
@@ -5097,23 +5207,11 @@ type GenericModelQueryContext<Result> = GenericQueryContextBase<Result> & {
5097
5207
  /** The call's controls this handler's extension declares, and only those. */
5098
5208
  readonly controls?: AdmittedControls;
5099
5209
  };
5100
- type GenericRawQueryContext<Result> = GenericQueryContextBase<Result> & ({
5101
- readonly kind: "queryRaw";
5102
- readonly model: undefined;
5103
- readonly operation: "$queryRaw";
5104
- } | {
5105
- readonly kind: "executeRaw";
5106
- readonly model: undefined;
5107
- readonly operation: "$executeRaw";
5108
- } | {
5109
- readonly kind: "queryRawUnsafe";
5210
+ type GenericRawQueryContext<Result> = GenericQueryContextBase<Result> & { [Kind in RawQueryKind]: {
5211
+ readonly kind: Kind;
5110
5212
  readonly model: undefined;
5111
- readonly operation: "$queryRawUnsafe";
5112
- } | {
5113
- readonly kind: "executeRawUnsafe";
5114
- readonly model: undefined;
5115
- readonly operation: "$executeRawUnsafe";
5116
- });
5213
+ readonly operation: `$${Kind}`;
5214
+ } }[RawQueryKind];
5117
5215
  type GenericQueryContext<Result> = GenericModelQueryContext<Result> | GenericRawQueryContext<Result>;
5118
5216
  type GenericQueryHandlerCall = <Result>(context: GenericQueryContext<Result>) => Promise<Result>;
5119
5217
  declare const officialQueryHandlerIdentity: unique symbol;
@@ -5169,80 +5267,6 @@ type OfficialCacheExtension = {
5169
5267
  readonly controls: OfficialCacheControls;
5170
5268
  };
5171
5269
  //#endregion
5172
- //#region src/drivers/shared/transaction-options.d.ts
5173
- /** Prisma's isolation-level spellings, exactly. */
5174
- declare const TRANSACTION_ISOLATION_LEVELS: readonly ["ReadUncommitted", "ReadCommitted", "RepeatableRead", "Serializable"];
5175
- type TransactionIsolationLevel = (typeof TRANSACTION_ISOLATION_LEVELS)[number];
5176
- /** Options accepted by the interactive (callback) `$transaction` form. */
5177
- interface TransactionOptions {
5178
- /** Isolation level for the transaction. */
5179
- isolationLevel?: TransactionIsolationLevel;
5180
- /** Milliseconds the callback body may run before rollback. */
5181
- timeout?: number;
5182
- /** Milliseconds to wait for a transaction slot before giving up. */
5183
- maxWait?: number;
5184
- }
5185
- /**
5186
- * Options accepted by the sequential (array) `$transaction` form. Prisma's
5187
- * sequential API takes `isolationLevel` only: an array has no interactive
5188
- * window for `timeout` to bound, so neither client offers it there.
5189
- */
5190
- interface BatchTransactionOptions {
5191
- isolationLevel?: TransactionIsolationLevel;
5192
- }
5193
- /** Where a driver must emit `SET TRANSACTION ISOLATION LEVEL`, if anywhere. */
5194
- type IsolationLevelPlacement = /** PostgreSQL family: first statement *inside* the open transaction. */
5195
- "provider" | "post-begin"
5196
- /** MySQL family: on the transaction's own connection *before* BEGIN. */ | "pre-begin"
5197
- /** SQLite family: serializable by construction; nothing to emit. */ | "serializable-only"
5198
- /** No transaction is opened, so there is nothing to configure. */ | "unsupported";
5199
- /** How a driver can bound the wait for a transaction slot. */
5200
- type MaxWaitSupport = /** The driver serializes transactions through a queue we can bound. */
5201
- "queue"
5202
- /** The driver acquires a pooled connection it can abandon and release. */ | "acquisition"
5203
- /** No wait we own, or no wait at all. */ | "unsupported";
5204
- /**
5205
- * A driver's honest answer for each option. Every advertised driver declares
5206
- * one; `tests/drivers/transaction-portability.test.ts` pins every cell.
5207
- */
5208
- interface TransactionOptionSupport {
5209
- readonly isolationLevel: IsolationLevelPlacement;
5210
- /**
5211
- * Why this driver cannot honor the levels it refuses. Required whenever
5212
- * `isolationLevel` is not `"post-begin"` or `"pre-begin"`, so a refusal
5213
- * always names its reason instead of just saying "no".
5214
- */
5215
- readonly isolationLevelReason?: string;
5216
- /** Whether the callback body can be raced against a timer and rolled back. */
5217
- readonly timeout: boolean;
5218
- /** Why `timeout` cannot be honored. Required when `timeout` is false. */
5219
- readonly timeoutReason?: string;
5220
- readonly maxWait: MaxWaitSupport;
5221
- /** Why `maxWait` cannot be honored. Required when `maxWait` is unsupported. */
5222
- readonly maxWaitReason?: string;
5223
- }
5224
- /** The `$transaction` form the options were passed to. */
5225
- type TransactionForm = "callback" | "batch";
5226
- /** What the driver layer must act on. `timeout` never reaches a driver. */
5227
- interface DriverTransactionOptions {
5228
- /** Set only when the driver's placement is `"pre-begin"`. */
5229
- readonly isolationLevel?: TransactionIsolationLevel;
5230
- /** Set only when the driver's max-wait mode is `"acquisition"`. */
5231
- readonly maxWaitMs?: number;
5232
- }
5233
- /** The honored shape of a validated, driver-accepted options object. */
5234
- interface TransactionPlan {
5235
- readonly isolationLevel?: TransactionIsolationLevel;
5236
- /** `SET TRANSACTION ISOLATION LEVEL ...`, when the driver emits SQL. */
5237
- readonly isolationStatement?: string;
5238
- readonly isolationPlacement: IsolationLevelPlacement;
5239
- readonly timeoutMs?: number;
5240
- readonly maxWaitMs?: number;
5241
- readonly maxWaitMode: MaxWaitSupport;
5242
- /** The subset the driver's own `transaction()` must act on. */
5243
- readonly driverOptions?: DriverTransactionOptions;
5244
- }
5245
- //#endregion
5246
5270
  //#region src/client/omit.d.ts
5247
5271
  /** Fields a client hides by default, per model key of the schema. */
5248
5272
  type ClientOmitConfig<S$1 extends Record<string, AnyModel>> = { [K in keyof S$1]?: ClientModelOmit<S$1[K]> };
@@ -5371,11 +5395,13 @@ type NoExtraDriverConfigKeys<Given, Options$1, S$1 extends Schema$1> = Record<Ex
5371
5395
  */
5372
5396
  type TransactionClient<C$1 extends VibORMConfig, X$1 extends ExtensionStateConstraint = EmptyClientExtensionState> = ExtensionModelClient<C$1, X$1> & RawSurface & {
5373
5397
  readonly $schema: ClientSchema<C$1>;
5374
- $transaction: {
5375
- <T$1>(fn: (tx: TransactionClient<C$1, X$1>) => PromiseLike<T$1>, options?: TransactionOptions): Promise<T$1>;
5376
- <T$1 extends BatchTransactionOperation<unknown>[]>(operations: [...T$1], options?: BatchTransactionOptions): Promise<{ [K in keyof T$1]: Awaited<T$1[K]> }>;
5377
- };
5398
+ $transaction: TransactionMethod<C$1, X$1>;
5378
5399
  } & X$1["client"];
5400
+ /** `$transaction`'s two forms: an interactive callback, or a batch array. */
5401
+ type TransactionMethod<C$1 extends VibORMConfig, X$1 extends ExtensionStateConstraint> = {
5402
+ <T$1>(fn: (tx: TransactionClient<C$1, X$1>) => PromiseLike<T$1>, options?: TransactionOptions): Promise<T$1>;
5403
+ <T$1 extends BatchTransactionOperation<unknown>[]>(operations: [...T$1], options?: BatchTransactionOptions): Promise<{ [K in keyof T$1]: Awaited<T$1[K]> }>;
5404
+ };
5379
5405
  /**
5380
5406
  * Extended client type with utility methods
5381
5407
  */
@@ -5428,10 +5454,7 @@ interface VibORMClientMembers<C$1 extends VibORMConfig, X$1 extends ExtensionSta
5428
5454
  * The array form takes `isolationLevel` only: a preplanned array has no
5429
5455
  * interactive window for `timeout` or `maxWait` to bound.
5430
5456
  */
5431
- $transaction: {
5432
- <T$1>(fn: (tx: TransactionClient<C$1, X$1>) => PromiseLike<T$1>, options?: TransactionOptions): Promise<T$1>;
5433
- <T$1 extends BatchTransactionOperation<unknown>[]>(operations: [...T$1], options?: BatchTransactionOptions): Promise<{ [K in keyof T$1]: Awaited<T$1[K]> }>;
5434
- };
5457
+ $transaction: TransactionMethod<C$1, X$1>;
5435
5458
  /** Connect to the database */
5436
5459
  $connect: () => Promise<void>;
5437
5460
  /** Disconnect from the database */
@@ -6605,9 +6628,9 @@ type GenerationChoice<State$1 extends ScalarState<"string">, Given> = Given exte
6605
6628
  generate: infer Choice extends boolean | undefined;
6606
6629
  } ? Choice : undefined;
6607
6630
  type HasCustomDefault<State$1 extends ScalarState<"string">> = State$1["default"] extends GeneratorDefaultBrand ? false : State$1["hasDefault"];
6608
- type FormatState<State$1 extends ScalarState<"string">, Given, Kind extends IdentifierKind = IdentifierKind> = {
6631
+ type FormatState<State$1 extends ScalarState<"string">, Given, Kind$1 extends IdentifierKind = IdentifierKind> = {
6609
6632
  autoGenerate: AutoGenerate & {
6610
- kind: Kind;
6633
+ kind: Kind$1;
6611
6634
  implicit?: undefined;
6612
6635
  generate: GenerationChoice<State$1, Given>;
6613
6636
  };
@@ -6931,15 +6954,15 @@ type VectorSortOrderSchema = typeof vectorSortOrderSchema;
6931
6954
  type ModelStateOf$7<M$1 extends AnyModel> = M$1["~"]["state"];
6932
6955
  type ModelScalars$2<M$1 extends AnyModel> = ModelStateOf$7<M$1>["scalars"];
6933
6956
  type ModelScalarKey<M$1 extends AnyModel> = StringKeyOf<ModelScalars$2<M$1>>;
6934
- type ScalarStateOf$2<F$1> = F$1 extends {
6957
+ type ScalarStateOf$3<F$1> = F$1 extends {
6935
6958
  "~": {
6936
6959
  state: infer S;
6937
6960
  };
6938
6961
  } ? S extends ScalarState ? S : never : never;
6939
6962
  type ModelDecimalListScalarKeys<M$1 extends AnyModel> = Extract<DecimalListScalarKeys<ModelScalars$2<M$1>>, ModelScalarKey<M$1>>;
6940
6963
  type OrderableScalarKeys<M$1 extends AnyModel> = Exclude<ModelScalarKey<M$1>, ModelDecimalListScalarKeys<M$1> | PointScalarKeys$2<M$1>>;
6941
- type VectorScalarKeys$1<M$1 extends AnyModel> = { [K in keyof ModelScalars$2<M$1>]: ScalarStateOf$2<ModelScalars$2<M$1>[K]>["type"] extends "vector" ? K extends string ? K : never : never }[keyof ModelScalars$2<M$1>];
6942
- type PointScalarKeys$2<M$1 extends AnyModel> = { [K in keyof ModelScalars$2<M$1>]: ScalarStateOf$2<ModelScalars$2<M$1>[K]>["type"] extends "point" ? K extends string ? K : never : never }[keyof ModelScalars$2<M$1>];
6964
+ type VectorScalarKeys$1<M$1 extends AnyModel> = { [K in keyof ModelScalars$2<M$1>]: ScalarStateOf$3<ModelScalars$2<M$1>[K]>["type"] extends "vector" ? K extends string ? K : never : never }[keyof ModelScalars$2<M$1>];
6965
+ type PointScalarKeys$2<M$1 extends AnyModel> = { [K in keyof ModelScalars$2<M$1>]: ScalarStateOf$3<ModelScalars$2<M$1>[K]>["type"] extends "point" ? K extends string ? K : never : never }[keyof ModelScalars$2<M$1>];
6943
6966
  type NonVectorScalarKeys<M$1 extends AnyModel> = Exclude<OrderableScalarKeys<M$1>, VectorScalarKeys$1<M$1>>;
6944
6967
  /** A decimal list has equality semantics, but no portable numeric ordering. */
6945
6968
 
@@ -6958,12 +6981,12 @@ type OrderBySchema<M$1 extends AnyModel, F$1 extends ScalarSchemas<M$1>> = V$1.O
6958
6981
  type ModelStateOf$6<M$1 extends AnyModel> = M$1["~"]["state"];
6959
6982
  type ModelScalars$1<M$1 extends AnyModel> = ModelStateOf$6<M$1>["scalars"];
6960
6983
  type ModelDecimalListScalarKey<M$1 extends AnyModel> = DecimalListScalarKeys<ModelScalars$1<M$1>>;
6961
- type ScalarStateOf$1<F$1> = F$1 extends {
6984
+ type ScalarStateOf$2<F$1> = F$1 extends {
6962
6985
  "~": {
6963
6986
  state: infer S;
6964
6987
  };
6965
6988
  } ? S extends ScalarState ? S : never : never;
6966
- type VectorScalarKey<M$1 extends AnyModel> = { [K in keyof ModelScalars$1<M$1>]: ScalarStateOf$1<ModelScalars$1<M$1>[K]>["type"] extends "vector" ? K extends string ? K : never : never }[keyof ModelScalars$1<M$1>];
6989
+ type VectorScalarKey<M$1 extends AnyModel> = { [K in keyof ModelScalars$1<M$1>]: ScalarStateOf$2<ModelScalars$1<M$1>[K]>["type"] extends "vector" ? K extends string ? K : never : never }[keyof ModelScalars$1<M$1>];
6967
6990
  type NonVectorScalarKey<M$1 extends AnyModel> = Exclude<OrderableScalarKeys<M$1>, VectorScalarKey<M$1>>;
6968
6991
  type ModelScalarOrderByEntries<M$1 extends AnyModel> = V$1.FromKeys<NonVectorScalarKey<M$1>[], SortOrderSchema>["entries"] & V$1.FromKeys<VectorScalarKey<M$1>[], VectorSortOrderSchema>["entries"] & V$1.FromKeys<ModelDecimalListScalarKey<M$1>[], DecimalListOrderByRefusalSchema>["entries"];
6969
6992
  /**
@@ -8355,9 +8378,16 @@ type JsonUpdateSchema<F$1 extends ScalarState<"json">, S$1 extends V$1.Schema> =
8355
8378
  }>, V$1.Coerce<JsonWriteOperand<F$1, S$1>, {
8356
8379
  set: JsonWriteOperand<F$1, S$1>[" vibInferred"]["1"];
8357
8380
  }>]>;
8381
+ /**
8382
+ * The create schema reads the same envelope (see {@link isSetEnvelope}), so it
8383
+ * takes what an update takes and yields the value it stores.
8384
+ */
8385
+ type JsonCreateSchema<F$1 extends ScalarState<"json">, S$1 extends V$1.Schema> = VibSchema<V$1.Input<JsonWriteOperand<F$1, S$1>> | {
8386
+ set: Exclude<V$1.Input<JsonWriteOperand<F$1, S$1>>, undefined>;
8387
+ }, V$1.Output<JsonWriteOperand<F$1, S$1>>>;
8358
8388
  interface JsonSchemas<F$1 extends ScalarState<"json">> {
8359
8389
  base: F$1["base"];
8360
- create: JsonWriteOperand<F$1, V$1.Json<F$1>>;
8390
+ create: JsonCreateSchema<F$1, V$1.Json<F$1>>;
8361
8391
  update: JsonUpdateSchema<F$1, F$1["base"]>;
8362
8392
  filter: JsonFilterSchema<V$1.Json>;
8363
8393
  }
@@ -8711,13 +8741,13 @@ type ProjectableScalarKeys<M$1 extends AnyModel> = Exclude<StringKeyOf<ModelStat
8711
8741
  */
8712
8742
  type ModelStateOf$2<M$1 extends AnyModel> = M$1["~"]["state"];
8713
8743
  type ModelScalars<M$1 extends AnyModel> = ModelStateOf$2<M$1>["scalars"];
8714
- type ScalarStateOf<F$1> = F$1 extends {
8744
+ type ScalarStateOf$1<F$1> = F$1 extends {
8715
8745
  "~": {
8716
8746
  state: infer S;
8717
8747
  };
8718
8748
  } ? S extends ScalarState ? S : never : never;
8719
- type AnyVectorScalarKeys<M$1 extends AnyModel> = { [K in keyof ModelScalars<M$1>]: ScalarStateOf<ModelScalars<M$1>[K]>["type"] extends "vector" ? K extends string ? K : never : never }[keyof ModelScalars<M$1>];
8720
- type AnyPointScalarKeys<M$1 extends AnyModel> = { [K in keyof ModelScalars<M$1>]: ScalarStateOf<ModelScalars<M$1>[K]>["type"] extends "point" ? K extends string ? K : never : never }[keyof ModelScalars<M$1>];
8749
+ type AnyVectorScalarKeys<M$1 extends AnyModel> = { [K in keyof ModelScalars<M$1>]: ScalarStateOf$1<ModelScalars<M$1>[K]>["type"] extends "vector" ? K extends string ? K : never : never }[keyof ModelScalars<M$1>];
8750
+ type AnyPointScalarKeys<M$1 extends AnyModel> = { [K in keyof ModelScalars<M$1>]: ScalarStateOf$1<ModelScalars<M$1>[K]>["type"] extends "point" ? K extends string ? K : never : never }[keyof ModelScalars<M$1>];
8721
8751
  /**
8722
8752
  * Both halves of the select schema are keyed on {@link ProjectableScalarKeys},
8723
8753
  * so a model-level `.omit()`-ed scalar has no `select` entry at all: naming it
@@ -8878,9 +8908,20 @@ declare const pointScalarSelectSchema: UnionSchema<readonly [BooleanSchema<boole
8878
8908
  }>>;
8879
8909
  }>>;
8880
8910
  type PointScalarSelectSchema = typeof pointScalarSelectSchema;
8911
+ /**
8912
+ * A written `select` names what the row carries, so one that names nothing
8913
+ * (`{}`, only `false`, or a `_count` that counts no relation, as `_count: true`
8914
+ * does on a model with no to-many relation) is a caller mistake, refused at its
8915
+ * own path. Leaving `select` out is how a caller asks for the default row.
8916
+ */
8917
+ declare const requireSelectedField: (select: Record<string, unknown>) => string | undefined;
8918
+ /** The refusal every written `select` carries ({@link requireSelectedField}). */
8919
+ type SelectRefusal = {
8920
+ readonly refuse: typeof requireSelectedField;
8921
+ };
8881
8922
  type SelectSchema<M$1 extends AnyModel, F$1 extends ScalarSchemas<M$1>> = V$1.Object<V$1.FromKeys<PlainScalarKeys<M$1>[], typeof scalarSelectSchema>["entries"] & V$1.FromKeys<VectorScalarKeys<M$1>[], VectorScalarSelectSchema>["entries"] & V$1.FromKeys<PointScalarKeys$1<M$1>[], PointScalarSelectSchema>["entries"] & V$1.FromObject<F$1["relations"], "select">["entries"] & V$1.FromObject<F$1["polymorphic"], "select">["entries"] & {
8882
8923
  _count: CountSchema<F$1>;
8883
- }>;
8924
+ }, SelectRefusal>;
8884
8925
  /**
8885
8926
  * The SCALAR-ONLY projection: {@link SelectSchema} without relation keys and
8886
8927
  * without `_count`.
@@ -8902,7 +8943,7 @@ type SelectSchema<M$1 extends AnyModel, F$1 extends ScalarSchemas<M$1>> = V$1.Ob
8902
8943
  * `<Model>SelectCreateManyAndReturn` / `<Model>IncludeCreateManyAndReturn` types
8903
8944
  * (prisma 6.8.2, `prisma-client/generator-build`, `Model.argsTypes`).
8904
8945
  */
8905
- type ScalarSelectSchema<M$1 extends AnyModel> = V$1.Object<V$1.FromKeys<PlainScalarKeys<M$1>[], typeof scalarSelectSchema>["entries"] & V$1.FromKeys<VectorScalarKeys<M$1>[], VectorScalarSelectSchema>["entries"] & V$1.FromKeys<PointScalarKeys$1<M$1>[], PointScalarSelectSchema>["entries"]>;
8946
+ type ScalarSelectSchema<M$1 extends AnyModel> = V$1.Object<V$1.FromKeys<PlainScalarKeys<M$1>[], typeof scalarSelectSchema>["entries"] & V$1.FromKeys<VectorScalarKeys<M$1>[], VectorScalarSelectSchema>["entries"] & V$1.FromKeys<PointScalarKeys$1<M$1>[], PointScalarSelectSchema>["entries"], SelectRefusal>;
8906
8947
  /**
8907
8948
  * Build include schema - nested include for each relation
8908
8949
  */
@@ -9986,7 +10027,8 @@ type SingularFieldTree<M$1> = M$1 extends {
9986
10027
  } ? { [V in keyof Entries]: Entries[V] extends {
9987
10028
  readonly getter: () => infer Next;
9988
10029
  } ? SingularFieldTree<Next> : never } : never : true } : never;
9989
- type SchemaKeyOf<S$1, T$1> = { [J in keyof S$1]-?: [SingularFieldTree<S$1[J]>] extends [SingularFieldTree<T$1>] ? [SingularFieldTree<T$1>] extends [SingularFieldTree<S$1[J]>] ? IsIdentical<S$1[J], T$1> extends true ? J : never : never : never }[keyof S$1];
10030
+ type TreeEntries<S$1> = { [J in keyof S$1]-?: [SingularFieldTree<S$1[J]>, J] }[keyof S$1];
10031
+ type SchemaKeyOf<S$1, T$1> = Extract<TreeEntries<S$1>, [SingularFieldTree<T$1>, unknown]> extends infer Hit ? Hit extends [infer Tree, infer J extends keyof S$1] ? [SingularFieldTree<T$1>] extends [Tree] ? IsIdentical<S$1[J], T$1> extends true ? J : never : never : never : never;
9990
10032
  type TargetLinks<S$1, Target$1> = Target$1 extends {
9991
10033
  readonly kind: "model";
9992
10034
  readonly getter: infer G;
@@ -9997,29 +10039,43 @@ type TargetLinks<S$1, Target$1> = Target$1 extends {
9997
10039
  readonly getter: infer G;
9998
10040
  } ? G extends (() => infer M) ? SchemaKeyOf<S$1, M> : never : never } : never;
9999
10041
  /** Resolve while the producer still owns the exact getter types. */
10000
- type RelationLinks<S$1 extends Schema$1> = { [K in keyof S$1]: { [R in keyof S$1[K]["~"]["state"]["relations"]]: TargetLinks<S$1, S$1[K]["~"]["state"]["relations"][R]["~"]["state"]["target"]> } } extends infer U ? { [K in keyof U]: U[K] } : never;
10042
+ type RelationLinks<S$1 extends Schema$1> = { [K in keyof S$1]: { [R in keyof S$1[K]["~"]["state"]["relations"]]: TargetLinks<S$1, S$1[K]["~"]["state"]["relations"][R]["~"]["state"]["target"]> } };
10001
10043
  type LinkAt<L$1, K$1, R$1> = K$1 extends keyof L$1 ? R$1 extends keyof L$1[K$1] ? L$1[K$1][R$1] : never : never;
10002
10044
  type VariantLink<T$1, V$2> = V$2 extends keyof T$1 ? T$1[V$2] : never;
10003
10045
  /** Clone every state fact inline; no alias retains the original recursive shape. */
10004
- type FlatSchema<S$1 extends Schema$1, L$1> = { [K in keyof S$1]: S$1[K] extends Model$1<infer State> ? Model$1<{ [P in keyof State]: P extends "shape" | "relations" ? { [F in keyof State[P]]: State[P][F] extends AnyRelation ? State[P][F]["~"]["state"] extends infer RS extends RelationState ? RS extends ModelToOneState ? ModelToOneRelation<{ [Q in keyof RS]: Q extends "target" ? [LinkAt<L$1, K, F>] extends [never] ? RS[Q] : { [T in keyof RS[Q]]: T extends "getter" ? unknown : RS[Q][T] } : RS[Q] }> : RS extends ModelToManyState ? ModelToManyRelation<{ [Q in keyof RS]: Q extends "target" ? [LinkAt<L$1, K, F>] extends [never] ? RS[Q] : { [T in keyof RS[Q]]: T extends "getter" ? unknown : RS[Q][T] } : RS[Q] }> : RS extends VariantToOneState ? VariantToOneRelation<{ [Q in keyof RS]: Q extends "target" ? RS[Q] extends {
10046
+ type FlatSchema<S$1 extends Schema$1, L$1> = { [K in keyof S$1]: S$1[K] extends Model$1<infer State> ? Model$1<{ [P in keyof State]: P extends "shape" | "relations" ? { [F in keyof State[P]]: State[P][F] extends AnyRelation ? State[P][F]["~"]["state"] extends infer RS extends RelationState ? RS extends ModelToOneState ? ModelToOneRelation<{ [Q in keyof RS]: Q extends "target" ? { [T in keyof RS[Q]]: T extends "getter" ? [LinkAt<L$1, K, F>] extends [never] ? RS[Q][T] : unknown : RS[Q][T] } : RS[Q] }> : RS extends ModelToManyState ? ModelToManyRelation<{ [Q in keyof RS]: Q extends "target" ? { [T in keyof RS[Q]]: T extends "getter" ? [LinkAt<L$1, K, F>] extends [never] ? RS[Q][T] : unknown : RS[Q][T] } : RS[Q] }> : RS extends VariantToOneState ? VariantToOneRelation<{ [Q in keyof RS]: Q extends "target" ? RS[Q] extends {
10005
10047
  readonly entries: infer Entries;
10006
10048
  } ? { [T in keyof RS[Q]]: T extends "entries" ? { [V in keyof Entries]: { [E in keyof Entries[V]]: E extends "getter" ? [VariantLink<LinkAt<L$1, K, F>, V>] extends [never] ? Entries[V][E] : unknown : Entries[V][E] } } : RS[Q][T] } : RS[Q] : RS[Q] }> : RS extends VariantToManyState ? VariantToManyRelation<{ [Q in keyof RS]: Q extends "target" ? RS[Q] extends {
10007
10049
  readonly entries: infer Entries;
10008
10050
  } ? { [T in keyof RS[Q]]: T extends "entries" ? { [V in keyof Entries]: { [E in keyof Entries[V]]: E extends "getter" ? [VariantLink<LinkAt<L$1, K, F>, V>] extends [never] ? Entries[V][E] : unknown : Entries[V][E] } } : RS[Q][T] } : RS[Q] : RS[Q] }> : State[P][F] : State[P][F] : State[P][F] } : P extends "scalars" | "uniques" ? { [F in keyof State[P]]: State[P][F] } : P extends "compoundId" | "compoundUniques" ? State[P] extends infer Constraints extends State[P] ? Constraints extends object ? { [F in keyof Constraints]: Constraints[F] extends ObjectSchema<infer Entries, infer Options, infer Input, infer Output> ? ObjectSchema<{ [E in keyof Entries]: Entries[E] }, Options, Input extends object ? { [E in keyof Input]: Input[E] } : Input, Output extends object ? { [E in keyof Output]: Output[E] } : Output> : Constraints[F] } : Constraints : never : State[P] }> : never };
10009
- type RepointTarget<Target$1, Link, S$1 extends Schema$1, L$1> = Target$1 extends {
10051
+ /** One linked target; a union of twin keys answers a union of targets. */
10052
+ type LinkedTarget<S$1 extends Schema$1, L$1, J$1> = J$1 extends keyof S$1 ? Linked<S$1, L$1, J$1> : never;
10053
+ type RepointTarget<Target$1, S$1 extends Schema$1, L$1, K$1, F$1> = Target$1 extends {
10010
10054
  readonly kind: "model";
10011
- } ? [Link] extends [never] ? Target$1 : Link extends keyof S$1 ? { [P in keyof Target$1]: P extends "getter" ? () => Linked<S$1, L$1, Link> : Target$1[P] } : Target$1 : Target$1 extends {
10055
+ } ? { [P in keyof Target$1]: P extends "getter" ? Target$1[P] extends (() => unknown) ? Target$1[P] : () => LinkedTarget<S$1, L$1, LinkAt<L$1, K$1, F$1>> : Target$1[P] } : Target$1 extends {
10012
10056
  readonly kind: "variants";
10013
10057
  readonly entries: infer Entries;
10014
- } ? { [P in keyof Target$1]: P extends "entries" ? { [V in keyof Entries]: { [E in keyof Entries[V]]: E extends "getter" ? VariantLink<Link, V> extends infer J ? [J] extends [never] ? Entries[V][E] : J extends keyof S$1 ? () => Linked<S$1, L$1, J> : Entries[V][E] : Entries[V][E] : Entries[V][E] } } : Target$1[P] } : Target$1;
10015
- type RepointState<State$1, Link, S$1 extends Schema$1, L$1> = { [P in keyof State$1]: P extends "target" ? RepointTarget<State$1[P], Link, S$1, L$1> : State$1[P] };
10016
- type LinkedRelation<R$1, Link, S$1 extends Schema$1, L$1> = R$1 extends AnyRelation ? R$1["~"]["state"] extends infer State extends RelationState ? State extends ModelToOneState ? ModelToOneRelation<RepointState<State, Link, S$1, L$1>> : State extends ModelToManyState ? ModelToManyRelation<RepointState<State, Link, S$1, L$1>> : State extends VariantToOneState ? VariantToOneRelation<RepointState<State, Link, S$1, L$1>> : State extends VariantToManyState ? VariantToManyRelation<RepointState<State, Link, S$1, L$1>> : R$1 : R$1 : R$1;
10017
- /** Relinking operates only on the already-flat schema and resolved literal links. */
10018
- type LinkedState<S$1 extends Schema$1, L$1, K$1 extends keyof S$1> = S$1[K$1] extends Model$1<infer State> ? { [P in keyof State]: P extends "shape" | "relations" ? { [F in keyof State[P]]: LinkedRelation<State[P][F], LinkAt<L$1, K$1, F>, S$1, L$1> } : State[P] } : never;
10058
+ } ? RepointVariants<Target$1, Entries, LinkAt<L$1, K$1, F$1>, S$1, L$1> : Target$1;
10059
+ type RepointVariants<Target$1, Entries$1, Link, S$1 extends Schema$1, L$1> = { [P in keyof Target$1]: P extends "entries" ? { [V in keyof Entries$1]: { [E in keyof Entries$1[V]]: E extends "getter" ? VariantLink<Link, V> extends infer J ? [J] extends [never] ? Entries$1[V][E] : J extends keyof S$1 ? () => Linked<S$1, L$1, J> : Entries$1[V][E] : Entries$1[V][E] : Entries$1[V][E] } } : Target$1[P] };
10060
+ type RepointState<State$1, S$1 extends Schema$1, L$1, K$1, F$1> = { [P in keyof State$1]: P extends "target" ? RepointTarget<State$1[P], S$1, L$1, K$1, F$1> : State$1[P] };
10061
+ type LinkedRelation<R$1, S$1 extends Schema$1, L$1, K$1, F$1> = R$1 extends {
10062
+ readonly "~": {
10063
+ readonly state: infer State;
10064
+ };
10065
+ } ? State extends SlotKind<"one", "model"> ? ModelToOneRelation<RepointState<State, S$1, L$1, K$1, F$1>> : State extends SlotKind<"many", "model"> ? ModelToManyRelation<RepointState<State, S$1, L$1, K$1, F$1>> : State extends SlotKind<"one", "variants"> ? VariantToOneRelation<RepointState<State, S$1, L$1, K$1, F$1>> : State extends SlotKind<"many", "variants"> ? VariantToManyRelation<RepointState<State, S$1, L$1, K$1, F$1>> : R$1 : R$1;
10066
+ type SlotKind<Cardinality$1, Kind$1> = {
10067
+ readonly kind: "relation";
10068
+ readonly cardinality: Cardinality$1;
10069
+ readonly target: {
10070
+ readonly kind: Kind$1;
10071
+ };
10072
+ };
10073
+ /** Relinking operates only on the already-flat schema and its literal links. */
10074
+ type LinkedState<S$1 extends Schema$1, L$1, K$1 extends keyof S$1> = S$1[K$1] extends Model$1<infer State> ? { [P in keyof State]: P extends "shape" | "relations" ? { [F in keyof State[P]]: LinkedRelation<State[P][F], S$1, L$1, K$1, F> } : State[P] } : never;
10019
10075
  type Linked<S$1 extends Schema$1, L$1, K$1 extends keyof S$1> = Model$1<LinkedState<S$1, L$1, K$1>>;
10020
10076
  type SchemaRelationKeys<S$1 extends Schema$1> = { [K in keyof S$1]: keyof S$1[K]["~"]["state"]["relations"] }[keyof S$1];
10021
10077
  /** Only a finite schema with relations has getter facts to carry. */
10022
- type SchemaLinks<S$1 extends Schema$1> = string extends keyof S$1 ? never : [SchemaRelationKeys<S$1>] extends [never] ? never : RelationLinks<S$1>;
10078
+ type SchemaLinks<S$1 extends Schema$1> = string extends keyof S$1 ? never : [SchemaRelationKeys<S$1>] extends [never] ? never : RelationLinks<S$1> extends infer U ? { [K in keyof U]: U[K] } : never;
10023
10079
  type SchemaSnapshot<S$1 extends Schema$1, L$1> = { [K in keyof S$1]: [L$1] extends [never] ? S$1[K] : FlatSchema<S$1, L$1>[K] };
10024
10080
  type SchemaModel<S$1 extends Schema$1, L$1, K$1 extends keyof S$1> = [L$1] extends [undefined] ? S$1[K$1] : Linked<S$1, L$1, K$1>;
10025
10081
  /** Raw aliases and carried configs share the same schema-only model view. */
@@ -10653,6 +10709,9 @@ declare const defaultOperationResultArgs: unique symbol;
10653
10709
  type DefaultOperationResultArgs = typeof defaultOperationResultArgs;
10654
10710
  type ResolvedOperationResultArgs<Args, Merged> = Merged extends DefaultOperationResultArgs ? Args : Merged;
10655
10711
  type ResolvedOperationResultOmit<Args, DefaultOmit, Merged> = Merged extends DefaultOperationResultArgs ? MergeClientOmit<DefaultOmit, NodeOmit<Args>> : NodeOmit<Merged>;
10712
+ /** The verbs whose result is the selected row, wrapped by cardinality. */
10713
+ type RowOperation = "findFirst" | "findUnique" | "findFirstOrThrow" | "findUniqueOrThrow" | "findMany" | "create" | "update" | "delete" | "upsert";
10714
+ type RowCardinality<O$1, Row> = O$1 extends "findFirst" | "findUnique" ? Row | null : O$1 extends "findMany" ? Row[] : Row;
10656
10715
  /**
10657
10716
  * Operation result type - infers result shape based on select/include args
10658
10717
  * This provides full type safety for ORM operation results
@@ -10665,7 +10724,7 @@ type ResolvedOperationResultOmit<Args, DefaultOmit, Merged> = Merged extends Def
10665
10724
  * The private merged-args marker distinguishes ordinary public arguments from
10666
10725
  * the effective argument shape carried by one concrete client.
10667
10726
  */
10668
- type OperationResultWithClientDefaults<O$1 extends Operations, M$1 extends Model$1<any>, Args, DefaultOmit, ClientDefaults, Merged = DefaultOperationResultArgs, ResultArgs = ResolvedOperationResultArgs<Args, Merged>, UnselectedOmit = ResolvedOperationResultOmit<Args, DefaultOmit, Merged>> = M$1 extends Model$1<infer S> ? O$1 extends "findFirst" | "findUnique" ? Prettify<InferSelectInclude<S, ResultArgs, NodeSelect<ResultArgs>, UnselectedOmit, ClientDefaults>> | null : O$1 extends "findFirstOrThrow" | "findUniqueOrThrow" ? Prettify<InferSelectInclude<S, ResultArgs, NodeSelect<ResultArgs>, UnselectedOmit, ClientDefaults>> : O$1 extends "findMany" ? Prettify<InferSelectInclude<S, ResultArgs, NodeSelect<ResultArgs>, UnselectedOmit, ClientDefaults>>[] : O$1 extends "create" | "update" | "delete" | "upsert" ? Prettify<InferSelectInclude<S, ResultArgs, NodeSelect<ResultArgs>, UnselectedOmit, ClientDefaults>> : O$1 extends "createMany" | "updateMany" | "deleteMany" ? BulkWriteResult<S, Args, DefaultOmit> : O$1 extends "count" ? CountResultType<Args> : O$1 extends "exist" ? boolean : O$1 extends "aggregate" ? AggregateResultType<ExtractFields<M$1>, Args> : O$1 extends "groupBy" ? GroupByResultType<ExtractFields<M$1>, Args>[] : never : never;
10727
+ type OperationResultWithClientDefaults<O$1 extends Operations, M$1 extends Model$1<any>, Args, DefaultOmit, ClientDefaults, Merged = DefaultOperationResultArgs, ResultArgs = ResolvedOperationResultArgs<Args, Merged>, UnselectedOmit = ResolvedOperationResultOmit<Args, DefaultOmit, Merged>> = M$1 extends Model$1<infer S> ? O$1 extends RowOperation ? RowCardinality<O$1, Prettify<InferSelectInclude<S, ResultArgs, NodeSelect<ResultArgs>, UnselectedOmit, ClientDefaults>>> : O$1 extends "createMany" | "updateMany" | "deleteMany" ? BulkWriteResult<S, Args, DefaultOmit> : O$1 extends "count" ? CountResultType<Args> : O$1 extends "exist" ? boolean : O$1 extends "aggregate" ? AggregateResultType<ExtractFields<M$1>, Args> : O$1 extends "groupBy" ? GroupByResultType<ExtractFields<M$1>, Args>[] : never : never;
10669
10728
  /**
10670
10729
  * Public operation result helper for one operation and its declared args.
10671
10730
  * Schema-only: on a client whose extensions declare `rows`, a to-one relation
@@ -10696,7 +10755,7 @@ type StampedOperation = "create" | "createMany" | "update" | "updateMany" | "ups
10696
10755
  * out, and a caller who writes one keeps its value (owner rulings, plan v4
10697
10756
  * §7.5 and §7.1).
10698
10757
  */
10699
- type StampedOperations<C$1 extends VibORMConfig, ClientDefaults, Controls$1, Data, K$1 extends keyof ClientSchema<C$1>> = { [O in StampedOperation]: Operation$1<O, ClientSchema<C$1>[K$1], ClientDefaultOmit<C$1, K$1>, ClientDefaults, PlacedOperationControls<Controls$1, K$1, O>, StampedPayload<O, OperationPayload<O, ClientSchema<C$1>[K$1]>, ClientSchema<C$1>[K$1], StampedFieldNames<Data, K$1>, Stamps<Data, ClientSchema<C$1>>>> };
10758
+ type StampedOperations<C$1 extends VibORMConfig, ClientDefaults, Controls$1, Data$1, K$1 extends keyof ClientSchema<C$1>> = { [O in StampedOperation]: Operation$1<O, ClientSchema<C$1>[K$1], ClientDefaultOmit<C$1, K$1>, ClientDefaults, PlacedOperationControls<Controls$1, K$1, O>, StampedPayload<O, OperationPayload<O, ClientSchema<C$1>[K$1]>, ClientSchema<C$1>[K$1], StampedFieldNames<Data$1, K$1>, Stamps<Data$1, ClientSchema<C$1>>>> };
10700
10759
  /**
10701
10760
  * The call's own clauses, rebuilt: a create's rows, and an update's for the
10702
10761
  * creates they nest.
@@ -10705,8 +10764,8 @@ type StampedPayload<O$1, Payload, M$1, Fields$1 extends PropertyKey, Context> =
10705
10764
  type CreateClause<O$1> = O$1 extends "upsert" ? "create" : O$1 extends "create" | "createMany" ? "data" : never;
10706
10765
  type UpdateClause<O$1> = O$1 extends "upsert" ? "update" : O$1 extends "update" | "updateMany" ? "data" : never;
10707
10766
  /** What a nested write needs to find the fields its target's stamps write. */
10708
- interface Stamps<Data, S$1> {
10709
- readonly data: Data;
10767
+ interface Stamps<Data$1, S$1> {
10768
+ readonly data: Data$1;
10710
10769
  readonly schema: S$1;
10711
10770
  }
10712
10771
  /**
@@ -10767,7 +10826,7 @@ type SpelledClauseKeys<Given> = Given extends object ? Given extends readonly un
10767
10826
  * The keys spelled inside an ARRAY clause that no element of the payload
10768
10827
  * accepts — the array spelling's equivalent of the `Exclude` below.
10769
10828
  */
10770
- type UnknownArrayClauseKeys<Given extends readonly unknown[], Allowed> = Exclude<SpelledClauseKeys<Given[number]>, ClauseKeys<NonNullable<Allowed>>>;
10829
+ type UnknownArrayClauseKeys<Given extends readonly unknown[], Allowed, Always extends PropertyKey> = Exclude<Exclude<SpelledClauseKeys<Given[number]>, Always>, ClauseKeys<NonNullable<Allowed>>>;
10771
10830
  /**
10772
10831
  * What the ARRAY spelling of a clause is refused WITH. The key cannot be
10773
10832
  * reported on itself there (see `NoExtraClauseKeys`), so the clause as a whole
@@ -10805,7 +10864,7 @@ type UnknownClauseKey<K$1> = {
10805
10864
  *
10806
10865
  * `Given` arrives with `undefined`/`null` already stripped (see `ClauseGuard`).
10807
10866
  */
10808
- type NoExtraClauseKeys<Given, Allowed> = Given extends readonly unknown[] ? [UnknownArrayClauseKeys<Given, Allowed>] extends [never] ? unknown : UnknownClauseKey<UnknownArrayClauseKeys<Given, Allowed>> : string extends keyof Given ? unknown : Given extends object ? Record<Exclude<keyof Given, ClauseKeys<NonNullable<Allowed>>>, never> : unknown;
10867
+ type NoExtraClauseKeys<Given, Allowed, Always extends PropertyKey = never> = Given extends readonly unknown[] ? [UnknownArrayClauseKeys<Given, Allowed, Always>] extends [never] ? unknown : UnknownClauseKey<UnknownArrayClauseKeys<Given, Allowed, Always>> : string extends keyof Given ? unknown : Given extends object ? Record<Exclude<Exclude<keyof Given, Always>, ClauseKeys<NonNullable<Allowed>>>, never> : unknown;
10809
10868
  /**
10810
10869
  * The typo'd keys of an operation's args, at the operation's OWN level and at
10811
10870
  * each clause inside it.
@@ -10847,29 +10906,40 @@ type NoExtraClauseKeys<Given, Allowed> = Given extends readonly unknown[] ? [Unk
10847
10906
  * Estate type-check 34s → 45s when the guard landed; adding the other two
10848
10907
  * spellings cost nothing measurable (same tree, back-to-back runs: 83.3s vs
10849
10908
  * 78.1s user, the difference inside the noise of a loaded machine).
10850
- * - `data` / `create` / `update` — NOT generally guarded. A write clause's
10851
- * payload is the recursive nested-write union, and reaching for its keys
10852
- * expands it: six estate sites turn `TS2589: Type instantiation is
10853
- * excessively deep`, and the type-check goes to 172s. The one narrow
10854
- * exception is a DIRECT decimal update leaf below: its operation keys come
10855
- * from the scalar's exact-one owner and it never walks a relation input.
10909
+ * - `data` / `create` / `update` — not keyed against the payload. A write
10910
+ * clause's payload is the recursive nested-write union, and reaching for its
10911
+ * keys expands it: six estate sites turn `TS2589: Type instantiation is
10912
+ * excessively deep`, and the type-check goes to 172s. Direct write names
10913
+ * are keyed from the model state instead (`DirectWriteKeysGuard`), nested
10914
+ * write data by walking the caller's literal (`NestedClauseGuard`).
10856
10915
  * - `cursor` / `having` / `cache` — NOT guarded. Three more TS2589 sites, on
10857
10916
  * compound-unique and aggregate payloads.
10858
10917
  *
10859
- * Scalar operator bags and nested projections remain out of this guard:
10860
- * `where.title.contians` and `select.books.select` stay pinned. The separate
10861
- * NestedWhereClauseGuard visits only caller-spelled logical/ordinary relation
10862
- * filters and checks their model field names, including held values.
10863
- * Every remaining unguarded level is pinned as a compiling misspelling in
10864
- * `tests/client/contextual-typing-gate.test.ts`, so the boundary is a measured
10865
- * fact rather than an assumption, and a future TypeScript that can carry more
10866
- * turns those pins red.
10867
- * The finite `recurse` option bag is the one exception that reaches every
10868
- * depth: `RecursiveProjectionRootGuard` walks the literal the caller wrote, not
10869
- * the model, so it never resolves a target mid-inference (see there).
10870
- */
10871
- type SameWhereValue<A, B$1> = (<T$1>() => T$1 extends A ? 1 : 2) extends (<T$1>() => T$1 extends B$1 ? 1 : 2) ? true : false;
10872
- type SeenWhereValue<Given, M$1, Seen> = true extends (Seen extends unknown ? SameWhereValue<readonly [Given, M$1], Seen> : never) ? true : false;
10918
+ * Below the root, every check walks the literal the caller wrote, never the
10919
+ * payload: `NestedClauseGuard` (WHERE model field names, nested write data),
10920
+ * `OperatorBagGuard` (root WHERE operator bags) and
10921
+ * `RecursiveProjectionRootGuard` (nested `select` / `include` / `where`,
10922
+ * `recurse` bags). A guard that inspects a value cannot key a type parameter,
10923
+ * so the projection and operator guards keep each leaf's own arm in a union,
10924
+ * which is what keeps a generic leaf assignable. What stays unguarded —
10925
+ * operator bags below the root WHERE, selectors, variant arms — is pinned as a
10926
+ * compiling misspelling in `tests/types/client/contextual-typing-gate.core.types.ts`
10927
+ * and listed on the quick start.
10928
+ */
10929
+ /**
10930
+ * The root-reported walks (WHERE model keys, nested write data) follow the
10931
+ * LITERAL the caller wrote, key each spelled object against a key set read
10932
+ * from the model's state, and report what is left as ONE `UnknownClauseKey` on
10933
+ * the root clause. Neither maps over a payload's own keys, which is what
10934
+ * expands the recursive payloads (see above). Cycle detection uses the exact
10935
+ * spelled-value/model pair, never a numeric depth cap, so a held value typed
10936
+ * as a recursive payload stops at its first repeat. `NoInfer` keeps that
10937
+ * comparison from inferring through a relinked model (a mapped type), which
10938
+ * would walk its whole relation graph.
10939
+ */
10940
+ type SameValue<A, B$1> = (<T$1>() => T$1 extends NoInfer<A> ? 1 : 2) extends (<T$1>() => T$1 extends NoInfer<B$1> ? 1 : 2) ? true : false;
10941
+ type SeenValue<Given, M$1, Seen> = true extends (Seen extends unknown ? SameValue<readonly [Given, M$1], Seen> : never) ? true : false;
10942
+ type ElementOf<Value> = Value extends readonly (infer Element)[] ? Element : Value;
10873
10943
  type WhereLogicalKey = "AND" | "OR" | "NOT";
10874
10944
  type WhereLogicalKeys<M$1 extends Model$1<any>> = Exclude<WhereLogicalKey, keyof M$1["~"]["state"]["shape"]>;
10875
10945
  type WhereModelKeys<M$1 extends Model$1<any>> = keyof M$1["~"]["state"]["shape"] | WhereLogicalKey;
@@ -10881,10 +10951,66 @@ type QuantifiedWhereUnknownKeys<Given, R$1 extends AnyRelation, Seen, Q$1 extend
10881
10951
  * is sealed exactly as on the select side.
10882
10952
  */
10883
10953
  type RelationWhereUnknownKeys<Given, R$1 extends AnyRelation, Seen> = TargetKind<R$1> extends "model" ? "recurse" extends SpelledClauseKeys<Given> ? QuantifiedWhereUnknownKeys<Given, R$1, Seen, "some" | "every" | "none"> | MisspelledRecurrenceKeys<ValueAt<Given, "recurse">> : Cardinality<R$1> extends "one" ? [Extract<SpelledClauseKeys<Given>, "is" | "isNot">] extends [never] ? WhereUnknownKeys<Given, GetTargetModel<R$1>, Seen> : QuantifiedWhereUnknownKeys<Given, R$1, Seen, "is" | "isNot"> : QuantifiedWhereUnknownKeys<Given, R$1, Seen, "some" | "every" | "none"> : never;
10884
- type WhereUnknownKeys<Given, M$1 extends Model$1<any>, Seen = never, Allowed extends PropertyKey = WhereModelKeys<M$1>> = Given extends readonly unknown[] ? WhereUnknownKeys<Given[number], M$1, Seen, Allowed> : Given extends object ? string extends keyof Given ? never : Exclude<keyof Given, Allowed> | (SeenWhereValue<Given, M$1, Seen> extends true ? never : { [K in Extract<keyof Given, WhereLogicalKeys<M$1> | keyof M$1["~"]["state"]["relations"]>]: K extends WhereLogicalKeys<M$1> ? WhereUnknownKeys<NonNullable<Given[K]>, M$1, Seen | readonly [Given, M$1]> : K extends keyof M$1["~"]["state"]["relations"] ? RelationWhereUnknownKeys<NonNullable<Given[K]>, M$1["~"]["state"]["relations"][K], Seen | readonly [Given, M$1]> : never }[Extract<keyof Given, WhereLogicalKeys<M$1> | keyof M$1["~"]["state"]["relations"]>]) : never;
10885
- type NestedWhereClauseGuard<Arg, Payload, M$1 extends Model$1<any>> = "where" extends keyof Arg ? "where" extends keyof Payload ? [Extract<SpelledClauseKeys<NonNullable<Arg["where"]>>, WhereLogicalKeys<M$1> | keyof M$1["~"]["state"]["relations"]>] extends [never] ? unknown : SameWhereValue<NonNullable<Arg["where"]>, NonNullable<Payload["where"]>> extends true ? unknown : WhereUnknownKeys<NonNullable<Arg["where"]>, M$1, never, ClauseKeys<NonNullable<Payload["where"]>>> extends infer Extra ? [Extra] extends [never] ? unknown : {
10886
- where?: UnknownClauseKey<Extra>;
10954
+ type WhereUnknownKeys<Given, M$1 extends Model$1<any>, Seen = never, Allowed extends PropertyKey = WhereModelKeys<M$1>> = Given extends readonly unknown[] ? WhereUnknownKeys<Given[number], M$1, Seen, Allowed> : Given extends object ? string extends keyof Given ? never : Exclude<keyof Given, Allowed> | (SeenValue<Given, M$1, Seen> extends true ? never : { [K in Extract<keyof Given, WhereLogicalKeys<M$1> | keyof M$1["~"]["state"]["relations"]>]: K extends WhereLogicalKeys<M$1> ? WhereUnknownKeys<NonNullable<Given[K]>, M$1, Seen | readonly [Given, M$1]> : K extends keyof M$1["~"]["state"]["relations"] ? RelationWhereUnknownKeys<NonNullable<Given[K]>, M$1["~"]["state"]["relations"][K], Seen | readonly [Given, M$1]> : never }[Extract<keyof Given, WhereLogicalKeys<M$1> | keyof M$1["~"]["state"]["relations"]>]) : never;
10955
+ /**
10956
+ * The data objects one relation's write verbs carry: `create`,
10957
+ * `createMany.data`, `connectOrCreate.create`, `upsert.create` / `.update`,
10958
+ * and the `data` of `update` / `updateMany`. A to-one `update` is read as the
10959
+ * parse boundary reads it (`to-one-update-form.ts`): the `{ where?, data }`
10960
+ * envelope when `where` is spelled or the target owns no `data` field, the
10961
+ * bare data otherwise.
10962
+ */
10963
+ type NestedWriteData<Verbs, TargetKeys> = ElementOf<ValueAt<Verbs, "create">> | ElementOf<ValueAt<ValueAt<Verbs, "createMany">, "data">> | ValueAt<ElementOf<ValueAt<Verbs, "connectOrCreate" | "upsert">>, "create"> | ValueAt<ElementOf<ValueAt<Verbs, "upsert">>, "update"> | ValueAt<ElementOf<ValueAt<Verbs, "updateMany">>, "data"> | UpdateFormData<ElementOf<ValueAt<Verbs, "update">>, TargetKeys>;
10964
+ type UpdateFormData<Update, TargetKeys> = Update extends {
10965
+ data: infer Data;
10966
+ } ? "where" extends keyof Update ? Data : "data" extends TargetKeys ? Update : Data : Update;
10967
+ /**
10968
+ * The keys an object SPELLED: its required ones. A union of literals (a
10969
+ * ternary between two payload forms) carries each arm's missing keys as
10970
+ * optional `?: undefined` members nobody wrote, and a held value typed as the
10971
+ * payload carries every key as optional and has nothing misspelled.
10972
+ */
10973
+ type RequiredSpelledKeys<Given> = Given extends object ? { [K in keyof Given]-?: Record<never, never> extends Pick<Given, K> ? never : K }[keyof Given] : never;
10974
+ /**
10975
+ * The keys nested write data spells that its model does not declare, at
10976
+ * every depth below the root data (whose own keys `DirectWriteKeysGuard`
10977
+ * reports on the key itself). Only spelled keys are read, so a payload-typed
10978
+ * value's recursive schema is never expanded, which also bounds the walk.
10979
+ * Selectors (`where`, `connect`, …) stay unkeyed, as
10980
+ * `contextual-typing-gate.core.types.ts` pins.
10981
+ */
10982
+ type NestedWriteUnknownKeys<Data$1, M$1 extends Model$1<any>> = Data$1 extends readonly unknown[] ? NestedWriteUnknownKeys<Data$1[number], M$1> : { [K in Extract<RequiredSpelledKeys<Data$1>, keyof M$1["~"]["state"]["relations"]>]: TargetKind<M$1["~"]["state"]["relations"][K]> extends "model" ? TargetWriteUnknownKeys<NonNullable<ValueAt<Data$1, K>>, GetTargetModel<M$1["~"]["state"]["relations"][K]>> : never }[Extract<RequiredSpelledKeys<Data$1>, keyof M$1["~"]["state"]["relations"]>];
10983
+ type TargetWriteUnknownKeys<Verbs, T$1 extends Model$1<any>, Keys$1 extends PropertyKey = keyof T$1["~"]["state"]["shape"]> = NestedWriteData<Verbs, Keys$1> extends infer Data ? Data extends object ? Exclude<RequiredSpelledKeys<Data>, Keys$1> | NestedWriteUnknownKeys<Data, T$1> : never : never;
10984
+ /**
10985
+ * Whether the argument SPELLED `Clause`. A literal's keys are required; a
10986
+ * payload type's are optional — an omitted or generically forwarded argument
10987
+ * — and walking one would expand its recursive schema as though every
10988
+ * optional key was spelled.
10989
+ */
10990
+ type SpelledClause<Arg, Clause extends PropertyKey> = [Arg] extends [{ [Key in Clause]: unknown }] ? true : false;
10991
+ /**
10992
+ * One spelled root clause, refused as a whole with the keys its walk finds:
10993
+ * `where` walks model field names through relation and logical filters,
10994
+ * `data` / `create` / `update` walk nested write data. A clause spelling no
10995
+ * relation or logical group has nothing below its root to walk. A `where`
10996
+ * that IS the payload type is not walked either (the WHERE walk follows
10997
+ * optional keys); the write walk needs no such check, because it descends
10998
+ * only spelled keys.
10999
+ */
11000
+ type NestedClauseGuard<Arg, Payload, M$1 extends Model$1<any>, Clause extends "where" | "data" | "create" | "update"> = Clause extends keyof Arg ? SpelledClause<Arg, Clause> extends true ? Clause extends keyof Payload ? [Extract<SpelledClauseKeys<ElementOf<NonNullable<Arg[Clause]>>>, WhereLogicalKeys<M$1> | keyof M$1["~"]["state"]["relations"]>] extends [never] ? unknown : (Clause extends "where" ? SameValue<NonNullable<Arg[Clause]>, NonNullable<Payload[Clause]>> extends true ? never : WhereUnknownKeys<NonNullable<Arg[Clause]>, M$1, never, ClauseKeys<NonNullable<Payload[Clause]>>> : NestedWriteUnknownKeys<NonNullable<Arg[Clause]>, M$1>) extends infer Extra ? [Extra] extends [never] ? unknown : { [Key in Clause]?: UnknownClauseKey<Extra> } : unknown : unknown : unknown : unknown;
11001
+ /**
11002
+ * A root WHERE operator bag, sealed at the bag: an object spelled for a
11003
+ * scalar is keyed against every key the field's object arms declare, so
11004
+ * `{ contains: "x", mdoe: "insensitive" }` is refused on `mdoe`. The value's
11005
+ * own primitive, list and `Date` arms stay in the union, which is what keeps
11006
+ * a generic leaf (`title: t`, `T extends string`) assignable: TypeScript
11007
+ * cannot key a type parameter, so a guard that inspected one would refuse it.
11008
+ * Bags inside relation filters and logical groups are not sealed.
11009
+ */
11010
+ type OperatorBagGuard<Arg, Payload, M$1 extends Model$1<any>> = "where" extends keyof Arg ? SpelledClause<Arg, "where"> extends true ? "where" extends keyof Payload ? {
11011
+ where?: { [K in Extract<SpelledClauseKeys<NonNullable<Arg["where"]>>, keyof M$1["~"]["state"]["scalars"]>]?: OperatorBagSeal<ValueAt<NonNullable<Arg["where"]>, K>, ValueAt<NonNullable<Payload["where"]>, K>> };
10887
11012
  } : unknown : unknown : unknown;
11013
+ type OperatorBagSeal<Given, Input$1> = Exclude<Input$1, object> | Extract<Input$1, readonly unknown[] | Date> | Record<Exclude<SpelledClauseKeys<NonNullable<Given>>, ClauseKeys<Extract<NonNullable<Input$1>, object>>>, never>;
10888
11014
  type ClauseGuard<Arg, Payload, K$1 extends string> = K$1 extends keyof Arg ? K$1 extends keyof Payload ? { [P in K$1]?: NoExtraClauseKeys<NonNullable<Arg[K$1]>, Payload[K$1]> } : unknown : unknown;
10889
11015
  type ValueAt<Container, Key$1 extends PropertyKey> = Container extends unknown ? Key$1 extends keyof Container ? Container[Key$1] : never : never;
10890
11016
  type PolymorphicVariantKeys<Relation> = keyof VariantEntries<Relation>;
@@ -10950,26 +11076,37 @@ type RecurrenceBagGuard<Bag> = [MisspelledRecurrenceKeys<Bag>] extends [never] ?
10950
11076
  */
10951
11077
  type RelationNodeClauseKey = "where" | "orderBy" | "take" | "skip" | "cursor" | "distinct" | "select" | "include" | "omit" | "recurse" | "only" | "variants";
10952
11078
  /**
10953
- * The `recurse` option bags of an operation, sealed at every depth the caller
10954
- * spelled. The walk follows the LITERAL — a node's `select`, `include`,
10955
- * collection `variants` and to-one variant arms — never the model, so it costs
10956
- * what the argument contains, never resolves a target getter, and never
10957
- * enters `where`, `orderBy`, `cursor` or write data, whose keys are fields.
11079
+ * The relation nodes of an operation's projection, sealed at every depth the
11080
+ * caller spelled. The walk follows the LITERAL — a node's `select`,
11081
+ * `include`, `where`, collection `variants` and to-one variant arms — and
11082
+ * reads a target model only for a relation key the caller spelled, so it
11083
+ * costs what the argument contains. On a model-target node it keys `select`
11084
+ * against the target's fields, `include` against its relations (both beside
11085
+ * `_count`), walks `where` as the root WHERE is walked, and seals `recurse`
11086
+ * option bags; variant arms and `variants` are sealed by
11087
+ * `DirectPolymorphicProjectionGuard`, not keyed here. An `any` argument (what
11088
+ * an erased signature passes, as `Parameters<…>` reads it) is not walked.
11089
+ */
11090
+ type RecursiveProjectionRootGuard<Arg, M$1 extends Model$1<any>> = 0 extends 1 & Arg ? unknown : RecursiveRootClause<Arg, M$1, "select"> & RecursiveRootClause<Arg, M$1, "include">;
11091
+ /**
11092
+ * A clause the argument spelled — a REQUIRED key of the argument. The guard
11093
+ * names no key the caller did not, and an optional clause belongs to a payload
11094
+ * type (an erased signature's, as `Parameters<…>` reads it), never walked.
10958
11095
  */
10959
- type RecursiveProjectionRootGuard<Arg> = RecursiveRootClause<Arg, "select"> & RecursiveRootClause<Arg, "include">;
10960
- /** A clause the argument spelled; the guard names no key the caller did not. */
10961
- type RecursiveRootClause<Arg, Clause extends "select" | "include"> = Clause extends keyof Arg ? { [Key in Clause]?: RecursiveRootMembers<Arg[Key]> } : unknown;
11096
+ type RecursiveRootClause<Arg, M$1 extends Model$1<any>, Clause extends "select" | "include"> = Clause extends keyof Arg ? SpelledClause<Arg, Clause> extends true ? { [Key in Clause]?: RecursiveRootMembers<Arg[Key], M$1> } : unknown : unknown;
10962
11097
  /**
10963
11098
  * The operation's own projection. Its members meet the node guard directly,
10964
11099
  * so a misspelling one relation deep is reported on the key itself.
10965
11100
  */
10966
- type RecursiveRootMembers<Clause> = { [Key in SpelledClauseKeys<NonNullable<Clause>>]?: RecursiveNodeGuard<ValueAt<NonNullable<Clause>, Key>> };
11101
+ type RecursiveRootMembers<Clause, M$1> = { [Key in SpelledClauseKeys<NonNullable<Clause>>]?: RecursiveNodeGuard<ValueAt<NonNullable<Clause>, Key>, RelationTarget<M$1, Key>> };
11102
+ /** The model a relation key targets; `never` (nothing to key) otherwise. */
11103
+ type RelationTarget<M$1, Key$1> = M$1 extends Model$1<any> ? Key$1 extends keyof M$1["~"]["state"]["relations"] ? TargetKind<M$1["~"]["state"]["relations"][Key$1]> extends "model" ? GetTargetModel<M$1["~"]["state"]["relations"][Key$1]> : never : never : never;
10967
11104
  /**
10968
11105
  * Only an object is a node to walk. A leaf, or a payload type wide enough to
10969
11106
  * admit one, states nothing: the guard is for what a caller spelled, and TS
10970
11107
  * falls back to the payload type itself when an argument fails it.
10971
11108
  */
10972
- type RecursiveNodeGuard<Node> = [Exclude<Node, null | undefined>] extends [object] ? RecursiveNodeObjectGuard<Exclude<Node, null | undefined>> : unknown;
11109
+ type RecursiveNodeGuard<Node, T$1> = [Exclude<Node, null | undefined>] extends [object] ? RecursiveNodeObjectGuard<Exclude<Node, null | undefined>, T$1> : unknown;
10973
11110
  type ExclusiveSelection<Node> = Node extends {
10974
11111
  select: object;
10975
11112
  include: object;
@@ -10978,27 +11115,36 @@ type ExclusiveSelection<Node> = Node extends {
10978
11115
  } | {
10979
11116
  include?: undefined;
10980
11117
  } : unknown;
10981
- type RecursiveNodeObjectGuard<Node> = ExclusiveSelection<Node> & ("recurse" extends keyof Node ? {
11118
+ type RecursiveNodeObjectGuard<Node, T$1> = ExclusiveSelection<Node> & ("recurse" extends keyof Node ? {
10982
11119
  recurse?: RecurrenceBagGuard<Node["recurse"]>;
10983
11120
  } : unknown) & ("select" extends keyof Node ? {
10984
- select?: RecursiveProjectionGuard<Node["select"]>;
11121
+ select?: RecursiveProjectionGuard<Node["select"], T$1> & ProjectionKeySeal<Node["select"], T$1, "select">;
10985
11122
  } : unknown) & ("include" extends keyof Node ? {
10986
- include?: RecursiveProjectionGuard<Node["include"]>;
11123
+ include?: RecursiveProjectionGuard<Node["include"], T$1> & ProjectionKeySeal<Node["include"], T$1, "include">;
11124
+ } : unknown) & ([Node] extends [{
11125
+ where: unknown;
11126
+ }] ? {
11127
+ where?: NodeWhereSeal<Node["where"], T$1>;
10987
11128
  } : unknown) & ("variants" extends keyof Node ? {
10988
- variants?: RecursiveProjectionGuard<Node["variants"]>;
10989
- } : unknown) & RecursiveProjectionGuard<Node, RelationNodeClauseKey>;
11129
+ variants?: RecursiveProjectionGuard<Node["variants"], never>;
11130
+ } : unknown) & RecursiveProjectionGuard<Node, never, RelationNodeClauseKey>;
10990
11131
  /**
10991
11132
  * A nested projection map. Its members are boolean leaves or nodes; naming
10992
- * the leaf keeps a generic node assignable when its constraint spells scalar
10993
- * leaves, because TypeScript cannot resolve the walk through a type parameter.
10994
- */
10995
- type RecursiveProjectionGuard<Clause, Skipped extends PropertyKey = never> = { [Key in Exclude<SpelledClauseKeys<NonNullable<Clause>>, Skipped>]?: boolean | RecursiveNodeGuard<ValueAt<NonNullable<Clause>, Key>> };
10996
- type DecimalStateOf<Field> = Field extends {
11133
+ * the leaf keeps a generic leaf assignable, because TypeScript cannot resolve
11134
+ * the walk through a type parameter. A generic NODE whose constraint spells
11135
+ * `select`, `include` or `where` is refused: those keys cannot be proven.
11136
+ */
11137
+ type RecursiveProjectionGuard<Clause, T$1, Skipped extends PropertyKey = never> = { [Key in Exclude<SpelledClauseKeys<NonNullable<Clause>>, Skipped>]?: boolean | RecursiveNodeGuard<ValueAt<NonNullable<Clause>, Key>, RelationTarget<T$1, Key>> };
11138
+ /** A model-target node's `select` / `include` keys, beside `_count`. */
11139
+ type ProjectionKeySeal<Clause, T$1, Kind$1 extends "select" | "include"> = [T$1] extends [never] ? unknown : T$1 extends Model$1<any> ? Record<Exclude<SpelledClauseKeys<NonNullable<Clause>>, "_count" | keyof T$1["~"]["state"][Kind$1 extends "select" ? "shape" : "relations"]>, never> : unknown;
11140
+ /** A model-target node's `where`, walked as the root WHERE is. */
11141
+ type NodeWhereSeal<Where, T$1> = [T$1] extends [never] ? unknown : T$1 extends Model$1<any> ? WhereUnknownKeys<NonNullable<Where>, T$1> extends infer Extra ? [Extra] extends [never] ? unknown : UnknownClauseKey<Extra> : unknown : unknown;
11142
+ type ScalarStateOf<Field, Kind$1 extends ScalarType> = Field extends {
10997
11143
  readonly "~": {
10998
- readonly state: infer State extends ScalarState<"decimal">;
11144
+ readonly state: infer State extends ScalarState<Kind$1>;
10999
11145
  };
11000
11146
  } ? State : never;
11001
- type DirectDecimalScalarKeys<State$1 extends ModelState> = { [Key in keyof State$1["scalars"]]: [DecimalStateOf<State$1["scalars"][Key]>] extends [never] ? never : Key }[keyof State$1["scalars"]];
11147
+ type ScalarKeysOf<State$1 extends ModelState, Kind$1 extends ScalarType> = { [Key in keyof State$1["scalars"]]: [ScalarStateOf<State$1["scalars"][Key], Kind$1>] extends [never] ? never : Key }[keyof State$1["scalars"]];
11002
11148
  /**
11003
11149
  * Refuse only keys the caller spelled BESIDE a real decimal operation.
11004
11150
  *
@@ -11012,17 +11158,11 @@ type DirectDecimalScalarKeys<State$1 extends ModelState> = { [Key in keyof State
11012
11158
  */
11013
11159
  type SpelledDecimalUpdateObjectKeys<Given, OperationKeys extends PropertyKey> = Given extends readonly unknown[] ? never : Given extends object ? string extends keyof Given ? never : [Extract<keyof Given, OperationKeys>] extends [never] ? never : keyof Given : never;
11014
11160
  type NoExtraDecimalUpdateLeafKeys<Given, State$1 extends ScalarState<"decimal">, OperationKeys extends PropertyKey = DecimalUpdateOperationKeys<State$1>> = Record<Exclude<SpelledDecimalUpdateObjectKeys<Given, OperationKeys>, OperationKeys>, never>;
11015
- type UsedDirectDecimalFields<Given, State$1 extends ModelState> = Extract<SpelledClauseKeys<Given>, DirectDecimalScalarKeys<State$1>>;
11161
+ type UsedDirectDecimalFields<Given, State$1 extends ModelState> = Extract<SpelledClauseKeys<Given>, ScalarKeysOf<State$1, "decimal">>;
11016
11162
  /** One direct-field map after union branches have contributed their keys. */
11017
- type DirectDecimalUpdateObjectGuard<Given, M$1 extends Model$1<any>> = M$1 extends Model$1<infer State> ? { [Key in UsedDirectDecimalFields<Given, State>]?: NoExtraDecimalUpdateLeafKeys<ValueAt<Given, Key>, DecimalStateOf<State["scalars"][Key]>> } : unknown;
11163
+ type DirectDecimalUpdateObjectGuard<Given, M$1 extends Model$1<any>> = M$1 extends Model$1<infer State> ? { [Key in UsedDirectDecimalFields<Given, State>]?: NoExtraDecimalUpdateLeafKeys<ValueAt<Given, Key>, ScalarStateOf<State["scalars"][Key], "decimal">> } : unknown;
11018
11164
  type DirectDecimalUpdateClauseGuard<Arg, M$1 extends Model$1<any>, Clause extends "data" | "update"> = Clause extends keyof Arg ? { [Key in Clause]?: DirectDecimalUpdateObjectGuard<NonNullable<Arg[Key]>, M$1> } : unknown;
11019
11165
  type DirectDecimalUpdateGuard<O$1 extends Operations, Arg, M$1 extends Model$1<any>> = O$1 extends "update" | "updateMany" ? DirectDecimalUpdateClauseGuard<Arg, M$1, "data"> : O$1 extends "upsert" ? DirectDecimalUpdateClauseGuard<Arg, M$1, "update"> : unknown;
11020
- type GeoPointStateOf<Field> = Field extends {
11021
- readonly "~": {
11022
- readonly state: infer State extends ScalarState<"point">;
11023
- };
11024
- } ? State : never;
11025
- type DirectGeoPointScalarKeys<State$1 extends ModelState> = { [Key in keyof State$1["scalars"]]: [GeoPointStateOf<State$1["scalars"][Key]>] extends [never] ? never : Key }[keyof State$1["scalars"]];
11026
11166
  type NoExtraRecognizedKeys<Given, Allowed extends PropertyKey, Recognized extends PropertyKey = Allowed> = Given extends readonly unknown[] ? unknown : Given extends object ? string extends keyof Given ? unknown : [Extract<keyof Given, Recognized>] extends [never] ? unknown : Record<Exclude<keyof Given, Allowed>, never> : unknown;
11027
11167
  type GeoPointValueGuard<Given> = NoExtraRecognizedKeys<Given, "longitude" | "latitude">;
11028
11168
  type GeoBoundsValueGuard<Given> = NoExtraRecognizedKeys<Given, "south" | "west" | "north" | "east">;
@@ -11056,7 +11196,7 @@ type GeoPointWriteValueGuard<Given> = Given extends object ? "set" extends keyof
11056
11196
  type UsedGeoPointKeys<Row, PointKeys extends PropertyKey> = Extract<SpelledClauseKeys<Row>, PointKeys>;
11057
11197
  type GeoPointRowGuard<Given, PointKeys extends PropertyKey, Mode extends "filter" | "write", Row = (Given extends readonly (infer Member)[] ? Member : Given)> = [UsedGeoPointKeys<Row, PointKeys>] extends [never] ? unknown : Row extends object ? { [Key in UsedGeoPointKeys<Row, PointKeys>]?: Mode extends "filter" ? GeoPointFilterValueGuard<ValueAt<Row, Key>> : GeoPointWriteValueGuard<ValueAt<Row, Key>> } : unknown;
11058
11198
  type DirectGeoPointClauseGuard<Arg, Clause extends PropertyKey, PointKeys extends PropertyKey, Mode extends "filter" | "write"> = Clause extends keyof Arg ? { [Key in Clause]?: GeoPointRowGuard<NonNullable<Arg[Key]>, PointKeys, Mode> } : unknown;
11059
- type DirectGeoPointGuard<O$1 extends Operations, Arg, M$1 extends Model$1<any>, PointKeys extends PropertyKey = (M$1 extends Model$1<infer State> ? DirectGeoPointScalarKeys<State> : never)> = [PointKeys] extends [never] ? unknown : DirectGeoPointClauseGuard<Arg, "where", PointKeys, "filter"> & (O$1 extends "create" | "createMany" | "update" | "updateMany" ? DirectGeoPointClauseGuard<Arg, "data", PointKeys, "write"> : O$1 extends "upsert" ? DirectGeoPointClauseGuard<Arg, "create", PointKeys, "write"> & DirectGeoPointClauseGuard<Arg, "update", PointKeys, "write"> : unknown);
11199
+ type DirectGeoPointGuard<O$1 extends Operations, Arg, M$1 extends Model$1<any>, PointKeys extends PropertyKey = (M$1 extends Model$1<infer State> ? ScalarKeysOf<State, "point"> : never)> = [PointKeys] extends [never] ? unknown : DirectGeoPointClauseGuard<Arg, "where", PointKeys, "filter"> & (O$1 extends "create" | "createMany" | "update" | "updateMany" ? DirectGeoPointClauseGuard<Arg, "data", PointKeys, "write"> : O$1 extends "upsert" ? DirectGeoPointClauseGuard<Arg, "create", PointKeys, "write"> & DirectGeoPointClauseGuard<Arg, "update", PointKeys, "write"> : unknown);
11060
11200
  /** Direct write names come from State, never the recursive write payload. */
11061
11201
  type DirectWriteKeysGuard<O$1 extends Operations, Arg, M$1 extends Model$1<any>, Keys$1 extends PropertyKey = keyof M$1["~"]["state"]["shape"]> = O$1 extends "create" | "createMany" | "update" | "updateMany" ? ClauseGuard<Arg, {
11062
11202
  data: Record<Keys$1, unknown>;
@@ -11065,18 +11205,27 @@ type DirectWriteKeysGuard<O$1 extends Operations, Arg, M$1 extends Model$1<any>,
11065
11205
  }, "create"> & ClauseGuard<Arg, {
11066
11206
  update: Record<Keys$1, unknown>;
11067
11207
  }, "update"> : unknown;
11068
- type NoExtraOperationKeys<O$1 extends Operations, Arg, Payload, M$1 extends Model$1<any>, Controls$1 = NoControls> = Arg & ExclusiveSelection<Arg> & Record<Exclude<keyof Arg, keyof Payload | keyof Controls$1>, never> & ClauseGuard<Arg, Payload, "where"> & NestedWhereClauseGuard<Arg, Payload, M$1> & ClauseGuard<Arg, Payload, "select"> & ClauseGuard<Arg, Payload, "include"> & ClauseGuard<Arg, Payload, "orderBy"> & ClauseGuard<Arg, Payload, "omit"> & ClauseGuard<Arg, Controls$1, "cache"> & DirectPolymorphicProjectionGuard<Arg, M$1, "select"> & DirectPolymorphicProjectionGuard<Arg, M$1, "include"> & RecursiveProjectionRootGuard<Arg> & DirectWriteKeysGuard<O$1, Arg, M$1> & DirectDecimalUpdateGuard<O$1, Arg, M$1> & DirectGeoPointGuard<O$1, Arg, M$1>;
11069
11208
  /**
11070
- * Operation type - returns PendingOperation which implements PromiseLike
11071
- * This allows operations to be:
11072
- * - Awaited directly: `await client.user.findMany()`
11073
- * - Batched in transactions: `await client.$transaction([op1, op2])`
11209
+ * groupBy `orderBy` names an aggregate or a field the literal `by` grouped.
11210
+ * Aggregates are admitted before `by` is read, so a `by` list that is a type
11211
+ * parameter still orders by aggregates, while a field beside it is refused:
11212
+ * no grouped key can be proven. An empty `by` stays a runtime refusal (V4001)
11213
+ * because refusing `[]` here would refuse every generic `by` list too.
11074
11214
  */
11075
- type Operation$1<O$1 extends Operations, M$1 extends Model$1<any>, DefaultOmit = undefined, ClientDefaults = never, Controls$1 = NoControls, Payload = OperationPayload<O$1, M$1>> = undefined extends Payload ? <Arg extends Payload>(args?: WithControlArgs<NoExtraOperationKeys<O$1, Exclude<Arg, undefined>, Exclude<Payload, undefined>, M$1, Controls$1>, Controls$1>) => PendingOperation<OperationResultWithClientDefaults<O$1, M$1, Arg, DefaultOmit, ClientDefaults>> : <Arg extends Payload>(args: WithControlArgs<NoExtraOperationKeys<O$1, Arg, Payload, M$1, Controls$1>, Controls$1>) => PendingOperation<OperationResultWithClientDefaults<O$1, M$1, Arg, DefaultOmit, ClientDefaults>>;
11215
+ type GroupByOrderGuard<O$1 extends Operations, Arg, Payload, M$1 extends Model$1<any>> = O$1 extends "groupBy" ? "orderBy" extends keyof Arg ? {
11216
+ orderBy?: NoExtraClauseKeys<NonNullable<Arg["orderBy"]>, Record<Extract<ElementOf<NonNullable<ValueAt<Arg, "by">>>, PropertyKey>, unknown>, Exclude<ClauseKeys<ElementOf<NonNullable<ValueAt<Payload, "orderBy">>>>, keyof M$1["~"]["state"]["scalars"]>>;
11217
+ } : unknown : unknown;
11218
+ type NoExtraOperationKeys<O$1 extends Operations, Arg, Payload, M$1 extends Model$1<any>, Controls$1 = NoControls> = Arg & ExclusiveSelection<Arg> & Record<Exclude<keyof Arg, keyof Payload | keyof Controls$1>, never> & ClauseGuard<Arg, Payload, "where"> & NestedClauseGuard<Arg, Payload, M$1, "where"> & OperatorBagGuard<Arg, Payload, M$1> & ClauseGuard<Arg, Payload, "select"> & ClauseGuard<Arg, Payload, "include"> & ClauseGuard<Arg, Payload, "orderBy"> & ClauseGuard<Arg, Payload, "omit"> & ClauseGuard<Arg, Controls$1, "cache"> & DirectPolymorphicProjectionGuard<Arg, M$1, "select"> & DirectPolymorphicProjectionGuard<Arg, M$1, "include"> & RecursiveProjectionRootGuard<Arg, M$1> & DirectWriteKeysGuard<O$1, Arg, M$1> & NestedClauseGuard<Arg, Payload, M$1, "data"> & NestedClauseGuard<Arg, Payload, M$1, "create"> & NestedClauseGuard<Arg, Payload, M$1, "update"> & GroupByOrderGuard<O$1, Arg, Payload, M$1> & DirectDecimalUpdateGuard<O$1, Arg, M$1> & DirectGeoPointGuard<O$1, Arg, M$1>;
11076
11219
  /**
11077
- * Cached operation type - returns Promise directly (not batchable)
11220
+ * One client method signature. `Pending` picks its carrier: a PendingOperation
11221
+ * (PromiseLike, so it can be awaited directly or batched in
11222
+ * `$transaction([op1, op2])`), or a plain Promise for a cached read, which is
11223
+ * not batchable.
11078
11224
  */
11079
- type CachedOperation<O$1 extends Operations, M$1 extends Model$1<any>, DefaultOmit = undefined, ClientDefaults = never, Controls$1 = NoControls, Payload = OperationPayload<O$1, M$1>> = undefined extends Payload ? <Arg extends Payload>(args?: WithControlArgs<NoExtraOperationKeys<O$1, Exclude<Arg, undefined>, Exclude<Payload, undefined>, M$1, Controls$1>, Controls$1>) => Promise<OperationResultWithClientDefaults<O$1, M$1, Arg, DefaultOmit, ClientDefaults>> : <Arg extends Payload>(args: WithControlArgs<NoExtraOperationKeys<O$1, Arg, Payload, M$1, Controls$1>, Controls$1>) => Promise<OperationResultWithClientDefaults<O$1, M$1, Arg, DefaultOmit, ClientDefaults>>;
11225
+ type OperationMethod<O$1 extends Operations, M$1 extends Model$1<any>, DefaultOmit, ClientDefaults, Controls$1, Payload, Pending extends boolean> = undefined extends Payload ? <Arg extends Payload>(args?: WithControlArgs<NoExtraOperationKeys<O$1, Exclude<Arg, undefined>, Exclude<Payload, undefined>, M$1, Controls$1>, Controls$1>) => OperationCarrier<OperationResultWithClientDefaults<O$1, M$1, Arg, DefaultOmit, ClientDefaults>, Pending> : <Arg extends Payload>(args: WithControlArgs<NoExtraOperationKeys<O$1, Arg, Payload, M$1, Controls$1>, Controls$1>) => OperationCarrier<OperationResultWithClientDefaults<O$1, M$1, Arg, DefaultOmit, ClientDefaults>, Pending>;
11226
+ type OperationCarrier<Result, Pending extends boolean> = Pending extends true ? PendingOperation<Result> : Promise<Result>;
11227
+ type Operation$1<O$1 extends Operations, M$1 extends Model$1<any>, DefaultOmit = undefined, ClientDefaults = never, Controls$1 = NoControls, Payload = OperationPayload<O$1, M$1>> = OperationMethod<O$1, M$1, DefaultOmit, ClientDefaults, Controls$1, Payload, true>;
11228
+ type CachedOperation<O$1 extends Operations, M$1 extends Model$1<any>, DefaultOmit = undefined, ClientDefaults = never, Controls$1 = NoControls> = OperationMethod<O$1, M$1, DefaultOmit, ClientDefaults, Controls$1, OperationPayload<O$1, M$1>, false>;
11080
11229
  /**
11081
11230
  * Cached client type - provides typed access to only cacheable (read) operations
11082
11231
  * Returns Promises directly (not PendingOperation) - cache operations are not batchable
@@ -11208,21 +11357,6 @@ declare class SavepointQueue {
11208
11357
  }
11209
11358
  //#endregion
11210
11359
  //#region src/drivers/shared/driver-options.d.ts
11211
- /**
11212
- * The driver-option boundary.
11213
- *
11214
- * Every public `namespace` and MySQL2's `migrationNamespaceAttestation` reach
11215
- * VibORM through a caller-owned object, which may be a proxy or carry an
11216
- * accessor. This module is the one place those properties are read: exactly
11217
- * once, with a thrown accessor turned into the client-construction failure the
11218
- * rest of the surface already raises. A second read is what would let a value
11219
- * that passed validation be swapped for one that did not before it is used.
11220
- *
11221
- * Convenience wrappers read the caller's configuration here and hand their
11222
- * driver a plain primitive; direct driver construction reads its own options
11223
- * object here. Both entries reach this owner, and neither reaches a provider
11224
- * before it answers.
11225
- */
11226
11360
  /**
11227
11361
  * MySQL2's transport assertion. It selects nothing: it states that qualified
11228
11362
  * `database.table` references and the pinned migration session's `USE` cannot
@@ -11561,6 +11695,15 @@ declare abstract class DriverTransactionBase<TClient, TTransaction> extends Driv
11561
11695
  interface PinnedSessionReservation<TSession> {
11562
11696
  /** The reserved producer. Every statement of the session runs on it. */
11563
11697
  readonly session: TSession;
11698
+ /**
11699
+ * The failure the provider itself saw end this session's connection, or
11700
+ * `undefined` while it has seen none.
11701
+ *
11702
+ * Only a provider that observes its connection has one (`pg`, through the
11703
+ * client's `error` event). Elsewhere a lost connection is recognized by the
11704
+ * failure that reported it.
11705
+ */
11706
+ readonly lost?: () => unknown;
11564
11707
  /**
11565
11708
  * Returns the producer to the provider.
11566
11709
  *
@@ -11570,11 +11713,42 @@ interface PinnedSessionReservation<TSession> {
11570
11713
  * pool. A provider whose session can never be made clean again (MySQL2, which
11571
11714
  * has executed `USE` and possibly author-owned statements) destroys
11572
11715
  * unconditionally and ignores the flag.
11716
+ *
11717
+ * `lost` is true when the connection itself is gone or stopped answering:
11718
+ * the provider must send nothing more on it — not even the reset a discard
11719
+ * otherwise runs — and abandon or destroy it.
11573
11720
  */
11574
- release(discard: boolean): Promise<void>;
11721
+ release(discard: boolean, lost?: boolean): Promise<void>;
11575
11722
  }
11576
11723
  //#endregion
11577
11724
  //#region src/drivers/driver.d.ts
11725
+ /** A PostgreSQL driver's transport assertion for migration sessions. */
11726
+ type MigrationSessionAttestation = "dedicated-session";
11727
+ /**
11728
+ * What a SQLite driver states to run effectful migration work. Each member is a
11729
+ * safety claim with one admitted value; a driver that cannot make all of them
11730
+ * does not declare the capability. Whether it runs callback transactions stays
11731
+ * the driver's own `supportsTransactions` declaration, read beside this one.
11732
+ */
11733
+ interface SqliteMigrationCapability {
11734
+ /**
11735
+ * `PRAGMA foreign_keys` run between transactions on the migration's
11736
+ * connection takes effect there and reads back.
11737
+ */
11738
+ readonly foreignKeys: "pragma";
11739
+ /**
11740
+ * The platform reserves no table names: every table outside `sqlite_*` is
11741
+ * the caller's. Cloudflare's `_cf_*` tables are why D1 cannot declare it.
11742
+ */
11743
+ readonly reservedTablePrefixes: "none";
11744
+ /**
11745
+ * Every transaction this driver opens holds SQLite's database write lock
11746
+ * from its BEGIN (`BEGIN IMMEDIATE`), so no other writer interleaves with a
11747
+ * migration transaction before it commits or rolls back.
11748
+ */
11749
+ readonly exclusion: "database-write-lock";
11750
+ }
11751
+ declare const SQLITE_MIGRATION_CAPABILITY: SqliteMigrationCapability;
11578
11752
  declare abstract class Driver<TClient, TTransaction> extends DriverTransactionBase<TClient, TTransaction> {
11579
11753
  protected createTransactionBoundDriver(tx: TTransaction, context: QueryExecutionContext): TransactionBoundDriver<TClient, TTransaction>;
11580
11754
  /**
@@ -11614,6 +11788,40 @@ declare abstract class Driver<TClient, TTransaction> extends DriverTransactionBa
11614
11788
  * client a caller may hand to several drivers.
11615
11789
  */
11616
11790
  protected physicalPinnedSession?(): Promise<object>;
11791
+ /**
11792
+ * Every endpoint this PostgreSQL driver's configuration names for its
11793
+ * sessions — host names and connection URLs, as configured; entries that are
11794
+ * not strings name nothing — read when a migration command is admitted.
11795
+ * Absent on a driver that names none (PGlite, a custom driver). Migration
11796
+ * admission is its one consumer: it refuses effectful commands when one of
11797
+ * them is a transaction-pooling host it knows (Cloudflare Hyperdrive, a Neon
11798
+ * `-pooler` endpoint), because a session lock taken there is held by
11799
+ * whichever server session served that statement.
11800
+ */
11801
+ protected migrationSessionEndpoints?(): readonly unknown[];
11802
+ /**
11803
+ * The caller's claim, at their risk, that every connection this PostgreSQL
11804
+ * driver opens is one server session for its whole life. It lifts only the
11805
+ * pooler-host refusal; a driver with no pinned-session hook stays refused.
11806
+ * Installed like `migrationNamespaceAttestation`: only the exact literal.
11807
+ */
11808
+ readonly migrationSessionAttestation: MigrationSessionAttestation | undefined;
11809
+ /**
11810
+ * This SQLite driver's migration capability, or absent. Its presence binds a
11811
+ * custom SQLite driver to VibORM's SQLite migration implementation, and
11812
+ * effectful migration work is admitted only on a driver that declares it.
11813
+ * Only the exact {@link SQLITE_MIGRATION_CAPABILITY} values count.
11814
+ */
11815
+ readonly sqliteMigrationCapability: SqliteMigrationCapability | undefined;
11816
+ /**
11817
+ * Runs on the migration's connection immediately before a SQLite table
11818
+ * recreation's `PRAGMA foreign_keys = OFF`, outside any transaction, or is
11819
+ * absent. SQLite ignores that pragma while a write is pending, so a driver
11820
+ * whose platform can hold one open settles it here: a Durable Object driver
11821
+ * calls `await ctx.storage.sync()`. The pragma is read back afterwards
11822
+ * either way, and the recreation is refused when it still reads 1.
11823
+ */
11824
+ protected beforeForeignKeysOff?(): Promise<void>;
11617
11825
  disconnect(): Promise<void>;
11618
11826
  }
11619
11827
  /**
@@ -11709,7 +11917,8 @@ declare class TransactionBoundDriver<TClient, TTransaction> extends Driver<TClie
11709
11917
  * substrate (result shape, program lowering, identity helpers); the client never
11710
11918
  * spells them, and they share their family's arg schema.
11711
11919
  */
11712
- type Operation = "findFirst" | "findMany" | "findUnique" | "create" | "createMany" | "createManyAndReturn" | "update" | "updateMany" | "updateManyAndReturn" | "delete" | "deleteMany" | "deleteManyAndReturn" | "upsert" | "count" | "aggregate" | "groupBy" | "exist";
11920
+ declare const OPERATIONS: readonly ["findFirst", "findMany", "findUnique", "create", "createMany", "createManyAndReturn", "update", "updateMany", "updateManyAndReturn", "delete", "deleteMany", "deleteManyAndReturn", "upsert", "count", "aggregate", "groupBy", "exist"];
11921
+ type Operation = (typeof OPERATIONS)[number];
11713
11922
  //#endregion
11714
11923
  //#region src/adapters/adapter-result-parser.d.ts
11715
11924
  interface AdapterResultParser {
@@ -11971,7 +12180,11 @@ interface DatabaseAdapter {
11971
12180
  true: () => Sql;
11972
12181
  /** FALSE literal (database-specific: FALSE vs 0) */
11973
12182
  false: () => Sql;
11974
- /** Create a value list: ($1, $2, $3) */
12183
+ /**
12184
+ * Returns the dialect's membership operand, valid only as `operators.in` /
12185
+ * `notIn` input: a parenthesized list, a PostgreSQL array parameter, or,
12186
+ * past 25 members, a SQLite `json_each` subquery.
12187
+ */
11975
12188
  list: (values: Sql[]) => Sql;
11976
12189
  /** JSON value (PG: native, MySQL/SQLite: JSON.stringify) */
11977
12190
  json: (v: unknown) => Sql;
@@ -12164,7 +12377,8 @@ interface DatabaseAdapter {
12164
12377
  * would bind the hex text's own bytes, so the binary arm decodes it
12165
12378
  * (`decode(…, 'hex')`, `UNHEX`, `unhex`). SQLite's `unhex()` arrived in
12166
12379
  * 3.41, above this adapter's 3.35 floor: a compact identifier on SQLite
12167
- * needs 3.41, and nothing else here does.
12380
+ * needs 3.41, and so does a bytes list longer than `literals.list` keeps
12381
+ * parenthesized; nothing else here does.
12168
12382
  */
12169
12383
  idCast: (expr: Sql, representation: IdRepresentation) => Sql;
12170
12384
  coalesce: (...exprs: Sql[]) => Sql;
@@ -12188,6 +12402,33 @@ interface DatabaseAdapter {
12188
12402
  count: (expr?: Sql) => Sql;
12189
12403
  countDistinct: (expr: Sql) => Sql;
12190
12404
  sum: (expr: Sql) => Sql;
12405
+ /**
12406
+ * A double column's sum as two `SUM`s no row count can overflow: its
12407
+ * members of magnitude at least 1e-288 divided by 2^64, and the smaller
12408
+ * ones as they are. Dividing such a double by 2^64 is exact, so the first
12409
+ * part is the plain sum scaled exactly, and the reader's
12410
+ * `high * 2^64 + low` is that sum — `±Infinity` past the double range,
12411
+ * where PostgreSQL's own `SUM` raises and MySQL's answers 0 (engine-10).
12412
+ *
12413
+ * `having` compares `value` and a grouped `orderBy` sorts by `order`, so
12414
+ * a group is kept and placed by the sum the projection publishes.
12415
+ */
12416
+ numberSum: (expr: Sql) => {
12417
+ readonly parts: readonly [high: Sql, low: Sql];
12418
+ /** The joined sum as one comparable expression. */
12419
+ readonly value: Sql;
12420
+ /** Sort keys, most significant first, ordering by the joined sum. */
12421
+ readonly order: readonly Sql[];
12422
+ };
12423
+ /**
12424
+ * Stated only where an integer `SUM` is int64 and raises past it
12425
+ * (SQLite): an int64 column's sum as two `SUM`s no realistic row count
12426
+ * can overflow — each member's high 32 bits and the rest — read back
12427
+ * exactly as `high * 2^32 + low` (engine-10), compared and sorted as
12428
+ * `numberSum` states. PostgreSQL and MySQL already sum integers as exact
12429
+ * numerics.
12430
+ */
12431
+ integerSum?: DatabaseAdapter["aggregates"]["numberSum"];
12191
12432
  avg: (expr: Sql) => Sql;
12192
12433
  min: (expr: Sql, boolean?: boolean) => Sql;
12193
12434
  max: (expr: Sql, boolean?: boolean) => Sql;
@@ -12712,6 +12953,12 @@ declare class MySQLAdapter implements DatabaseAdapter {
12712
12953
  count: (expr?: Sql) => Sql;
12713
12954
  countDistinct: (expr: Sql) => Sql;
12714
12955
  sum: (expr: Sql) => Sql;
12956
+ numberSum: (expr: Sql) => {
12957
+ readonly parts: readonly [high: Sql, low: Sql];
12958
+ readonly value: Sql;
12959
+ readonly order: readonly Sql[];
12960
+ };
12961
+ integerSum?: DatabaseAdapter["aggregates"]["numberSum"] | undefined;
12715
12962
  avg: (expr: Sql) => Sql;
12716
12963
  min: (expr: Sql, boolean?: boolean) => Sql;
12717
12964
  max: (expr: Sql, boolean?: boolean) => Sql;
@@ -12725,7 +12972,7 @@ declare class MySQLAdapter implements DatabaseAdapter {
12725
12972
  array: (items: Sql[]) => Sql;
12726
12973
  emptyArray: () => Sql;
12727
12974
  agg: (expr: Sql) => Sql;
12728
- objectFromColumns: (columns: [string, Sql][]) => Sql;
12975
+ objectFromColumns: (pairs: [string, Sql][]) => Sql;
12729
12976
  extract: (column: Sql, path: string[]) => Sql;
12730
12977
  extractText: (column: Sql, path: string[]) => Sql;
12731
12978
  numberAtPath: (column: Sql, path: string[]) => Sql;
@@ -12852,6 +13099,7 @@ declare class MySQLAdapter implements DatabaseAdapter {
12852
13099
  }
12853
13100
  //#endregion
12854
13101
  //#region src/adapters/databases/postgres/postgres-adapter.d.ts
13102
+ declare function postgresAsciiCaseFold(expr: Sql): Sql;
12855
13103
  declare function postgresJsonObject(pairs: [string, Sql][]): Sql;
12856
13104
  declare class PostgresAdapter implements DatabaseAdapter {
12857
13105
  #private;
@@ -12872,9 +13120,9 @@ declare class PostgresAdapter implements DatabaseAdapter {
12872
13120
  json: (v: unknown) => Sql;
12873
13121
  decimal: (canonical: string, descriptor: DecimalDescriptor) => Sql;
12874
13122
  id: (physical: string | Uint8Array, representation: IdRepresentation) => Sql;
13123
+ list: (values: Sql[]) => Sql;
12875
13124
  value: (v: unknown) => Sql;
12876
13125
  null: () => Sql;
12877
- list: (values: Sql[]) => Sql;
12878
13126
  };
12879
13127
  operators: {
12880
13128
  exists: (subquery: Sql) => Sql;
@@ -12886,8 +13134,6 @@ declare class PostgresAdapter implements DatabaseAdapter {
12886
13134
  notBetween: (column: Sql, min: Sql, max: Sql) => Sql;
12887
13135
  isNull: (expr: Sql) => Sql;
12888
13136
  isNotNull: (expr: Sql) => Sql;
12889
- in: (column: Sql, values: Sql) => Sql;
12890
- notIn: (column: Sql, values: Sql) => Sql;
12891
13137
  like: (column: Sql, pattern: Sql) => Sql;
12892
13138
  notLike: (column: Sql, pattern: Sql) => Sql;
12893
13139
  ilike: (column: Sql, pattern: Sql) => Sql;
@@ -12898,6 +13144,8 @@ declare class PostgresAdapter implements DatabaseAdapter {
12898
13144
  startsWithPrefix: (column: Sql, value: string, nativeType?: NativeTypeDeclaration) => Sql;
12899
13145
  exactTextEq: (column: Sql, value: Sql, nativeType?: NativeTypeDeclaration) => Sql;
12900
13146
  exactTextIn: (column: Sql, values: Sql, nativeType?: NativeTypeDeclaration) => Sql;
13147
+ in: (column: Sql, values: Sql) => Sql;
13148
+ notIn: (column: Sql, values: Sql) => Sql;
12901
13149
  eq: (left: Sql, right: Sql) => Sql;
12902
13150
  neq: (left: Sql, right: Sql) => Sql;
12903
13151
  lt: (left: Sql, right: Sql) => Sql;
@@ -12907,7 +13155,7 @@ declare class PostgresAdapter implements DatabaseAdapter {
12907
13155
  };
12908
13156
  expressions: {
12909
13157
  caseSensitiveText: (expr: Sql, nativeType?: NativeTypeDeclaration, textOperation?: boolean) => Sql;
12910
- asciiCaseFold: (expr: Sql) => Sql;
13158
+ asciiCaseFold: typeof postgresAsciiCaseFold;
12911
13159
  concat: (...parts: Sql[]) => Sql;
12912
13160
  greatest: (...exprs: Sql[]) => Sql;
12913
13161
  least: (...exprs: Sql[]) => Sql;
@@ -12936,6 +13184,12 @@ declare class PostgresAdapter implements DatabaseAdapter {
12936
13184
  count: (expr?: Sql) => Sql;
12937
13185
  countDistinct: (expr: Sql) => Sql;
12938
13186
  sum: (expr: Sql) => Sql;
13187
+ numberSum: (expr: Sql) => {
13188
+ readonly parts: readonly [high: Sql, low: Sql];
13189
+ readonly value: Sql;
13190
+ readonly order: readonly Sql[];
13191
+ };
13192
+ integerSum?: DatabaseAdapter["aggregates"]["numberSum"] | undefined;
12939
13193
  avg: (expr: Sql) => Sql;
12940
13194
  };
12941
13195
  json: {
@@ -13074,6 +13328,15 @@ declare class PostgresAdapter implements DatabaseAdapter {
13074
13328
  //#region src/adapters/databases/sqlite/sqlite-adapter.d.ts
13075
13329
  /** Admit the exact TEXT-to-INTEGER cast domain, including its 19-digit edges. */
13076
13330
  declare function sqliteIntegerPrecision(coefficient: string): number | undefined;
13331
+ /**
13332
+ * engine-09: a list longer than {@link PLANNED_LIST} whose members are each one
13333
+ * parameter under one spelling — bare, or a decimal's coefficient cast — as
13334
+ * ONE parameter, a JSON array `json_each` reads back and spells per element as
13335
+ * each member was, so `IN` and `NOT IN` keep their answers, NULLs included.
13336
+ * Blobs travel as hex, read through `unhex` (SQLite 3.41). Any other list
13337
+ * keeps a parameter per member.
13338
+ */
13339
+ declare function sqliteList(members: Sql[]): Sql;
13077
13340
  /** Facts a SQLite driver states about its transport. */
13078
13341
  interface SQLiteAdapterOptions {
13079
13342
  /**
@@ -13105,8 +13368,8 @@ declare class SQLiteAdapter implements DatabaseAdapter {
13105
13368
  dateTime: (iso: string, nativeType?: NativeTypeDeclaration) => Sql;
13106
13369
  decimal: (canonical: string, descriptor: DecimalDescriptor) => Sql;
13107
13370
  id: (physical: string | Uint8Array, _representation: IdRepresentation) => Sql;
13371
+ list: typeof sqliteList;
13108
13372
  null: () => Sql;
13109
- list: (values: Sql[]) => Sql;
13110
13373
  };
13111
13374
  operators: {
13112
13375
  exists: (subquery: Sql) => Sql;
@@ -13163,9 +13426,19 @@ declare class SQLiteAdapter implements DatabaseAdapter {
13163
13426
  aggregates: {
13164
13427
  decimalAvg: (column: Sql, _descriptor: DecimalDescriptor) => Sql;
13165
13428
  decimalSumOperandPrecision: typeof sqliteIntegerPrecision;
13429
+ integerSum: (column: Sql) => {
13430
+ parts: readonly [Sql, Sql];
13431
+ value: Sql;
13432
+ order: Sql[];
13433
+ };
13166
13434
  count: (expr?: Sql) => Sql;
13167
13435
  countDistinct: (expr: Sql) => Sql;
13168
13436
  sum: (expr: Sql) => Sql;
13437
+ numberSum: (expr: Sql) => {
13438
+ readonly parts: readonly [high: Sql, low: Sql];
13439
+ readonly value: Sql;
13440
+ readonly order: readonly Sql[];
13441
+ };
13169
13442
  avg: (expr: Sql) => Sql;
13170
13443
  min: (expr: Sql, boolean?: boolean) => Sql;
13171
13444
  max: (expr: Sql, boolean?: boolean) => Sql;
@@ -13179,7 +13452,7 @@ declare class SQLiteAdapter implements DatabaseAdapter {
13179
13452
  array: (items: Sql[]) => Sql;
13180
13453
  emptyArray: () => Sql;
13181
13454
  agg: (expr: Sql) => Sql;
13182
- objectFromColumns: (columns: [string, Sql][]) => Sql;
13455
+ objectFromColumns: (pairs: [string, Sql][]) => Sql;
13183
13456
  extract: (column: Sql, path: string[]) => Sql;
13184
13457
  extractText: (column: Sql, path: string[]) => Sql;
13185
13458
  numberAtPath: (column: Sql, path: string[]) => Sql;
@@ -13310,4 +13583,4 @@ declare const mysqlAdapter: MySQLAdapter;
13310
13583
  declare const postgresAdapter: PostgresAdapter;
13311
13584
  declare const sqliteAdapter: SQLiteAdapter;
13312
13585
  //#endregion
13313
- export { ModelCoreInput as $, ScalarType as $n, ConnectionError as $r, EmptyClientExtensionState as $t, BatchPayload as A, VibORMErrorCode as Ai, V$1 as An, toJsonSchema as Ar, validateOperationPayload as At, ModelShape as B, DecimalDescriptor as Bi, IndexOptions as Bn, inferred as Br, BatchTransactionOptions as Bt, OperationPayload as C, isValueTooLongError as Ci, WithCacheOptions as Cn, BaseBooleanSchema as Cr, ReferencesStage as Ct, Schema$1 as D, CacheOperationNotCacheableError as Di, QueryExecutionContext as Dn, BaseBigIntSchema as Dr, getOperationPayloadSchema as Dt, Operations as E, CacheInvalidTTLError as Ei, Dialect as En, BlobSchema as Er, getSchemas as Et, FlatSchema as F, DiagnosticDisclosure as Fi, ModelFieldRefs as Fn, JsonNull as Fr, NoExtraDriverConfigKeys as Ft, InferInput as G, PG as Gi, ModelState as Gn, RelationCardinality as Gr, NoControls as Gt, VariantToOneRelation as H, MYSQL as Hi, InitialModelState as Hn, Getter as Hr, TransactionOptionSupport as Ht, Linked as I, GeoArea as Ii, createModelFieldRefs as In, JsonNullKind as Ir, VibORMClient as It, Prettify as J, AutoGenerate as Jn, ValidationErrorSource as Jr, defineExtension as Jt, InferOutput as K, SQLITE as Ki, UpdateState as Kn, RelationSlot as Kr, PlacedControl as Kt, LinkedClientConfig as L, GeoBounds as Li, isFieldRef as Ln, JsonNullSentinel as Lr, VibORMConfig as Lt, GroupByResultType as M, isVibORMError as Mi, StringSchema as Mn, AnyJsonNullSentinel as Mr, ExtendedClient as Mt, InferSelectInclude as N, toPrismaErrorCode as Ni, AnyFieldRef as Nn, AnyNull as Nr, ExtendedOperationResult as Nt, ValidatedOperationPayload as O, PrismaErrorCode as Oi, QueryResult as On, BigIntSchema as Or, renderOperationResultType as Ot, ClientSchema as P, wrapError as Pi, FieldRef as Pn, DbNull as Pr, ExtensionState as Pt, ModelArgsSchemas as Q, ScalarState as Qn, ClientInitializationError as Qr, ClientExtensionState as Qt, Links as R, GeoPoint as Ri, AnyModel as Rn, isJsonNullSentinel as Rr, createClient as Rt, MutationOperations as S, isUniqueConstraintError as Si, CacheInvalidationOptions as Sn, EnumSchema as Sr, ModelToOneRelation as St, OperationResult as T, CacheInvalidKeyError as Ti, CommittedBatchNotification as Tn, BaseBlobSchema as Tr, s as Tt, Scalar as U, NativeType as Ui, Model$1 as Un, JunctionReferentialAction as Ur, OfficialCacheExtension as Ut, type VariantToManyRelation as V, Decimal as Vi, IndexType as Vn, AnyRelation as Vr, DriverTransactionOptions as Vt, BigIntScalar as W, NativeTypeMap as Wi, ModelInternal as Wn, ReferentialAction as Wr, DefinitionControls as Wt, SchemaRegistryOperation as X, GeneratorDefaultBrand as Xn, InvalidTransactionInputError as Xr, StatementHandler as Xt, SchemaRegistryLookup as Y, AutoGenerateType as Yn, isValidationError as Yr, StatementContext as Yt, VibSchema as Z, InitialScalarState as Zn, TransactionError as Zr, AccumulatedExtensionState as Zt, OFFICIAL_INSTRUMENTATION_NAME as _, UniqueConstraintError as _i, isPendingOperation as _n, BaseIsoTimestampSchema as _r, TimeScalar as _t, PostgresAdapter as a, QueryEngineError as ai, validateSchema as an, PointSchema as ar, ScalarSchemas as at, Client as b, isForeignKeyError as bi, CacheSetOptions as bn, IsoTimestampSchema as br, BooleanScalar as bt, Operation as c, isClientInitializationError as ci, isSchemaValidationError as cn, BaseNumberSchema as cr, NumericScalar as ct, PinnedSessionReservation as d, isUnsupportedOperationError as di, ValidationResult$1 as dn, BaseJsonSchema as dr, PointScalar as dt, FeatureNotSupportedError as ei, ExtensionCacheState as en, UpdateState$1 as er, ModelCoreSchemas as et, DriverResultParser as f, MigrationError as fi, DateTimePhysicalForm as fn, InputJsonValue as fr, NumberScalar as ft, ObserveHandler as g, NotNullConstraintError as gi, UnwrapPendingOperations as gn, BaseIsoTimeSchema as gr, DecimalScalar as gt, ObservationUnit as h, ForeignKeyError as hi, UnwrapPendingOperation as hn, BaseIsoDateSchema as hr, EnumScalar as ht, SQLiteAdapter as i, PendingOperationError as ii, RawOperation as in, BasePointSchema as ir, ModelStateSchemas as it, CountResultType as j, isRetryableError as ji, v as jn, createSchemaRegistry as jr, DriverConfig as jt, AggregateResultType as k, VibORMError as ki, sqliteResultParser as kn, createJsonSchemaConverter as kr, renderSchemaType as kt, AnyDriver as l, isNotFoundError as li, SchemaValidationIssue as ln, IntegerSchema as lr, VectorScalar as lt, ObservationCompletion as m, CheckConstraintError as mi, PendingOperation as mn, JsonValue as mr, IntScalar as mt, postgresAdapter as n, NestedWriteError as ni, ExtensionResultConsumerState as nn, BaseVectorSchema as nr, ModelRelationNestedInput as nt, MySQLAdapter as o, QueryError as oi, validateSchemaOrThrow as on, ObjectSchema as or, ArgsSchemas as ot, MigrationNamespaceAttestation as p, isMigrationError as pi, Schema$3 as pn, JsonSchema as pr, JsonScalar as pt, ParseResult as q, DecimalSchema as qn, ValidationError as qr, ClientExtension as qt, sqliteAdapter as r, NotFoundError as ri, MergeExtensionState as rn, VectorSchema as rr, ModelSchemas as rt, DatabaseAdapter as s, UnsupportedOperationError as si, SchemaValidationError as sn, BaseIntegerSchema as sr, CoreSchemas as st, mysqlAdapter as t, NestedWriteAssertionError as ti, ExtensionContributionState as tn, parse as tr, ModelOperationInput as tt, Driver as u, isPendingOperationError as ui, Severity as un, NumberSchema as ur, StringScalar as ut, CacheableOperations as v, ValueTooLongError as vi, CacheDriver as vn, IsoDateSchema as vr, DateTimeScalar as vt, OperationPayloadSchema as w, CacheConfigurationError as wi, BatchQuery as wn, BooleanSchema as wr, ModelToManyRelation as wt, InferDatabase as x, isNotNullConstraintError as xi, WaitUntilFn as xn, BaseEnumSchema as xr, BlobScalar as xt, CachedClient as y, isCheckConstraintError as yi, CacheEntry as yn, IsoTimeSchema as yr, DateScalar as yt, RelationLinks as z, GeoPolygon as zi, IndexDefinition as zn, JsonSchema$1 as zr, defaultOmit as zt };
13586
+ export { SchemaRegistryOperation as $, GeneratorDefaultBrand as $n, InvalidTransactionInputError as $r, EmptyClientExtensionState as $t, Schema$1 as A, CacheOperationNotCacheableError as Ai, Dialect as An, BaseBigIntSchema as Ar, getOperationPayloadSchema as At, LinkedClientConfig as B, GeoBounds as Bi, isFieldRef as Bn, JsonNullSentinel as Br, VibORMConfig as Bt, Client as C, isForeignKeyError as Ci, WithCacheOptions as Cn, IsoTimestampSchema as Cr, BooleanScalar as Ct, OperationPayloadSchema as D, CacheConfigurationError as Di, TransactionOptionSupport as Dn, BooleanSchema as Dr, ModelToManyRelation as Dt, OperationPayload as E, isValueTooLongError as Ei, DriverTransactionOptions as En, BaseBooleanSchema as Er, ReferencesStage as Et, GroupByResultType as F, isVibORMError as Fi, StringSchema as Fn, AnyJsonNullSentinel as Fr, ExtendedClient as Ft, VariantToOneRelation as G, MYSQL as Gi, InitialModelState as Gn, Getter as Gr, NoControls as Gt, RelationLinks as H, GeoPolygon as Hi, IndexDefinition as Hn, JsonSchema$1 as Hr, defaultOmit as Ht, InferSelectInclude as I, toPrismaErrorCode as Ii, AnyFieldRef as In, AnyNull as Ir, ExtendedOperationResult as It, InferInput as J, PG as Ji, ModelState as Jn, RelationCardinality as Jr, defineExtension as Jt, Scalar as K, NativeType as Ki, Model$1 as Kn, JunctionReferentialAction as Kr, PlacedControl as Kt, ClientSchema as L, wrapError as Li, FieldRef as Ln, DbNull as Lr, ExtensionState as Lt, AggregateResultType as M, VibORMError as Mi, QueryResult as Mn, createJsonSchemaConverter as Mr, renderSchemaType as Mt, BatchPayload as N, VibORMErrorCode as Ni, V$1 as Nn, toJsonSchema as Nr, validateOperationPayload as Nt, OperationResult as O, CacheInvalidKeyError as Oi, BatchQuery as On, BaseBlobSchema as Or, s as Ot, CountResultType as P, isRetryableError as Pi, v as Pn, createSchemaRegistry as Pr, DriverConfig as Pt, SchemaRegistryLookup as Q, AutoGenerateType as Qn, isValidationError as Qr, ClientExtensionState as Qt, FlatSchema as R, DiagnosticDisclosure as Ri, ModelFieldRefs as Rn, JsonNull as Rr, NoExtraDriverConfigKeys as Rt, CachedClient as S, isCheckConstraintError as Si, CacheInvalidationOptions as Sn, IsoTimeSchema as Sr, DateScalar as St, MutationOperations as T, isUniqueConstraintError as Ti, BatchTransactionOptions as Tn, EnumSchema as Tr, ModelToOneRelation as Tt, ModelShape as U, DecimalDescriptor as Ui, IndexOptions as Un, inferred as Ur, OfficialCacheExtension as Ut, type Links as V, GeoPoint as Vi, AnyModel as Vn, isJsonNullSentinel as Vr, createClient as Vt, VariantToManyRelation as W, Decimal as Wi, IndexType as Wn, AnyRelation as Wr, DefinitionControls as Wt, ParseResult as X, DecimalSchema as Xn, ValidationError as Xr, StatementHandler as Xt, InferOutput as Y, SQLITE as Yi, UpdateState as Yn, RelationSlot as Yr, StatementContext as Yt, Prettify as Z, AutoGenerate as Zn, ValidationErrorSource as Zr, AccumulatedExtensionState as Zt, ObservationCompletion as _, CheckConstraintError as _i, isPendingOperation as _n, JsonValue as _r, IntScalar as _t, PostgresAdapter as a, NestedWriteError as ai, validateSchema as an, BaseVectorSchema as ar, ModelRelationNestedInput as at, OFFICIAL_INSTRUMENTATION_NAME as b, UniqueConstraintError as bi, CacheSetOptions as bn, BaseIsoTimestampSchema as br, TimeScalar as bt, Operation as c, QueryEngineError as ci, isSchemaValidationError as cn, PointSchema as cr, ScalarSchemas as ct, MigrationSessionAttestation as d, isClientInitializationError as di, ValidationResult$1 as dn, BaseNumberSchema as dr, NumericScalar as dt, TransactionError as ei, ExtensionCacheState as en, InitialScalarState as er, VibSchema as et, SQLITE_MIGRATION_CAPABILITY as f, isNotFoundError as fi, DateTimePhysicalForm as fn, IntegerSchema as fr, VectorScalar as ft, MigrationNamespaceAttestation as g, isMigrationError as gi, UnwrapPendingOperations as gn, JsonSchema as gr, JsonScalar as gt, DriverResultParser as h, MigrationError as hi, UnwrapPendingOperation as hn, InputJsonValue as hr, NumberScalar as ht, SQLiteAdapter as i, NestedWriteAssertionError as ii, RawOperation as in, parse as ir, ModelOperationInput as it, ValidatedOperationPayload as j, PrismaErrorCode as ji, QueryExecutionContext as jn, BigIntSchema as jr, renderOperationResultType as jt, Operations as k, CacheInvalidTTLError as ki, CommittedBatchNotification as kn, BlobSchema as kr, getSchemas as kt, AnyDriver as l, QueryError as li, SchemaValidationIssue as ln, ObjectSchema as lr, ArgsSchemas as lt, PinnedSessionReservation as m, isUnsupportedOperationError as mi, PendingOperation as mn, BaseJsonSchema as mr, PointScalar as mt, postgresAdapter as n, ConnectionError as ni, ExtensionResultConsumerState as nn, ScalarType as nr, ModelCoreInput as nt, MySQLAdapter as o, NotFoundError as oi, validateSchemaOrThrow as on, VectorSchema as or, ModelSchemas as ot, SqliteMigrationCapability as p, isPendingOperationError as pi, Schema$3 as pn, NumberSchema as pr, StringScalar as pt, BigIntScalar as q, NativeTypeMap as qi, ModelInternal as qn, ReferentialAction as qr, ClientExtension as qt, sqliteAdapter as r, FeatureNotSupportedError as ri, MergeExtensionState as rn, UpdateState$1 as rr, ModelCoreSchemas as rt, DatabaseAdapter as s, PendingOperationError as si, SchemaValidationError as sn, BasePointSchema as sr, ModelStateSchemas as st, mysqlAdapter as t, ClientInitializationError as ti, ExtensionContributionState as tn, ScalarState as tr, ModelArgsSchemas as tt, Driver as u, UnsupportedOperationError as ui, Severity as un, BaseIntegerSchema as ur, CoreSchemas as ut, ObservationUnit as v, ForeignKeyError as vi, CacheDriver as vn, BaseIsoDateSchema as vr, EnumScalar as vt, InferDatabase as w, isNotNullConstraintError as wi, sqliteResultParser as wn, BaseEnumSchema as wr, BlobScalar as wt, CacheableOperations as x, ValueTooLongError as xi, WaitUntilFn as xn, IsoDateSchema as xr, DateTimeScalar as xt, ObserveHandler as y, NotNullConstraintError as yi, CacheEntry as yn, BaseIsoTimeSchema as yr, DecimalScalar as yt, Linked as z, GeoArea as zi, createModelFieldRefs as zn, JsonNullKind as zr, VibORMClient as zt };