viborm 1.0.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 (300) hide show
  1. package/README.md +4 -3
  2. package/dist/{adapter-namespace-DMhEF6my.mjs → adapter-namespace-DqkJQdrD.mjs} +2 -2
  3. package/dist/{adapter-namespace-DMhEF6my.mjs.map → adapter-namespace-DqkJQdrD.mjs.map} +1 -1
  4. package/dist/adapters.d.mts +1 -1
  5. package/dist/adapters.mjs +1 -1
  6. package/dist/{array-literal-D9FexFqy.mjs → array-literal-BsbbSLw3.mjs} +1 -1
  7. package/dist/{array-literal-D9FexFqy.mjs.map → array-literal-BsbbSLw3.mjs.map} +1 -1
  8. package/dist/base-AdXAoy6l.mjs +2 -0
  9. package/dist/base-AdXAoy6l.mjs.map +1 -0
  10. package/dist/batch-refs-4L8ECdPU.mjs +2 -0
  11. package/dist/batch-refs-4L8ECdPU.mjs.map +1 -0
  12. package/dist/bind-parameter-capacity-CjPgqnmx.mjs +2 -0
  13. package/dist/{bind-parameter-capacity-DzMcIB95.mjs.map → bind-parameter-capacity-CjPgqnmx.mjs.map} +1 -1
  14. package/dist/builder-Ycvq3ETg.mjs +2 -0
  15. package/dist/builder-Ycvq3ETg.mjs.map +1 -0
  16. package/dist/bun-sql.d.mts +19 -2
  17. package/dist/bun-sql.mjs +1 -1
  18. package/dist/bun-sql.mjs.map +1 -1
  19. package/dist/bun-sqlite.d.mts +9 -8
  20. package/dist/bun-sqlite.mjs +1 -1
  21. package/dist/bun-sqlite.mjs.map +1 -1
  22. package/dist/cache/cloudflare-kv.d.mts +1 -1
  23. package/dist/cache/cloudflare-kv.mjs +1 -1
  24. package/dist/cache/memory.d.mts +1 -1
  25. package/dist/cache/memory.mjs +1 -1
  26. package/dist/cache/memory.mjs.map +1 -1
  27. package/dist/cache-BO57X0TT.mjs +2 -0
  28. package/dist/cache-BO57X0TT.mjs.map +1 -0
  29. package/dist/cache.d.mts +1 -1
  30. package/dist/cache.mjs +1 -1
  31. package/dist/cache.mjs.map +1 -1
  32. package/dist/canonical-json-rfC2Dg0X.mjs +2 -0
  33. package/dist/canonical-json-rfC2Dg0X.mjs.map +1 -0
  34. package/dist/chain-Dh0FV72b.mjs +2 -0
  35. package/dist/chain-Dh0FV72b.mjs.map +1 -0
  36. package/dist/cli.mjs +5 -6
  37. package/dist/cli.mjs.map +1 -1
  38. package/dist/client-BLiBmykn.mjs +2 -0
  39. package/dist/client-BLiBmykn.mjs.map +1 -0
  40. package/dist/client-CCgfcp5A.mjs +52 -0
  41. package/dist/client-CCgfcp5A.mjs.map +1 -0
  42. package/dist/client-CRBo95D0.d.mts +610 -0
  43. package/dist/client.d.mts +1 -1
  44. package/dist/client.mjs +1 -1
  45. package/dist/{clock-W8H2Khng.mjs → clock-CK41KO7t.mjs} +1 -1
  46. package/dist/{clock-W8H2Khng.mjs.map → clock-CK41KO7t.mjs.map} +1 -1
  47. package/dist/config.d.mts +3 -3
  48. package/dist/config.mjs +1 -1
  49. package/dist/controls-DXgIn4zh.mjs +2 -0
  50. package/dist/controls-DXgIn4zh.mjs.map +1 -0
  51. package/dist/d1.d.mts +1 -1
  52. package/dist/d1.mjs +1 -1
  53. package/dist/d1.mjs.map +1 -1
  54. package/dist/datetime-physical-codec-oIhiYZEP.mjs +2 -0
  55. package/dist/datetime-physical-codec-oIhiYZEP.mjs.map +1 -0
  56. package/dist/driver-B19QlFqn.mjs +2 -0
  57. package/dist/{driver-CRaDT4B7.mjs.map → driver-B19QlFqn.mjs.map} +1 -1
  58. package/dist/driver-BlnKXPFF.mjs +2 -0
  59. package/dist/driver-BlnKXPFF.mjs.map +1 -0
  60. package/dist/driver.d.mts +2 -2
  61. package/dist/driver.mjs +1 -1
  62. package/dist/error-mapping-CnPCv1dm.mjs +2 -0
  63. package/dist/error-mapping-CnPCv1dm.mjs.map +1 -0
  64. package/dist/every-4KE0p2Gw.mjs +2 -0
  65. package/dist/every-4KE0p2Gw.mjs.map +1 -0
  66. package/dist/execution-context-BKR3bgES.mjs +2 -0
  67. package/dist/execution-context-BKR3bgES.mjs.map +1 -0
  68. package/dist/fs-estate-CAhDg7nY.mjs +2 -0
  69. package/dist/fs-estate-CAhDg7nY.mjs.map +1 -0
  70. package/dist/{geo-area-codec-B4DRInvA.mjs → geo-area-codec-1SY9im7O.mjs} +2 -2
  71. package/dist/{geo-area-codec-B4DRInvA.mjs.map → geo-area-codec-1SY9im7O.mjs.map} +1 -1
  72. package/dist/geo-point-codec-lhxH42SK.mjs +2 -0
  73. package/dist/geo-point-codec-lhxH42SK.mjs.map +1 -0
  74. package/dist/{hydration-D6JICBQG.mjs → hydration-CAxOL4aI.mjs} +2 -2
  75. package/dist/{hydration-D6JICBQG.mjs.map → hydration-CAxOL4aI.mjs.map} +1 -1
  76. package/dist/identifier-conversion-GgbwHc2G.mjs +2 -0
  77. package/dist/identifier-conversion-GgbwHc2G.mjs.map +1 -0
  78. package/dist/{identifier-EsWKVHXi.mjs → identifier-hQCs8M1n.mjs} +2 -2
  79. package/dist/{identifier-EsWKVHXi.mjs.map → identifier-hQCs8M1n.mjs.map} +1 -1
  80. package/dist/identity-CLFhCTZx.mjs +2 -0
  81. package/dist/identity-CLFhCTZx.mjs.map +1 -0
  82. package/dist/{index-T0YKKw66.d.mts → index-C_XLSTy2.d.mts} +723 -400
  83. package/dist/index.d.mts +2 -2
  84. package/dist/index.mjs +1 -1
  85. package/dist/index.mjs.map +1 -1
  86. package/dist/instrumentation.d.mts +1 -1
  87. package/dist/instrumentation.mjs +1 -1
  88. package/dist/instrumentation.mjs.map +1 -1
  89. package/dist/{invariant-DCsftyml.mjs → invariant-BnLYqsHO.mjs} +1 -1
  90. package/dist/{invariant-DCsftyml.mjs.map → invariant-BnLYqsHO.mjs.map} +1 -1
  91. package/dist/{json-number-C10HFiy6.mjs → json-number-CGXpPu4D.mjs} +1 -1
  92. package/dist/{json-number-C10HFiy6.mjs.map → json-number-CGXpPu4D.mjs.map} +1 -1
  93. package/dist/key-BeoOwGr3.mjs +2 -0
  94. package/dist/key-BeoOwGr3.mjs.map +1 -0
  95. package/dist/libsql-Bu_IdFU1.mjs +11 -0
  96. package/dist/libsql-Bu_IdFU1.mjs.map +1 -0
  97. package/dist/libsql.d.mts +8 -3
  98. package/dist/libsql.mjs +1 -1
  99. package/dist/libsql.mjs.map +1 -1
  100. package/dist/memory-D4yxtCPK.mjs +2 -0
  101. package/dist/memory-D4yxtCPK.mjs.map +1 -0
  102. package/dist/migrations/mysql.d.mts +6 -0
  103. package/dist/migrations/mysql.mjs +2 -0
  104. package/dist/migrations/mysql.mjs.map +1 -0
  105. package/dist/migrations/postgres.d.mts +6 -0
  106. package/dist/migrations/postgres.mjs +2 -0
  107. package/dist/migrations/postgres.mjs.map +1 -0
  108. package/dist/migrations/sqlite.d.mts +6 -0
  109. package/dist/migrations/sqlite.mjs +2 -0
  110. package/dist/migrations/sqlite.mjs.map +1 -0
  111. package/dist/migrations/storage/durable-object.d.mts +17 -0
  112. package/dist/migrations/storage/durable-object.mjs +2 -0
  113. package/dist/migrations/storage/durable-object.mjs.map +1 -0
  114. package/dist/migrations/storage/fs.d.mts +6 -1
  115. package/dist/migrations/storage/fs.mjs +1 -1
  116. package/dist/migrations/storage/r2.d.mts +14 -0
  117. package/dist/migrations/storage/r2.mjs +2 -0
  118. package/dist/migrations/storage/r2.mjs.map +1 -0
  119. package/dist/migrations/tenant.d.mts +92 -0
  120. package/dist/migrations/tenant.mjs +2 -0
  121. package/dist/migrations/tenant.mjs.map +1 -0
  122. package/dist/{migrations-BWZSBMZh.mjs → migrations-DTObIjAm.mjs} +2 -2
  123. package/dist/migrations-DTObIjAm.mjs.map +1 -0
  124. package/dist/migrations.d.mts +6 -559
  125. package/dist/migrations.mjs +1 -1
  126. package/dist/migrations.mjs.map +1 -1
  127. package/dist/mysql-CibPaHSp.mjs +99 -0
  128. package/dist/mysql-CibPaHSp.mjs.map +1 -0
  129. package/dist/mysql-adapter-DkJPfoGf.mjs +2 -0
  130. package/dist/mysql-adapter-DkJPfoGf.mjs.map +1 -0
  131. package/dist/mysql2.d.mts +1 -3
  132. package/dist/mysql2.mjs +1 -1
  133. package/dist/mysql2.mjs.map +1 -1
  134. package/dist/neon-http.d.mts +1 -1
  135. package/dist/neon-http.mjs +1 -1
  136. package/dist/neon-http.mjs.map +1 -1
  137. package/dist/object-store-DQR6bTBY.mjs +2 -0
  138. package/dist/object-store-DQR6bTBY.mjs.map +1 -0
  139. package/dist/object-store-DyYOCtmX.d.mts +156 -0
  140. package/dist/observation-DUSm7oXK.mjs +2 -0
  141. package/dist/observation-DUSm7oXK.mjs.map +1 -0
  142. package/dist/pg.d.mts +37 -12
  143. package/dist/pg.mjs +1 -1
  144. package/dist/pg.mjs.map +1 -1
  145. package/dist/pglite.d.mts +2 -1
  146. package/dist/pglite.mjs +1 -1
  147. package/dist/pglite.mjs.map +1 -1
  148. package/dist/physical-6V_LNU3L.mjs +2 -0
  149. package/dist/{physical-BkelResN.mjs.map → physical-6V_LNU3L.mjs.map} +1 -1
  150. package/dist/pinned-session-CLxj5M5e.mjs +2 -0
  151. package/dist/pinned-session-CLxj5M5e.mjs.map +1 -0
  152. package/dist/planetscale.d.mts +1 -1
  153. package/dist/planetscale.mjs +1 -1
  154. package/dist/planetscale.mjs.map +1 -1
  155. package/dist/{planner-B11VjIin.d.mts → planner-C6Lfsasx.d.mts} +57 -3
  156. package/dist/postgres-adapter-B3SQvcV1.mjs +2 -0
  157. package/dist/postgres-adapter-B3SQvcV1.mjs.map +1 -0
  158. package/dist/postgres-adapter-CQD2oGuD.mjs +2 -0
  159. package/dist/postgres-adapter-CQD2oGuD.mjs.map +1 -0
  160. package/dist/postgres-oqNW9xqo.mjs +415 -0
  161. package/dist/postgres-oqNW9xqo.mjs.map +1 -0
  162. package/dist/{postgres-result-Dc_iW3Hb.mjs → postgres-result-7F0DllQe.mjs} +2 -2
  163. package/dist/{postgres-result-Dc_iW3Hb.mjs.map → postgres-result-7F0DllQe.mjs.map} +1 -1
  164. package/dist/postgres.d.mts +11 -1
  165. package/dist/postgres.mjs +1 -1
  166. package/dist/postgres.mjs.map +1 -1
  167. package/dist/provider-limits-BHATED_m.mjs +2 -0
  168. package/dist/provider-limits-BHATED_m.mjs.map +1 -0
  169. package/dist/registration-preflight-DEjv050M.mjs +4 -0
  170. package/dist/registration-preflight-DEjv050M.mjs.map +1 -0
  171. package/dist/result-shape-CTNdNSW3.mjs +2 -0
  172. package/dist/result-shape-CTNdNSW3.mjs.map +1 -0
  173. package/dist/scalar-U0wD5bKy.mjs +2 -0
  174. package/dist/{scalar-BTktMqvO.mjs.map → scalar-U0wD5bKy.mjs.map} +1 -1
  175. package/dist/schema/json.d.mts +1 -1
  176. package/dist/schema/json.mjs +1 -1
  177. package/dist/schema/json.mjs.map +1 -1
  178. package/dist/schema-Cjem1-0f.mjs +2 -0
  179. package/dist/{schema-BFNcMdO6.mjs.map → schema-Cjem1-0f.mjs.map} +1 -1
  180. package/dist/schema-introspection-DEYGC2qg.mjs +6 -0
  181. package/dist/schema-introspection-DEYGC2qg.mjs.map +1 -0
  182. package/dist/schema.d.mts +1 -1
  183. package/dist/schema.mjs +1 -1
  184. package/dist/{select-assembly-BgqlrePH.mjs → select-assembly-f1UGoblh.mjs} +2 -2
  185. package/dist/select-assembly-f1UGoblh.mjs.map +1 -0
  186. package/dist/settle-B9Vg1FnP.mjs +2 -0
  187. package/dist/settle-B9Vg1FnP.mjs.map +1 -0
  188. package/dist/soft-delete.d.mts +1 -1
  189. package/dist/{sql--69HUgel.mjs → sql-Bp7jicEX.mjs} +1 -1
  190. package/dist/{sql--69HUgel.mjs.map → sql-Bp7jicEX.mjs.map} +1 -1
  191. package/dist/{sql-statement-tokens-CykxFmOJ.mjs → sql-statement-tokens-BBcoGmJb.mjs} +1 -1
  192. package/dist/{sql-statement-tokens-CykxFmOJ.mjs.map → sql-statement-tokens-BBcoGmJb.mjs.map} +1 -1
  193. package/dist/sql.d.mts +1 -1
  194. package/dist/sql.mjs +1 -1
  195. package/dist/sqlite-adapter-CW_3l6ea.mjs +2 -0
  196. package/dist/sqlite-adapter-CW_3l6ea.mjs.map +1 -0
  197. package/dist/sqlite-utils-DlgokMJN.mjs +2 -0
  198. package/dist/sqlite-utils-DlgokMJN.mjs.map +1 -0
  199. package/dist/sqlite3.d.mts +2 -8
  200. package/dist/sqlite3.mjs +1 -1
  201. package/dist/sqlite3.mjs.map +1 -1
  202. package/dist/standard-sql-Bk4RZPqJ.mjs +6 -0
  203. package/dist/standard-sql-Bk4RZPqJ.mjs.map +1 -0
  204. package/dist/{suppressed-failure-BPxfHTMc.mjs → suppressed-failure-BwULh-8h.mjs} +1 -1
  205. package/dist/{suppressed-failure-BPxfHTMc.mjs.map → suppressed-failure-BwULh-8h.mjs.map} +1 -1
  206. package/dist/{terminal-BbRi0CNZ.mjs → terminal-C8cq1WWX.mjs} +2 -2
  207. package/dist/{terminal-BbRi0CNZ.mjs.map → terminal-C8cq1WWX.mjs.map} +1 -1
  208. package/dist/{transaction-oskVwmsf.mjs → transaction-Bnl6ULTw.mjs} +2 -2
  209. package/dist/transaction-Bnl6ULTw.mjs.map +1 -0
  210. package/dist/{transaction-operation-BC7aua5V.mjs → transaction-operation-CKK3l_9x.mjs} +2 -2
  211. package/dist/transaction-operation-CKK3l_9x.mjs.map +1 -0
  212. package/dist/{utils-DfztpPvR.mjs → utils-CZNaOZR7.mjs} +4 -3
  213. package/dist/utils-CZNaOZR7.mjs.map +1 -0
  214. package/dist/v-D5Z06FKN.mjs +2 -0
  215. package/dist/v-D5Z06FKN.mjs.map +1 -0
  216. package/dist/validation-Dk9Q_-C7.mjs +2 -0
  217. package/dist/validation-Dk9Q_-C7.mjs.map +1 -0
  218. package/dist/validation-PF9-_nKd.mjs +2 -0
  219. package/dist/{validation-tgjL_9n8.mjs.map → validation-PF9-_nKd.mjs.map} +1 -1
  220. package/dist/validation.d.mts +1 -1
  221. package/dist/validation.mjs +1 -1
  222. package/dist/validator-X9-bwtRo.mjs +2 -0
  223. package/dist/{validator-DMlEScV3.mjs.map → validator-X9-bwtRo.mjs.map} +1 -1
  224. package/dist/value-guards-CK9guf2Z.mjs +2 -0
  225. package/dist/value-guards-CK9guf2Z.mjs.map +1 -0
  226. package/dist/version-JDaZht4U.mjs +2 -0
  227. package/dist/{version-Cr80LFvx.mjs.map → version-JDaZht4U.mjs.map} +1 -1
  228. package/package.json +75 -34
  229. package/dist/base-vfur-DaU.mjs +0 -2
  230. package/dist/base-vfur-DaU.mjs.map +0 -1
  231. package/dist/batch-refs-BY51FIXm.mjs +0 -6
  232. package/dist/batch-refs-BY51FIXm.mjs.map +0 -1
  233. package/dist/bind-parameter-capacity-DzMcIB95.mjs +0 -2
  234. package/dist/builder-bPfagDQV.mjs +0 -2
  235. package/dist/builder-bPfagDQV.mjs.map +0 -1
  236. package/dist/chain-uIFlkkXS.mjs +0 -2
  237. package/dist/chain-uIFlkkXS.mjs.map +0 -1
  238. package/dist/client-NleI4Nm-.mjs +0 -434
  239. package/dist/client-NleI4Nm-.mjs.map +0 -1
  240. package/dist/client-tjSMPjeZ.mjs +0 -2
  241. package/dist/client-tjSMPjeZ.mjs.map +0 -1
  242. package/dist/controls-BhxRnPYS.mjs +0 -2
  243. package/dist/controls-BhxRnPYS.mjs.map +0 -1
  244. package/dist/decimal-12NERGYZ.mjs +0 -3
  245. package/dist/decimal-12NERGYZ.mjs.map +0 -1
  246. package/dist/driver-CRaDT4B7.mjs +0 -2
  247. package/dist/driver-options-DxlB1tms.mjs +0 -2
  248. package/dist/driver-options-DxlB1tms.mjs.map +0 -1
  249. package/dist/driver-yCYqzIQg.mjs +0 -2
  250. package/dist/driver-yCYqzIQg.mjs.map +0 -1
  251. package/dist/error-mapping-BWzb-l02.mjs +0 -2
  252. package/dist/error-mapping-BWzb-l02.mjs.map +0 -1
  253. package/dist/execution-context-BPk0YLhd.mjs +0 -2
  254. package/dist/execution-context-BPk0YLhd.mjs.map +0 -1
  255. package/dist/fs-estate-3Bu_K9mk.d.mts +0 -7
  256. package/dist/fs-estate-BcjgY4iY.mjs +0 -2
  257. package/dist/fs-estate-BcjgY4iY.mjs.map +0 -1
  258. package/dist/geo-point-codec-DUTTtlav.mjs +0 -2
  259. package/dist/geo-point-codec-DUTTtlav.mjs.map +0 -1
  260. package/dist/identifiers-By-JRCb5.mjs +0 -2
  261. package/dist/identifiers-By-JRCb5.mjs.map +0 -1
  262. package/dist/key-DKaqPb8w.mjs +0 -2
  263. package/dist/key-DKaqPb8w.mjs.map +0 -1
  264. package/dist/migrations-BWZSBMZh.mjs.map +0 -1
  265. package/dist/mysql-adapter-D9FoHlWE.mjs +0 -2
  266. package/dist/mysql-adapter-D9FoHlWE.mjs.map +0 -1
  267. package/dist/observation-CLp8ylmL.mjs +0 -2
  268. package/dist/observation-CLp8ylmL.mjs.map +0 -1
  269. package/dist/physical-BkelResN.mjs +0 -2
  270. package/dist/pinned-session-Ca7C9yxY.mjs +0 -2
  271. package/dist/pinned-session-Ca7C9yxY.mjs.map +0 -1
  272. package/dist/postgres-adapter-T2Iko-vt.mjs +0 -2
  273. package/dist/postgres-adapter-T2Iko-vt.mjs.map +0 -1
  274. package/dist/registration-preflight-BrA3EWvq.mjs +0 -4
  275. package/dist/registration-preflight-BrA3EWvq.mjs.map +0 -1
  276. package/dist/result-shape-DKTu8yre.mjs +0 -2
  277. package/dist/result-shape-DKTu8yre.mjs.map +0 -1
  278. package/dist/scalar-BTktMqvO.mjs +0 -2
  279. package/dist/schema-BFNcMdO6.mjs +0 -2
  280. package/dist/schema-introspection-DsXPfCst.mjs +0 -6
  281. package/dist/schema-introspection-DsXPfCst.mjs.map +0 -1
  282. package/dist/select-assembly-BgqlrePH.mjs.map +0 -1
  283. package/dist/sqlite-adapter-HqO3GpAK.mjs +0 -2
  284. package/dist/sqlite-adapter-HqO3GpAK.mjs.map +0 -1
  285. package/dist/sqlite-utils-D26BFuJJ.mjs +0 -2
  286. package/dist/sqlite-utils-D26BFuJJ.mjs.map +0 -1
  287. package/dist/transaction-operation-BC7aua5V.mjs.map +0 -1
  288. package/dist/transaction-oskVwmsf.mjs.map +0 -1
  289. package/dist/transactions-gjmrWN5W.mjs +0 -2
  290. package/dist/transactions-gjmrWN5W.mjs.map +0 -1
  291. package/dist/utils-DfztpPvR.mjs.map +0 -1
  292. package/dist/v-B2WwtcRz.mjs +0 -2
  293. package/dist/v-B2WwtcRz.mjs.map +0 -1
  294. package/dist/validation-Du6j0Q38.mjs +0 -2
  295. package/dist/validation-Du6j0Q38.mjs.map +0 -1
  296. package/dist/validation-tgjL_9n8.mjs +0 -2
  297. package/dist/validator-DMlEScV3.mjs +0 -2
  298. package/dist/version-Cr80LFvx.mjs +0 -2
  299. /package/dist/{contract-BHUOUAZ-.d.mts → contract-CIIqgFyb.d.mts} +0 -0
  300. /package/dist/{sql--yhoVvRM.d.mts → sql-BvfwUKIh.d.mts} +0 -0
