void 0.26.1 → 0.28.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 (287) hide show
  1. package/README.md +3 -1
  2. package/dist/{account-cmd-CfUXh_nU.mjs → account-cmd-Ci00cncT.mjs} +5 -5
  3. package/dist/{agents-B_pX_HmQ.mjs → agents-CuNtT0D_.mjs} +5 -2
  4. package/dist/{application-analysis-DKy02UY0.mjs → application-analysis-D72ZQfMZ.mjs} +118 -135
  5. package/dist/{application-routing-DQyUh_5S.mjs → application-routing-Dy589Vgn.mjs} +1 -2
  6. package/dist/atomic-write-Dq6R0BPN.mjs +18 -0
  7. package/dist/{auth-B5_tZLxT.mjs → auth-B6iOCjKI.mjs} +23 -56
  8. package/dist/{auth-link-D5RmKnzh.mjs → auth-link-DWr6Afao.mjs} +10 -10
  9. package/dist/{auth-migrations-BwHgeEsD.mjs → auth-migrations-Cgs0k6lS.mjs} +28 -5
  10. package/dist/{auth-router-Bap-pvbn.mjs → auth-router-DP14wVkZ.mjs} +4 -4
  11. package/dist/auth-wn6F8dB8.mjs +2 -0
  12. package/dist/base64-DVrOndmI.mjs +16 -0
  13. package/dist/{better-auth-shared-CPvWD3nG.d.mts → better-auth-shared-B74NJIus.d.mts} +8 -13
  14. package/dist/{better-auth-shared-DPpj8zxc.mjs → better-auth-shared-CMXlZG7W.mjs} +56 -68
  15. package/dist/{build-cmd-B58c8iS8.mjs → build-cmd-Cr3FJxv0.mjs} +5 -5
  16. package/dist/{cache-Bo52trKF.mjs → cache-D0Tt28cn.mjs} +5 -5
  17. package/dist/{cancel-deploy-BZNz3Q26.mjs → cancel-deploy-CJKvk7AN.mjs} +4 -4
  18. package/dist/{cf-access-TWNzXltp.mjs → cf-access-BM9G0lhO.mjs} +4 -3
  19. package/dist/{cf-access-ngGqZpHZ.mjs → cf-access-CWP4avfP.mjs} +3 -7
  20. package/dist/cf-build-output-2u583yJK.mjs +2 -0
  21. package/dist/{cf-build-output-DjvB_872.mjs → cf-build-output-Bc8i3dzE.mjs} +2 -2
  22. package/dist/cf-user-agent-ChjQp2MU.mjs +33 -0
  23. package/dist/cli/cli.mjs +198 -311
  24. package/dist/cli/cloudflare-operation-process.mjs +46 -14
  25. package/dist/cli/env-schema-probe.d.mts +5 -43
  26. package/dist/cli/env-schema-probe.mjs +14 -80
  27. package/dist/client-C1BjRn3g.mjs +2 -0
  28. package/dist/{client-C2Prx_Bi.mjs → client-DM9Kcf4e.mjs} +161 -415
  29. package/dist/{cloudflare-auth-CuxfF6OA.mjs → cloudflare-auth-CqFBDo52.mjs} +12 -39
  30. package/dist/{cloudflare-cmd-lHqNlJGW.mjs → cloudflare-cmd-CTrn-lXJ.mjs} +6 -5
  31. package/dist/{cloudflare-config-BmhBv3HV.mjs → cloudflare-config-DV60XFFK.mjs} +16 -28
  32. package/dist/{cloudflare-connect-2G3rL2rP.mjs → cloudflare-connect-BosmCNlq.mjs} +3 -3
  33. package/dist/{cloudflare-operations-CwI1bChl.mjs → cloudflare-operations-BKdSfNBN.mjs} +26 -34
  34. package/dist/{cloudflare-operations-BlYLlowZ.mjs → cloudflare-operations-Ds-lX3Ts.mjs} +1 -1
  35. package/dist/{cloudflare-process-2-TfIEzB.mjs → cloudflare-process-CeDWJRhj.mjs} +12 -7
  36. package/dist/collect-NUlJMpLY.mjs +2 -0
  37. package/dist/{collect-DiTn9yr6.mjs → collect-xjffdCdk.mjs} +1 -1
  38. package/dist/{config-CSa15FvD.d.mts → config-7qoq2p9v.d.mts} +2 -2
  39. package/dist/{config-CLYAosnQ.mjs → config-BEm9vRvS.mjs} +11 -5
  40. package/dist/{config-DiowPT80.mjs → config-Bx_1SpnO.mjs} +87 -177
  41. package/dist/config-CNnrSMYm.mjs +2 -0
  42. package/dist/{config-DPByhVck.mjs → config-D0GY5ItR.mjs} +1 -1
  43. package/dist/config-entry.d.mts +1 -1
  44. package/dist/{connect-X0MUA1gk.mjs → connect-nukQSoEO.mjs} +8 -8
  45. package/dist/{create-project-DxiyW6iX.mjs → create-project-D4APeBwX.mjs} +7 -7
  46. package/dist/{create-project-iwkbqiBU.mjs → create-project-DL7YXpjj.mjs} +1 -1
  47. package/dist/{db-XnVMHzoV.mjs → db-27RztQLy.mjs} +173 -263
  48. package/dist/{delete-esYlMiSJ.mjs → delete-BbsZFZIw.mjs} +5 -5
  49. package/dist/deploy-B06EQq4t.mjs +6009 -0
  50. package/dist/deploy-Db2ALnQP.mjs +3 -0
  51. package/dist/deploy-managed-static-CGswbcay.mjs +2277 -0
  52. package/dist/deploy-transport-BiicfoQW.mjs +180 -0
  53. package/dist/deploy.d.mts +10 -0
  54. package/dist/deploy.mjs +82 -0
  55. package/dist/dev-inbox-Rd6j_8vM.mjs +217 -0
  56. package/dist/discover-CTUiSsfG.mjs +2 -0
  57. package/dist/{discover-CkCYv9T_.mjs → discover-D2PGT63u.mjs} +2 -2
  58. package/dist/{dist-BVqXeR_h.mjs → dist-ipQi0Q8y.mjs} +2 -3
  59. package/dist/{domain-CbbBWhWE.mjs → domain-Bfq9n03H.mjs} +7 -22
  60. package/dist/{dotenv-BfU6eqFt.mjs → dotenv-CNazY3-w.mjs} +4 -16
  61. package/dist/{email-d_Aux1vM.mjs → email-BcjSyAL0.mjs} +4 -20
  62. package/dist/{email-CpuT42g7.mjs → email-DIwaQU4P.mjs} +99 -191
  63. package/dist/email-cloudflare-CH053RxK.mjs +1096 -0
  64. package/dist/email-protocol-D9nTvhCp.mjs +82 -0
  65. package/dist/{entry-CMAkqBmU.mjs → entry-ehmBvs5w.mjs} +2 -2
  66. package/dist/{env-BxocywBB.mjs → env-BJjULvL0.mjs} +2 -2
  67. package/dist/{env-DMA3cXZt.mjs → env-BhdWMrNy.mjs} +2 -13
  68. package/dist/{env-w9jOyGZn.mjs → env-C6ipBLp3.mjs} +8 -8
  69. package/dist/{env-public-DR7ZM6d-.d.mts → env-public-CCdykygU.d.mts} +6 -23
  70. package/dist/{env-raw-jZpP5n47.mjs → env-raw-Cklzcde3.mjs} +3 -20
  71. package/dist/{env-types-CwXgeMgL.mjs → env-types-DS2_y4X8.mjs} +2 -2
  72. package/dist/{env-validation-CrVNjsPm.mjs → env-validation-CTn-HhG1.mjs} +1 -1
  73. package/dist/env-validation-cE0zcmzO.mjs +486 -0
  74. package/dist/{gen-DtkQhvQg.mjs → gen-CnN1Xidx.mjs} +131 -253
  75. package/dist/gen-F8pSZnhc.mjs +2 -0
  76. package/dist/{generate-GDbL7sUr.mjs → generate-Dat0UTry.mjs} +38 -4
  77. package/dist/generate-Rii9klHB.mjs +2 -0
  78. package/dist/generated-wrangler-config-DeWj5F9Y.mjs +18 -0
  79. package/dist/{github-cmd-D_FsOFxq.mjs → github-cmd-BdkU4Nhe.mjs} +27 -71
  80. package/dist/{handler-BHAn2fZJ.mjs → handler-BZ1t7-Rv.mjs} +2 -2
  81. package/dist/{handler-CNAwjRcW.d.mts → handler-_PqY82xe.d.mts} +1 -1
  82. package/dist/{headers-DlfR78Nu.mjs → headers-Di1FsD3e.mjs} +26 -81
  83. package/dist/{help-CVFBTmBx.mjs → help-Bug7pyK_.mjs} +18 -10
  84. package/dist/help-s9q7LTcu.mjs +2 -0
  85. package/dist/{inbound-PfQDLXc5.mjs → inbound-DmkTQeWp.mjs} +71 -222
  86. package/dist/{inbound-CH5Mksyy.d.mts → inbound-brj2-TM5.d.mts} +19 -58
  87. package/dist/index.d.mts +2 -18
  88. package/dist/index.mjs +200 -496
  89. package/dist/{info-PYWwkWyt.mjs → info-CujPwtMe.mjs} +5 -5
  90. package/dist/{init-Bw-fRKGp.mjs → init-ZWOJvc-Z.mjs} +179 -388
  91. package/dist/isr-config-DPjXM8J2.mjs +194 -0
  92. package/dist/{link-DlPG8iX3.mjs → link-UEc7bnF4.mjs} +8 -8
  93. package/dist/{list-2GN7_ueV.mjs → list-CuWeOnzk.mjs} +6 -17
  94. package/dist/{live-CgQuTpqD.mjs → live-BxLX-JqJ.mjs} +19 -17
  95. package/dist/{live-Du8jXwOW.d.mts → live-DJONVlQK.d.mts} +1 -1
  96. package/dist/load-user-env-DD5qveNU.mjs +49 -0
  97. package/dist/{local-d1-ga5O_idV.mjs → local-d1-BM3p74mm.mjs} +6 -6
  98. package/dist/{login-D-Q4xw3Q.mjs → login-CZ2Cqa-D.mjs} +11 -11
  99. package/dist/login-DhK7o1oJ.mjs +2 -0
  100. package/dist/{logs-rd8J-OFh.mjs → logs-TihRcLTk.mjs} +5 -5
  101. package/dist/migrate-BgT-hmu8.mjs +2 -0
  102. package/dist/{migrate-NLsjBbuM.mjs → migrate-uFwojusJ.mjs} +69 -21
  103. package/dist/migration-handler-Cg0Y4EPu.mjs +470 -0
  104. package/dist/{migration-handler-DM4clYj5.d.mts → migration-handler-CwlEQUoo.d.mts} +17 -26
  105. package/dist/{mime-DxCznlJq.mjs → mime-srOklVVv.mjs} +92 -395
  106. package/dist/{node-DJicPvPj.mjs → node-DoKbo1SZ.mjs} +8 -24
  107. package/dist/{operator-args-BNsW5gfp.mjs → operator-args-UnE8Y2eK.mjs} +27 -26
  108. package/dist/{operator-auth-AzVLbrr3.mjs → operator-auth-Cr2zCc-J.mjs} +2 -2
  109. package/dist/{operator-client-BQtzyG-g.mjs → operator-client-C-ROjk1I.mjs} +4 -4
  110. package/dist/{operator-cmd-B6f6Cg9Z.mjs → operator-cmd-C5lCctnc.mjs} +8 -8
  111. package/dist/operator-cmd-Cjk5DiRx.mjs +2 -0
  112. package/dist/{output-C50ag2r3.mjs → output-FNHKw5Ac.mjs} +36 -5
  113. package/dist/{package-json-DXfiT1jV.mjs → package-json-BjYqR-So.mjs} +1 -1
  114. package/dist/pages/client.d.mts +1 -1
  115. package/dist/pages/client.mjs +91 -5
  116. package/dist/pages/index.d.mts +1 -2
  117. package/dist/pages/index.mjs +6 -6
  118. package/dist/pages/islands-plugin.mjs +5 -83
  119. package/dist/pages/protocol.d.mts +2 -2
  120. package/dist/pages/protocol.mjs +1 -1
  121. package/dist/pages/serialize.mjs +1 -1
  122. package/dist/{platform-args-BoZkWQnJ.mjs → platform-args-C6Mb_I3a.mjs} +34 -58
  123. package/dist/platform-args-Cm7x-fot.mjs +2 -0
  124. package/dist/{platform-auth-config-n603OANg.mjs → platform-auth-config-CJmNkFT2.mjs} +10 -11
  125. package/dist/{platform-auth-protection-zxDr0hWW.mjs → platform-auth-protection-D5wvsI-Y.mjs} +36 -26
  126. package/dist/{platform-auth-recovery-tw9lgtgE.mjs → platform-auth-recovery-D_0I3n-1.mjs} +8 -9
  127. package/dist/{platform-cmd-C00YM14r.mjs → platform-cmd-Cuj4oUVo.mjs} +1 -1
  128. package/dist/{platform-cmd-B8-bCb7t.mjs → platform-cmd-DxxZO6e5.mjs} +17 -16
  129. package/dist/{platform-discovery-BC0HCKYt.mjs → platform-discovery-CHhNs8Nn.mjs} +1 -1
  130. package/dist/{platform-domain-p0kobLV8.mjs → platform-domain-zLXnW1G_.mjs} +5 -5
  131. package/dist/{platform-lifecycle-D_QEY32D.mjs → platform-lifecycle-DOW-wLfx.mjs} +1398 -2043
  132. package/dist/{platform-lifecycle-vFqtNPPa.mjs → platform-lifecycle-_gfnjUBr.mjs} +1 -1
  133. package/dist/{platform-management-oi-SvI3f.mjs → platform-management-CYrLvTGH.mjs} +1 -1
  134. package/dist/{platform-management-BdYblvvE.mjs → platform-management-t7HKy4-U.mjs} +632 -124
  135. package/dist/{platform-plans-config-CjiFv5J4.mjs → platform-plans-config-CNH6zbPX.mjs} +15 -11
  136. package/dist/{platform-recovery-PvNS9Nl2.mjs → platform-recovery-DeucI7A9.mjs} +6 -9
  137. package/dist/{platform-registry-P387v42A.mjs → platform-registry-B9mWX9LO.mjs} +18 -19
  138. package/dist/{platform-setup-DVe42Ws7.mjs → platform-setup-CTf6MMT9.mjs} +19 -26
  139. package/dist/{plugin-inference-BlQbOL0P.mjs → plugin-inference-DsARdQKE.mjs} +18 -33
  140. package/dist/{prepare-Dq9hTIbo.mjs → prepare-C4zfwks4.mjs} +3 -3
  141. package/dist/{prepare-Do96654b.mjs → prepare-CSH9dKTI.mjs} +11 -13
  142. package/dist/prepare-dr9uxQSV.mjs +2 -0
  143. package/dist/{prerender-render-Ct20jftc.mjs → prerender-render-Bfsumdkv.mjs} +8 -2
  144. package/dist/prerender-render.d.mts +2 -0
  145. package/dist/prerender-render.mjs +2 -2
  146. package/dist/project-DiiOBZPF.mjs +2 -0
  147. package/dist/{project-cmd-ti8_yTcA.mjs → project-cmd-Dq75AXzy.mjs} +19 -19
  148. package/dist/{project-paths-GgcMozYz.mjs → project-paths-DMvEeSau.mjs} +9 -14
  149. package/dist/{project-DQstYTxO.mjs → project-rqDnVsJN.mjs} +8 -4
  150. package/dist/{project-team-CDPE1Tsg.mjs → project-team-B3_QcStG.mjs} +6 -6
  151. package/dist/{project-token-CkZ1cN0Z.mjs → project-token-CvsRvv2I.mjs} +5 -5
  152. package/dist/{project-tsconfig-CVJhNMxs.mjs → project-tsconfig-bveqhlYA.mjs} +3 -5
  153. package/dist/{project-zero-trust-DdjLR61k.mjs → project-zero-trust-D1ICiwN_.mjs} +5 -5
  154. package/dist/{protocol-BPZaNqBo.d.mts → protocol-4H7V_3Os.d.mts} +1 -1
  155. package/dist/{protocol-CfaUwNs8.mjs → protocol-RNP0u7UY.mjs} +9 -3
  156. package/dist/{provision-BfaLiWbj.mjs → provision-DDh7ITVS.mjs} +118 -865
  157. package/dist/{requests-DFAqyYy8.mjs → requests-3CL3BuZh.mjs} +4 -4
  158. package/dist/resolve-project-B9Hr0D3n.mjs +2 -0
  159. package/dist/resolve-project-C_Cu7E8a.mjs +48 -0
  160. package/dist/{rollback-BKYXBduI.mjs → rollback-Ce1d_0J9.mjs} +7 -17
  161. package/dist/{route-types-CbtsIeFn.mjs → route-types-IrBuwJ7u.mjs} +35 -70
  162. package/dist/routing-assets-VkrKIbxE.mjs +139 -0
  163. package/dist/{runner-9wjsSZx-.mjs → runner-B5huK2eC.mjs} +1 -1
  164. package/dist/{runner-DMBKSrRk.mjs → runner-DcVDrzuR.mjs} +7 -28
  165. package/dist/{runner-mysql-CEzKtmFb.mjs → runner-mysql-CCtyI0p6.mjs} +4 -3
  166. package/dist/runner-mysql-CaJq-hd6.mjs +2 -0
  167. package/dist/runner-pg-BJhFZZG4.mjs +2 -0
  168. package/dist/{runner-pg-DV8p_zjA.mjs → runner-pg-CPd-CB_F.mjs} +1 -1
  169. package/dist/runtime/ai.mjs +9 -22
  170. package/dist/runtime/better-auth-mysql.d.mts +2 -5
  171. package/dist/runtime/better-auth-mysql.mjs +6 -31
  172. package/dist/runtime/better-auth-pg.d.mts +2 -5
  173. package/dist/runtime/better-auth-pg.mjs +6 -32
  174. package/dist/runtime/better-auth.d.mts +2 -4
  175. package/dist/runtime/better-auth.mjs +9 -19
  176. package/dist/runtime/db.mjs +1 -1
  177. package/dist/runtime/durable.d.mts +16 -0
  178. package/dist/runtime/durable.mjs +26 -2
  179. package/dist/runtime/email/testing.d.mts +1 -1
  180. package/dist/runtime/email/testing.mjs +9 -23
  181. package/dist/runtime/email-protocol.d.mts +12 -0
  182. package/dist/runtime/email-protocol.mjs +2 -70
  183. package/dist/runtime/email.d.mts +1 -1
  184. package/dist/runtime/email.mjs +79 -221
  185. package/dist/runtime/env-public.d.mts +1 -1
  186. package/dist/runtime/env-public.mjs +12 -38
  187. package/dist/runtime/env.d.mts +1 -12
  188. package/dist/runtime/env.mjs +1 -1
  189. package/dist/runtime/handler.d.mts +1 -1
  190. package/dist/runtime/handler.mjs +1 -1
  191. package/dist/runtime/isr.mjs +1 -1
  192. package/dist/runtime/kv.mjs +1 -1
  193. package/dist/runtime/live-client.d.mts +1 -1
  194. package/dist/runtime/live-server.mjs +1 -16
  195. package/dist/runtime/live.d.mts +1 -1
  196. package/dist/runtime/live.mjs +1 -1
  197. package/dist/runtime/migration-handler-mysql.d.mts +2 -2
  198. package/dist/runtime/migration-handler-mysql.mjs +3 -2
  199. package/dist/runtime/migration-handler-pg.d.mts +2 -2
  200. package/dist/runtime/migration-handler-pg.mjs +1 -1
  201. package/dist/runtime/migration-handler.d.mts +2 -2
  202. package/dist/runtime/migration-handler.mjs +2 -470
  203. package/dist/runtime/queues.mjs +1 -1
  204. package/dist/runtime/remote/binding-handler.mjs +62 -62
  205. package/dist/runtime/remote/index.mjs +16 -77
  206. package/dist/runtime/routing.d.mts +1 -4
  207. package/dist/runtime/routing.mjs +82 -218
  208. package/dist/runtime/sandbox-container.d.mts +2 -2
  209. package/dist/runtime/sandbox-container.mjs +2 -2
  210. package/dist/runtime/sandbox.d.mts +2 -2
  211. package/dist/runtime/sandbox.mjs +13 -6
  212. package/dist/runtime/storage.mjs +1 -1
  213. package/dist/runtime/validator.d.mts +1 -1
  214. package/dist/runtime/ws-server.d.mts +2 -3
  215. package/dist/runtime/ws-server.mjs +6 -28
  216. package/dist/runtime/ws.d.mts +1 -1
  217. package/dist/{sandbox-container-Bo0eiFKz.d.mts → sandbox-container-ChQRum-j.d.mts} +3 -1
  218. package/dist/{sandbox-container-C6ItmVuN.mjs → sandbox-container-DBKIqDEK.mjs} +12 -1
  219. package/dist/{sandbox-C5LFoJMf.d.mts → sandbox-q3waMc2T.d.mts} +1 -1
  220. package/dist/{scan-C3uDzz6J.mjs → scan-C0BMdmEd.mjs} +84 -7
  221. package/dist/{secret-BAt2KMmO.mjs → secret-B5J8bBsI.mjs} +62 -80
  222. package/dist/{serialize-BPvnNQuA.mjs → serialize-BtQyaYoC.mjs} +10 -4
  223. package/dist/{skills-BgVMvQdy.mjs → skills-BJsan98C.mjs} +2 -2
  224. package/dist/{subcommand-prompt-BSlnD1fI.mjs → subcommand-prompt-gQ-NDA-u.mjs} +38 -43
  225. package/dist/sveltekit.mjs +1 -1
  226. package/dist/validate-C9xtFOYR.mjs +2 -0
  227. package/dist/{validate-C9qJArv7.mjs → validate-CheZGRE7.mjs} +4 -8
  228. package/dist/version-metadata-DIrqEHQo.mjs +73 -0
  229. package/dist/{wrangler-D9KTuqnv.mjs → wrangler-BYs07Rxy.mjs} +119 -378
  230. package/dist/{ws-CChrrAU-.d.mts → ws-aKVYB-fA.d.mts} +1 -1
  231. package/dist/yarn-pnp-DLbEFMT0.mjs +92 -0
  232. package/docs/guide/auth.md +2 -0
  233. package/docs/guide/database/postgresql.md +2 -0
  234. package/docs/guide/database.md +2 -0
  235. package/docs/guide/deployment.md +2 -2
  236. package/docs/guide/durable-state.md +24 -0
  237. package/docs/guide/platform/administration/access.md +5 -1
  238. package/docs/guide/platform/administration/connected-apps.md +55 -0
  239. package/docs/guide/platform/installation/credentials.md +3 -1
  240. package/docs/guide/platform/installation/first-deployment.md +1 -1
  241. package/docs/guide/project-collaboration.md +1 -1
  242. package/docs/guide/quickstart.md +2 -0
  243. package/docs/guide/sandboxes.md +2 -0
  244. package/docs/reference/api/deploy.md +23 -0
  245. package/docs/reference/api/pages.md +2 -0
  246. package/docs/reference/api.md +2 -1
  247. package/docs/reference/cli/auth.md +1 -1
  248. package/docs/reference/cli/database.md +9 -3
  249. package/docs/reference/cli/deploy.md +1 -1
  250. package/docs/reference/cli/platform-installation.md +1 -1
  251. package/docs/reference/cli/setup.md +2 -0
  252. package/package.json +14 -17
  253. package/skills/void/SKILL.md +4 -2
  254. package/dist/auth-BgX2qYSY.mjs +0 -2
  255. package/dist/cf-build-output-H9a97vME.mjs +0 -2
  256. package/dist/client-By4JjMw_.mjs +0 -2
  257. package/dist/collect-DLyFDiKW.mjs +0 -2
  258. package/dist/config-5r-YpMC-.mjs +0 -2
  259. package/dist/config-B_ggY-IO.mjs +0 -89
  260. package/dist/config-BtSFvXZx.mjs +0 -2
  261. package/dist/config-write-AHGesphx.mjs +0 -61
  262. package/dist/deploy-BsEvnlJl.mjs +0 -10455
  263. package/dist/deploy-C1d-YTfp.mjs +0 -2
  264. package/dist/dev-inbox-CK-UuPob.mjs +0 -297
  265. package/dist/discover-EDUf6JJw.mjs +0 -2
  266. package/dist/dist-_UUlL6bg.mjs +0 -2
  267. package/dist/env-validation-Dxdx_5wo.mjs +0 -951
  268. package/dist/gen-dA9hW7AV.mjs +0 -2
  269. package/dist/head-client-DzmJGN4C.mjs +0 -90
  270. package/dist/help-DzKUrQvk.mjs +0 -2
  271. package/dist/login-Dc-wuTDq.mjs +0 -2
  272. package/dist/migrate-BHp07yJE.mjs +0 -2
  273. package/dist/operator-cmd-Cwn50lOV.mjs +0 -2
  274. package/dist/pages/head-client.d.mts +0 -13
  275. package/dist/pages/head-client.mjs +0 -2
  276. package/dist/platform-args-DYgITk0D.mjs +0 -2
  277. package/dist/prepare-DRUV-g3X.mjs +0 -2
  278. package/dist/project-BiaPQ7ur.mjs +0 -2
  279. package/dist/provision-Wu9ZBk9L.mjs +0 -2
  280. package/dist/resolve-project-BIeYs9Cw.mjs +0 -2
  281. package/dist/resolve-project-CP8rZs_p.mjs +0 -28
  282. package/dist/runner-mysql-CkFqZ6CE.mjs +0 -2
  283. package/dist/runner-pg-BGYRFdRp.mjs +0 -2
  284. package/dist/runtime/env-helpers.d.mts +0 -2
  285. package/dist/runtime/env-helpers.mjs +0 -2
  286. package/dist/validate-BJr9LfXy.mjs +0 -2
  287. package/dist/yarn-pnp-CUX_iTPA.mjs +0 -188
