d1s 0.2.10 → 0.2.12

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 (329) hide show
  1. package/dist/.next/.next/BUILD_ID +1 -1
  2. package/dist/.next/.next/app-build-manifest.json +33 -33
  3. package/dist/.next/.next/app-path-routes-manifest.json +1 -1
  4. package/dist/.next/.next/build-manifest.json +3 -3
  5. package/dist/.next/.next/cache/.rscinfo +1 -1
  6. package/dist/.next/.next/cache/.tsbuildinfo +1 -1
  7. package/dist/.next/.next/cache/webpack/client-production/0.pack +0 -0
  8. package/dist/.next/.next/cache/webpack/client-production/1.pack +0 -0
  9. package/dist/.next/.next/cache/webpack/client-production/10.pack +0 -0
  10. package/dist/.next/.next/cache/webpack/client-production/11.pack +0 -0
  11. package/dist/.next/.next/cache/webpack/client-production/12.pack +0 -0
  12. package/dist/.next/.next/cache/webpack/client-production/2.pack +0 -0
  13. package/dist/.next/.next/cache/webpack/client-production/3.pack +0 -0
  14. package/dist/.next/.next/cache/webpack/client-production/4.pack +0 -0
  15. package/dist/.next/.next/cache/webpack/client-production/5.pack +0 -0
  16. package/dist/.next/.next/cache/webpack/client-production/6.pack +0 -0
  17. package/dist/.next/.next/cache/webpack/client-production/7.pack +0 -0
  18. package/dist/.next/.next/cache/webpack/client-production/8.pack +0 -0
  19. package/dist/.next/.next/cache/webpack/client-production/9.pack +0 -0
  20. package/dist/.next/.next/cache/webpack/client-production/index.pack +0 -0
  21. package/dist/.next/.next/cache/webpack/client-production/index.pack.old +0 -0
  22. package/dist/.next/.next/cache/webpack/edge-server-production/index.pack +0 -0
  23. package/dist/.next/.next/cache/webpack/server-production/0.pack +0 -0
  24. package/dist/.next/.next/cache/webpack/server-production/1.pack +0 -0
  25. package/dist/.next/.next/cache/webpack/server-production/index.pack +0 -0
  26. package/dist/.next/.next/cache/webpack/server-production/index.pack.old +0 -0
  27. package/dist/.next/.next/next-minimal-server.js.nft.json +1 -1
  28. package/dist/.next/.next/next-server.js.nft.json +1 -1
  29. package/dist/.next/.next/prerender-manifest.json +1 -1
  30. package/dist/.next/.next/required-server-files.json +1 -1
  31. package/dist/.next/.next/server/app/_not-found/page.js +1 -1
  32. package/dist/.next/.next/server/app/_not-found/page.js.nft.json +1 -1
  33. package/dist/.next/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  34. package/dist/.next/.next/server/app/_not-found.html +1 -1
  35. package/dist/.next/.next/server/app/_not-found.rsc +4 -4
  36. package/dist/.next/.next/server/app/api/cloudflare/route.js +1 -1
  37. package/dist/.next/.next/server/app/api/cloudflare/route_client-reference-manifest.js +1 -1
  38. package/dist/.next/.next/server/app/api/databases/route.js +1 -1
  39. package/dist/.next/.next/server/app/api/databases/route_client-reference-manifest.js +1 -1
  40. package/dist/.next/.next/server/app/api/migrations/sync/route.js +5 -5
  41. package/dist/.next/.next/server/app/api/migrations/sync/route_client-reference-manifest.js +1 -1
  42. package/dist/.next/.next/server/app/api/migrations/sync-files/route.js +3 -3
  43. package/dist/.next/.next/server/app/api/migrations/sync-files/route_client-reference-manifest.js +1 -1
  44. package/dist/.next/.next/server/app/api/pull-data/confirm/route.js +1 -1
  45. package/dist/.next/.next/server/app/api/pull-data/confirm/route_client-reference-manifest.js +1 -1
  46. package/dist/.next/.next/server/app/api/pull-remote/confirm/route.js +2 -2
  47. package/dist/.next/.next/server/app/api/pull-remote/confirm/route_client-reference-manifest.js +1 -1
  48. package/dist/.next/.next/server/app/api/pull-remote/preview/route.js +4 -4
  49. package/dist/.next/.next/server/app/api/pull-remote/preview/route_client-reference-manifest.js +1 -1
  50. package/dist/.next/.next/server/app/api/push-remote/confirm/route.js +5 -5
  51. package/dist/.next/.next/server/app/api/push-remote/confirm/route_client-reference-manifest.js +1 -1
  52. package/dist/.next/.next/server/app/api/push-remote/preview/route.js +4 -4
  53. package/dist/.next/.next/server/app/api/push-remote/preview/route_client-reference-manifest.js +1 -1
  54. package/dist/.next/.next/server/app/api/query/route.js +3 -3
  55. package/dist/.next/.next/server/app/api/query/route_client-reference-manifest.js +1 -1
  56. package/dist/.next/.next/server/app/api/tables/[name]/route.js +5 -5
  57. package/dist/.next/.next/server/app/api/tables/[name]/route_client-reference-manifest.js +1 -1
  58. package/dist/.next/.next/server/app/api/tables/route.js +2 -2
  59. package/dist/.next/.next/server/app/api/tables/route_client-reference-manifest.js +1 -1
  60. package/dist/.next/.next/server/app/api/update/route.js +1 -1
  61. package/dist/.next/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
  62. package/dist/.next/.next/server/app/index.html +3 -3
  63. package/dist/.next/.next/server/app/index.rsc +5 -5
  64. package/dist/.next/.next/server/app/page.js +11 -13
  65. package/dist/.next/.next/server/app/page.js.nft.json +1 -1
  66. package/dist/.next/.next/server/app/page_client-reference-manifest.js +1 -1
  67. package/dist/.next/.next/server/app-paths-manifest.json +3 -3
  68. package/dist/.next/.next/server/chunks/226.js +12 -12
  69. package/dist/.next/.next/server/chunks/391.js +5 -5
  70. package/dist/.next/.next/server/chunks/452.js +1 -1
  71. package/dist/.next/.next/server/chunks/572.js +1 -0
  72. package/dist/.next/.next/server/chunks/627.js +3 -3
  73. package/dist/.next/.next/server/chunks/638.js +3 -3
  74. package/dist/.next/.next/server/chunks/992.js +3 -3
  75. package/dist/.next/.next/server/middleware-build-manifest.js +1 -1
  76. package/dist/.next/.next/server/next-font-manifest.js +1 -1
  77. package/dist/.next/.next/server/next-font-manifest.json +1 -1
  78. package/dist/.next/.next/server/pages/404.html +1 -1
  79. package/dist/.next/.next/server/pages/500.html +1 -1
  80. package/dist/.next/.next/server/pages/_app.js +1 -1
  81. package/dist/.next/.next/server/pages/_document.js +1 -1
  82. package/dist/.next/.next/server/pages/_error.js +1 -1
  83. package/dist/.next/.next/server/server-reference-manifest.json +1 -1
  84. package/dist/.next/.next/static/chunks/576-18a2209e1ed26aad.js +1 -0
  85. package/dist/.next/.next/static/chunks/{92-c4466e0f1ca8a3a8.js → 92-5f7522943fcb72a8.js} +1 -1
  86. package/dist/.next/.next/static/chunks/app/{layout-be6ee67cf0c92654.js → layout-40ec07d04681ba81.js} +1 -1
  87. package/dist/.next/.next/static/chunks/app/page-f05cd0fc436bf9bc.js +1 -0
  88. package/dist/.next/.next/static/chunks/{main-app-fa35024de9bd9284.js → main-app-4506e88db72db4b7.js} +1 -1
  89. package/dist/.next/.next/static/css/7c16f57d325d0d7d.css +3 -0
  90. package/dist/.next/.next/static/gABGrAoO8IPArDo_Ns_7g/_buildManifest.js +1 -0
  91. package/dist/.next/.next/static/gABGrAoO8IPArDo_Ns_7g/_ssgManifest.js +1 -0
  92. package/dist/.next/.next/static/gh-QfIUVo4FTTduYCVKT6/_buildManifest.js +1 -0
  93. package/dist/.next/.next/static/gh-QfIUVo4FTTduYCVKT6/_ssgManifest.js +1 -0
  94. package/dist/.next/.next/static/media/8d697b304b401681-s.woff2 +0 -0
  95. package/dist/.next/.next/static/media/9610d9e46709d722-s.woff2 +0 -0
  96. package/dist/.next/.next/static/ybCx6L6gHqtODbKmlhU-d/_buildManifest.js +1 -0
  97. package/dist/.next/.next/static/ybCx6L6gHqtODbKmlhU-d/_ssgManifest.js +1 -0
  98. package/dist/.next/.next/trace +3 -3
  99. package/dist/.next/.next/types/app/api/cloudflare/route.ts +1 -1
  100. package/dist/.next/.next/types/app/api/databases/route.ts +1 -1
  101. package/dist/.next/.next/types/app/api/migrations/sync/route.ts +1 -1
  102. package/dist/.next/.next/types/app/api/migrations/sync-files/route.ts +1 -1
  103. package/dist/.next/.next/types/app/api/pull-data/confirm/route.ts +1 -1
  104. package/dist/.next/.next/types/app/api/pull-remote/confirm/route.ts +1 -1
  105. package/dist/.next/.next/types/app/api/pull-remote/preview/route.ts +1 -1
  106. package/dist/.next/.next/types/app/api/push-remote/confirm/route.ts +1 -1
  107. package/dist/.next/.next/types/app/api/push-remote/preview/route.ts +1 -1
  108. package/dist/.next/.next/types/app/api/query/route.ts +1 -1
  109. package/dist/.next/.next/types/app/api/tables/[name]/route.ts +1 -1
  110. package/dist/.next/.next/types/app/api/tables/route.ts +1 -1
  111. package/dist/.next/.next/types/app/api/update/route.ts +1 -1
  112. package/dist/.next/.next/types/app/page.ts +1 -1
  113. package/dist/.next/BUILD_ID +1 -1
  114. package/dist/.next/app-build-manifest.json +32 -32
  115. package/dist/.next/app-path-routes-manifest.json +1 -1
  116. package/dist/.next/build-manifest.json +3 -3
  117. package/dist/.next/cache/.rscinfo +1 -1
  118. package/dist/.next/cache/.tsbuildinfo +1 -1
  119. package/dist/.next/cache/webpack/client-production/0.pack +0 -0
  120. package/dist/.next/cache/webpack/client-production/1.pack +0 -0
  121. package/dist/.next/cache/webpack/client-production/2.pack +0 -0
  122. package/dist/.next/cache/webpack/client-production/index.pack +0 -0
  123. package/dist/.next/cache/webpack/client-production/index.pack.old +0 -0
  124. package/dist/.next/cache/webpack/edge-server-production/index.pack +0 -0
  125. package/dist/.next/cache/webpack/server-production/0.pack +0 -0
  126. package/dist/.next/cache/webpack/server-production/index.pack +0 -0
  127. package/dist/.next/next-minimal-server.js.nft.json +1 -1
  128. package/dist/.next/next-server.js.nft.json +1 -1
  129. package/dist/.next/prerender-manifest.json +1 -1
  130. package/dist/.next/required-server-files.json +1 -1
  131. package/dist/.next/server/app/_not-found/page.js +1 -1
  132. package/dist/.next/server/app/_not-found/page.js.nft.json +1 -1
  133. package/dist/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  134. package/dist/.next/server/app/_not-found.html +1 -1
  135. package/dist/.next/server/app/_not-found.rsc +4 -4
  136. package/dist/.next/server/app/api/cloudflare/route.js +1 -1
  137. package/dist/.next/server/app/api/cloudflare/route_client-reference-manifest.js +1 -1
  138. package/dist/.next/server/app/api/databases/route.js +1 -1
  139. package/dist/.next/server/app/api/databases/route_client-reference-manifest.js +1 -1
  140. package/dist/.next/server/app/api/migrations/sync/route.js +5 -5
  141. package/dist/.next/server/app/api/migrations/sync/route_client-reference-manifest.js +1 -1
  142. package/dist/.next/server/app/api/migrations/sync-files/route.js +3 -3
  143. package/dist/.next/server/app/api/migrations/sync-files/route_client-reference-manifest.js +1 -1
  144. package/dist/.next/server/app/api/pull-data/confirm/route.js +1 -1
  145. package/dist/.next/server/app/api/pull-data/confirm/route_client-reference-manifest.js +1 -1
  146. package/dist/.next/server/app/api/pull-remote/confirm/route.js +2 -2
  147. package/dist/.next/server/app/api/pull-remote/confirm/route_client-reference-manifest.js +1 -1
  148. package/dist/.next/server/app/api/pull-remote/preview/route.js +4 -4
  149. package/dist/.next/server/app/api/pull-remote/preview/route_client-reference-manifest.js +1 -1
  150. package/dist/.next/server/app/api/push-remote/confirm/route.js +5 -5
  151. package/dist/.next/server/app/api/push-remote/confirm/route_client-reference-manifest.js +1 -1
  152. package/dist/.next/server/app/api/push-remote/preview/route.js +4 -4
  153. package/dist/.next/server/app/api/push-remote/preview/route_client-reference-manifest.js +1 -1
  154. package/dist/.next/server/app/api/query/route.js +3 -3
  155. package/dist/.next/server/app/api/query/route_client-reference-manifest.js +1 -1
  156. package/dist/.next/server/app/api/tables/[name]/route.js +5 -5
  157. package/dist/.next/server/app/api/tables/[name]/route_client-reference-manifest.js +1 -1
  158. package/dist/.next/server/app/api/tables/route.js +2 -2
  159. package/dist/.next/server/app/api/tables/route_client-reference-manifest.js +1 -1
  160. package/dist/.next/server/app/api/update/route.js +1 -1
  161. package/dist/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
  162. package/dist/.next/server/app/index.html +3 -3
  163. package/dist/.next/server/app/index.rsc +5 -5
  164. package/dist/.next/server/app/page.js +11 -13
  165. package/dist/.next/server/app/page.js.nft.json +1 -1
  166. package/dist/.next/server/app/page_client-reference-manifest.js +1 -1
  167. package/dist/.next/server/app-paths-manifest.json +2 -2
  168. package/dist/.next/server/chunks/226.js +12 -12
  169. package/dist/.next/server/chunks/391.js +5 -5
  170. package/dist/.next/server/chunks/452.js +1 -1
  171. package/dist/.next/server/chunks/572.js +1 -0
  172. package/dist/.next/server/chunks/627.js +3 -3
  173. package/dist/.next/server/chunks/638.js +3 -3
  174. package/dist/.next/server/chunks/992.js +3 -3
  175. package/dist/.next/server/middleware-build-manifest.js +1 -1
  176. package/dist/.next/server/next-font-manifest.js +1 -1
  177. package/dist/.next/server/next-font-manifest.json +1 -1
  178. package/dist/.next/server/pages/404.html +1 -1
  179. package/dist/.next/server/pages/500.html +1 -1
  180. package/dist/.next/server/pages/_app.js +1 -1
  181. package/dist/.next/server/pages/_document.js +1 -1
  182. package/dist/.next/server/pages/_error.js +1 -1
  183. package/dist/.next/server/server-reference-manifest.json +1 -1
  184. package/dist/.next/static/IX-QLbm7scYnyqWeeimal/_buildManifest.js +1 -0
  185. package/dist/.next/static/IX-QLbm7scYnyqWeeimal/_ssgManifest.js +1 -0
  186. package/dist/.next/static/chunks/576-18a2209e1ed26aad.js +1 -0
  187. package/dist/.next/static/chunks/{92-c4466e0f1ca8a3a8.js → 92-5f7522943fcb72a8.js} +1 -1
  188. package/dist/.next/static/chunks/app/{layout-be6ee67cf0c92654.js → layout-40ec07d04681ba81.js} +1 -1
  189. package/dist/.next/static/chunks/app/page-f05cd0fc436bf9bc.js +1 -0
  190. package/dist/.next/static/chunks/{main-app-fa35024de9bd9284.js → main-app-4506e88db72db4b7.js} +1 -1
  191. package/dist/.next/static/css/7c16f57d325d0d7d.css +3 -0
  192. package/dist/.next/static/media/8d697b304b401681-s.woff2 +0 -0
  193. package/dist/.next/static/media/9610d9e46709d722-s.woff2 +0 -0
  194. package/dist/.next/trace +3 -16
  195. package/dist/.next/types/app/api/cloudflare/route.ts +1 -1
  196. package/dist/.next/types/app/api/databases/route.ts +1 -1
  197. package/dist/.next/types/app/api/migrations/sync/route.ts +1 -1
  198. package/dist/.next/types/app/api/migrations/sync-files/route.ts +1 -1
  199. package/dist/.next/types/app/api/pull-data/confirm/route.ts +1 -1
  200. package/dist/.next/types/app/api/pull-remote/confirm/route.ts +1 -1
  201. package/dist/.next/types/app/api/pull-remote/preview/route.ts +1 -1
  202. package/dist/.next/types/app/api/push-remote/confirm/route.ts +1 -1
  203. package/dist/.next/types/app/api/push-remote/preview/route.ts +1 -1
  204. package/dist/.next/types/app/api/query/route.ts +1 -1
  205. package/dist/.next/types/app/api/tables/[name]/route.ts +1 -1
  206. package/dist/.next/types/app/api/tables/route.ts +1 -1
  207. package/dist/.next/types/app/api/update/route.ts +1 -1
  208. package/dist/.next/types/app/page.ts +1 -1
  209. package/dist/app/api/tables/[name]/route.js +22 -10
  210. package/dist/app/globals.css +39 -0
  211. package/dist/app/page.jsx +13 -23
  212. package/dist/d1-studio.js +34 -4
  213. package/dist/lib/data-type-handlers.js +426 -0
  214. package/dist/lib/sql-operations.js +32 -8
  215. package/dist/lib/sql-sanitizer.js +233 -0
  216. package/package.json +3 -9
  217. package/dist/.next/.next/cache/webpack/server-production/2.pack +0 -0
  218. package/dist/.next/.next/server/chunks/90.js +0 -1
  219. package/dist/.next/.next/static/chunks/700-dc8f9f08b166c5e6.js +0 -1
  220. package/dist/.next/.next/static/chunks/app/page-16ec561fc8bebb5d.js +0 -1
  221. package/dist/.next/.next/static/css/0c512cea5f3d317a.css +0 -3
  222. package/dist/.next/server/chunks/90.js +0 -1
  223. package/dist/.next/static/chunks/700-dc8f9f08b166c5e6.js +0 -1
  224. package/dist/.next/static/chunks/app/page-16ec561fc8bebb5d.js +0 -1
  225. package/dist/.next/static/css/0c512cea5f3d317a.css +0 -3
  226. package/dist/app/app/api/cloudflare/route.js +0 -150
  227. package/dist/app/app/api/databases/route.js +0 -71
  228. package/dist/app/app/api/migrations/sync/route.js +0 -174
  229. package/dist/app/app/api/migrations/sync-files/route.js +0 -172
  230. package/dist/app/app/api/pull-data/confirm/route.js +0 -230
  231. package/dist/app/app/api/pull-remote/confirm/route.js +0 -278
  232. package/dist/app/app/api/pull-remote/preview/route.js +0 -144
  233. package/dist/app/app/api/push-remote/confirm/route.js +0 -196
  234. package/dist/app/app/api/push-remote/preview/route.js +0 -179
  235. package/dist/app/app/api/query/route.js +0 -168
  236. package/dist/app/app/api/tables/[name]/route.js +0 -174
  237. package/dist/app/app/api/tables/route.js +0 -178
  238. package/dist/app/app/api/update/route.js +0 -45
  239. package/dist/app/app/globals.css +0 -93
  240. package/dist/app/app/layout.jsx +0 -35
  241. package/dist/app/app/page.jsx +0 -44
  242. package/next.config.mjs +0 -18
  243. package/postcss.config.mjs +0 -8
  244. package/scripts/studio.js +0 -169
  245. package/scripts/test.js +0 -366
  246. package/src/app/api/cloudflare/route.js +0 -150
  247. package/src/app/api/databases/route.js +0 -71
  248. package/src/app/api/migrations/sync/route.js +0 -174
  249. package/src/app/api/migrations/sync-files/route.js +0 -172
  250. package/src/app/api/pull-data/confirm/route.js +0 -230
  251. package/src/app/api/pull-remote/confirm/route.js +0 -278
  252. package/src/app/api/pull-remote/preview/route.js +0 -144
  253. package/src/app/api/push-remote/confirm/route.js +0 -196
  254. package/src/app/api/push-remote/preview/route.js +0 -179
  255. package/src/app/api/query/route.js +0 -168
  256. package/src/app/api/tables/[name]/route.js +0 -174
  257. package/src/app/api/tables/route.js +0 -178
  258. package/src/app/api/update/route.js +0 -45
  259. package/src/app/globals.css +0 -93
  260. package/src/app/layout.jsx +0 -35
  261. package/src/app/page.jsx +0 -44
  262. package/src/components/cloudflare-credentials-modal.jsx +0 -94
  263. package/src/components/column-selector.jsx +0 -133
  264. package/src/components/column-sorting.jsx +0 -65
  265. package/src/components/delete-records-dialog.jsx +0 -64
  266. package/src/components/download-button.jsx +0 -205
  267. package/src/components/edit-error-alert.jsx +0 -30
  268. package/src/components/editable-cell.jsx +0 -163
  269. package/src/components/editable-row.jsx +0 -169
  270. package/src/components/environment-handler.jsx +0 -332
  271. package/src/components/environment-select.jsx +0 -62
  272. package/src/components/pull-preview-toast.jsx +0 -215
  273. package/src/components/push-error-alert.jsx +0 -72
  274. package/src/components/push-preview-toast.jsx +0 -183
  275. package/src/components/query-results.jsx +0 -112
  276. package/src/components/refresh-button.jsx +0 -61
  277. package/src/components/resize-columns.jsx +0 -101
  278. package/src/components/sidebar.jsx +0 -254
  279. package/src/components/sql-editor.jsx +0 -411
  280. package/src/components/sql-error-display.jsx +0 -167
  281. package/src/components/sync-migrations-button.jsx +0 -87
  282. package/src/components/table-error-dialog.jsx +0 -65
  283. package/src/components/table-toolbar.jsx +0 -285
  284. package/src/components/table-view.jsx +0 -843
  285. package/src/components/ui/alert.jsx +0 -47
  286. package/src/components/ui/button.jsx +0 -48
  287. package/src/components/ui/card.jsx +0 -50
  288. package/src/components/ui/checkbox.jsx +0 -24
  289. package/src/components/ui/collapsible.jsx +0 -11
  290. package/src/components/ui/dialog.jsx +0 -96
  291. package/src/components/ui/dropdown-menu.jsx +0 -158
  292. package/src/components/ui/input.jsx +0 -19
  293. package/src/components/ui/scroll-area.jsx +0 -40
  294. package/src/components/ui/select.jsx +0 -121
  295. package/src/components/ui/separator.jsx +0 -25
  296. package/src/components/ui/sheet.jsx +0 -109
  297. package/src/components/ui/sidebar.jsx +0 -620
  298. package/src/components/ui/skeleton.jsx +0 -14
  299. package/src/components/ui/table.jsx +0 -86
  300. package/src/components/ui/tabs.jsx +0 -43
  301. package/src/components/ui/toast.jsx +0 -86
  302. package/src/components/ui/toaster.jsx +0 -35
  303. package/src/components/ui/tooltip.jsx +0 -28
  304. package/src/components/update-banner.jsx +0 -93
  305. package/src/context/database-context.js +0 -510
  306. package/src/hooks/use-mobile.jsx +0 -19
  307. package/src/hooks/use-sql-error.ts +0 -23
  308. package/src/hooks/use-toast.js +0 -155
  309. package/src/lib/database-queue.js +0 -37
  310. package/src/lib/error.js +0 -20
  311. package/src/lib/find-wrangler-config.js +0 -74
  312. package/src/lib/license.js +0 -99
  313. package/src/lib/logger.js +0 -58
  314. package/src/lib/migrations.js +0 -415
  315. package/src/lib/parse-sql-error.js +0 -200
  316. package/src/lib/request-deduplication.js +0 -24
  317. package/src/lib/schema-operations.js +0 -106
  318. package/src/lib/sql-error-types.js +0 -14
  319. package/src/lib/sql-operations.js +0 -647
  320. package/src/lib/utils.js +0 -6
  321. package/src/lib/version-utils.js +0 -34
  322. /package/dist/.next/.next/static/{5dBGGUmK5q7of4h5Rahrg → Y9mYu4WBghepP5oT_3OdR}/_buildManifest.js +0 -0
  323. /package/dist/.next/.next/static/{5dBGGUmK5q7of4h5Rahrg → Y9mYu4WBghepP5oT_3OdR}/_ssgManifest.js +0 -0
  324. /package/dist/.next/.next/static/{PflNFnmFsNegSqhzjI6lA → ae3gNmoSGm-R5LJC4UagI}/_buildManifest.js +0 -0
  325. /package/dist/.next/.next/static/{PflNFnmFsNegSqhzjI6lA → ae3gNmoSGm-R5LJC4UagI}/_ssgManifest.js +0 -0
  326. /package/dist/.next/.next/static/{p8875OZM4iDNsPzmoyLe7 → bKfUJeuvAQlBmR3TjrfkH}/_buildManifest.js +0 -0
  327. /package/dist/.next/.next/static/{p8875OZM4iDNsPzmoyLe7 → bKfUJeuvAQlBmR3TjrfkH}/_ssgManifest.js +0 -0
  328. /package/dist/.next/{static 2/5dBGGUmK5q7of4h5Rahrg → .next/static/ejYPqJ2kVicVp5EFWOZIC}/_buildManifest.js +0 -0
  329. /package/dist/.next/{static 2/5dBGGUmK5q7of4h5Rahrg → .next/static/ejYPqJ2kVicVp5EFWOZIC}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- {"version":1,"files":["../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../node_modules/next/dist/server/app-render/action-async-storage-instance.js","../../../node_modules/next/dist/server/app-render/action-async-storage.external.js","../../../node_modules/next/dist/server/app-render/after-task-async-storage-instance.js","../../../node_modules/next/dist/server/app-render/after-task-async-storage.external.js","../../../node_modules/next/dist/server/app-render/async-local-storage.js","../../../node_modules/next/dist/server/app-render/clean-async-snapshot-instance.js","../../../node_modules/next/dist/server/app-render/clean-async-snapshot.external.js","../../../node_modules/next/dist/server/app-render/work-async-storage-instance.js","../../../node_modules/next/dist/server/app-render/work-async-storage.external.js","../../../node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js","../../../node_modules/next/dist/server/app-render/work-unit-async-storage.external.js","../../../node_modules/next/dist/server/lib/trace/constants.js","../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../node_modules/next/dist/shared/lib/is-thenable.js","../../../node_modules/next/package.json","../../package.json","../chunks/638.js","../chunks/90.js","../chunks/992.js","../webpack-runtime.js","page_client-reference-manifest.js"]}