@@ -0,0 +1,610 @@
1
+ import { n as Sql } from "./sql-BvfwUKIh.mjs";
2
+ import { i as ResolveCallback, n as DiffOperation, r as MigrationTarget, s as MigrationLimits, t as MigrationClient } from "./planner-C6Lfsasx.mjs";
3
+ import { i as Sha256, n as MigrationStorageWriter, t as MigrationStorageReader } from "./contract-CIIqgFyb.mjs";
4
+
5
+ //#region src/migrations/v1-types.d.ts
6
+
7
+ type MigrationFormatV1 = "1";
8
+ interface MigrationEstateDescriptorV1 {
9
+ readonly format: MigrationFormatV1;
10
+ readonly target: MigrationTarget;
11
+ readonly hash: "sha256";
12
+ }
13
+ type MigrationParameterV1 = {
14
+ readonly kind: "null";
15
+ } | {
16
+ readonly kind: "target-namespace";
17
+ } | {
18
+ readonly kind: "boolean";
19
+ readonly value: boolean;
20
+ } | {
21
+ readonly kind: "string";
22
+ readonly value: string;
23
+ } | {
24
+ readonly kind: "number";
25
+ readonly value: number;
26
+ } | {
27
+ readonly kind: "bigint";
28
+ readonly value: string;
29
+ } | {
30
+ readonly kind: "bytes";
31
+ readonly value: string;
32
+ } | {
33
+ readonly kind: "date-time";
34
+ readonly value: string;
35
+ } | {
36
+ readonly kind: "decimal";
37
+ readonly value: string;
38
+ } | {
39
+ readonly kind: "json";
40
+ readonly value: unknown;
41
+ };
42
+ interface MigrationDispatchV1 {
43
+ readonly dispatchId: Sha256;
44
+ readonly sqlHash: Sha256;
45
+ readonly offset: number;
46
+ readonly length: number;
47
+ readonly parameters: readonly MigrationParameterV1[];
48
+ }
49
+ interface MigrationBooleanCheckV1 {
50
+ readonly kind: "driver" | "trusted-read";
51
+ readonly id: string;
52
+ readonly query: MigrationDispatchV1;
53
+ readonly equals: boolean;
54
+ }
55
+ type MigrationStepV1 = {
56
+ readonly retry: "proven";
57
+ readonly precheck: MigrationBooleanCheckV1;
58
+ readonly execute: MigrationDispatchV1;
59
+ readonly postcheck: MigrationBooleanCheckV1;
60
+ } | {
61
+ readonly retry: "opaque";
62
+ readonly execute: MigrationDispatchV1;
63
+ };
64
+ interface MigrationOperationV1 {
65
+ readonly id: string;
66
+ readonly label: string;
67
+ readonly origin: "generated" | "manual";
68
+ readonly risk: "safe" | "destructive" | "opaque";
69
+ readonly steps: readonly MigrationStepV1[];
70
+ }
71
+ type MigrationRollbackV1 = {
72
+ readonly kind: "schema";
73
+ readonly operations: readonly MigrationOperationV1[];
74
+ } | {
75
+ readonly kind: "manual";
76
+ readonly requestedBoundary: "transactional" | "stepwise";
77
+ readonly operations: readonly MigrationOperationV1[];
78
+ } | {
79
+ readonly kind: "irreversible";
80
+ readonly reason: string;
81
+ };
82
+ /**
83
+ * One destructive change of a generated transition, approved through the
84
+ * resolve callback at `generate`. It names the change by identity only, so the
85
+ * same decision on the same diff always encodes to the same bytes.
86
+ */
87
+ interface MigrationApprovalV1 {
88
+ readonly operation: "dropTable" | "dropColumn" | "addColumn" | "alterColumn";
89
+ readonly table: string;
90
+ readonly column: string | null;
91
+ }
92
+ interface MigrationParentTransitionV1 {
93
+ readonly fromState: Sha256 | null;
94
+ readonly transitionHash: Sha256;
95
+ readonly originChecks: readonly MigrationBooleanCheckV1[];
96
+ readonly requestedForwardBoundary: "transactional" | "stepwise" | null;
97
+ readonly operations: readonly MigrationOperationV1[];
98
+ readonly rollback: MigrationRollbackV1;
99
+ /**
100
+ * Present, non-empty and part of `transitionHash` only when the transition
101
+ * carries destructive changes, so a transition without one keeps the bytes
102
+ * and the ids it had before approvals existed.
103
+ */
104
+ readonly approvals?: readonly MigrationApprovalV1[];
105
+ }
106
+ interface MigrationStateManifestV1 {
107
+ readonly format: MigrationFormatV1;
108
+ readonly estateHash: Sha256;
109
+ readonly name: string;
110
+ readonly stateId: Sha256;
111
+ readonly snapshotHash: Sha256;
112
+ readonly sqlHash: Sha256;
113
+ readonly destinationChecks: readonly MigrationBooleanCheckV1[];
114
+ readonly parents: readonly MigrationParentTransitionV1[];
115
+ }
116
+ interface MigrationCheckInput {
117
+ readonly kind: "trusted-read";
118
+ readonly query: Sql;
119
+ readonly equals: boolean;
120
+ }
121
+ interface ManualTransitionInput {
122
+ readonly from: Sha256 | null;
123
+ readonly execution: "transactional" | "stepwise";
124
+ readonly up: readonly Sql[];
125
+ readonly originChecks?: readonly MigrationCheckInput[];
126
+ readonly rollback: {
127
+ readonly kind: "manual";
128
+ readonly execution: "transactional" | "stepwise";
129
+ readonly sql: readonly Sql[];
130
+ } | {
131
+ readonly kind: "irreversible";
132
+ readonly reason: string;
133
+ };
134
+ }
135
+ interface ManualMigrationInput {
136
+ readonly transitions: readonly ManualTransitionInput[];
137
+ readonly destinationChecks?: readonly MigrationCheckInput[];
138
+ }
139
+ type StateSelector = {
140
+ readonly id: Sha256;
141
+ } | {
142
+ readonly prefix: string;
143
+ } | {
144
+ readonly name: string;
145
+ };
146
+ interface ApplyV1Options {
147
+ readonly to?: StateSelector;
148
+ readonly via?: readonly Sha256[];
149
+ readonly dryRun?: boolean;
150
+ /**
151
+ * What to do when the database marker is AHEAD of this history — its arrival
152
+ * path leaves this estate after a state it holds, because newer code
153
+ * migrated the database. `"refuse"` (the default) throws V11002; `"noop"`
154
+ * returns a `noop` outcome without touching the database. A marker unknown
155
+ * to this estate altogether is always refused.
156
+ */
157
+ readonly ifAhead?: "noop" | "refuse";
158
+ }
159
+ interface ResetV1Options {
160
+ readonly to?: StateSelector;
161
+ readonly via?: readonly Sha256[];
162
+ readonly dryRun?: boolean;
163
+ }
164
+ interface BaselineOptions {
165
+ readonly to: StateSelector;
166
+ readonly via?: readonly Sha256[];
167
+ }
168
+ /**
169
+ * `reanchor()` (plan T3) moves a marker this history does not hold onto the
170
+ * one state the live schema matches. `to` adopts the state it names instead:
171
+ * the explicit consent to take the live schema as a new baseline there, which
172
+ * several matching states need.
173
+ */
174
+ interface ReanchorOptions {
175
+ readonly to?: StateSelector;
176
+ readonly via?: readonly Sha256[];
177
+ }
178
+ /**
179
+ * `down({ to })` is the form for automation: a retry finds the marker already
180
+ * there and does nothing. The relative `steps` form takes `expectRevision`, the
181
+ * `marker.revision` the caller read, so a retried call refuses (V11015)
182
+ * instead of rolling back one more state.
183
+ */
184
+ type DownV1Options = ({
185
+ readonly steps?: number;
186
+ readonly to?: never;
187
+ } | {
188
+ readonly to: StateSelector;
189
+ readonly steps?: never;
190
+ }) & {
191
+ readonly dryRun?: boolean;
192
+ /** Refuse with V11015 unless the marker is still at this revision. */
193
+ readonly expectRevision?: number;
194
+ /**
195
+ * Answers each destructive change the rollback would make to a table that
196
+ * holds rows, as `generate` and `push` ask: `change.proceed()` approves it.
197
+ * Without it, such a rollback refuses with V11017.
198
+ */
199
+ readonly resolve?: ResolveCallback;
200
+ };
201
+ /**
202
+ * One edge of a `down({ dryRun: true })` preview, in the order `down` would
203
+ * roll it back: the state left, the state reached, and the review of its
204
+ * rollback SQL.
205
+ */
206
+ interface DownPreviewEdgeV1 {
207
+ readonly stateId: Sha256;
208
+ readonly toState: Sha256 | null;
209
+ readonly sql: string;
210
+ }
211
+ /**
212
+ * `down` itself returns `preview: false`. A dry run returns each edge's
213
+ * rollback SQL and `refusal`: the error `down` would raise with the same
214
+ * options (an irreversible step, an unapproved loss of rows, drift), or `null`.
215
+ * Plain data, so it crosses an RPC boundary intact.
216
+ */
217
+ type DownV1Result = {
218
+ readonly path: readonly Sha256[];
219
+ readonly preview: false;
220
+ } | {
221
+ readonly path: readonly Sha256[];
222
+ readonly preview: true;
223
+ readonly edges: readonly DownPreviewEdgeV1[];
224
+ readonly refusal: {
225
+ readonly code: string;
226
+ readonly message: string;
227
+ } | null;
228
+ };
229
+ /**
230
+ * One `createPredefinedResolver` decision, plain JSON. Each names the change
231
+ * it answers by that change's own fields: a rename by table and old and new
232
+ * name, an enum value removal by its column, a destructive change by its
233
+ * approval identity (`column` is `null` for a table).
234
+ */
235
+ type MigrationDecisionV1 = {
236
+ readonly type: "column";
237
+ readonly tableName: string;
238
+ readonly from: string;
239
+ readonly to: string;
240
+ readonly resolution: "rename" | "addAndDrop";
241
+ } | {
242
+ readonly type: "table";
243
+ readonly from: string;
244
+ readonly to: string;
245
+ readonly resolution: "rename" | "addAndDrop";
246
+ } | {
247
+ readonly type: "enumValueRemoval";
248
+ readonly tableName: string;
249
+ readonly columnName: string;
250
+ readonly mapValues: Readonly<Record<string, string | null>>;
251
+ } | ({
252
+ readonly type: "destructive";
253
+ } & MigrationApprovalV1);
254
+ interface ResolveV1Options {
255
+ readonly outcome: "complete" | "rolled-back" | "retry";
256
+ }
257
+ interface GenerateV1Options {
258
+ readonly name?: string;
259
+ /** Full parent state id, or `null` for the virtual empty root. */
260
+ readonly from?: Sha256 | null;
261
+ readonly dryRun?: boolean;
262
+ readonly resolve?: ResolveCallback;
263
+ readonly skipValidation?: boolean;
264
+ readonly manualMigration?: ManualMigrationInput;
265
+ /**
266
+ * PostgreSQL (plan T5b): build each index on, and add each foreign key to,
267
+ * a table the migration does not create without a lock that blocks writes
268
+ * while it reads the table. The change is published as consecutive states:
269
+ * the rest of it in one transaction, each index `CREATE INDEX CONCURRENTLY`
270
+ * outside any, the keys `NOT VALID`, then their `VALIDATE CONSTRAINT` in a
271
+ * commit of its own. A step outside a transaction needs a direct session,
272
+ * which a transaction pooler cannot give. Other dialects ignore it.
273
+ */
274
+ readonly lowLock?: boolean;
275
+ }
276
+ type PathHash = Sha256;
277
+ interface MarkerPathEdgeV1 {
278
+ readonly stateId: Sha256;
279
+ readonly transitionHash: Sha256;
280
+ readonly baselineBoundary: boolean;
281
+ }
282
+ interface MigrationMarkerV1 {
283
+ readonly format: MigrationFormatV1;
284
+ readonly estateHash: Sha256;
285
+ readonly stateId: Sha256 | null;
286
+ readonly snapshotHash: Sha256;
287
+ readonly path: readonly MarkerPathEdgeV1[];
288
+ readonly pathHash: PathHash;
289
+ readonly revision: number;
290
+ readonly updatedAt: string;
291
+ }
292
+ type LedgerEventKindV1 = "started" | "step-confirmed" | "applied" | "failed" | "rolled-back" | "baselined" | "reanchored" | "resolved" | "reset-started" | "reset-step-confirmed" | "reset-applied";
293
+ type LedgerEffectStateV1 = "none" | "committed" | "partial" | "may-have-committed";
294
+ interface ResetPlanV1 {
295
+ readonly estateHash: Sha256;
296
+ readonly targetIdentity: string;
297
+ readonly sourceRevision: number;
298
+ readonly sourceFingerprint: Sha256;
299
+ readonly replayPath: readonly Sha256[];
300
+ readonly clearDispatches: readonly MigrationDispatchV1[];
301
+ readonly referencedStates: readonly Sha256[];
302
+ readonly resetPlanHash: Sha256;
303
+ }
304
+ interface LedgerEventV1 {
305
+ readonly format: MigrationFormatV1;
306
+ readonly eventId: Sha256;
307
+ readonly attemptId: Sha256;
308
+ readonly kind: LedgerEventKindV1;
309
+ readonly estateHash: Sha256;
310
+ readonly snapshotHash: Sha256;
311
+ readonly sqlHash: Sha256 | null;
312
+ readonly fromState: Sha256 | null;
313
+ readonly toState: Sha256 | null;
314
+ readonly transitionHash: Sha256 | null;
315
+ readonly direction: "forward" | "rollback" | "reset" | "baseline" | "resolve";
316
+ readonly operationId: string | null;
317
+ readonly dispatchId: Sha256 | null;
318
+ readonly effectState: LedgerEffectStateV1;
319
+ readonly startedAt: string;
320
+ readonly finishedAt: string | null;
321
+ readonly toolVersion: string;
322
+ readonly resetPlan?: ResetPlanV1;
323
+ readonly failure: string | null;
324
+ }
325
+ interface PushPlanningOptions {
326
+ readonly forceReset?: boolean;
327
+ readonly skipValidation?: boolean;
328
+ readonly resolve?: ResolveCallback;
329
+ }
330
+ type PushTargetIdentity = {
331
+ readonly dialect: "postgresql";
332
+ readonly database: string;
333
+ readonly namespace: string;
334
+ } | {
335
+ readonly dialect: "mysql";
336
+ readonly database: string;
337
+ } | {
338
+ readonly dialect: "sqlite";
339
+ readonly location: string | null;
340
+ };
341
+ interface PushStatementPreview {
342
+ readonly sql: string;
343
+ readonly parameters: readonly MigrationParameterV1[];
344
+ }
345
+ interface PushResolution {
346
+ readonly id: string;
347
+ readonly decision: string;
348
+ }
349
+ interface PushConsent {
350
+ readonly format: MigrationFormatV1;
351
+ readonly target: PushTargetIdentity;
352
+ readonly planHash: Sha256;
353
+ readonly mode: "diff" | "force-reset";
354
+ readonly validation: "full" | "structural-only";
355
+ readonly resolutions: readonly PushResolution[];
356
+ }
357
+ type PushOptionsV1 = (PushPlanningOptions & {
358
+ readonly dryRun: true;
359
+ }) | (PushPlanningOptions & {
360
+ readonly dryRun?: false;
361
+ readonly consent?: never;
362
+ }) | {
363
+ readonly consent: PushConsent;
364
+ readonly dryRun?: false;
365
+ };
366
+ type PushOptionKey = "forceReset" | "skipValidation" | "resolve" | "dryRun" | "consent";
367
+ type ExactPushOptions<O> = O & Record<Exclude<keyof O & string, PushOptionKey>, never>;
368
+ interface PushOperation {
369
+ readonly id: string;
370
+ readonly label: string;
371
+ readonly risk: "safe" | "destructive" | "opaque";
372
+ }
373
+ interface PushPreview$1 {
374
+ readonly outcome: "planned" | "noop";
375
+ readonly target: PushTargetIdentity;
376
+ readonly planHash: Sha256;
377
+ readonly destructive: boolean;
378
+ readonly operations: readonly PushOperation[];
379
+ readonly statements: readonly PushStatementPreview[];
380
+ readonly consent: PushConsent;
381
+ }
382
+ interface PushApplyResult$1 {
383
+ readonly outcome: "applied" | "noop";
384
+ readonly target: PushTargetIdentity;
385
+ readonly planHash: Sha256;
386
+ readonly operations: readonly PushOperation[];
387
+ readonly statements: readonly PushStatementPreview[];
388
+ }
389
+ //#endregion
390
+ //#region src/migrations/catalog-probes.d.ts
391
+ /** One index an interrupted CONCURRENTLY build left INVALID. */
392
+ interface InvalidIndex {
393
+ readonly table: string;
394
+ readonly index: string;
395
+ }
396
+ //#endregion
397
+ //#region src/migrations/check.d.ts
398
+ interface CheckFinding {
399
+ readonly code: string;
400
+ readonly message: string;
401
+ }
402
+ interface CheckResult {
403
+ readonly ok: boolean;
404
+ readonly findings: readonly CheckFinding[];
405
+ }
406
+ //#endregion
407
+ //#region src/migrations/apply-v1.d.ts
408
+ interface ApplyV1Result {
409
+ readonly outcome: "applied" | "noop" | "preview";
410
+ readonly path: readonly Sha256[];
411
+ readonly statements: readonly string[];
412
+ /**
413
+ * Present only when the migration committed but releasing a session lock
414
+ * failed after it (MySQL, PostgreSQL). The session was discarded, so the
415
+ * lock does not outlive it.
416
+ */
417
+ readonly warnings?: readonly string[];
418
+ }
419
+ //#endregion
420
+ //#region src/migrations/generate-v1.d.ts
421
+ interface GenerateV1Result {
422
+ readonly outcome: "published" | "preview" | "noop";
423
+ readonly stateId: Sha256 | null;
424
+ readonly name: string | null;
425
+ readonly estateHash: Sha256 | null;
426
+ readonly snapshotHash: Sha256 | null;
427
+ readonly sqlHash: Sha256 | null;
428
+ readonly operations: readonly DiffOperation[];
429
+ readonly warnings: readonly string[];
430
+ readonly operationsByParent: readonly {
431
+ readonly fromState: string | null;
432
+ readonly operations: readonly DiffOperation[];
433
+ }[];
434
+ readonly sql: string;
435
+ readonly reviewSql: string;
436
+ }
437
+ //#endregion
438
+ //#region src/migrations/operators.d.ts
439
+ interface StatusV1Result {
440
+ readonly control: "absent" | "present";
441
+ readonly marker: MigrationMarkerV1 | null;
442
+ readonly pending: readonly Sha256[];
443
+ readonly unfinished: boolean;
444
+ /**
445
+ * Present only when the marker names a state this estate does not hold:
446
+ * `"ahead"` when its arrival path leaves this history after a state it holds
447
+ * (newer code migrated the database), `"unknown"` when nothing on that path
448
+ * belongs here. `pending` is then empty.
449
+ */
450
+ readonly markerState?: "ahead" | "unknown";
451
+ /** Present only when a managed table carries an INVALID index (PostgreSQL). */
452
+ readonly invalidIndexes?: readonly InvalidIndex[];
453
+ /**
454
+ * The latest `failed` ledger event, present once a rolled-back attempt left
455
+ * one: its `toState`, `dispatchId` and `failure` say what failed and why.
456
+ */
457
+ readonly lastFailure?: LedgerEventV1;
458
+ }
459
+ interface VerifyV1Result {
460
+ readonly ok: boolean;
461
+ /** Present, with `ok: false`, when the marker names a state this estate does not hold. */
462
+ readonly markerState?: "ahead" | "unknown";
463
+ }
464
+ interface PruneOptions {
465
+ /** The authored checkpoint (`generate({ from: null })`) to keep history from. */
466
+ readonly checkpoint: StateSelector;
467
+ /** A fresh history: the source is never changed. */
468
+ readonly into: MigrationStorageWriter;
469
+ }
470
+ interface PruneResult {
471
+ /** The states `into` now holds from this history. */
472
+ readonly states: readonly Sha256[];
473
+ }
474
+ //#endregion
475
+ //#region src/migrations/public-view.d.ts
476
+ interface MigrationStateListItem {
477
+ readonly stateId: Sha256;
478
+ readonly name: string;
479
+ }
480
+ interface MigrationStateMetadata extends MigrationStateListItem {
481
+ readonly snapshotHash: Sha256;
482
+ readonly sqlHash: Sha256;
483
+ readonly root: boolean;
484
+ readonly leaf: boolean;
485
+ }
486
+ type MigrationRollbackMetadata = {
487
+ readonly kind: "schema" | "manual";
488
+ readonly operationCount: number;
489
+ readonly stepCount: number;
490
+ } | {
491
+ readonly kind: "irreversible";
492
+ readonly reason: string;
493
+ readonly operationCount: 0;
494
+ readonly stepCount: 0;
495
+ };
496
+ interface MigrationEdgeMetadata {
497
+ readonly fromState: Sha256 | null;
498
+ readonly toState: Sha256;
499
+ readonly transitionHash: Sha256;
500
+ readonly requestedBoundary: "transactional" | "stepwise" | null;
501
+ readonly operationCount: number;
502
+ readonly stepCount: number;
503
+ readonly origins: readonly ("generated" | "manual")[];
504
+ readonly risks: readonly ("safe" | "destructive" | "opaque")[];
505
+ /** The destructive changes approved at `generate`; empty when none was asked. */
506
+ readonly approvals: readonly MigrationApprovalV1[];
507
+ readonly rollback: MigrationRollbackMetadata;
508
+ }
509
+ interface MigrationStateDetails extends MigrationStateMetadata {
510
+ readonly incoming: readonly MigrationEdgeMetadata[];
511
+ readonly outgoing: readonly MigrationEdgeMetadata[];
512
+ }
513
+ interface GraphResult {
514
+ readonly estateHash: Sha256;
515
+ readonly target: MigrationTarget;
516
+ readonly roots: readonly Sha256[];
517
+ readonly leaves: readonly Sha256[];
518
+ readonly states: readonly MigrationStateMetadata[];
519
+ readonly edges: readonly MigrationEdgeMetadata[];
520
+ }
521
+ type ListResult = readonly MigrationStateListItem[];
522
+ type ShowResult = MigrationStateDetails;
523
+ //#endregion
524
+ //#region src/migrations/push-v1.d.ts
525
+ interface PushAttestation {
526
+ readonly pathHash: Sha256;
527
+ readonly planHash: Sha256;
528
+ readonly schemaHash: Sha256;
529
+ readonly fingerprint: Sha256;
530
+ }
531
+ interface PushApplyResult extends PushApplyResult$1 {
532
+ readonly attestation: PushAttestation;
533
+ }
534
+ interface PushPreview extends PushPreview$1 {
535
+ readonly schemaHash: Sha256;
536
+ readonly fingerprint: Sha256;
537
+ }
538
+ type PushResultFor<O> = [O] extends [{
539
+ readonly dryRun: true;
540
+ }] ? PushPreview : PushApplyResult;
541
+ //#endregion
542
+ //#region src/migrations/client.d.ts
543
+ interface MigrationClientOptions<S extends MigrationStorageReader = MigrationStorageReader> {
544
+ readonly storage: S;
545
+ readonly tables?: readonly string[];
546
+ /**
547
+ * PostgreSQL session limits and VibORM's own waits, in milliseconds, and
548
+ * `largeTableRows`, the estimated table size above which a rewrite or scan
549
+ * is refused in-request.
550
+ */
551
+ readonly limits?: MigrationLimits;
552
+ }
553
+ /** A storage-less client's options: managed tables, limits, or both. */
554
+ type LiveMigrationClientOptions = {
555
+ readonly tables: readonly string[];
556
+ readonly limits?: MigrationLimits;
557
+ } | {
558
+ readonly tables?: readonly string[];
559
+ readonly limits: MigrationLimits;
560
+ };
561
+ type NoExtraMigrationClientOptionKeys<Given> = Record<Exclude<keyof Given, "storage" | "tables" | "limits">, never>;
562
+ type GenerateResult = GenerateV1Result;
563
+ type StatusResult = StatusV1Result;
564
+ type VerifyResult = VerifyV1Result;
565
+ type LogResult = readonly LedgerEventV1[];
566
+ type ApplyResult = ApplyV1Result;
567
+ type DownResult = DownV1Result;
568
+ interface BaselineResult {
569
+ readonly stateId: string;
570
+ }
571
+ interface ReanchorResult {
572
+ readonly stateId: string;
573
+ }
574
+ interface ResolveResult {
575
+ readonly outcome: ResolveV1Options["outcome"];
576
+ }
577
+ interface ResetResult {
578
+ /** Physical tables selected for a read-only reset preview. */
579
+ readonly tables?: readonly string[];
580
+ readonly preview: boolean;
581
+ readonly path: readonly string[];
582
+ }
583
+ interface LiveMigrations {
584
+ log(): Promise<LogResult>;
585
+ push<O extends PushOptionsV1>(options?: ExactPushOptions<O>): Promise<PushResultFor<O>>;
586
+ }
587
+ interface ReadableMigrations extends LiveMigrations {
588
+ check(): Promise<CheckResult>;
589
+ list(): Promise<ListResult>;
590
+ show(selector: StateSelector): Promise<ShowResult>;
591
+ graph(): Promise<GraphResult>;
592
+ status(): Promise<StatusResult>;
593
+ verify(): Promise<VerifyResult>;
594
+ apply(options?: ApplyV1Options): Promise<ApplyResult>;
595
+ down(options?: DownV1Options): Promise<DownResult>;
596
+ baseline(options: BaselineOptions): Promise<BaselineResult>;
597
+ reanchor(options?: ReanchorOptions): Promise<ReanchorResult>;
598
+ prune(options: PruneOptions): Promise<PruneResult>;
599
+ resolve(options: ResolveV1Options): Promise<ResolveResult>;
600
+ }
601
+ interface WritableMigrations extends ReadableMigrations {
602
+ generate(options?: GenerateV1Options): Promise<GenerateResult>;
603
+ reset(options?: ResetV1Options): Promise<ResetResult>;
604
+ }
605
+ declare function createMigrationClient<Options extends MigrationClientOptions<MigrationStorageWriter>>(client: MigrationClient, options: Options & NoExtraMigrationClientOptionKeys<Options>): WritableMigrations;
606
+ declare function createMigrationClient<Options extends MigrationClientOptions<MigrationStorageReader>>(client: MigrationClient, options: Options & NoExtraMigrationClientOptionKeys<Options>): ReadableMigrations;
607
+ declare function createMigrationClient<Options extends LiveMigrationClientOptions>(client: MigrationClient, options: Options & NoExtraMigrationClientOptionKeys<Options>): LiveMigrations;
608
+ declare function createMigrationClient(client: MigrationClient, options?: undefined): LiveMigrations;
609
+ //#endregion
610
+ export { InvalidIndex as A, MigrationCheckInput as B, MigrationStateListItem as C, PruneResult as D, PruneOptions as E, ExactPushOptions as F, PushConsent as G, MigrationEstateDescriptorV1 as H, GenerateV1Options as I, ResetV1Options as J, PushOptionsV1 as K, ManualMigrationInput as L, BaselineOptions as M, DownPreviewEdgeV1 as N, CheckFinding as O, DownV1Options as P, ManualTransitionInput as R, MigrationStateDetails as S, ShowResult as T, MigrationMarkerV1 as U, MigrationDecisionV1 as V, MigrationStateManifestV1 as W, StateSelector as X, ResolveV1Options as Y, PushPreview as _, LiveMigrations as a, MigrationEdgeMetadata as b, ReadableMigrations as c, ResolveResult as d, StatusResult as f, PushApplyResult as g, createMigrationClient as h, GenerateResult as i, ApplyV1Options as j, CheckResult as k, ReanchorResult as l, WritableMigrations as m, BaselineResult as n, LogResult as o, VerifyResult as p, ReanchorOptions as q, DownResult as r, MigrationClientOptions as s, ApplyResult as t, ResetResult as u, GraphResult as v, MigrationStateMetadata as w, MigrationRollbackMetadata as x, ListResult as y, MigrationApprovalV1 as z };
package/dist/client.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { A as BatchPayload, At as validateOperationPayload, Bn as IndexOptions, C as OperationPayload, D as Schema, Dt as getOperationPayloadSchema, E as Operations, F as FlatSchema, I as Linked, Jt as defineExtension, Kt as PlacedControl, L as LinkedClientConfig, M as GroupByResultType, Mt as ExtendedClient, N as InferSelectInclude, O as ValidatedOperationPayload, Ot as renderOperationResultType, P as ClientSchema, R as Links, S as MutationOperations, T as OperationResult, Xt as StatementHandler, Yt as StatementContext, Z as VibSchema, _n as isPendingOperation, b as Client, en as ExtensionCacheState, g as ObserveHandler, gn as UnwrapPendingOperations, h as ObservationUnit, hn as UnwrapPendingOperation, in as RawOperation, j as CountResultType, k as AggregateResultType, kt as renderSchemaType, m as ObservationCompletion, mn as PendingOperation, nn as ExtensionResultConsumerState, or as ObjectSchema, qt as ClientExtension, v as CacheableOperations, w as OperationPayloadSchema, x as InferDatabase, y as CachedClient, z as RelationLinks, zn as IndexDefinition, zt as defaultOmit } from "./index-T0YKKw66.mjs";
1
+ import { A as Schema, At as getOperationPayloadSchema, B as LinkedClientConfig, C as Client, D as OperationPayloadSchema, E as OperationPayload, F as GroupByResultType, Ft as ExtendedClient, H as RelationLinks, Hn as IndexDefinition, Ht as defaultOmit, I as InferSelectInclude, Jt as defineExtension, Kt as PlacedControl, L as ClientSchema, M as AggregateResultType, Mt as renderSchemaType, N as BatchPayload, Nt as validateOperationPayload, O as OperationResult, P as CountResultType, R as FlatSchema, S as CachedClient, T as MutationOperations, Un as IndexOptions, V as Links, Xt as StatementHandler, Yt as StatementContext, _ as ObservationCompletion, _n as isPendingOperation, en as ExtensionCacheState, et as VibSchema, gn as UnwrapPendingOperations, hn as UnwrapPendingOperation, in as RawOperation, j as ValidatedOperationPayload, jt as renderOperationResultType, k as Operations, lr as ObjectSchema, mn as PendingOperation, nn as ExtensionResultConsumerState, qt as ClientExtension, v as ObservationUnit, w as InferDatabase, x as CacheableOperations, y as ObserveHandler, z as Linked } from "./index-C_XLSTy2.mjs";
2
2
  export { type AggregateResultType, type BatchPayload, type CacheableOperations, type CachedClient, type Client, type ClientExtension, type ClientSchema, type CountResultType, type ExtendedClient, type ExtensionCacheState, type ExtensionResultConsumerState, type FlatSchema, type GroupByResultType, type IndexDefinition, type IndexOptions, type InferDatabase, type InferSelectInclude, type Linked, type LinkedClientConfig, type Links, type MutationOperations, type ObjectSchema, type ObservationCompletion, type ObservationUnit, type ObserveHandler, type OperationPayload, type OperationPayloadSchema, type OperationResult, type Operations, PendingOperation, type PlacedControl, type RawOperation, type RelationLinks, type Schema, type StatementContext, type StatementHandler, type UnwrapPendingOperation, type UnwrapPendingOperations, type ValidatedOperationPayload, type VibSchema, defaultOmit, defineExtension, getOperationPayloadSchema, isPendingOperation, renderOperationResultType, renderSchemaType, validateOperationPayload };