@@ -1,22 +1,24 @@
1
- import { a as join, l as relative, r as extname, t as basename, u as resolve } from "./dist-BVqXeR_h.mjs";
2
- import { r as detectFramework } from "./plugin-inference-BlQbOL0P.mjs";
3
- import { n as readProjectPaths } from "./project-paths-GgcMozYz.mjs";
4
- import { h as resolveBindingNames, m as readConfig, u as getDatabaseDialect } from "./config-DiowPT80.mjs";
5
- import { i as writeJournal, n as readJournal, r as stripSqlExt, t as collectMigrations } from "./collect-DiTn9yr6.mjs";
6
- import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-DQstYTxO.mjs";
7
- import { t as resolveLocalD1Target } from "./local-d1-ga5O_idV.mjs";
8
- import { t as cfAccessHeaders } from "./cf-access-TWNzXltp.mjs";
9
- import { i as isCloudflareAccessChallenge, n as ensurePlatformAccessToken, r as ensurePlatformProxyAccess } from "./cf-access-ngGqZpHZ.mjs";
10
- import { c as getToken, o as getProxyUrl } from "./auth-B5_tZLxT.mjs";
11
- import { A as confirm, H as outro, L as log, tt as isCancel } from "./dist-D3m88sjf.mjs";
12
- import { d as printSuccess, i as dim, l as import_picocolors, s as formatCount } from "./output-C50ag2r3.mjs";
13
- import { o as loadLocalEnv } from "./env-BxocywBB.mjs";
14
- import { n as PlatformApiError, r as PlatformClient } from "./client-C2Prx_Bi.mjs";
15
- import { i as validateMigrations, r as listDrizzleArtifacts, t as assertJournalCoherence } from "./validate-C9qJArv7.mjs";
16
- import { n as formatTimestamp } from "./gen-DtkQhvQg.mjs";
1
+ import { a as join, c as resolve, n as dirname, r as extname, s as relative, t as basename } from "./dist-ipQi0Q8y.mjs";
2
+ import { r as detectFramework } from "./plugin-inference-DsARdQKE.mjs";
3
+ import { n as readProjectPaths } from "./project-paths-DMvEeSau.mjs";
4
+ import { d as readConfig, f as resolveBindingNames, s as getDatabaseDialect } from "./config-Bx_1SpnO.mjs";
5
+ import { i as writeJournal, n as readJournal, r as stripSqlExt, t as collectMigrations } from "./collect-xjffdCdk.mjs";
6
+ import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-rqDnVsJN.mjs";
7
+ import { t as resolveLocalD1Target } from "./local-d1-BM3p74mm.mjs";
8
+ import { t as cfAccessHeaders } from "./cf-access-BM9G0lhO.mjs";
9
+ import { n as ensurePlatformProxyAccess, r as isCloudflareAccessChallenge, t as ensurePlatformAccessToken } from "./cf-access-CWP4avfP.mjs";
10
+ import { c as getToken, o as getProxyUrl } from "./auth-B6iOCjKI.mjs";
11
+ import { A as confirm, H as outro, L as log, X as text, tt as isCancel } from "./dist-D3m88sjf.mjs";
12
+ import { f as import_picocolors, i as dim, l as formatUrl, m as printSuccess, o as formatCount, u as getErrorMessage } from "./output-FNHKw5Ac.mjs";
13
+ import { o as loadLocalEnv } from "./env-BJjULvL0.mjs";
14
+ import { i as validateMigrations, t as assertJournalCoherence } from "./validate-CheZGRE7.mjs";
15
+ import { n as PlatformApiError, r as PlatformClient } from "./client-DM9Kcf4e.mjs";
16
+ import { n as drizzleKitBin } from "./yarn-pnp-DLbEFMT0.mjs";
17
+ import { n as formatTimestamp } from "./gen-CnN1Xidx.mjs";
17
18
  import { createRequire } from "node:module";