1
+ {"version":1,"files":["../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../node_modules/next/dist/server/app-render/action-async-storage-instance.js","../../../node_modules/next/dist/server/app-render/action-async-storage.external.js","../../../node_modules/next/dist/server/app-render/after-task-async-storage-instance.js","../../../node_modules/next/dist/server/app-render/after-task-async-storage.external.js","../../../node_modules/next/dist/server/app-render/async-local-storage.js","../../../node_modules/next/dist/server/app-render/clean-async-snapshot-instance.js","../../../node_modules/next/dist/server/app-render/clean-async-snapshot.external.js","../../../node_modules/next/dist/server/app-render/work-async-storage-instance.js","../../../node_modules/next/dist/server/app-render/work-async-storage.external.js","../../../node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js","../../../node_modules/next/dist/server/app-render/work-unit-async-storage.external.js","../../../node_modules/next/dist/server/lib/trace/constants.js","../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../node_modules/next/dist/shared/lib/is-thenable.js","../../../node_modules/next/package.json","../../package.json","../chunks/572.js","../chunks/638.js","../chunks/992.js","../webpack-runtime.js","page_client-reference-manifest.js"]}
@@ -1 +1 @@
1
- globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/page"]={"moduleLoading":{"prefix":"/_next/","crossOrigin":null},"ssrModuleMapping":{"33":{"*":{"id":"2899","name":"*","chunks":[],"async":false}},"2328":{"*":{"id":"57174","name":"*","chunks":[],"async":false}},"3866":{"*":{"id":"87190","name":"*","chunks":[],"async":false}},"4547":{"*":{"id":"33875","name":"*","chunks":[],"async":false}},"4835":{"*":{"id":"88903","name":"*","chunks":[],"async":false}},"5244":{"*":{"id":"84178","name":"*","chunks":[],"async":false}},"5612":{"*":{"id":"53545","name":"*","chunks":[],"async":false}},"6124":{"*":{"id":"52652","name":"*","chunks":[],"async":false}},"6213":{"*":{"id":"61365","name":"*","chunks":[],"async":false}},"7033":{"*":{"id":"66959","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/Users/kona/Desktop/d1studio/node_modules/next/dist/client/components/client-page.js":{"id":7033,"name":"*","chunks":[],"async":false},"/Users/kona/Desktop/d1studio/node_modules/next/dist/esm/client/components/client-page.js":{"id":7033,"name":"*","chunks":[],"async":false},"/Users/kona/Desktop/d1studio/node_modules/next/dist/client/components/client-segment.js":{"id":4547,"name":"*","chunks":[],"async":false},"/Users/kona/Desktop/d1studio/node_modules/next/dist/esm/client/components/client-segment.js":{"id":4547,"name":"*","chunks":[],"async":false},"/Users/kona/Desktop/d1studio/node_modules/next/dist/client/components/error-boundary.js":{"id":4835,"name":"*","chunks":[],"async":false},"/Users/kona/Desktop/d1studio/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":4835,"name":"*","chunks":[],"async":false},"/Users/kona/Desktop/d1studio/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":2328,"name":"*","chunks":[],"async":false},"/Users/kona/Desktop/d1studio/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":2328,"name":"*","chunks":[],"async":false},"/Users/kona/Desktop/d1studio/node_modules/next/dist/client/components/layout-router.js":{"id":5244,"name":"*","chunks":[],"async":false},"/Users/kona/Desktop/d1studio/node_modules/next/dist/esm/client/components/layout-router.js":{"id":5244,"name":"*","chunks":[],"async":false},"/Users/kona/Desktop/d1studio/node_modules/next/dist/client/components/render-from-template-context.js":{"id":3866,"name":"*","chunks":[],"async":false},"/Users/kona/Desktop/d1studio/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":3866,"name":"*","chunks":[],"async":false},"/Users/kona/Desktop/d1studio/node_modules/next/dist/lib/metadata/metadata-boundary.js":{"id":6213,"name":"*","chunks":[],"async":false},"/Users/kona/Desktop/d1studio/node_modules/next/dist/esm/lib/metadata/metadata-boundary.js":{"id":6213,"name":"*","chunks":[],"async":false},"/Users/kona/Desktop/d1studio/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.jsx\",\"import\":\"Geist\",\"arguments\":[{\"variable\":\"--font-geist-sans\",\"subsets\":[\"latin\"]}],\"variableName\":\"geistSans\"}":{"id":5613,"name":"*","chunks":["692","static/chunks/692-ede418e1d28a1394.js","92","static/chunks/92-c4466e0f1ca8a3a8.js","735","static/chunks/735-b885dfec6353171d.js","177","static/chunks/app/layout-be6ee67cf0c92654.js"],"async":false},"/Users/kona/Desktop/d1studio/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.jsx\",\"import\":\"Geist_Mono\",\"arguments\":[{\"variable\":\"--font-geist-mono\",\"subsets\":[\"latin\"]}],\"variableName\":\"geistMono\"}":{"id":7207,"name":"*","chunks":["692","static/chunks/692-ede418e1d28a1394.js","92","static/chunks/92-c4466e0f1ca8a3a8.js","735","static/chunks/735-b885dfec6353171d.js","177","static/chunks/app/layout-be6ee67cf0c92654.js"],"async":false},"/Users/kona/Desktop/d1studio/src/app/globals.css":{"id":347,"name":"*","chunks":["692","static/chunks/692-ede418e1d28a1394.js","92","static/chunks/92-c4466e0f1ca8a3a8.js","735","static/chunks/735-b885dfec6353171d.js","177","static/chunks/app/layout-be6ee67cf0c92654.js"],"async":false},"/Users/kona/Desktop/d1studio/src/components/ui/toaster.jsx":{"id":6124,"name":"*","chunks":["692","static/chunks/692-ede418e1d28a1394.js","92","static/chunks/92-c4466e0f1ca8a3a8.js","735","static/chunks/735-b885dfec6353171d.js","177","static/chunks/app/layout-be6ee67cf0c92654.js"],"async":false},"/Users/kona/Desktop/d1studio/src/context/database-context.js":{"id":33,"name":"*","chunks":["692","static/chunks/692-ede418e1d28a1394.js","92","static/chunks/92-c4466e0f1ca8a3a8.js","735","static/chunks/735-b885dfec6353171d.js","177","static/chunks/app/layout-be6ee67cf0c92654.js"],"async":false},"/Users/kona/Desktop/d1studio/src/app/page.jsx":{"id":5612,"name":"*","chunks":["692","static/chunks/692-ede418e1d28a1394.js","700","static/chunks/700-dc8f9f08b166c5e6.js","735","static/chunks/735-b885dfec6353171d.js","974","static/chunks/app/page-16ec561fc8bebb5d.js"],"async":false}},"entryCSSFiles":{"/Users/kona/Desktop/d1studio/src/":[],"/Users/kona/Desktop/d1studio/src/app/layout":[{"inlined":false,"path":"static/css/0c512cea5f3d317a.css"}],"/Users/kona/Desktop/d1studio/src/app/page":[]},"rscModuleMapping":{"33":{"*":{"id":"91831","name":"*","chunks":[],"async":false}},"347":{"*":{"id":"61135","name":"*","chunks":[],"async":false}},"2328":{"*":{"id":"40802","name":"*","chunks":[],"async":false}},"3866":{"*":{"id":"48530","name":"*","chunks":[],"async":false}},"4547":{"*":{"id":"34863","name":"*","chunks":[],"async":false}},"4835":{"*":{"id":"25155","name":"*","chunks":[],"async":false}},"5244":{"*":{"id":"9350","name":"*","chunks":[],"async":false}},"5612":{"*":{"id":"46487","name":"*","chunks":[],"async":false}},"6124":{"*":{"id":"13164","name":"*","chunks":[],"async":false}},"6213":{"*":{"id":"88921","name":"*","chunks":[],"async":false}},"7033":{"*":{"id":"13219","name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{}}
1
+ globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/page"]={"moduleLoading":{"prefix":"/_next/","crossOrigin":null},"ssrModuleMapping":{"33":{"*":{"id":"2899","name":"*","chunks":[],"async":false}},"2328":{"*":{"id":"7174","name":"*","chunks":[],"async":false}},"2624":{"*":{"id":"4535","name":"*","chunks":[],"async":false}},"3866":{"*":{"id":"7190","name":"*","chunks":[],"async":false}},"4547":{"*":{"id":"3875","name":"*","chunks":[],"async":false}},"4835":{"*":{"id":"8903","name":"*","chunks":[],"async":false}},"5244":{"*":{"id":"4178","name":"*","chunks":[],"async":false}},"6124":{"*":{"id":"2652","name":"*","chunks":[],"async":false}},"6213":{"*":{"id":"1365","name":"*","chunks":[],"async":false}},"7033":{"*":{"id":"6959","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/client-page.js":{"id":7033,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/client-page.js":{"id":7033,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/client-segment.js":{"id":4547,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/client-segment.js":{"id":4547,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/error-boundary.js":{"id":4835,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":4835,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":2328,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":2328,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/layout-router.js":{"id":5244,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/layout-router.js":{"id":5244,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/render-from-template-context.js":{"id":3866,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":3866,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/lib/metadata/metadata-boundary.js":{"id":6213,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/lib/metadata/metadata-boundary.js":{"id":6213,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.jsx\",\"import\":\"Geist\",\"arguments\":[{\"variable\":\"--font-geist-sans\",\"subsets\":[\"latin\"]}],\"variableName\":\"geistSans\"}":{"id":5613,"name":"*","chunks":["692","static/chunks/692-ede418e1d28a1394.js","92","static/chunks/92-5f7522943fcb72a8.js","735","static/chunks/735-b885dfec6353171d.js","177","static/chunks/app/layout-40ec07d04681ba81.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.jsx\",\"import\":\"Geist_Mono\",\"arguments\":[{\"variable\":\"--font-geist-mono\",\"subsets\":[\"latin\"]}],\"variableName\":\"geistMono\"}":{"id":7207,"name":"*","chunks":["692","static/chunks/692-ede418e1d28a1394.js","92","static/chunks/92-5f7522943fcb72a8.js","735","static/chunks/735-b885dfec6353171d.js","177","static/chunks/app/layout-40ec07d04681ba81.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/app/globals.css":{"id":347,"name":"*","chunks":["692","static/chunks/692-ede418e1d28a1394.js","92","static/chunks/92-5f7522943fcb72a8.js","735","static/chunks/735-b885dfec6353171d.js","177","static/chunks/app/layout-40ec07d04681ba81.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/components/ui/toaster.jsx":{"id":6124,"name":"*","chunks":["692","static/chunks/692-ede418e1d28a1394.js","92","static/chunks/92-5f7522943fcb72a8.js","735","static/chunks/735-b885dfec6353171d.js","177","static/chunks/app/layout-40ec07d04681ba81.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/context/database-context.js":{"id":33,"name":"*","chunks":["692","static/chunks/692-ede418e1d28a1394.js","92","static/chunks/92-5f7522943fcb72a8.js","735","static/chunks/735-b885dfec6353171d.js","177","static/chunks/app/layout-40ec07d04681ba81.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/app/page.jsx":{"id":2624,"name":"*","chunks":["692","static/chunks/692-ede418e1d28a1394.js","576","static/chunks/576-18a2209e1ed26aad.js","735","static/chunks/735-b885dfec6353171d.js","974","static/chunks/app/page-f05cd0fc436bf9bc.js"],"async":false}},"entryCSSFiles":{"/Volumes/ProjectSpace/_wip/d1studio/src/":[],"/Volumes/ProjectSpace/_wip/d1studio/src/app/layout":[{"inlined":false,"path":"static/css/7c16f57d325d0d7d.css"}],"/Volumes/ProjectSpace/_wip/d1studio/src/app/page":[]},"rscModuleMapping":{"33":{"*":{"id":"1831","name":"*","chunks":[],"async":false}},"347":{"*":{"id":"1135","name":"*","chunks":[],"async":false}},"2328":{"*":{"id":"802","name":"*","chunks":[],"async":false}},"2624":{"*":{"id":"8868","name":"*","chunks":[],"async":false}},"3866":{"*":{"id":"8530","name":"*","chunks":[],"async":false}},"4547":{"*":{"id":"4863","name":"*","chunks":[],"async":false}},"4835":{"*":{"id":"5155","name":"*","chunks":[],"async":false}},"5244":{"*":{"id":"9350","name":"*","chunks":[],"async":false}},"6124":{"*":{"id":"3164","name":"*","chunks":[],"async":false}},"6213":{"*":{"id":"8921","name":"*","chunks":[],"async":false}},"7033":{"*":{"id":"3219","name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{}}
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "/_not-found/page": "app/_not-found/page.js",
3
- "/api/databases/route": "app/api/databases/route.js",
4
3
  "/api/cloudflare/route": "app/api/cloudflare/route.js",
4
+ "/api/databases/route": "app/api/databases/route.js",
5
5
  "/api/migrations/sync-files/route": "app/api/migrations/sync-files/route.js",
6
6
  "/api/migrations/sync/route": "app/api/migrations/sync/route.js",
7
7
  "/api/pull-data/confirm/route": "app/api/pull-data/confirm/route.js",
8
8
  "/api/pull-remote/confirm/route": "app/api/pull-remote/confirm/route.js",
9
9
  "/api/pull-remote/preview/route": "app/api/pull-remote/preview/route.js",
10
10
  "/api/push-remote/confirm/route": "app/api/push-remote/confirm/route.js",
11
- "/api/query/route": "app/api/query/route.js",
12
11
  "/api/push-remote/preview/route": "app/api/push-remote/preview/route.js",
13
- "/api/update/route": "app/api/update/route.js",
12
+ "/api/query/route": "app/api/query/route.js",
14
13
  "/api/tables/route": "app/api/tables/route.js",
14
+ "/api/update/route": "app/api/update/route.js",
15
15
  "/api/tables/[name]/route": "app/api/tables/[name]/route.js",
16
16
  "/page": "app/page.js"
17
17
  }
@@ -1,30 +1,30 @@
1
- exports.id=226,exports.ids=[226],exports.modules={96487:()=>{},78335:()=>{},65949:(t,e,r)=>{"use strict";r.d(e,{S:()=>c});var s=r(79748),n=r(43149),i=r(72537),a=r(26789),E=r(81804);let l=null,o=null;async function c(t){try{let e;if(!t||"string"!=typeof t)throw Error("Project path is required and must be a string");if(l&&o===t)return l;let r=null,c=null;for(let e of["wrangler.toml","wrangler.json","wrangler.jsonc"])if(r=await (0,n.dJ)(e,{cwd:t})){c=e;break}if(!r)return E.A.warn(`No Wrangler configuration file found in: ${t}`),null;E.A.info(`Found ${c} at: ${r}`);let u=await (0,s.readFile)(r,"utf-8");return c.endsWith(".toml")?e=(0,i.parse)(u):(c.endsWith(".jsonc")&&(u=(0,a.A)(u)),e=JSON.parse(u)),l={config:e,projectPath:t},o=t,l}catch(t){throw E.A.error(`Error reading Wrangler configuration: ${t.message}`),t}}},81804:(t,e,r)=>{"use strict";r.d(e,{A:()=>u});var s=r(26399);let{combine:n,timestamp:i,printf:a,colorize:E}=s.format,l="true"===process.env.DEBUG,o=a(({level:t,message:e,timestamp:r,...s})=>{let n=`${r} ${t}: ${e}`;return Object.keys(s).length>0&&(n+=` ${JSON.stringify(s)}`),n}),c=s.createLogger({level:l?"debug":"warn",format:n(i({format:"YYYY-MM-DD HH:mm:ss"}),E(),o),transports:[new s.transports.Console({level:l?"debug":"warn",silent:!1})]});c.logRequest=(t,e,r={})=>{c.debug(`Request: ${t} ${e}`,r)},c.logError=(t,e="unknown")=>{c.error(`Error in ${e}: ${t.message}`,{error:t.stack||t.message,source:e})},c.shouldLog=t=>{let e=c.level,r={error:0,warn:1,info:2,debug:3};return r[t]<=r[e]};let u=c},44218:(t,e,r)=>{"use strict";r.d(e,{IC:()=>a,ZX:()=>i});var s=r(19421),n=r(81804);async function i(t,e,r={},a=!1){let E=`
1
+ exports.id=226,exports.ids=[226],exports.modules={6487:()=>{},8335:()=>{},5949:(t,e,r)=>{"use strict";r.d(e,{S:()=>c});var s=r(9748),n=r(3149),a=r(2537),i=r(6789),E=r(1804);let l=null,o=null;async function c(t){try{let e;if(!t||"string"!=typeof t)throw Error("Project path is required and must be a string");if(l&&o===t)return l;let r=null,c=null;for(let e of["wrangler.toml","wrangler.json","wrangler.jsonc"])if(r=await (0,n.dJ)(e,{cwd:t})){c=e;break}if(!r)return E.A.warn(`No Wrangler configuration file found in: ${t}`),null;E.A.info(`Found ${c} at: ${r}`);let u=await (0,s.readFile)(r,"utf-8");return c.endsWith(".toml")?e=(0,a.parse)(u):(c.endsWith(".jsonc")&&(u=(0,i.A)(u)),e=JSON.parse(u)),l={config:e,projectPath:t},o=t,l}catch(t){throw E.A.error(`Error reading Wrangler configuration: ${t.message}`),t}}},1804:(t,e,r)=>{"use strict";r.d(e,{A:()=>u});var s=r(6399);let{combine:n,timestamp:a,printf:i,colorize:E}=s.format,l="true"===process.env.DEBUG,o=i(({level:t,message:e,timestamp:r,...s})=>{let n=`${r} ${t}: ${e}`;return Object.keys(s).length>0&&(n+=` ${JSON.stringify(s)}`),n}),c=s.createLogger({level:l?"debug":"warn",format:n(a({format:"YYYY-MM-DD HH:mm:ss"}),E(),o),transports:[new s.transports.Console({level:l?"debug":"warn",silent:!1})]});c.logRequest=(t,e,r={})=>{c.debug(`Request: ${t} ${e}`,r)},c.logError=(t,e="unknown")=>{c.error(`Error in ${e}: ${t.message}`,{error:t.stack||t.message,source:e})},c.shouldLog=t=>{let e=c.level,r={error:0,warn:1,info:2,debug:3};return r[t]<=r[e]};let u=c},4218:(t,e,r)=>{"use strict";r.d(e,{IC:()=>i,ZX:()=>a});var s=r(9421),n=r(1804);async function a(t,e,r={},i=!1){let E=`
2
2
  SELECT name, type, sql
3
3
  FROM sqlite_master
4
4
  WHERE type IN ('table', 'index', 'trigger')
5
5
  AND name NOT LIKE 'sqlite_%'
6
6
  AND name != 'd1_migrations';
7
- `;try{let n=await (0,s.KK)(t,e,E,r,a),i=JSON.parse(n);return i[0]?.results||[]}catch(t){throw n.A.error("Failed to get current schema:",t),{type:s.wU.EXECUTION_ERROR,message:"Failed to get current schema",details:{error:t.message,suggestions:["Check database permissions"]}}}}function a(t){let e=new Map;return t.filter(t=>"DATA_MODIFICATION"!==t.type).forEach(t=>{let r=(t.name||t.tableName).toLowerCase();if(e.has(r)||e.set(r,new Set),"CREATE_TABLE"===t.type){let s=t.sql.match(/FOREIGN\s+KEY\s*\([^)]+\)\s+REFERENCES\s+(\w+)/gi);s&&s.forEach(t=>{let s=t.match(/REFERENCES\s+(\w+)/i)[1].toLowerCase();e.get(r).add(s)})}}),function(t){let e=[],r=new Set,s=new Set;for(let n of t.keys())r.has(n)||function n(i){if(s.has(i))throw Error(`Circular dependency detected for table: ${i}`);if(!r.has(i)){for(let e of(s.add(i),t.get(i)||new Set)){if(!t.has(e))throw Error(`Missing table dependency: ${e}`);n(e)}s.delete(i),r.add(i),e.push(i)}}(n);return e}(e)}},19421:(t,e,r)=>{"use strict";r.d(e,{By:()=>c,F9:()=>f,Gq:()=>u,KK:()=>N,Pg:()=>E,QQ:()=>o,bp:()=>A,h3:()=>O,mA:()=>d,sP:()=>g,tn:()=>$,wU:()=>l,xk:()=>p,z6:()=>I});var s=r(28354),n=r(79646),i=r(81804);let a=(0,s.promisify)(n.exec),E={CREATE_TABLE:"CREATE_TABLE",ALTER_TABLE:"ALTER_TABLE",DROP_TABLE:"DROP_TABLE",CREATE_INDEX:"CREATE_INDEX",DROP_INDEX:"DROP_INDEX",DATA_MODIFICATION:"DATA_MODIFICATION"},l={VALIDATION_ERROR:"VALIDATION_ERROR",SYNTAX_ERROR:"SYNTAX_ERROR",EXECUTION_ERROR:"EXECUTION_ERROR",DEPENDENCY_ERROR:"DEPENDENCY_ERROR"};function o(t){return t.type!==E.DATA_MODIFICATION}function c(t){let e=t.trim().replace(/\s+/g," "),r=e.toUpperCase();if(r.startsWith("CREATE TABLE"))return{type:E.CREATE_TABLE,tableName:m(e,"CREATE TABLE"),sql:e,description:"create-table"};if(r.startsWith("ALTER TABLE")){let t=m(e,"ALTER TABLE"),s="";if(r.includes("RENAME")){let t=e.match(/RENAME\s+(?:COLUMN\s+)?([\w$]+)\s+TO\s+([\w$]+)/i);t&&(s=`rename-${t[1]}-to-${t[2]}`)}else if(r.includes("ADD COLUMN")){let t=e.match(/ADD\s+COLUMN\s+([\w$]+)(\s+[\w()]+)?/i);if(t){let e=t[1],r=t[2]?t[2].trim().replace(/\s+/g,"-"):"";s=r?`add-${e}-${r}`:`add-${e}`}}else if(r.includes("DROP COLUMN")){let t=e.match(/DROP\s+COLUMN\s+([\w$]+)/i);t&&(s=`drop-${t[1]}`)}else if(r.includes("MODIFY COLUMN")||r.includes("CHANGE COLUMN")){let t=e.match(/(?:MODIFY|CHANGE)\s+COLUMN\s+([\w$]+)(\s+[\w()]+)?/i);if(t){let e=t[1],r=t[2]?t[2].trim().replace(/\s+/g,"-"):"";s=r?`modify-${e}-to-${r}`:`modify-${e}`}}return{type:E.ALTER_TABLE,tableName:t,sql:e,description:s}}if(r.startsWith("DROP TABLE"))return{type:E.DROP_TABLE,tableName:m(e,"DROP TABLE"),sql:e,description:"drop-table"};if(r.startsWith("CREATE INDEX")||r.startsWith("CREATE UNIQUE INDEX")){let t=T(e),r=e.match(/INDEX\s+(?:IF\s+NOT\s+EXISTS\s+)?([\w$]+)/i),s=r?r[1]:"";return{type:E.CREATE_INDEX,tableName:t,sql:e,description:s}}if(r.startsWith("DROP INDEX")){let t=T(e),r=e.match(/DROP\s+INDEX\s+(?:IF\s+EXISTS\s+)?([\w$]+)/i),s=r?r[1]:"";return{type:E.DROP_INDEX,tableName:t,sql:e,description:s?`drop-index-${s}`:"drop-index"}}return{type:E.DATA_MODIFICATION,sql:e,description:"data-modification"}}function u(t){if(t.type!==E.DATA_MODIFICATION&&!t.tableName)throw{type:l.VALIDATION_ERROR,message:`Invalid SQL statement: unable to determine table name for "${t.type}".`,details:{sql:t.sql}};return t}function m(t,e){let r=t.match(RegExp(`${e}\\s+(?:IF\\s+(?:NOT\\s+)?EXISTS\\s+)?([\\w_]+)`,"i"));return r?r[1]:null}function T(t){let e=t.match(/ON\s+([\w_]+)/i);return e?e[1]:null}async function R(t){let e=t.match(/^\d+_create[-_]table[_-](.+)\.sql$/i);return e||(e=t.match(/^\d+_create[-](.+)-table\.sql$/i))||(e=t.match(/^\d+_alter[-_]table[_-](.+?)(?:[_-].+)?\.sql$/i))||(e=t.match(/^\d+_alter[-](.+?)-table(?:[_-].+)?\.sql$/i))||(e=t.match(/^\d+_create[-_]index[-_](.+)\.sql$/i))?e[1]:null}function A(t){return t.split("\n").filter(t=>!t.trim().startsWith("--")).join("\n").trim()}async function f(t,e,r,s,n=!1){let i=`SELECT name FROM sqlite_master WHERE type='table' AND name = '${s}' COLLATE NOCASE;`,a=await N(t,e,i,r,n);try{let t=a.indexOf("[");if(-1!==t){let e=a.substring(t),r=JSON.parse(e);return(r[0]?.results||[]).length>0}return!1}catch(t){return console.error("Error parsing tableExists result:",t),!1}}function d(t){return t.replace(/--.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"").trim().split(";").map(t=>t.trim()).filter(t=>t.length>0).map(t=>c(t+";"))}async function N(t,e,r,s={},n=!1){try{let E=r.trim().replace(/\s+/g," "),l=E.toUpperCase();(l.startsWith("CREATE INDEX")||l.startsWith("CREATE UNIQUE INDEX"))&&!l.includes("IF NOT EXISTS")&&(E=l.startsWith("CREATE UNIQUE INDEX")?E.replace(/CREATE\s+UNIQUE\s+INDEX/i,"CREATE UNIQUE INDEX IF NOT EXISTS"):E.replace(/CREATE\s+INDEX/i,"CREATE INDEX IF NOT EXISTS"));let o="win32"===process.platform,c=`${o?"npx.cmd":"npx"} wrangler d1 execute ${e} ${n?"--remote":"--local"} --command="${E.replace(/"/g,'\\"')}"`;i.A.shouldLog("debug")&&i.A.debug("Executing command:",c);let u={cwd:t,env:{...process.env,...s},maxBuffer:0xa00000,shell:!0},{stdout:m,stderr:T}=await a(c,u);if(T&&!T.includes("\uD83C\uDF00"))throw Error(T);try{let t=m.indexOf("[");if(-1!==t)return m.substring(t)}catch(t){console.warn("JSON parse warning:",t)}return m}catch(t){throw console.error("SQL Execution error:",t),{type:l.EXECUTION_ERROR,message:"Failed to execute SQL command",details:{command:t.cmd,stderr:t.stderr,stdout:t.stdout,originalError:t.message,suggestions:["Ensure Node.js and Wrangler are installed","Check npx in PATH","Verify the D1 database exists and is configured","Check wrangler.toml configuration"]}}}}async function O(t,e,r,s,n,a="id"){let E=`SELECT * FROM "${r}" ORDER BY "${a}" DESC LIMIT ${n};`;try{let r=await N(t,e,E,s,!0),n=r.indexOf("[");if(-1===n)throw Error(`Unexpected result format: ${r}`);let i=r.substring(n),a=JSON.parse(i);return a[0]?.results||[]}catch(t){throw i.A.error(`Error fetching remote data for table ${r}:`,t),t}}function p(t,e){if(!e||0===e.length)return"";let r=Object.keys(e[0]),s=r.map(t=>`"${t}"`).join(", "),n=e.map(t=>{let e=r.map(e=>{let r=t[e];return null==r?"NULL":`'${String(r).replace(/'/g,"''")}'`}).join(", ");return`(${e})`}).join(", ");return`INSERT INTO "${t}" (${s}) VALUES ${n};`}function I(t){let e=t.trim(),r=e.toUpperCase();return r.startsWith("CREATE TABLE")?function(t){let e=t.match(/CREATE\s+TABLE\s+(?:IF\s+NOT\s+EXISTS\s+)?(\w+)\s*\(([\s\S]*)\)/i);if(!e)return t;let[,r,s]=e,n=h(s).map(t=>t.trim()).filter(Boolean);return`CREATE TABLE ${r} (
7
+ `;try{let n=await (0,s.KK)(t,e,E,r,i),a=JSON.parse(n);return a[0]?.results||[]}catch(t){throw n.A.error("Failed to get current schema:",t),{type:s.wU.EXECUTION_ERROR,message:"Failed to get current schema",details:{error:t.message,suggestions:["Check database permissions"]}}}}function i(t){let e=new Map;return t.filter(t=>"DATA_MODIFICATION"!==t.type).forEach(t=>{let r=(t.name||t.tableName).toLowerCase();if(e.has(r)||e.set(r,new Set),"CREATE_TABLE"===t.type){let s=t.sql.match(/FOREIGN\s+KEY\s*\([^)]+\)\s+REFERENCES\s+(\w+)/gi);s&&s.forEach(t=>{let s=t.match(/REFERENCES\s+(\w+)/i)[1].toLowerCase();e.get(r).add(s)})}}),function(t){let e=[],r=new Set,s=new Set;for(let n of t.keys())r.has(n)||function n(a){if(s.has(a))throw Error(`Circular dependency detected for table: ${a}`);if(!r.has(a)){for(let e of(s.add(a),t.get(a)||new Set)){if(!t.has(e))throw Error(`Missing table dependency: ${e}`);n(e)}s.delete(a),r.add(a),e.push(a)}}(n);return e}(e)}},9421:(t,e,r)=>{"use strict";r.d(e,{By:()=>u,F9:()=>f,Gq:()=>m,KK:()=>I,Pg:()=>l,QQ:()=>c,bp:()=>d,h3:()=>O,mA:()=>N,sP:()=>L,tn:()=>g,wU:()=>o,xk:()=>p,z6:()=>h});var s=r(8354),n=r(9646),a=r(3648),i=r(1804);let E=(0,s.promisify)(n.exec),l={CREATE_TABLE:"CREATE_TABLE",ALTER_TABLE:"ALTER_TABLE",DROP_TABLE:"DROP_TABLE",CREATE_INDEX:"CREATE_INDEX",DROP_INDEX:"DROP_INDEX",DATA_MODIFICATION:"DATA_MODIFICATION"},o={VALIDATION_ERROR:"VALIDATION_ERROR",SYNTAX_ERROR:"SYNTAX_ERROR",EXECUTION_ERROR:"EXECUTION_ERROR",DEPENDENCY_ERROR:"DEPENDENCY_ERROR"};function c(t){return t.type!==l.DATA_MODIFICATION}function u(t){let e=t.trim().replace(/\s+/g," "),r=e.toUpperCase();if(r.startsWith("CREATE TABLE"))return{type:l.CREATE_TABLE,tableName:T(e,"CREATE TABLE"),sql:e,description:"create-table"};if(r.startsWith("ALTER TABLE")){let t=T(e,"ALTER TABLE"),s="";if(r.includes("RENAME")){let t=e.match(/RENAME\s+(?:COLUMN\s+)?([\w$]+)\s+TO\s+([\w$]+)/i);t&&(s=`rename-${t[1]}-to-${t[2]}`)}else if(r.includes("ADD COLUMN")){let t=e.match(/ADD\s+COLUMN\s+([\w$]+)(\s+[\w()]+)?/i);if(t){let e=t[1],r=t[2]?t[2].trim().replace(/\s+/g,"-"):"";s=r?`add-${e}-${r}`:`add-${e}`}}else if(r.includes("DROP COLUMN")){let t=e.match(/DROP\s+COLUMN\s+([\w$]+)/i);t&&(s=`drop-${t[1]}`)}else if(r.includes("MODIFY COLUMN")||r.includes("CHANGE COLUMN")){let t=e.match(/(?:MODIFY|CHANGE)\s+COLUMN\s+([\w$]+)(\s+[\w()]+)?/i);if(t){let e=t[1],r=t[2]?t[2].trim().replace(/\s+/g,"-"):"";s=r?`modify-${e}-to-${r}`:`modify-${e}`}}return{type:l.ALTER_TABLE,tableName:t,sql:e,description:s}}if(r.startsWith("DROP TABLE"))return{type:l.DROP_TABLE,tableName:T(e,"DROP TABLE"),sql:e,description:"drop-table"};if(r.startsWith("CREATE INDEX")||r.startsWith("CREATE UNIQUE INDEX")){let t=R(e),r=e.match(/INDEX\s+(?:IF\s+NOT\s+EXISTS\s+)?([\w$]+)/i),s=r?r[1]:"";return{type:l.CREATE_INDEX,tableName:t,sql:e,description:s}}if(r.startsWith("DROP INDEX")){let t=R(e),r=e.match(/DROP\s+INDEX\s+(?:IF\s+EXISTS\s+)?([\w$]+)/i),s=r?r[1]:"";return{type:l.DROP_INDEX,tableName:t,sql:e,description:s?`drop-index-${s}`:"drop-index"}}return{type:l.DATA_MODIFICATION,sql:e,description:"data-modification"}}function m(t){if(t.type!==l.DATA_MODIFICATION&&!t.tableName)throw{type:o.VALIDATION_ERROR,message:`Invalid SQL statement: unable to determine table name for "${t.type}".`,details:{sql:t.sql}};return t}function T(t,e){let r=t.match(RegExp(`${e}\\s+(?:IF\\s+(?:NOT\\s+)?EXISTS\\s+)?([\\w_]+)`,"i"));return r?r[1]:null}function R(t){let e=t.match(/ON\s+([\w_]+)/i);return e?e[1]:null}async function A(t){let e=t.match(/^\d+_create[-_]table[_-](.+)\.sql$/i);return e||(e=t.match(/^\d+_create[-](.+)-table\.sql$/i))||(e=t.match(/^\d+_alter[-_]table[_-](.+?)(?:[_-].+)?\.sql$/i))||(e=t.match(/^\d+_alter[-](.+?)-table(?:[_-].+)?\.sql$/i))||(e=t.match(/^\d+_create[-_]index[-_](.+)\.sql$/i))?e[1]:null}function d(t){return t.split("\n").filter(t=>!t.trim().startsWith("--")).join("\n").trim()}async function f(t,e,r,s,n=!1){try{(0,a.nZ)(s)}catch(t){return i.A.error("Invalid table name:",s,t.message),!1}let E=`SELECT name FROM sqlite_master WHERE type='table' AND name = '${s.replace(/'/g,"''")}' COLLATE NOCASE;`,l=await I(t,e,E,r,n);try{let t=l.indexOf("[");if(-1!==t){let e=l.substring(t),r=JSON.parse(e);return(r[0]?.results||[]).length>0}return!1}catch(t){return console.error("Error parsing tableExists result:",t),!1}}function N(t){return t.replace(/--.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"").trim().split(";").map(t=>t.trim()).filter(t=>t.length>0).map(t=>u(t+";"))}async function I(t,e,r,s={},n=!1){try{let a=r.trim().replace(/\s+/g," "),l=a.toUpperCase();if((l.startsWith("CREATE INDEX")||l.startsWith("CREATE UNIQUE INDEX"))&&!l.includes("IF NOT EXISTS")&&(a=l.startsWith("CREATE UNIQUE INDEX")?a.replace(/CREATE\s+UNIQUE\s+INDEX/i,"CREATE UNIQUE INDEX IF NOT EXISTS"):a.replace(/CREATE\s+INDEX/i,"CREATE INDEX IF NOT EXISTS")),!e||"string"!=typeof e||!/^[a-zA-Z0-9_-]+$/.test(e))throw Error("Invalid database name for security reasons");let o="win32"===process.platform,c=a.replace(/"/g,'\\"').replace(/\$/g,"\\$"),u=`${o?"npx.cmd":"npx"} wrangler d1 execute ${e} ${n?"--remote":"--local"} --command="${c}"`;i.A.shouldLog("debug")&&i.A.debug("Executing command:",u);let m={cwd:t,env:{...process.env,...s},maxBuffer:0xa00000,shell:!0},{stdout:T,stderr:R}=await E(u,m);if(R&&!R.includes("\uD83C\uDF00"))throw Error(R);try{let t=T.indexOf("[");if(-1!==t)return T.substring(t)}catch(t){console.warn("JSON parse warning:",t)}return T}catch(t){throw console.error("SQL Execution error:",t),{type:o.EXECUTION_ERROR,message:"Failed to execute SQL command",details:{command:t.cmd,stderr:t.stderr,stdout:t.stdout,originalError:t.message,suggestions:["Ensure Node.js and Wrangler are installed","Check npx in PATH","Verify the D1 database exists and is configured","Check wrangler.toml configuration"]}}}}async function O(t,e,r,s,n,E="id"){let l=(0,a.nZ)(r),o=(0,a.r0)(E),c=Math.max(1,Math.min(parseInt(n)||50,1e3)),u=`SELECT * FROM ${l} ORDER BY ${o} DESC LIMIT ${c};`;try{let r=await I(t,e,u,s,!0),n=r.indexOf("[");if(-1===n)throw Error(`Unexpected result format: ${r}`);let a=r.substring(n),i=JSON.parse(a);return i[0]?.results||[]}catch(t){throw i.A.error(`Error fetching remote data for table ${r}:`,t),t}}function p(t,e){if(!e||0===e.length)return"";let r=(0,a.nZ)(t),s=Object.keys(e[0]),n=s.map(t=>(0,a.r0)(t)).join(", "),i=e.map(t=>{let e=s.map(e=>{let r=t[e];return null==r?"NULL":`'${String(r).replace(/'/g,"''")}'`}).join(", ");return`(${e})`}).join(", ");return`INSERT INTO ${r} (${n}) VALUES ${i};`}function h(t){let e=t.trim(),r=e.toUpperCase();return r.startsWith("CREATE TABLE")?function(t){let e=t.match(/CREATE\s+TABLE\s+(?:IF\s+NOT\s+EXISTS\s+)?(\w+)\s*\(([\s\S]*)\)/i);if(!e)return t;let[,r,s]=e,n=$(s).map(t=>t.trim()).filter(Boolean);return`CREATE TABLE ${r} (
8
8
  ${n.join(",\n ")}
9
- );`}(e):r.startsWith("CREATE INDEX")||r.startsWith("CREATE UNIQUE INDEX")?function(t){let e=t.match(/CREATE\s+(UNIQUE\s+)?INDEX\s+(?:IF\s+NOT\s+EXISTS\s+)?(\w+)\s+ON\s+(\w+)\s*\((.*)\)/i);if(!e)return t;let[,r,s,n,i]=e,a=i.split(",").map(t=>t.trim()).join(", ");return`CREATE ${r||""}INDEX ${s} ON ${n} (${a});`}(e):r.startsWith("ALTER TABLE")?function(t){let e=t.match(/ALTER\s+TABLE\s+(\w+)\s+(.*)/i);if(!e)return t;let[,r,s]=e,n=h(s);return 1===n.length?`ALTER TABLE ${r} ${n[0]};`:`ALTER TABLE ${r}
10
- ${n.map((t,e)=>` ${t}${e<n.length-1?",":";"}`).join("\n")}`}(e):r.startsWith("DROP TABLE")||r.startsWith("DROP INDEX")?function(t){let e=t.match(/DROP\s+(TABLE|INDEX)\s+(?:IF\s+EXISTS\s+)?(\w+)/i);if(!e)return t;let[,r,s]=e;return`DROP ${r} IF EXISTS ${s};`}(e):r.startsWith("INSERT INTO")?function(t){let e=t.match(/INSERT\s+INTO\s+(\w+)\s*(\([^)]+\))?\s*VALUES\s*(.+)/i);if(!e)return t;let[,r,s,n]=e,i=h(n);return`INSERT INTO ${r}${s?` ${s}`:""}
9
+ );`}(e):r.startsWith("CREATE INDEX")||r.startsWith("CREATE UNIQUE INDEX")?function(t){let e=t.match(/CREATE\s+(UNIQUE\s+)?INDEX\s+(?:IF\s+NOT\s+EXISTS\s+)?(\w+)\s+ON\s+(\w+)\s*\((.*)\)/i);if(!e)return t;let[,r,s,n,a]=e,i=a.split(",").map(t=>t.trim()).join(", ");return`CREATE ${r||""}INDEX ${s} ON ${n} (${i});`}(e):r.startsWith("ALTER TABLE")?function(t){let e=t.match(/ALTER\s+TABLE\s+(\w+)\s+(.*)/i);if(!e)return t;let[,r,s]=e,n=$(s);return 1===n.length?`ALTER TABLE ${r} ${n[0]};`:`ALTER TABLE ${r}
10
+ ${n.map((t,e)=>` ${t}${e<n.length-1?",":";"}`).join("\n")}`}(e):r.startsWith("DROP TABLE")||r.startsWith("DROP INDEX")?function(t){let e=t.match(/DROP\s+(TABLE|INDEX)\s+(?:IF\s+EXISTS\s+)?(\w+)/i);if(!e)return t;let[,r,s]=e;return`DROP ${r} IF EXISTS ${s};`}(e):r.startsWith("INSERT INTO")?function(t){let e=t.match(/INSERT\s+INTO\s+(\w+)\s*(\([^)]+\))?\s*VALUES\s*(.+)/i);if(!e)return t;let[,r,s,n]=e,a=$(n);return`INSERT INTO ${r}${s?` ${s}`:""}
11
11
  VALUES
12
- `+i.map((t,e)=>` ${t}${e<i.length-1?",":";"}`).join("\n")}(e):r.startsWith("UPDATE")?function(t){let e=t.match(/UPDATE\s+(\w+)\s+SET\s+(.+?)(?:\s+WHERE\s+(.+))?$/i);if(!e)return t;let[,r,s,n]=e,i=h(s),a=`UPDATE ${r}
12
+ `+a.map((t,e)=>` ${t}${e<a.length-1?",":";"}`).join("\n")}(e):r.startsWith("UPDATE")?function(t){let e=t.match(/UPDATE\s+(\w+)\s+SET\s+(.+?)(?:\s+WHERE\s+(.+))?$/i);if(!e)return t;let[,r,s,n]=e,a=$(s),i=`UPDATE ${r}
13
13
  SET
14
- ${i.map(t=>` ${t.trim()}`).join(",\n")}`;return n&&(a+=`
14
+ ${a.map(t=>` ${t.trim()}`).join(",\n")}`;return n&&(i+=`
15
15
  WHERE
16
- ${n.trim()}`),a+";"}(e):r.startsWith("DELETE FROM")?function(t){let e=t.match(/DELETE\s+FROM\s+(\w+)(?:\s+WHERE\s+(.+))?$/i);if(!e)return t;let[,r,s]=e,n=`DELETE FROM ${r}`;return s&&(n+=`
16
+ ${n.trim()}`),i+";"}(e):r.startsWith("DELETE FROM")?function(t){let e=t.match(/DELETE\s+FROM\s+(\w+)(?:\s+WHERE\s+(.+))?$/i);if(!e)return t;let[,r,s]=e,n=`DELETE FROM ${r}`;return s&&(n+=`
17
17
  WHERE
18
- ${s.trim()}`),n+";"}(e):r.startsWith("SELECT")?function(t){let e=t.match(/SELECT\s+(.+?)\s+FROM\s+(.+?)(?:\s+WHERE\s+(.+?))?(?:\s+GROUP\s+BY\s+(.+?))?(?:\s+HAVING\s+(.+?))?(?:\s+ORDER\s+BY\s+(.+?))?(?:\s+LIMIT\s+(.+?))?$/i);if(!e)return t;let[,r,s,n,i,a,E,l]=e,o=`SELECT
18
+ ${s.trim()}`),n+";"}(e):r.startsWith("SELECT")?function(t){let e=t.match(/SELECT\s+(.+?)\s+FROM\s+(.+?)(?:\s+WHERE\s+(.+?))?(?:\s+GROUP\s+BY\s+(.+?))?(?:\s+HAVING\s+(.+?))?(?:\s+ORDER\s+BY\s+(.+?))?(?:\s+LIMIT\s+(.+?))?$/i);if(!e)return t;let[,r,s,n,a,i,E,l]=e,o=`SELECT
19
19
  ${r.split(",").map(t=>t.trim()).join(",\n ")}
20
20
  FROM
21
21
  ${s.trim()}`;return n&&(o+=`
22
22
  WHERE
23
- ${n.trim()}`),i&&(o+=`
23
+ ${n.trim()}`),a&&(o+=`
24
24
  GROUP BY
25
- ${i.trim()}`),a&&(o+=`
25
+ ${a.trim()}`),i&&(o+=`
26
26
  HAVING
27
- ${a.trim()}`),E&&(o+=`
27
+ ${i.trim()}`),E&&(o+=`
28
28
  ORDER BY
29
29
  ${E.trim()}`),l&&(o+=`
30
- LIMIT ${l.trim()}`),o+";"}(e):e+";"}function h(t){let e=[],r="",s=0,n=!1,i="";for(let a of t)'"'===a&&"\\"!==i&&(n=!n),!n&&("("===a&&s++,")"===a&&s--),","!==a||0!==s||n?r+=a:(e.push(r.trim()),r=""),i=a;return r.trim()&&e.push(r.trim()),e}function $(t){return t.split(";").map(t=>t.trim()).filter(t=>t.length>0).map(t=>I(t)).join("\n\n")+"\n"}async function g(t,e,r,s){try{let n;let i=await R(r);if(i&&!r.includes("create-index")){let r=await N(t,e,`SELECT sql FROM sqlite_master WHERE type='table' AND name='${i}';`,s,!0);try{let t=JSON.parse(r);n=t[0]?.results?.[0]?.sql}catch(t){console.error("Error parsing sqlite_master result:",t)}}if(!n&&r.includes("create-index")){let i=r.match(/create-index[_-](.+)\.sql$/i);if(i){let r=i[1],a=await N(t,e,`SELECT sql FROM sqlite_master WHERE type='index' AND name='${r}' COLLATE NOCASE;`,s,!0),E=JSON.parse(a);if(!(n=E[0]?.results?.[0]?.sql)){let i=r.split("-")[0];a=await N(t,e,`SELECT sql FROM sqlite_master WHERE type='index' AND name='${i}' COLLATE NOCASE;`,s,!0),E=JSON.parse(a),n=E[0]?.results?.[0]?.sql}}}if(!n&&i&&!r.includes("create-index")){let r=await N(t,e,`SELECT sql FROM sqlite_master WHERE name LIKE '%${i}%' LIMIT 1;`,s,!0);try{let t=JSON.parse(r);n=t[0]?.results?.[0]?.sql}catch(t){console.error("Error parsing fallback result:",t)}}if(!n)throw Error(`Could not retrieve SQL content for migration: ${r}`);return n+";"}catch(t){throw{type:l.EXECUTION_ERROR,message:`Failed to get migration file content: ${t.message}`,details:{file:r,error:t.message,suggestions:["Check if the table exists in the remote database","Verify the migration filename follows the expected pattern","Ensure you have permissions to access the remote database"]}}}}}};
30
+ LIMIT ${l.trim()}`),o+";"}(e):e+";"}function $(t){let e=[],r="",s=0,n=!1,a="";for(let i of t)'"'===i&&"\\"!==a&&(n=!n),!n&&("("===i&&s++,")"===i&&s--),","!==i||0!==s||n?r+=i:(e.push(r.trim()),r=""),a=i;return r.trim()&&e.push(r.trim()),e}function g(t){return t.split(";").map(t=>t.trim()).filter(t=>t.length>0).map(t=>h(t)).join("\n\n")+"\n"}async function L(t,e,r,s){try{let n;let a=await A(r);if(a&&!r.includes("create-index")){let r=await I(t,e,`SELECT sql FROM sqlite_master WHERE type='table' AND name='${a}';`,s,!0);try{let t=JSON.parse(r);n=t[0]?.results?.[0]?.sql}catch(t){console.error("Error parsing sqlite_master result:",t)}}if(!n&&r.includes("create-index")){let a=r.match(/create-index[_-](.+)\.sql$/i);if(a){let r=a[1],i=await I(t,e,`SELECT sql FROM sqlite_master WHERE type='index' AND name='${r}' COLLATE NOCASE;`,s,!0),E=JSON.parse(i);if(!(n=E[0]?.results?.[0]?.sql)){let a=r.split("-")[0];i=await I(t,e,`SELECT sql FROM sqlite_master WHERE type='index' AND name='${a}' COLLATE NOCASE;`,s,!0),E=JSON.parse(i),n=E[0]?.results?.[0]?.sql}}}if(!n&&a&&!r.includes("create-index")){let r=await I(t,e,`SELECT sql FROM sqlite_master WHERE name LIKE '%${a}%' LIMIT 1;`,s,!0);try{let t=JSON.parse(r);n=t[0]?.results?.[0]?.sql}catch(t){console.error("Error parsing fallback result:",t)}}if(!n)throw Error(`Could not retrieve SQL content for migration: ${r}`);return n+";"}catch(t){throw{type:o.EXECUTION_ERROR,message:`Failed to get migration file content: ${t.message}`,details:{file:r,error:t.message,suggestions:["Check if the table exists in the remote database","Verify the migration filename follows the expected pattern","Ensure you have permissions to access the remote database"]}}}}},3648:(t,e,r)=>{"use strict";function s(t){if(!t||"string"!=typeof t)throw Error("Table name must be a non-empty string");if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(t))throw Error(`Invalid table name: ${t}. Must start with letter or underscore and contain only letters, digits, and underscores.`);if(["SELECT","FROM","WHERE","INSERT","UPDATE","DELETE","CREATE","DROP","ALTER","TABLE","INDEX","VIEW","TRIGGER","PRAGMA","VACUUM","REINDEX","EXPLAIN","QUERY","PLAN","TRANSACTION","BEGIN","COMMIT","ROLLBACK"].includes(t.toUpperCase()))throw Error(`Table name cannot be a reserved word: ${t}`);return`"${t}"`}function n(t){if(!t||"string"!=typeof t)throw Error("Column name must be a non-empty string");if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(t))throw Error(`Invalid column name: ${t}. Must start with letter or underscore and contain only letters, digits, and underscores.`);return`"${t}"`}r.d(e,{nZ:()=>s,r0:()=>n})}};