package/dist/client.mjs CHANGED
@@ -1 +1 @@
1
- import{a as e,s as t}from"./chain-uIFlkkXS.mjs";import{d as n,m as r}from"./result-shape-DKTu8yre.mjs";import{i,n as a,r as o,t as s}from"./schema-introspection-DsXPfCst.mjs";export{n as PendingOperation,e as defaultOmit,t as defineExtension,s as getOperationPayloadSchema,r as isPendingOperation,a as renderOperationResultType,o as renderSchemaType,i as validateOperationPayload};
1
+ import{a as e,c as t}from"./chain-Dh0FV72b.mjs";import{p as n,u as r}from"./result-shape-CTNdNSW3.mjs";import{i,n as a,r as o,t as s}from"./schema-introspection-DEYGC2qg.mjs";export{r as PendingOperation,t as defaultOmit,e as defineExtension,s as getOperationPayloadSchema,n as isPendingOperation,a as renderOperationResultType,o as renderSchemaType,i as validateOperationPayload};
@@ -1,2 +1,2 @@
1
1
  import{n as e}from"./chunk-BuuaeEvq.mjs";const t={now:()=>Date.now(),setTimeout(e,t){let n=setTimeout(e,t);return{cancel:()=>clearTimeout(n),unref:()=>{typeof n.unref==`function`&&n.unref()}}}};export{t};