18
- import { existsSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
19
- import { fileURLToPath, pathToFileURL } from "node:url";
19
+ import { existsSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
20
+ import { pathToFileURL } from "node:url";
21
+ import { createJiti } from "jiti";
20
22
  import { execFileSync } from "node:child_process";
21
23
  //#region src/cli/db-export-sequences.ts
22
24
  function quoteSqlIdentifier(value) {
@@ -116,7 +118,6 @@ async function exportPgConstraints(client, tables) {
116
118
  }
117
119
  //#endregion
118
120
  //#region src/cli/db.ts
119
- const drizzleKitBin = join(fileURLToPath(import.meta.resolve("drizzle-kit")), "..", "bin.cjs");
120
121
  const DEFAULT_SEED_FILES = [
121
122
  "db/seed.ts",
122
123
  "db/seed.mts",
@@ -133,13 +134,15 @@ const MODULE_SEED_EXTENSIONS = /* @__PURE__ */ new Set([
133
134
  function getLocalD1Target(root) {
134
135
  const detected = detectFramework(root);
135
136
  const defaultPersistRoot = detected && (detected.class === "b" || detected.class === "c") ? join(root, ".wrangler", "state") : join(root, ".void");
136
- const bindingName = resolveBindingNames(readConfig(root).inference?.bindings)?.d1 ?? "DB";
137
137
  return resolveLocalD1Target(root, {
138
- bindingName,
138
+ bindingName: configuredD1Binding(root),
139
139
  defaultPersistRoot,
140
140
  readPersistState: true
141
141
  });
142
142
  }
143
+ function configuredD1Binding(root) {
144
+ return resolveBindingNames(readConfig(root).inference?.bindings)?.d1 ?? "DB";
145
+ }
143
146
  function runDrizzleKit(root, args) {
144
147
  execFileSync(process.execPath, [drizzleKitBin, ...args], {
145
148
  cwd: root,
@@ -153,7 +156,7 @@ function runDrizzleKit(root, args) {
153
156
  * already printed its own error.
154
157
  */
155
158
  async function runDrizzleKitWithDatabaseUrl(root, url, dialect, command) {
156
- const { withPrivateDrizzleConfig } = await import("./config-BtSFvXZx.mjs");
159
+ const { withPrivateDrizzleConfig } = await import("./config-CNnrSMYm.mjs");
157
160
  if (!withPrivateDrizzleConfig(root, url, dialect, (configPath) => {
158
161
  try {
159
162
  runDrizzleKit(root, [
@@ -167,21 +170,13 @@ async function runDrizzleKitWithDatabaseUrl(root, url, dialect, command) {
167
170
  }
168
171
  })) process.exit(1);
169
172
  }
170
- function getErrorMessage(error) {
171
- return error instanceof Error ? error.message : String(error);
172
- }
173
- function getPgUrl(root) {
174
- const url = loadLocalEnv(root).DATABASE_URL;
175
- if (!url) throw new Error("DATABASE_URL not found in .env. Add it to connect to your local PostgreSQL database.");
176
- return url;
177
- }
178
- function getMySqlUrl(root) {
173
+ function getLocalDatabaseUrl(root, dialect) {
179
174
  const url = loadLocalEnv(root).DATABASE_URL;
180
- if (!url) throw new Error("DATABASE_URL not found in .env. Add it to connect to your local MySQL database.");
175
+ if (!url) throw new Error(`DATABASE_URL not found in .env. Add it to connect to your local ${dialect === "mysql" ? "MySQL" : "PostgreSQL"} database.`);
181
176
  return url;
182
177
  }
183
178
  async function withPgClient(root, fn) {
184
- const url = getPgUrl(root);
179
+ const url = getLocalDatabaseUrl(root, "postgresql");
185
180
  const { Client } = await import("pg");
186
181
  const client = new Client({ connectionString: url });
187
182
  await client.connect();
@@ -192,24 +187,16 @@ async function withPgClient(root, fn) {
192
187
  }
193
188
  }
194
189
  async function withMySqlClient(root, fn) {
190
+ const { toMySqlClient } = await import("./runner-mysql-CaJq-hd6.mjs");
195
191
  const { createConnection } = await import("mysql2/promise");
196
192
  const connection = await createConnection({
197
- uri: getMySqlUrl(root),
193
+ uri: getLocalDatabaseUrl(root, "mysql"),
198
194
  multipleStatements: true
199
195
  });
200
- const client = {
201
- async query(sql, params) {
202
- const [rows] = await connection.query(sql, params);
203
- return Array.isArray(rows) ? rows : [];
204
- },
205
- async end() {
206
- await connection.end();
207
- }
208
- };
209
196
  try {
210
- return await fn(client);
197
+ return await fn(toMySqlClient(connection));
211
198
  } finally {
212
- await client.end();
199
+ await connection.end();
213
200
  }
214
201
  }
215
202
  function validatePendingMigrations(migrations, appliedNames) {
@@ -223,12 +210,12 @@ async function runDbCommand(root, args) {
223
210
  if (args.action === "push") await runPush(root, dialect);
224
211
  else if (args.action === "generate") await runGenerate(root, dialect);
225
212
  else if (args.action === "status") await runStatus(root, dialect);
226
- else if (args.action === "reset") await runReset(root, dialect);
227
- else if (args.action === "seed") await runSeed(root, args.file, dialect);
213
+ else if (args.action === "reset") await runReset(root, dialect, args.yes);
214
+ else if (args.action === "seed") await runSeed(root, args.file, dialect, args.yes);
228
215
  else if (args.action === "execute") await runExecute(root, args.command, args.file, dialect, args.remote);
229
216
  else if (args.action === "migrate") await runMigrate(root, dialect, args.remote);
230
217
  else if (args.action === "studio") await runStudio(root, dialect, args.remote);
231
- else if (args.action === "set-url") await runSetUrl(root);
218
+ else if (args.action === "set-url") await runSetUrl(root, dialect);
232
219
  else if (args.action === "connect") await runConnect(root, dialect, args);
233
220
  else if (args.action === "rename-migrations") await runRenameMigrations(root, dialect);
234
221
  else await runExport(root, args, dialect);
@@ -288,15 +275,14 @@ async function runConnect(root, dialect, args) {
288
275
  });
289
276
  connectionString = result.connectionString;
290
277
  log.step(`Provisioned ${adapter.label} database.`);
291
- if (result.dashboardUrl) log.info(`Dashboard: ${result.dashboardUrl}`);
278
+ if (result.dashboardUrl) log.info(`Dashboard: ${formatUrl(result.dashboardUrl)}`);
292
279
  }
293
280
  if (!connectionString) {
294
- const { text: promptText, isCancel: isCancelCheck } = await import("./dist-Bx1z6Eva.mjs");
295
- const answer = await promptText({
281
+ const answer = await text({
296
282
  message: `Enter your ${dialect === "mysql" ? "MySQL" : "PostgreSQL"} connection string:`,
297
283
  placeholder: dialect === "mysql" ? "mysql://user:pass@host:3306/database" : "postgresql://user:pass@host:5432/database"
298
284
  });
299
- if (isCancelCheck(answer)) process.exit(0);
285
+ if (isCancel(answer)) process.exit(0);
300
286
  connectionString = answer;
301
287
  }
302
288
  const parsed = new URL(connectionString);
@@ -315,13 +301,11 @@ async function runConnect(root, dialect, args) {
315
301
  }
316
302
  async function runPush(root, dialect) {
317
303
  if (dialect !== "sqlite") {
318
- await runDrizzleKitWithDatabaseUrl(root, dialect === "mysql" ? getMySqlUrl(root) : getPgUrl(root), dialect, "push");
304
+ await runDrizzleKitWithDatabaseUrl(root, getLocalDatabaseUrl(root, dialect), dialect, "push");
319
305
  printSuccess("Database schema pushed.");
320
306
  return;
321
307
  }
322
- const { writeDrizzleConfig } = await import("./config-BtSFvXZx.mjs");
323
- const { mkdirSync } = await import("node:fs");
324
- const { dirname } = await import("./dist-_UUlL6bg.mjs");
308
+ const { writeDrizzleConfig } = await import("./config-CNnrSMYm.mjs");
325
309
  const { databasePath: dbPath } = getLocalD1Target(root);
326
310
  mkdirSync(dirname(dbPath), { recursive: true });
327
311
  const configPath = writeDrizzleConfig(root, dbPath);
@@ -337,15 +321,15 @@ async function runPush(root, dialect) {
337
321
  printSuccess("Database schema pushed.");
338
322
  }
339
323
  async function runGenerate(root, dialect) {
340
- const { prepareProject } = await import("./prepare-DRUV-g3X.mjs");
341
- const { writeDrizzleConfig } = await import("./config-BtSFvXZx.mjs");
324
+ const { prepareProject } = await import("./prepare-dr9uxQSV.mjs");
325
+ const { PLACEHOLDER_DB_URL, writeDrizzleConfig } = await import("./config-CNnrSMYm.mjs");
342
326
  await prepareProject(root);
343
327
  const authSchemaPath = join(root, ".void", "better-auth-schema.ts");
344
328
  const additionalSchemas = existsSync(authSchemaPath) ? [authSchemaPath] : void 0;
345
- const configPath = writeDrizzleConfig(root, dialect === "postgresql" ? "postgresql://dummy" : dialect === "mysql" ? "mysql://dummy" : ":memory:", dialect, { additionalSchemas });
329
+ const configPath = writeDrizzleConfig(root, PLACEHOLDER_DB_URL[dialect], dialect, { additionalSchemas });
346
330
  try {
347
331
  if (dialect === "sqlite") {
348
- const { generateValidatedSqliteMigrations } = await import("./generate-GDbL7sUr.mjs");
332
+ const { generateValidatedSqliteMigrations } = await import("./generate-Rii9klHB.mjs");
349
333
  await generateValidatedSqliteMigrations(readProjectPaths(root).migrationsDir, () => {
350
334
  runDrizzleKit(root, [
351
335
  "generate",
@@ -380,45 +364,35 @@ async function runStatus(root, dialect) {
380
364
  }
381
365
  let localApplied;
382
366
  if (dialect === "postgresql") try {
383
- localApplied = await withPgClient(root, async (client) => {
384
- try {
385
- return (await client.query("SELECT name FROM _void_migrations ORDER BY name")).rows;
386
- } catch {
387
- return [];
388
- }
389
- });
367
+ const { readPgAppliedMigrations } = await import("./runner-pg-BJhFZZG4.mjs");
368
+ localApplied = await withPgClient(root, readPgAppliedMigrations);
390
369
  } catch {
391
370
  localApplied = [];
392
371
  }
393
372
  else if (dialect === "mysql") try {
394
- localApplied = await withMySqlClient(root, async (client) => {
395
- try {
396
- return await client.query("SELECT `name` FROM `_void_migrations` ORDER BY `name`");
397
- } catch {
398
- return [];
399
- }
400
- });
373
+ const { readMySqlAppliedMigrations } = await import("./runner-mysql-CaJq-hd6.mjs");
374
+ localApplied = await withMySqlClient(root, readMySqlAppliedMigrations);
401
375
  } catch {
402
376
  localApplied = [];
403
377
  }
404
378
  else {
405
- const { getAppliedMigrations } = await import("./runner-9wjsSZx-.mjs");
379
+ const { getAppliedMigrations } = await import("./runner-B5huK2eC.mjs");
406
380
  const { databasePath: dbPath } = getLocalD1Target(root);
407
- localApplied = await getAppliedMigrations(dbPath);
381
+ localApplied = (await getAppliedMigrations(dbPath)).map((m) => m.name);
408
382
  }
409
- const localSet = new Set(localApplied.map((m) => m.name));
383
+ const localSet = new Set(localApplied);
410
384
  let remoteApplied = null;
411
385
  if (readDeploymentPlatform(root) === "cloudflare") try {
412
386
  if (dialect !== "sqlite") {
413
387
  const databaseUrl = process.env.DATABASE_URL;
414
388
  if (!databaseUrl) throw new Error("DATABASE_URL is not available.");
415
- remoteApplied = (dialect === "postgresql" ? await (await import("./runner-pg-BGYRFdRp.mjs")).getPgAppliedMigrations(databaseUrl) : await (await import("./runner-mysql-CkFqZ6CE.mjs")).getMySqlAppliedMigrations(databaseUrl)).map((name) => ({
389
+ remoteApplied = (dialect === "postgresql" ? await (await import("./runner-pg-BJhFZZG4.mjs")).getPgAppliedMigrations(databaseUrl) : await (await import("./runner-mysql-CaJq-hd6.mjs")).getMySqlAppliedMigrations(databaseUrl)).map((name) => ({
416
390
  name,
417
391
  applied_at: ""
418
392
  }));
419
393
  } else {
420
- const { readCloudflareD1Migrations, resolveCloudflareD1Context } = await import("./cloudflare-operations-BlYLlowZ.mjs");
421
- remoteApplied = (await readCloudflareD1Migrations(resolveCloudflareD1Context(root, resolveBindingNames(readConfig(root).inference?.bindings)?.d1 ?? "DB"))).map((name) => ({
394
+ const { readCloudflareD1Migrations, resolveCloudflareD1Context } = await import("./cloudflare-operations-Ds-lX3Ts.mjs");
395
+ remoteApplied = (await readCloudflareD1Migrations(resolveCloudflareD1Context(root, configuredD1Binding(root)))).map((name) => ({
422
396
  name,
423
397
  applied_at: ""
424
398
  }));
@@ -449,7 +423,30 @@ async function runStatus(root, dialect) {
449
423
  }
450
424
  outro(parts.join(", "));
451
425
  }
452
- async function resetDatabase(root, dialect) {
426
+ const LOCAL_DATABASE_HOSTS = /* @__PURE__ */ new Set([
427
+ "",
428
+ "localhost",
429
+ "127.0.0.1",
430
+ "::1",
431
+ "[::1]"
432
+ ]);
433
+ /**
434
+ * `.env` may hold the deployed database URL (`void db connect` writes it there), so ask before
435
+ * dropping every table on any other host. Without a TTY, require `--yes`.
436
+ */
437
+ async function confirmDropAllTables(host, target, yes) {
438
+ if (yes || LOCAL_DATABASE_HOSTS.has(host) || host.startsWith("/")) return;
439
+ if (!process.stdin.isTTY) {
440
+ log.error(`db: Refusing to drop every table in ${target} without confirmation. Re-run with --yes.`);
441
+ process.exit(1);
442
+ }
443
+ const ok = await confirm({ message: `This drops every table in ${target}. Continue?` });
444
+ if (isCancel(ok) || !ok) {
445
+ log.info("Cancelled.");
446
+ process.exit(0);
447
+ }
448
+ }
449
+ async function resetDatabase(root, dialect, yes) {
453
450
  const migrationsDir = readProjectPaths(root).migrationsDir;
454
451
  const migrations = collectMigrations(migrationsDir);
455
452
  try {
@@ -459,29 +456,22 @@ async function resetDatabase(root, dialect) {
459
456
  process.exit(1);
460
457
  }
461
458
  if (dialect === "postgresql") {
459
+ const { Client } = await import("pg");
460
+ const { host, port, database } = new Client({ connectionString: getLocalDatabaseUrl(root, dialect) });
461
+ await confirmDropAllTables(host, `database "${database}" on ${host}:${port}`, yes);
462
+ const { applyPgMigrations } = await import("./runner-pg-BJhFZZG4.mjs");
462
463
  await withPgClient(root, async (client) => {
463
464
  const tables = await client.query("SELECT tablename FROM pg_tables WHERE schemaname = 'public'");
464
465
  for (const row of tables.rows) await client.query(`DROP TABLE IF EXISTS "${row.tablename}" CASCADE`);
465
- });
466
- if (migrations.length > 0) await withPgClient(root, async (client) => {
467
- await client.query(`CREATE TABLE IF NOT EXISTS _void_migrations (name TEXT PRIMARY KEY, applied_at TEXT NOT NULL)`);
468
- for (const m of migrations) {
469
- await client.query("BEGIN");
470
- try {
471
- await client.query(m.sql);
472
- await client.query("INSERT INTO _void_migrations (name, applied_at) VALUES ($1, $2)", [m.name, (/* @__PURE__ */ new Date()).toISOString()]);
473
- await client.query("COMMIT");
474
- } catch (err) {
475
- await client.query("ROLLBACK");
476
- throw err;
477
- }
478
- }
466
+ await applyPgMigrations(client, migrations);
479
467
  });
480
468
  return migrations.length;
481
469
  }
482
470
  if (dialect === "mysql") {
471
+ const { hostname, host, pathname } = new URL(getLocalDatabaseUrl(root, dialect));
472
+ await confirmDropAllTables(hostname, `database "${decodeURIComponent(pathname.slice(1))}" on ${host}`, yes);
483
473
  await withMySqlClient(root, async (client) => {
484
- const tables = await client.query("SELECT table_name FROM information_schema.tables WHERE table_schema = DATABASE() AND table_type = 'BASE TABLE'");
474
+ const tables = await client.query("SELECT table_name AS table_name FROM information_schema.tables WHERE table_schema = DATABASE() AND table_type = 'BASE TABLE'");
485
475
  await client.query("SET FOREIGN_KEY_CHECKS = 0");
486
476
  try {
487
477
  for (const row of tables) {
@@ -493,25 +483,25 @@ async function resetDatabase(root, dialect) {
493
483
  }
494
484
  });
495
485
  if (migrations.length > 0) {
496
- const { applyMySqlMigrations } = await import("./runner-mysql-CkFqZ6CE.mjs");
486
+ const { applyMySqlMigrations } = await import("./runner-mysql-CaJq-hd6.mjs");
497
487
  await withMySqlClient(root, (client) => applyMySqlMigrations(client, migrations));
498
488
  }
499
489
  return migrations.length;
500
490
  }
501
- const { runMigrations } = await import("./runner-9wjsSZx-.mjs");
491
+ const { runMigrations } = await import("./runner-B5huK2eC.mjs");
502
492
  const { databasePath: dbPath } = getLocalD1Target(root);
503
493
  rmSync(dbPath, { force: true });
504
494
  rmSync(dbPath + "-wal", { force: true });
505
495
  rmSync(dbPath + "-shm", { force: true });
506
496
  return (await runMigrations(migrationsDir, dbPath)).length;
507
497
  }
508
- async function runReset(root, dialect) {
509
- const count = await resetDatabase(root, dialect);
498
+ async function runReset(root, dialect, yes) {
499
+ const count = await resetDatabase(root, dialect, yes);
510
500
  if (dialect === "sqlite") log.info(dim("Restart your dev server if it's running."));
511
501
  printSuccess(`Database reset. Applied ${formatCount(count, "migration")}.`);
512
502
  }
513
- async function runSeed(root, file, dialect) {
514
- const migrationCount = await resetDatabase(root, dialect);
503
+ async function runSeed(root, file, dialect, yes) {
504
+ const migrationCount = await resetDatabase(root, dialect, yes);
515
505
  log.step(`Reset database. Applied ${formatCount(migrationCount, "migration")}.`);
516
506
  const seed = resolveSeedTarget(root, file);
517
507
  if (seed.kind === "sql") {
@@ -530,7 +520,7 @@ async function runSeed(root, file, dialect) {
530
520
  printSuccess(`Seeded from ${seed.displayPath}.`);
531
521
  return;
532
522
  }
533
- const { openSqliteDatabase } = await import("./runner-9wjsSZx-.mjs");
523
+ const { openSqliteDatabase } = await import("./runner-B5huK2eC.mjs");
534
524
  const { databasePath: dbPath } = getLocalD1Target(root);
535
525
  const db = await openSqliteDatabase(dbPath);
536
526
  try {
@@ -543,37 +533,10 @@ async function runSeed(root, file, dialect) {
543
533
  printSuccess(`Seeded from ${seed.displayPath}.`);
544
534
  }
545
535
  /**
546
- * Returns true when the SQL is read-only (SELECT / EXPLAIN only).
547
- * Used to skip the destructive-statement safety prompt for safe queries.
548
- *
549
- * This is a fail-closed heuristic, not a real SQL parser:
550
- * - SQL comments (slash-star block and double-dash line) are stripped first,
551
- * so commented variants like `EXPLAIN <block-comment> ANALYZE DELETE FROM
552
- * users` or `EXPLAIN -- c\n ANALYZE ...` can't bypass the EXPLAIN ANALYZE
553
- * check by hiding the `ANALYZE` keyword behind a comment that PostgreSQL
554
- * treats as whitespace. This also handles leading comments, so
555
- * `-- header\nSELECT 1` is classified as safe.
556
- * - The comment-stripping regex is naive and doesn't understand string
557
- * literals: a string literal containing a block-comment marker will have its
558
- * contents stripped. That's harmless here (still classified as SELECT, still
559
- * safe), but worth knowing if this helper is ever reused.
560
- * - `WITH` (CTEs) is intentionally excluded: writable CTEs such as
561
- * `WITH deleted AS (DELETE FROM users RETURNING *) SELECT * FROM deleted`
562
- * are destructive but match a naive `WITH` prefix check. Users with
563
- * read-only CTEs will see the safety prompt — minor friction, safe by default.
564
- * - Multi-statement SQL (`SELECT 1; DELETE FROM users`) is rejected: any `;`
565
- * followed by non-whitespace content after stripping a trailing semicolon is
566
- * treated as unsafe.
567
- * - `EXPLAIN ANALYZE` is explicitly excluded: in PostgreSQL, `EXPLAIN ANALYZE`
568
- * actually executes the underlying statement (including DML) to collect runtime
569
- * statistics. A naive `EXPLAIN` prefix check would treat it as safe when it is
570
- * in fact destructive. Only plain `EXPLAIN` (without `ANALYZE`) is allowed.
571
- * - `EXPLAIN (...)` parenthesized option lists (PostgreSQL) are scanned for
572
- * `ANALYZE`. The bare-keyword form `EXPLAIN ANALYZE ...` and the option-list
573
- * form `EXPLAIN (ANALYZE) ...` / `EXPLAIN (ANALYZE TRUE) ...` both execute
574
- * the underlying statement, so either shape is rejected. Even
575
- * `EXPLAIN (ANALYZE FALSE)` is rejected (over-strict, but safer than
576
- * guessing the boolean value of an arbitrary option expression).
536
+ * Fail-closed check for read-only SQL (SELECT or plain EXPLAIN), which skips the remote
537
+ * confirmation prompt. Comments are stripped first so they cannot hide `ANALYZE`.
538
+ * Multiple statements and `WITH` (a CTE can write) are rejected, and so is `EXPLAIN ANALYZE`
539
+ * in either form, because PostgreSQL executes the analyzed statement.
577
540
  */
578
541
  function isSafeStatement(sql) {
579
542
  const stripped = sql.replace(/\/\*[\s\S]*?\*\//g, " ").replace(/--[^\n]*/g, " ").replace(/;\s*$/, "");
@@ -653,8 +616,8 @@ async function runExecute(root, command, file, dialect, remote) {
653
616
  process.exit(0);
654
617
  }
655
618
  if (dialect === "sqlite") {
656
- const { executeCloudflareD1Sql, resolveCloudflareD1Context } = await import("./cloudflare-operations-BlYLlowZ.mjs");
657
- const rows = await executeCloudflareD1Sql(resolveCloudflareD1Context(root, resolveBindingNames(readConfig(root).inference?.bindings)?.d1 ?? "DB"), sql);
619
+ const { executeCloudflareD1Sql, resolveCloudflareD1Context } = await import("./cloudflare-operations-Ds-lX3Ts.mjs");
620
+ const rows = await executeCloudflareD1Sql(resolveCloudflareD1Context(root, configuredD1Binding(root)), sql);
658
621
  if (rows.length > 0) printTable(rows);
659
622
  } else {
660
623
  const dbUrl = process.env.DATABASE_URL;
@@ -687,8 +650,7 @@ async function runExecute(root, command, file, dialect, remote) {
687
650
  return;
688
651
  }
689
652
  const platformClient = new PlatformClient(token, { root });
690
- const voidConfig = readConfig(root);
691
- let binding = resolveBindingNames(voidConfig.inference?.bindings)?.d1 ?? "DB";
653
+ let binding = configuredD1Binding(root);
692
654
  try {
693
655
  const d1Resource = (await platformClient.getResources(projectConfig.projectId)).find((r) => r.type === "d1");
694
656
  if (d1Resource) binding = d1Resource.binding_name;
@@ -754,7 +716,7 @@ async function runExecute(root, command, file, dialect, remote) {
754
716
  printSuccess("SQL executed successfully.");
755
717
  return;
756
718
  }
757
- const { openSqliteDatabase } = await import("./runner-9wjsSZx-.mjs");
719
+ const { openSqliteDatabase } = await import("./runner-B5huK2eC.mjs");
758
720
  const { databasePath: dbPath } = getLocalD1Target(root);
759
721
  if (!existsSync(dbPath)) {
760
722
  log.error("No local database found. Run `void dev` first.");
@@ -818,11 +780,11 @@ async function runMigrate(root, dialect, remote) {
818
780
  let appliedNames;
819
781
  let applyMigrations;
820
782
  if (dialect === "postgresql") {
821
- const { getPgAppliedMigrations, runPgMigrations } = await import("./runner-pg-BGYRFdRp.mjs");
783
+ const { getPgAppliedMigrations, runPgMigrations } = await import("./runner-pg-BJhFZZG4.mjs");
822
784
  appliedNames = await getPgAppliedMigrations(databaseUrl);
823
785
  applyMigrations = () => runPgMigrations(migrationsDir, databaseUrl);
824
786
  } else {
825
- const { getMySqlAppliedMigrations, runMySqlMigrations } = await import("./runner-mysql-CkFqZ6CE.mjs");
787
+ const { getMySqlAppliedMigrations, runMySqlMigrations } = await import("./runner-mysql-CaJq-hd6.mjs");
826
788
  appliedNames = await getMySqlAppliedMigrations(databaseUrl);
827
789
  applyMigrations = () => runMySqlMigrations(migrationsDir, databaseUrl);
828
790
  }
@@ -847,8 +809,8 @@ async function runMigrate(root, dialect, remote) {
847
809
  log.info(`No migration files found in ${paths.sourceRelative("db/migrations")}/`);
848
810
  return;
849
811
  }
850
- const { applyCloudflareD1Migrations, readCloudflareD1Migrations, resolveCloudflareD1Context } = await import("./cloudflare-operations-BlYLlowZ.mjs");
851
- const binding = resolveBindingNames(readConfig(root).inference?.bindings)?.d1 ?? "DB";
812
+ const { applyCloudflareD1Migrations, readCloudflareD1Migrations, resolveCloudflareD1Context } = await import("./cloudflare-operations-Ds-lX3Ts.mjs");
813
+ const binding = configuredD1Binding(root);
852
814
  const context = resolveCloudflareD1Context(root, binding);
853
815
  const remoteBefore = new Set(await readCloudflareD1Migrations(context));
854
816
  const pending = rawMigrations.filter((migration) => !remoteBefore.has(migration.name));
@@ -862,7 +824,7 @@ async function runMigrate(root, dialect, remote) {
862
824
  log.error(getErrorMessage(error));
863
825
  process.exit(1);
864
826
  }
865
- const { checkWranglerMigrationApplySet, parseRootWranglerConfig } = await import("./deploy-C1d-YTfp.mjs");
827
+ const { checkWranglerMigrationApplySet, parseRootWranglerConfig } = await import("./deploy-Db2ALnQP.mjs");
866
828
  const applySet = await checkWranglerMigrationApplySet(context.operation.configPath, parseRootWranglerConfig(context.operation.configPath), binding, context.migrationsDir, rawMigrations);
867
829
  if (!applySet.ok) {
868
830
  log.error(applySet.reason);
@@ -920,21 +882,15 @@ async function runMigrate(root, dialect, remote) {
920
882
  }
921
883
  if (result.applied.length === 0) log.info("Remote database is up to date.");
922
884
  else for (const name of result.applied) log.step(name);
923
- for (const warning of result.warnings ?? []) log.warn(warning);
924
885
  if (result.applied.length > 0) printSuccess(`Applied ${formatCount(result.applied.length, "migration")} to remote database.`);
925
886
  return;
926
887
  }
927
888
  if (dialect === "postgresql") {
928
- const { applyPgMigrations } = await import("./runner-pg-BGYRFdRp.mjs");
889
+ const { applyPgMigrations, readPgAppliedMigrations } = await import("./runner-pg-BJhFZZG4.mjs");
929
890
  const applied = await withPgClient(root, async (client) => {
930
- let existingRows = [];
891
+ const appliedNames = await readPgAppliedMigrations(client).catch(() => []);
931
892
  try {
932
- existingRows = (await client.query("SELECT name FROM _void_migrations")).rows;
933
- } catch {
934
- existingRows = [];
935
- }
936
- try {
937
- validatePendingMigrations(rawMigrations, new Set(existingRows.map((row) => row.name)));
893
+ validatePendingMigrations(rawMigrations, new Set(appliedNames));
938
894
  } catch (err) {
939
895
  log.error(getErrorMessage(err));
940
896
  process.exit(1);
@@ -949,16 +905,11 @@ async function runMigrate(root, dialect, remote) {
949
905
  return;
950
906
  }
951
907
  if (dialect === "mysql") {
952
- const { applyMySqlMigrations } = await import("./runner-mysql-CkFqZ6CE.mjs");
908
+ const { applyMySqlMigrations, readMySqlAppliedMigrations } = await import("./runner-mysql-CaJq-hd6.mjs");
953
909
  const applied = await withMySqlClient(root, async (client) => {
954
- let existingRows = [];
910
+ const appliedNames = await readMySqlAppliedMigrations(client).catch(() => []);
955
911
  try {
956
- existingRows = await client.query("SELECT `name` FROM `_void_migrations`");
957
- } catch {
958
- existingRows = [];
959
- }
960
- try {
961
- validatePendingMigrations(rawMigrations, new Set(existingRows.map((row) => row.name)));
912
+ validatePendingMigrations(rawMigrations, new Set(appliedNames));
962
913
  } catch (err) {
963
914
  log.error(getErrorMessage(err));
964
915
  process.exit(1);
@@ -972,7 +923,7 @@ async function runMigrate(root, dialect, remote) {
972
923
  }
973
924
  return;
974
925
  }
975
- const { getAppliedMigrations, runMigrations } = await import("./runner-9wjsSZx-.mjs");
926
+ const { getAppliedMigrations, runMigrations } = await import("./runner-B5huK2eC.mjs");
976
927
  const { databasePath: dbPath } = getLocalD1Target(root);
977
928
  try {
978
929
  const existingRows = await getAppliedMigrations(dbPath);
@@ -1020,12 +971,12 @@ async function runStudio(root, dialect, remote) {
1020
971
  return;
1021
972
  }
1022
973
  if (dialect !== "sqlite") {
1023
- const url = dialect === "mysql" ? getMySqlUrl(root) : getPgUrl(root);
974
+ const url = getLocalDatabaseUrl(root, dialect);
1024
975
  log.info("Opening Drizzle Studio...");
1025
976
  await runDrizzleKitWithDatabaseUrl(root, url, dialect, "studio");
1026
977
  return;
1027
978
  }
1028
- const { writeDrizzleConfig } = await import("./config-BtSFvXZx.mjs");
979
+ const { writeDrizzleConfig } = await import("./config-CNnrSMYm.mjs");
1029
980
  const { databasePath: dbPath } = getLocalD1Target(root);
1030
981
  if (!existsSync(dbPath)) {
1031
982
  log.error("No local database found. Run `void dev` first.");
@@ -1067,7 +1018,6 @@ async function runRenameMigrations(root, dialect) {
1067
1018
  return;
1068
1019
  }
1069
1020
  const timestampFiles = files.filter((f) => /^\d{14}_/.test(f));
1070
- const formatTs = formatTimestamp;
1071
1021
  let baseTime;
1072
1022
  if (timestampFiles.length > 0) {
1073
1023
  const earliest = timestampFiles[0].slice(0, 14);
@@ -1083,21 +1033,20 @@ async function runRenameMigrations(root, dialect) {
1083
1033
  for (let fileIndex = 0; fileIndex < oldStyleFiles.length; fileIndex++) {
1084
1034
  const oldName = oldStyleFiles[fileIndex];
1085
1035
  const description = oldName.replace(/^\d+_/, "");
1086
- const newName = `${formatTs(new Date(baseTime.getTime() + fileIndex * 1e3))}_${description}`;
1036
+ const ts = new Date(baseTime.getTime() + fileIndex * 1e3);
1037
+ const newName = `${formatTimestamp(ts)}_${description}`;
1087
1038
  renames.push({
1088
1039
  from: oldName,
1089
1040
  to: newName
1090
1041
  });
1091
1042
  }
1092
- const journalPath = join(migrationsDir, "meta", "_journal.json");
1093
- const originalJournalBytes = existsSync(journalPath) ? readFileSync(journalPath) : null;
1094
1043
  const metaDir = join(migrationsDir, "meta");
1044
+ const journalPath = join(metaDir, "_journal.json");
1045
+ const originalJournalBytes = existsSync(journalPath) ? readFileSync(journalPath) : null;
1046
+ const journal = readJournal(migrationsDir);
1095
1047
  const snapshotPrefix = (tag) => tag.split("_")[0];
1096
1048
  const snapshotPathFor = (tag) => join(metaDir, `${snapshotPrefix(tag)}_snapshot.json`);
1097
- const preRenameJournal = readJournal(migrationsDir);
1098
- const drizzleArtifacts = listDrizzleArtifacts(migrationsDir);
1099
- const isBareLegacyPlaceholder = preRenameJournal !== void 0 && preRenameJournal !== null && typeof preRenameJournal === "object" && Array.isArray(preRenameJournal.entries) && preRenameJournal.entries.length === 0 && drizzleArtifacts.length === 0;
1100
- if (originalJournalBytes !== null && !isBareLegacyPlaceholder) {
1049
+ if (journal && journal.entries.length > 0) {
1101
1050
  const missingSnapshots = [];
1102
1051
  for (const { from } of renames) {
1103
1052
  const fromTag = stripSqlExt(from);
@@ -1127,9 +1076,26 @@ async function runRenameMigrations(root, dialect) {
1127
1076
  log.error(String(err));
1128
1077
  process.exit(1);
1129
1078
  }
1130
- const reverseRemote = async () => {
1131
- if (!remoteRenamed || !token || !config) return;
1132
- try {
1079
+ let journalRewritten = false;
1080
+ const renamed = [];
1081
+ const renamedSnapshots = [];
1082
+ const rollback = async (message, err) => {
1083
+ for (const { from, to } of renamedSnapshots) try {
1084
+ renameSync(to, from);
1085
+ } catch (error) {
1086
+ log.warn(`db: Could not reverse snapshot rename for '${from}'. The meta/ directory may be in a partial state.`);
1087
+ log.warn(String(error));
1088
+ }
1089
+ for (const { from, to } of renamed) try {
1090
+ renameSync(join(migrationsDir, to), join(migrationsDir, from));
1091
+ } catch {}
1092
+ if (journalRewritten && originalJournalBytes !== null) try {
1093
+ writeFileSync(journalPath, originalJournalBytes);
1094
+ } catch (error) {
1095
+ log.warn("Could not restore db/migrations/meta/_journal.json after rollback. The journal may be in a partial state.\nRegenerate it with `void db generate`, or restore it from version control.");
1096
+ log.warn(String(error));
1097
+ }
1098
+ if (remoteRenamed && token && config) try {
1133
1099
  const client = new PlatformClient(token, { root });
1134
1100
  const reversed = renames.map(({ from, to }) => ({
1135
1101
  from: to,
@@ -1139,26 +1105,9 @@ async function runRenameMigrations(root, dialect) {
1139
1105
  } catch {
1140
1106
  log.warn("db: Could not reverse remote rename. Run `void deploy` to sync remote records.");
1141
1107
  }
1142
- };
1143
- let journalRewritten = false;
1144
- const restoreJournal = () => {
1145
- if (!journalRewritten || originalJournalBytes === null) return;
1146
- try {
1147
- writeFileSync(journalPath, originalJournalBytes);
1148
- } catch (err) {
1149
- log.warn("Could not restore db/migrations/meta/_journal.json after rollback. The journal may be in a partial state.\nRegenerate it with `void db generate`, or restore it from version control.");
1150
- log.warn(String(err));
1151
- }
1152
- };
1153
- const renamed = [];
1154
- const renamedSnapshots = [];
1155
- const reverseSnapshotRenames = () => {
1156
- for (const { from, to } of renamedSnapshots) try {
1157
- renameSync(to, from);
1158
- } catch (err) {
1159
- log.warn(`db: Could not reverse snapshot rename for '${from}'. The meta/ directory may be in a partial state.`);
1160
- log.warn(String(err));
1161
- }
1108
+ log.error(message);
1109
+ log.error(String(err));
1110
+ process.exit(1);
1162
1111
  };
1163
1112
  try {
1164
1113
  for (const { from, to } of renames) {
@@ -1168,10 +1117,8 @@ async function runRenameMigrations(root, dialect) {
1168
1117
  to
1169
1118
  });
1170
1119
  log.step(`${from} → ${to}`);
1171
- const fromTag = stripSqlExt(from);
1172
- const toTag = stripSqlExt(to);
1173
- const snapshotFrom = snapshotPathFor(fromTag);
1174
- const snapshotTo = snapshotPathFor(toTag);
1120
+ const snapshotFrom = snapshotPathFor(stripSqlExt(from));
1121
+ const snapshotTo = snapshotPathFor(stripSqlExt(to));
1175
1122
  if (existsSync(snapshotFrom)) {
1176
1123
  renameSync(snapshotFrom, snapshotTo);
1177
1124
  renamedSnapshots.push({
@@ -1181,22 +1128,14 @@ async function runRenameMigrations(root, dialect) {
1181
1128
  }
1182
1129
  }
1183
1130
  } catch (err) {
1184
- reverseSnapshotRenames();
1185
- for (const { from, to } of renamed) try {
1186
- renameSync(join(migrationsDir, to), join(migrationsDir, from));
1187
- } catch {}
1188
- restoreJournal();
1189
- await reverseRemote();
1190
- log.error("db: Failed to rename migration files. All changes have been reverted.");
1191
- log.error(String(err));
1192
- process.exit(1);
1131
+ await rollback("db: Failed to rename migration files. All changes have been reverted.", err);
1193
1132
  }
1194
- if (originalJournalBytes !== null) try {
1195
- const journal = readJournal(migrationsDir);
1196
- if (!journal) throw new Error("db: db/migrations/meta/_journal.json disappeared mid-run. File renames will be reverted.");
1133
+ if (journal) try {
1134
+ const current = readJournal(migrationsDir);
1135
+ if (!current) throw new Error("db: db/migrations/meta/_journal.json disappeared mid-run. File renames will be reverted.");
1197
1136
  const renameMap = /* @__PURE__ */ new Map();
1198
1137
  for (const { from, to } of renames) renameMap.set(stripSqlExt(from), stripSqlExt(to));
1199
- const updatedEntries = journal.entries.map((entry) => {
1138
+ const updatedEntries = current.entries.map((entry) => {
1200
1139
  const next = renameMap.get(entry.tag);
1201
1140
  return next ? {
1202
1141
  ...entry,
@@ -1205,20 +1144,12 @@ async function runRenameMigrations(root, dialect) {
1205
1144
  });
1206
1145
  journalRewritten = true;
1207
1146
  writeJournal(migrationsDir, {
1208
- version: journal.version,
1209
- dialect: journal.dialect,
1147
+ version: current.version,
1148
+ dialect: current.dialect,
1210
1149
  entries: updatedEntries
1211
1150
  });
1212
1151
  } catch (err) {
1213
- reverseSnapshotRenames();
1214
- for (const { from, to } of renames) try {
1215
- renameSync(join(migrationsDir, to), join(migrationsDir, from));
1216
- } catch {}
1217
- restoreJournal();
1218
- await reverseRemote();
1219
- log.error("db: Failed to update db/migrations/meta/_journal.json. File renames have been reverted.");
1220
- log.error(String(err));
1221
- process.exit(1);
1152
+ await rollback("db: Failed to update db/migrations/meta/_journal.json. File renames have been reverted.", err);
1222
1153
  }
1223
1154
  if (dialect === "postgresql") try {
1224
1155
  await withPgClient(root, async (client) => {
@@ -1233,15 +1164,7 @@ async function runRenameMigrations(root, dialect) {
1233
1164
  }
1234
1165
  });
1235
1166
  } catch (err) {
1236
- reverseSnapshotRenames();
1237
- for (const { from, to } of renames) try {
1238
- renameSync(join(migrationsDir, to), join(migrationsDir, from));
1239
- } catch {}
1240
- restoreJournal();
1241
- await reverseRemote();
1242
- log.error("db: Failed to update PostgreSQL tracking table. File renames have been reverted.\nFix the database connection and run `void db rename-migrations` again.");
1243
- log.error(String(err));
1244
- process.exit(1);
1167
+ await rollback("db: Failed to update PostgreSQL tracking table. File renames have been reverted.\nFix the database connection and run `void db rename-migrations` again.", err);
1245
1168
  }
1246
1169
  else if (dialect === "mysql") try {
1247
1170
  await withMySqlClient(root, async (client) => {
@@ -1249,18 +1172,10 @@ async function runRenameMigrations(root, dialect) {
1249
1172
  for (const { from, to } of renames) await client.query("UPDATE `_void_migrations` SET `name` = ? WHERE `name` = ?", [to, from]);
1250
1173
  });
1251
1174
  } catch (err) {
1252
- reverseSnapshotRenames();
1253
- for (const { from, to } of renames) try {
1254
- renameSync(join(migrationsDir, to), join(migrationsDir, from));
1255
- } catch {}
1256
- restoreJournal();
1257
- await reverseRemote();
1258
- log.error("db: Failed to update MySQL tracking table. File renames have been reverted.\nFix the database connection and run `void db rename-migrations` again.");
1259
- log.error(String(err));
1260
- process.exit(1);
1175
+ await rollback("db: Failed to update MySQL tracking table. File renames have been reverted.\nFix the database connection and run `void db rename-migrations` again.", err);
1261
1176
  }
1262
1177
  else {
1263
- const { openSqliteDatabase } = await import("./runner-9wjsSZx-.mjs");
1178
+ const { openSqliteDatabase } = await import("./runner-B5huK2eC.mjs");
1264
1179
  const { databasePath: dbPath } = getLocalD1Target(root);
1265
1180
  if (existsSync(dbPath)) try {
1266
1181
  const db = await openSqliteDatabase(dbPath);
@@ -1278,15 +1193,7 @@ async function runRenameMigrations(root, dialect) {
1278
1193
  db.close();
1279
1194
  }
1280
1195
  } catch (err) {
1281
- reverseSnapshotRenames();
1282
- for (const { from, to } of renames) try {
1283
- renameSync(join(migrationsDir, to), join(migrationsDir, from));
1284
- } catch {}
1285
- restoreJournal();
1286
- await reverseRemote();
1287
- log.error("db: Failed to update SQLite tracking table. File renames have been reverted.\nFix the database issue and run `void db rename-migrations` again.");
1288
- log.error(String(err));
1289
- process.exit(1);
1196
+ await rollback("db: Failed to update SQLite tracking table. File renames have been reverted.\nFix the database issue and run `void db rename-migrations` again.", err);
1290
1197
  }
1291
1198
  }
1292
1199
  printSuccess(`Renamed ${formatCount(renames.length, "migration")} to timestamp format.`);
@@ -1383,7 +1290,8 @@ async function runExport(root, args, dialect) {
1383
1290
  process.exit(1);
1384
1291
  }
1385
1292
  tables = [args.table];
1386
- } else tables = (await client.query("SELECT table_name FROM information_schema.tables WHERE table_schema = DATABASE() AND table_type = 'BASE TABLE' AND table_name NOT LIKE '\\_%' ORDER BY table_name")).map((row) => String(row.table_name));
1293
+ } else tables = (await client.query("SELECT table_name AS table_name FROM information_schema.tables WHERE table_schema = DATABASE() AND table_type = 'BASE TABLE' AND table_name NOT LIKE '\\_%' ORDER BY table_name")).map((row) => String(row.table_name));
1294
+ parts.push("SET FOREIGN_KEY_CHECKS = 0;");
1387
1295
  for (const table of tables) {
1388
1296
  const escapedTable = table.replaceAll("`", "``");
1389
1297
  if (!args.noSchema) {
@@ -1401,6 +1309,7 @@ async function runExport(root, args, dialect) {
1401
1309
  }
1402
1310
  parts.push("");
1403
1311
  }
1312
+ parts.push("SET FOREIGN_KEY_CHECKS = 1;", "");
1404
1313
  });
1405
1314
  const output = parts.join("\n");
1406
1315
  if (args.output) {
@@ -1409,7 +1318,7 @@ async function runExport(root, args, dialect) {
1409
1318
  } else process.stdout.write(output);
1410
1319
  return;
1411
1320
  }
1412
- const { openSqliteDatabase } = await import("./runner-9wjsSZx-.mjs");
1321
+ const { openSqliteDatabase } = await import("./runner-B5huK2eC.mjs");
1413
1322
  const { databasePath: dbPath } = getLocalD1Target(root);
1414
1323
  if (!existsSync(dbPath)) {
1415
1324
  log.error("No local database found. Run `void dev` first.", errOut);
@@ -1473,9 +1382,7 @@ async function runExport(root, args, dialect) {
1473
1382
  db.close();
1474
1383
  }
1475
1384
  }
1476
- async function runSetUrl(root) {
1477
- const { readConfig: readVoidConfig, getDatabaseDialect: getDialect } = await import("./config-5r-YpMC-.mjs");
1478
- const dialect = getDialect(readVoidConfig(root));
1385
+ async function runSetUrl(root, dialect) {
1479
1386
  if (dialect === "sqlite") {
1480
1387
  log.error("db: This command is only for PostgreSQL and MySQL projects. Set \"database\" to \"pg\" or \"mysql\" in void.config.ts.");
1481
1388
  process.exit(1);
@@ -1490,8 +1397,7 @@ async function runSetUrl(root) {
1490
1397
  log.error("No project linked. Run `void deploy` first or link a project.");
1491
1398
  process.exit(1);
1492
1399
  }
1493
- const { text: promptText, isCancel: isCancelCheck } = await import("./dist-Bx1z6Eva.mjs");
1494
- const connectionString = await promptText({
1400
+ const connectionString = await text({
1495
1401
  message: `Enter your ${dialect === "mysql" ? "MySQL" : "PostgreSQL"} connection string:`,
1496
1402
  placeholder: dialect === "mysql" ? "mysql://user:pass@host:3306/dbname" : "postgresql://user:pass@host:5432/dbname",
1497
1403
  validate(value = "") {
@@ -1500,7 +1406,7 @@ async function runSetUrl(root) {
1500
1406
  } else if (!value.startsWith("postgres://") && !value.startsWith("postgresql://")) return "Connection string must start with \"postgres://\" or \"postgresql://\"";
1501
1407
  }
1502
1408
  });
1503
- if (isCancelCheck(connectionString)) process.exit(0);
1409
+ if (isCancel(connectionString)) process.exit(0);
1504
1410
  await new PlatformClient(token, { root }).setDatabaseUrl(projectConfig.projectId, connectionString);
1505
1411
  printSuccess("Database URL updated.");
1506
1412
  }
@@ -1559,7 +1465,7 @@ async function runSeedModule(root, seedPath, dialect) {
1559
1465
  if (dialect === "mysql") {
1560
1466
  const { drizzle } = await import("drizzle-orm/mysql2");
1561
1467
  const { createConnection } = await import("mysql2/promise");
1562
- const connection = await createConnection(getMySqlUrl(root));
1468
+ const connection = await createConnection(getLocalDatabaseUrl(root, "mysql"));
1563
1469
  try {
1564
1470
  const options = getDrizzleSchemaOptions(schema);
1565
1471
  await seed({
@@ -1576,7 +1482,7 @@ async function runSeedModule(root, seedPath, dialect) {
1576
1482
  return;
1577
1483
  }
1578
1484
  const { drizzle } = await import("drizzle-orm/better-sqlite3");
1579
- const { openSqliteDatabase } = await import("./runner-9wjsSZx-.mjs");
1485
+ const { openSqliteDatabase } = await import("./runner-B5huK2eC.mjs");
1580
1486
  const { databasePath: dbPath } = getLocalD1Target(root);
1581
1487
  const sqlite = await openSqliteDatabase(dbPath);
1582
1488
  try {
@@ -1597,7 +1503,7 @@ async function loadSeedFunction(seedPath) {
1597
1503
  return seed;
1598
1504
  }
1599
1505
  async function loadSeedSchema(root) {
1600
- const { discoverSchema } = await import("./discover-EDUf6JJw.mjs");
1506
+ const { discoverSchema } = await import("./discover-CTUiSsfG.mjs");
1601
1507
  const location = discoverSchema(root, readProjectPaths(root));
1602
1508
  if (!location) return {};
1603
1509
  if (location.type === "file") {
@@ -1621,7 +1527,11 @@ function collectSchemaModuleFiles(dir) {
1621
1527
  return files.sort();
1622
1528
  }
1623
1529
  async function importLocalModule(modulePath) {
1624
- return import(`${pathToFileURL(modulePath).href}?t=${Date.now()}`);
1530
+ return createJiti(import.meta.url, {
1531
+ fsCache: false,
1532
+ moduleCache: false,
1533
+ interopDefault: false
1534
+ }).import(modulePath);
1625
1535
  }
1626
1536
  function getDrizzleSchemaOptions(schema) {
1627
1537
  return Object.keys(schema).length > 0 ? { schema } : void 0;