2
- //# sourceMappingURL=clock-W8H2Khng.mjs.map
2
+ //# sourceMappingURL=clock-CK41KO7t.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"clock-W8H2Khng.mjs","names":[],"sources":["../src/clock.ts"],"sourcesContent":["/**\n * The time seam.\n *\n * Two subsystems decide things by reading the wall clock and arming timers:\n * cache freshness (TTL, and the stale window SWR serves from) and the\n * transaction `timeout` / `maxWait` bounds. Both are behavior worth testing,\n * and testing either through the host clock means sleeping — which buys a slow\n * suite and a timing race, not a proof.\n *\n * So both take their time from a `Clock`. The default is the host's own, and\n * nothing here is public API: the override exists so a test can advance time\n * instead of waiting for it. Driver-internal timers are deliberately out of\n * scope — they belong to the database client, not to us.\n */\n\n/**\n * A timer armed by a `Clock`. The handle owns its own cancellation, so a call\n * site never reaches for a host timer function to undo what a clock started.\n */\nexport interface ClockTimer {\n /** Cancel the pending callback. Safe to call after it has already fired. */\n cancel(): void;\n /**\n * Release the host's hold on the event loop, where the host has one to\n * release. Node timers do; a virtual clock has nothing to release and says\n * so by omitting this.\n */\n unref?(): void;\n}\n\n/** The reading of time and the arming of timers, as one injectable thing. */\nexport interface Clock {\n /** Milliseconds since the epoch, exactly as `Date.now()` reports them. */\n now(): number;\n /** Arm `callback` to run `ms` from now. Cancel through the returned handle. */\n setTimeout(callback: () => void, ms: number): ClockTimer;\n}\n\n/** The host clock: `Date.now` and the global timer functions. The default. */\nexport const systemClock: Clock = {\n now: () => Date.now(),\n setTimeout(callback: () => void, ms: number): ClockTimer {\n const timer = setTimeout(callback, ms);\n return {\n cancel: () => clearTimeout(timer),\n // Hosts that are not Node (browsers, some edge runtimes) hand back a\n // number with no `unref`. Asking is cheaper than assuming.\n unref: () => {\n if (typeof timer.unref === \"function\") timer.unref();\n },\n };\n },\n};\n"],"mappings":"yCAuCA,MAAa,EAAqB,CAChC,QAAW,KAAK,KAAK,CACrB,WAAW,EAAsB,EAAwB,CACvD,IAAM,EAAQ,WAAW,EAAU,EAAG,CACtC,MAAO,CACL,WAAc,aAAa,EAAM,CAGjC,UAAa,CACP,OAAO,EAAM,OAAU,YAAY,EAAM,OAAO,EAEvD,EAEJ"}
1
+ {"version":3,"file":"clock-CK41KO7t.mjs","names":[],"sources":["../src/clock.ts"],"sourcesContent":["/**\n * The time seam.\n *\n * Two subsystems decide things by reading the wall clock and arming timers:\n * cache freshness (TTL, and the stale window SWR serves from) and the\n * transaction `timeout` / `maxWait` bounds. Both are behavior worth testing,\n * and testing either through the host clock means sleeping — which buys a slow\n * suite and a timing race, not a proof.\n *\n * So both take their time from a `Clock`. The default is the host's own, and\n * nothing here is public API: the override exists so a test can advance time\n * instead of waiting for it. Driver-internal timers are deliberately out of\n * scope — they belong to the database client, not to us.\n */\n\n/**\n * A timer armed by a `Clock`. The handle owns its own cancellation, so a call\n * site never reaches for a host timer function to undo what a clock started.\n */\nexport interface ClockTimer {\n /** Cancel the pending callback. Safe to call after it has already fired. */\n cancel(): void;\n /**\n * Release the host's hold on the event loop, where the host has one to\n * release. Node timers do; a virtual clock has nothing to release and says\n * so by omitting this.\n */\n unref?(): void;\n}\n\n/** The reading of time and the arming of timers, as one injectable thing. */\nexport interface Clock {\n /** Milliseconds since the epoch, exactly as `Date.now()` reports them. */\n now(): number;\n /** Arm `callback` to run `ms` from now. Cancel through the returned handle. */\n setTimeout(callback: () => void, ms: number): ClockTimer;\n}\n\n/** The host clock: `Date.now` and the global timer functions. The default. */\nexport const systemClock: Clock = {\n now: () => Date.now(),\n setTimeout(callback: () => void, ms: number): ClockTimer {\n const timer = setTimeout(callback, ms);\n return {\n cancel: () => clearTimeout(timer),\n // Hosts that are not Node (browsers, some edge runtimes) hand back a\n // number with no `unref`. Asking is cheaper than assuming.\n unref: () => {\n if (typeof timer.unref === \"function\") timer.unref();\n },\n };\n },\n};\n"],"mappings":"yCAuCA,MAAa,EAAqB,CAChC,QAAW,KAAK,KAAK,CACrB,WAAW,EAAsB,EAAwB,CACvD,IAAM,EAAQ,WAAW,EAAU,EAAG,CACtC,MAAO,CACL,WAAc,aAAa,EAAM,CAGjC,UAAa,CACP,OAAO,EAAM,OAAU,YAAY,EAAM,OAAO,EAEvD,EAEJ"}
package/dist/config.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { i as ResolveCallback, t as MigrationClient } from "./planner-B11VjIin.mjs";
2
- import { n as MigrationStorageWriter } from "./contract-BHUOUAZ-.mjs";
1
+ import { i as ResolveCallback, t as MigrationClient } from "./planner-C6Lfsasx.mjs";
2
+ import { n as MigrationStorageWriter } from "./contract-CIIqgFyb.mjs";
3
3
 
4
4
  //#region src/cli/utils.d.ts
5
5
 
@@ -18,7 +18,7 @@ interface MigrationConfig {
18
18
  *
19
19
  * @example
20
20
  * ```ts
21
- * import { createFsStorageWriter } from "viborm/migrations";
21
+ * import { createFsStorageWriter } from "viborm/migrations/storage/fs";
22
22
  *
23
23
  * migrations: {
24
24
  * storage: createFsStorageWriter("./migrations"),
package/dist/config.mjs CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./utils-DfztpPvR.mjs";export{e as defineConfig};
1
+ import{t as e}from"./utils-CZNaOZR7.mjs";export{e as defineConfig};