d1s 0.2.8 → 0.2.9

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 (310) hide show
  1. package/dist/.next/.next/BUILD_ID +1 -1
  2. package/dist/.next/.next/app-build-manifest.json +33 -26
  3. package/dist/.next/.next/app-path-routes-manifest.json +1 -1
  4. package/dist/.next/.next/build-manifest.json +2 -2
  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/2.pack +0 -0
  10. package/dist/.next/.next/cache/webpack/client-production/index.pack +0 -0
  11. package/dist/.next/.next/cache/webpack/client-production/index.pack.old +0 -0
  12. package/dist/.next/.next/cache/webpack/edge-server-production/index.pack +0 -0
  13. package/dist/.next/.next/cache/webpack/server-production/0.pack +0 -0
  14. package/dist/.next/.next/cache/webpack/server-production/index.pack +0 -0
  15. package/dist/.next/.next/next-minimal-server.js.nft.json +1 -1
  16. package/dist/.next/.next/next-server.js.nft.json +1 -1
  17. package/dist/.next/.next/prerender-manifest.json +1 -1
  18. package/dist/.next/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  19. package/dist/.next/.next/server/app/_not-found.html +1 -1
  20. package/dist/.next/.next/server/app/_not-found.rsc +4 -4
  21. package/dist/.next/.next/server/app/api/cloudflare/route.js +1 -1
  22. package/dist/.next/.next/server/app/api/cloudflare/route_client-reference-manifest.js +1 -1
  23. package/dist/.next/.next/server/app/api/databases/route.js +1 -1
  24. package/dist/.next/.next/server/app/api/databases/route_client-reference-manifest.js +1 -1
  25. package/dist/.next/.next/server/app/api/migrations/sync/route.js +28 -3
  26. package/dist/.next/.next/server/app/api/migrations/sync/route.js.nft.json +1 -1
  27. package/dist/.next/.next/server/app/api/migrations/sync/route_client-reference-manifest.js +1 -1
  28. package/dist/.next/.next/server/app/api/migrations/sync-files/route.js +26 -1
  29. package/dist/.next/.next/server/app/api/migrations/sync-files/route.js.nft.json +1 -1
  30. package/dist/.next/.next/server/app/api/migrations/sync-files/route_client-reference-manifest.js +1 -1
  31. package/dist/.next/.next/server/app/api/pull-data/confirm/route.js +1 -0
  32. package/dist/.next/.next/server/app/api/pull-data/confirm/route.js.nft.json +1 -0
  33. package/dist/.next/.next/server/app/api/pull-data/confirm/route_client-reference-manifest.js +1 -0
  34. package/dist/.next/.next/server/app/api/pull-remote/confirm/route.js +26 -1
  35. package/dist/.next/.next/server/app/api/pull-remote/confirm/route.js.nft.json +1 -1
  36. package/dist/.next/.next/server/app/api/pull-remote/confirm/route_client-reference-manifest.js +1 -1
  37. package/dist/.next/.next/server/app/api/pull-remote/preview/route.js +26 -1
  38. package/dist/.next/.next/server/app/api/pull-remote/preview/route.js.nft.json +1 -1
  39. package/dist/.next/.next/server/app/api/pull-remote/preview/route_client-reference-manifest.js +1 -1
  40. package/dist/.next/.next/server/app/api/push-remote/confirm/route.js +28 -3
  41. package/dist/.next/.next/server/app/api/push-remote/confirm/route.js.nft.json +1 -1
  42. package/dist/.next/.next/server/app/api/push-remote/confirm/route_client-reference-manifest.js +1 -1
  43. package/dist/.next/.next/server/app/api/push-remote/preview/route.js +28 -3
  44. package/dist/.next/.next/server/app/api/push-remote/preview/route.js.nft.json +1 -1
  45. package/dist/.next/.next/server/app/api/push-remote/preview/route_client-reference-manifest.js +1 -1
  46. package/dist/.next/.next/server/app/api/query/route.js +27 -2
  47. package/dist/.next/.next/server/app/api/query/route.js.nft.json +1 -1
  48. package/dist/.next/.next/server/app/api/query/route_client-reference-manifest.js +1 -1
  49. package/dist/.next/.next/server/app/api/tables/[name]/route.js +4 -4
  50. package/dist/.next/.next/server/app/api/tables/[name]/route_client-reference-manifest.js +1 -1
  51. package/dist/.next/.next/server/app/api/tables/route.js +2 -2
  52. package/dist/.next/.next/server/app/api/tables/route_client-reference-manifest.js +1 -1
  53. package/dist/.next/.next/server/app/api/update/route.js +2 -2
  54. package/dist/.next/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
  55. package/dist/.next/.next/server/app/index.html +3 -3
  56. package/dist/.next/.next/server/app/index.rsc +5 -5
  57. package/dist/.next/.next/server/app/page.js +11 -11
  58. package/dist/.next/.next/server/app/page_client-reference-manifest.js +1 -1
  59. package/dist/.next/.next/server/app-paths-manifest.json +2 -1
  60. package/dist/.next/.next/server/chunks/226.js +30 -0
  61. package/dist/.next/.next/server/chunks/336.js +1 -1
  62. package/dist/.next/.next/server/pages/404.html +1 -1
  63. package/dist/.next/.next/server/pages/500.html +1 -1
  64. package/dist/.next/.next/server/pages-manifest.json +1 -1
  65. package/dist/.next/.next/server/server-reference-manifest.json +1 -1
  66. package/dist/.next/.next/static/7XBqETNmhSxMXhw8iUpEa/_buildManifest.js +1 -0
  67. package/dist/.next/.next/static/chunks/{958-98887928efebfdf7.js → 176-9146975ef8699719.js} +1 -1
  68. package/dist/.next/.next/static/chunks/{735-c9144179c6bd7d06.js → 735-b885dfec6353171d.js} +1 -1
  69. package/dist/.next/.next/static/chunks/app/api/cloudflare/route-b77846f372b01f38.js +1 -0
  70. package/dist/.next/.next/static/chunks/app/api/databases/route-407794f8145d9a0b.js +1 -0
  71. package/dist/.next/.next/static/chunks/app/api/migrations/sync/route-9f480f5590369a8f.js +1 -0
  72. package/dist/.next/.next/static/chunks/app/api/migrations/sync-files/route-92010db279b4dd8e.js +1 -0
  73. package/dist/.next/.next/static/chunks/app/api/pull-data/confirm/route-a02fe6d3cdd0a535.js +1 -0
  74. package/dist/.next/.next/static/chunks/app/api/pull-remote/confirm/route-f401a03507d1da50.js +1 -0
  75. package/dist/.next/.next/static/chunks/app/api/pull-remote/preview/route-3c53814b5cb8b6b0.js +1 -0
  76. package/dist/.next/.next/static/chunks/app/api/push-remote/confirm/route-8f359249e907c63b.js +1 -0
  77. package/dist/.next/.next/static/chunks/app/api/push-remote/preview/route-b51bf94f39c17a9d.js +1 -0
  78. package/dist/.next/.next/static/chunks/app/api/query/route-87bae2d4aebaf859.js +1 -0
  79. package/dist/.next/.next/static/chunks/app/api/tables/[name]/route-d20ca163b9c03e7c.js +1 -0
  80. package/dist/.next/.next/static/chunks/app/api/tables/route-0f46f911562abcdf.js +1 -0
  81. package/dist/.next/.next/static/chunks/app/api/update/route-14edc1917760bce0.js +1 -0
  82. package/dist/.next/.next/static/chunks/app/page-5990cb23b8bd27c4.js +1 -0
  83. package/dist/.next/.next/static/css/674bee6608c638e4.css +3 -0
  84. package/dist/.next/.next/trace +3 -3
  85. package/dist/.next/.next/types/app/api/pull-data/confirm/route.ts +347 -0
  86. package/dist/.next/BUILD_ID +1 -1
  87. package/dist/.next/app-build-manifest.json +35 -21
  88. package/dist/.next/app-path-routes-manifest.json +1 -1
  89. package/dist/.next/build-manifest.json +2 -2
  90. package/dist/.next/cache/.rscinfo +1 -1
  91. package/dist/.next/cache/.tsbuildinfo +1 -1
  92. package/dist/.next/cache/webpack/client-production/0.pack +0 -0
  93. package/dist/.next/cache/webpack/client-production/index.pack +0 -0
  94. package/dist/.next/cache/webpack/edge-server-production/index.pack +0 -0
  95. package/dist/.next/cache/webpack/server-production/0.pack +0 -0
  96. package/dist/.next/cache/webpack/server-production/index.pack +0 -0
  97. package/dist/.next/next-minimal-server.js.nft.json +1 -1
  98. package/dist/.next/next-server.js.nft.json +1 -1
  99. package/dist/.next/prerender-manifest.json +1 -1
  100. package/dist/.next/server/app/_not-found/page.js +1 -1
  101. package/dist/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  102. package/dist/.next/server/app/_not-found.html +1 -1
  103. package/dist/.next/server/app/_not-found.rsc +4 -4
  104. package/dist/.next/server/app/api/cloudflare/route.js +1 -1
  105. package/dist/.next/server/app/api/cloudflare/route.js.nft.json +1 -1
  106. package/dist/.next/server/app/api/cloudflare/route_client-reference-manifest.js +1 -1
  107. package/dist/.next/server/app/api/databases/route.js +1 -1
  108. package/dist/.next/server/app/api/databases/route.js.nft.json +1 -1
  109. package/dist/.next/server/app/api/databases/route_client-reference-manifest.js +1 -1
  110. package/dist/.next/server/app/api/migrations/sync/route.js +28 -3
  111. package/dist/.next/server/app/api/migrations/sync/route.js.nft.json +1 -1
  112. package/dist/.next/server/app/api/migrations/sync/route_client-reference-manifest.js +1 -1
  113. package/dist/.next/server/app/api/migrations/sync-files/route.js +26 -1
  114. package/dist/.next/server/app/api/migrations/sync-files/route.js.nft.json +1 -1
  115. package/dist/.next/server/app/api/migrations/sync-files/route_client-reference-manifest.js +1 -1
  116. package/dist/.next/server/app/api/pull-data/confirm/route.js +1 -0
  117. package/dist/.next/server/app/api/pull-data/confirm/route.js.nft.json +1 -0
  118. package/dist/.next/server/app/api/pull-data/confirm/route_client-reference-manifest.js +1 -0
  119. package/dist/.next/server/app/api/pull-remote/confirm/route.js +26 -1
  120. package/dist/.next/server/app/api/pull-remote/confirm/route.js.nft.json +1 -1
  121. package/dist/.next/server/app/api/pull-remote/confirm/route_client-reference-manifest.js +1 -1
  122. package/dist/.next/server/app/api/pull-remote/preview/route.js +26 -1
  123. package/dist/.next/server/app/api/pull-remote/preview/route.js.nft.json +1 -1
  124. package/dist/.next/server/app/api/pull-remote/preview/route_client-reference-manifest.js +1 -1
  125. package/dist/.next/server/app/api/push-remote/confirm/route.js +28 -3
  126. package/dist/.next/server/app/api/push-remote/confirm/route.js.nft.json +1 -1
  127. package/dist/.next/server/app/api/push-remote/confirm/route_client-reference-manifest.js +1 -1
  128. package/dist/.next/server/app/api/push-remote/preview/route.js +28 -3
  129. package/dist/.next/server/app/api/push-remote/preview/route.js.nft.json +1 -1
  130. package/dist/.next/server/app/api/push-remote/preview/route_client-reference-manifest.js +1 -1
  131. package/dist/.next/server/app/api/query/route.js +27 -2
  132. package/dist/.next/server/app/api/query/route.js.nft.json +1 -1
  133. package/dist/.next/server/app/api/query/route_client-reference-manifest.js +1 -1
  134. package/dist/.next/server/app/api/tables/[name]/route.js +3 -3
  135. package/dist/.next/server/app/api/tables/[name]/route.js.nft.json +1 -1
  136. package/dist/.next/server/app/api/tables/[name]/route_client-reference-manifest.js +1 -1
  137. package/dist/.next/server/app/api/tables/route.js +2 -2
  138. package/dist/.next/server/app/api/tables/route.js.nft.json +1 -1
  139. package/dist/.next/server/app/api/tables/route_client-reference-manifest.js +1 -1
  140. package/dist/.next/server/app/api/update/route.js +5 -0
  141. package/dist/.next/server/app/api/update/route.js.nft.json +1 -0
  142. package/dist/.next/server/app/api/update/route_client-reference-manifest.js +1 -0
  143. package/dist/.next/server/app/index.html +3 -3
  144. package/dist/.next/server/app/index.rsc +5 -5
  145. package/dist/.next/server/app/page.js +13 -11
  146. package/dist/.next/server/app/page_client-reference-manifest.js +1 -1
  147. package/dist/.next/server/app-paths-manifest.json +5 -3
  148. package/dist/.next/server/chunks/226.js +30 -0
  149. package/dist/.next/server/chunks/336.js +1 -1
  150. package/dist/.next/server/chunks/391.js +23 -0
  151. package/dist/.next/server/chunks/452.js +1 -0
  152. package/dist/.next/server/chunks/627.js +3 -3
  153. package/dist/.next/server/chunks/638.js +3 -3
  154. package/dist/.next/server/chunks/992.js +3 -3
  155. package/dist/.next/server/pages/404.html +1 -1
  156. package/dist/.next/server/pages/500.html +1 -1
  157. package/dist/.next/server/pages/_app.js +1 -1
  158. package/dist/.next/server/pages/_document.js +1 -1
  159. package/dist/.next/server/pages/_error.js +1 -1
  160. package/dist/.next/server/server-reference-manifest.json +1 -1
  161. package/dist/.next/static/MoZBULXFiTFzrY1JVK_Df/_buildManifest.js +1 -0
  162. package/dist/.next/static/chunks/176-9146975ef8699719.js +1 -0
  163. package/dist/.next/static/chunks/{735-c9144179c6bd7d06.js → 735-b885dfec6353171d.js} +1 -1
  164. package/dist/.next/static/chunks/app/api/cloudflare/route-b77846f372b01f38.js +1 -0
  165. package/dist/.next/static/chunks/app/api/databases/route-407794f8145d9a0b.js +1 -0
  166. package/dist/.next/static/chunks/app/api/migrations/sync/route-9f480f5590369a8f.js +1 -0
  167. package/dist/.next/static/chunks/app/api/migrations/sync-files/route-92010db279b4dd8e.js +1 -0
  168. package/dist/.next/static/chunks/app/api/pull-data/confirm/route-a02fe6d3cdd0a535.js +1 -0
  169. package/dist/.next/static/chunks/app/api/pull-remote/confirm/route-f401a03507d1da50.js +1 -0
  170. package/dist/.next/static/chunks/app/api/pull-remote/preview/route-3c53814b5cb8b6b0.js +1 -0
  171. package/dist/.next/static/chunks/app/api/push-remote/confirm/route-8f359249e907c63b.js +1 -0
  172. package/dist/.next/static/chunks/app/api/push-remote/preview/route-b51bf94f39c17a9d.js +1 -0
  173. package/dist/.next/static/chunks/app/api/query/route-87bae2d4aebaf859.js +1 -0
  174. package/dist/.next/static/chunks/app/api/tables/[name]/route-d20ca163b9c03e7c.js +1 -0
  175. package/dist/.next/static/chunks/app/api/tables/route-0f46f911562abcdf.js +1 -0
  176. package/dist/.next/static/chunks/app/api/update/route-14edc1917760bce0.js +1 -0
  177. package/dist/.next/static/chunks/app/page-5990cb23b8bd27c4.js +1 -0
  178. package/dist/.next/static/css/674bee6608c638e4.css +3 -0
  179. package/dist/.next/trace +17 -14
  180. package/dist/.next/types/app/api/pull-data/confirm/route.ts +347 -0
  181. package/dist/.next/types/app/api/update/route.ts +347 -0
  182. package/dist/app/api/pull-data/confirm/route.js +230 -0
  183. package/dist/app/api/update/route.js +36 -0
  184. package/dist/app/app/api/pull-data/confirm/route.js +230 -0
  185. package/dist/app/app/api/update/route.js +30 -5
  186. package/dist/app/app/page.jsx +21 -17
  187. package/dist/app/page.jsx +24 -14
  188. package/dist/d1-studio.js +8 -1
  189. package/dist/lib/logger.js +35 -5
  190. package/dist/lib/sql-operations.js +77 -0
  191. package/package.json +1 -1
  192. package/scripts/studio.js +8 -1
  193. package/src/app/api/pull-data/confirm/route.js +230 -0
  194. package/src/app/api/update/route.js +30 -5
  195. package/src/app/page.jsx +21 -17
  196. package/src/components/environment-handler.jsx +70 -16
  197. package/src/components/environment-select.jsx +6 -3
  198. package/src/components/pull-preview-toast.jsx +90 -63
  199. package/src/components/sidebar.jsx +25 -24
  200. package/src/components/update-banner.jsx +29 -31
  201. package/src/context/database-context.js +4 -4
  202. package/src/lib/logger.js +35 -5
  203. package/src/lib/sql-operations.js +77 -0
  204. package/dist/.next/.next/cache/webpack/client-development/0.pack.gz +0 -0
  205. package/dist/.next/.next/cache/webpack/client-development/1.pack.gz +0 -0
  206. package/dist/.next/.next/cache/webpack/client-development/2.pack.gz +0 -0
  207. package/dist/.next/.next/cache/webpack/client-development/3.pack.gz +0 -0
  208. package/dist/.next/.next/cache/webpack/client-development/4.pack.gz +0 -0
  209. package/dist/.next/.next/cache/webpack/client-development/index.pack.gz +0 -0
  210. package/dist/.next/.next/cache/webpack/client-development/index.pack.gz.old +0 -0
  211. package/dist/.next/.next/cache/webpack/client-production/10.pack +0 -0
  212. package/dist/.next/.next/cache/webpack/client-production/11.pack +0 -0
  213. package/dist/.next/.next/cache/webpack/client-production/12.pack +0 -0
  214. package/dist/.next/.next/cache/webpack/client-production/13.pack +0 -0
  215. package/dist/.next/.next/cache/webpack/client-production/14.pack +0 -0
  216. package/dist/.next/.next/cache/webpack/client-production/3.pack +0 -0
  217. package/dist/.next/.next/cache/webpack/client-production/4.pack +0 -0
  218. package/dist/.next/.next/cache/webpack/client-production/5.pack +0 -0
  219. package/dist/.next/.next/cache/webpack/client-production/6.pack +0 -0
  220. package/dist/.next/.next/cache/webpack/client-production/7.pack +0 -0
  221. package/dist/.next/.next/cache/webpack/client-production/8.pack +0 -0
  222. package/dist/.next/.next/cache/webpack/client-production/9.pack +0 -0
  223. package/dist/.next/.next/cache/webpack/server-development/0.pack.gz +0 -0
  224. package/dist/.next/.next/cache/webpack/server-development/1.pack.gz +0 -0
  225. package/dist/.next/.next/cache/webpack/server-development/2.pack.gz +0 -0
  226. package/dist/.next/.next/cache/webpack/server-development/3.pack.gz +0 -0
  227. package/dist/.next/.next/cache/webpack/server-development/4.pack.gz +0 -0
  228. package/dist/.next/.next/cache/webpack/server-development/index.pack.gz +0 -0
  229. package/dist/.next/.next/cache/webpack/server-development/index.pack.gz.old +0 -0
  230. package/dist/.next/.next/cache/webpack/server-production/1.pack +0 -0
  231. package/dist/.next/.next/cache/webpack/server-production/10.pack +0 -0
  232. package/dist/.next/.next/cache/webpack/server-production/11.pack +0 -0
  233. package/dist/.next/.next/cache/webpack/server-production/12.pack +0 -0
  234. package/dist/.next/.next/cache/webpack/server-production/13.pack +0 -0
  235. package/dist/.next/.next/cache/webpack/server-production/2.pack +0 -0
  236. package/dist/.next/.next/cache/webpack/server-production/3.pack +0 -0
  237. package/dist/.next/.next/cache/webpack/server-production/4.pack +0 -0
  238. package/dist/.next/.next/cache/webpack/server-production/5.pack +0 -0
  239. package/dist/.next/.next/cache/webpack/server-production/6.pack +0 -0
  240. package/dist/.next/.next/cache/webpack/server-production/7.pack +0 -0
  241. package/dist/.next/.next/cache/webpack/server-production/8.pack +0 -0
  242. package/dist/.next/.next/cache/webpack/server-production/9.pack +0 -0
  243. package/dist/.next/.next/cache/webpack/server-production/index.pack.old +0 -0
  244. package/dist/.next/.next/server/chunks/686.js +0 -23
  245. package/dist/.next/.next/server/chunks/801.js +0 -55
  246. package/dist/.next/.next/static/IWRJZhjf8U8mjzz4h0VNE/_buildManifest.js +0 -1
  247. package/dist/.next/.next/static/JrwgdSDcipr0Zh7k19Cj_/_buildManifest.js +0 -1
  248. package/dist/.next/.next/static/chunks/422-6fa3c14fc64ad67b.js +0 -1
  249. package/dist/.next/.next/static/chunks/app/api/cloudflare/route-3458d78022185d7f.js +0 -1
  250. package/dist/.next/.next/static/chunks/app/api/cloudflare/route-5133155a604f2719.js +0 -1
  251. package/dist/.next/.next/static/chunks/app/api/databases/route-63a31080b565794e.js +0 -1
  252. package/dist/.next/.next/static/chunks/app/api/databases/route-64255424877a9f72.js +0 -1
  253. package/dist/.next/.next/static/chunks/app/api/migrations/sync/route-03766b3afcf043ba.js +0 -1
  254. package/dist/.next/.next/static/chunks/app/api/migrations/sync/route-d97667565b4a59b6.js +0 -1
  255. package/dist/.next/.next/static/chunks/app/api/migrations/sync-files/route-02fa291c8000dadf.js +0 -1
  256. package/dist/.next/.next/static/chunks/app/api/migrations/sync-files/route-7089bcbfeb6b5260.js +0 -1
  257. package/dist/.next/.next/static/chunks/app/api/pull-remote/confirm/route-7e05bb8920127abe.js +0 -1
  258. package/dist/.next/.next/static/chunks/app/api/pull-remote/confirm/route-9143e6e4c3f05162.js +0 -1
  259. package/dist/.next/.next/static/chunks/app/api/pull-remote/preview/route-0fa15f783e8a306c.js +0 -1
  260. package/dist/.next/.next/static/chunks/app/api/pull-remote/preview/route-c963d143a51aed66.js +0 -1
  261. package/dist/.next/.next/static/chunks/app/api/push-remote/confirm/route-072132c0a6cb3df3.js +0 -1
  262. package/dist/.next/.next/static/chunks/app/api/push-remote/confirm/route-96691f1880e4ed14.js +0 -1
  263. package/dist/.next/.next/static/chunks/app/api/push-remote/preview/route-a798679c67374552.js +0 -1
  264. package/dist/.next/.next/static/chunks/app/api/push-remote/preview/route-ca6bf35aa72661ee.js +0 -1
  265. package/dist/.next/.next/static/chunks/app/api/query/route-1466f6b7ffd8b6c0.js +0 -1
  266. package/dist/.next/.next/static/chunks/app/api/query/route-e90d0030a5083e20.js +0 -1
  267. package/dist/.next/.next/static/chunks/app/api/tables/[name]/route-1efe63e73b480e58.js +0 -1
  268. package/dist/.next/.next/static/chunks/app/api/tables/[name]/route-898d3f85fc8544c4.js +0 -1
  269. package/dist/.next/.next/static/chunks/app/api/tables/route-3772b4f480c4b4a4.js +0 -1
  270. package/dist/.next/.next/static/chunks/app/api/tables/route-91650359fc3735cb.js +0 -1
  271. package/dist/.next/.next/static/chunks/app/api/update/route-504d663df9124f97.js +0 -1
  272. package/dist/.next/.next/static/chunks/app/page-2c28a255a4ecd8d4.js +0 -1
  273. package/dist/.next/.next/static/chunks/app/page-3db7feef57019055.js +0 -1
  274. package/dist/.next/.next/static/chunks/app/page-79049bfa6cc07e11.js +0 -1
  275. package/dist/.next/.next/static/css/4957328384ed5c42.css +0 -3
  276. package/dist/.next/.next/static/css/cf41da7a0d47f779.css +0 -3
  277. package/dist/.next/.next/static/gc8l1G6KXOeLLOM7VJip6/_buildManifest.js +0 -1
  278. package/dist/.next/.next/static/gc8l1G6KXOeLLOM7VJip6/_ssgManifest.js +0 -1
  279. package/dist/.next/.next/static/kYsJoni86CJWDuTkc1xU6/_buildManifest.js +0 -1
  280. package/dist/.next/.next/static/kYsJoni86CJWDuTkc1xU6/_ssgManifest.js +0 -1
  281. package/dist/.next/.next/static/scC5qwQC9H7rR1groM0Q-/_buildManifest.js +0 -1
  282. package/dist/.next/.next/static/scC5qwQC9H7rR1groM0Q-/_ssgManifest.js +0 -1
  283. package/dist/.next/.next/static/tEHOI_-t-iqfJClNzuo9m/_buildManifest.js +0 -1
  284. package/dist/.next/.next/static/tEHOI_-t-iqfJClNzuo9m/_ssgManifest.js +0 -1
  285. package/dist/.next/.next/static/vin2VQs5pM_dH2e2_I7AN/_buildManifest.js +0 -1
  286. package/dist/.next/.next/static/vin2VQs5pM_dH2e2_I7AN/_ssgManifest.js +0 -1
  287. package/dist/.next/.next/static/wHKwQhaxin5_i06GFVDHb/_buildManifest.js +0 -1
  288. package/dist/.next/.next/static/wHKwQhaxin5_i06GFVDHb/_ssgManifest.js +0 -1
  289. package/dist/.next/.next/static/xW4MspD8XibrhXDi_q2IO/_buildManifest.js +0 -1
  290. package/dist/.next/.next/static/xW4MspD8XibrhXDi_q2IO/_ssgManifest.js +0 -1
  291. package/dist/.next/server/chunks/686.js +0 -23
  292. package/dist/.next/server/chunks/801.js +0 -55
  293. package/dist/.next/static/ZwNOdZJ0LOtE0AJMNWwzY/_buildManifest.js +0 -1
  294. package/dist/.next/static/ZwNOdZJ0LOtE0AJMNWwzY/_ssgManifest.js +0 -1
  295. package/dist/.next/static/chunks/422-6fa3c14fc64ad67b.js +0 -1
  296. package/dist/.next/static/chunks/app/api/cloudflare/route-3458d78022185d7f.js +0 -1
  297. package/dist/.next/static/chunks/app/api/databases/route-64255424877a9f72.js +0 -1
  298. package/dist/.next/static/chunks/app/api/migrations/sync/route-03766b3afcf043ba.js +0 -1
  299. package/dist/.next/static/chunks/app/api/migrations/sync-files/route-02fa291c8000dadf.js +0 -1
  300. package/dist/.next/static/chunks/app/api/pull-remote/confirm/route-7e05bb8920127abe.js +0 -1
  301. package/dist/.next/static/chunks/app/api/pull-remote/preview/route-0fa15f783e8a306c.js +0 -1
  302. package/dist/.next/static/chunks/app/api/push-remote/confirm/route-96691f1880e4ed14.js +0 -1
  303. package/dist/.next/static/chunks/app/api/push-remote/preview/route-a798679c67374552.js +0 -1
  304. package/dist/.next/static/chunks/app/api/query/route-e90d0030a5083e20.js +0 -1
  305. package/dist/.next/static/chunks/app/api/tables/[name]/route-1efe63e73b480e58.js +0 -1
  306. package/dist/.next/static/chunks/app/api/tables/route-3772b4f480c4b4a4.js +0 -1
  307. package/dist/.next/static/chunks/app/page-79049bfa6cc07e11.js +0 -1
  308. package/dist/.next/static/css/cf41da7a0d47f779.css +0 -3
  309. /package/dist/.next/.next/static/{IWRJZhjf8U8mjzz4h0VNE → 7XBqETNmhSxMXhw8iUpEa}/_ssgManifest.js +0 -0
  310. /package/dist/.next/{.next/static/JrwgdSDcipr0Zh7k19Cj_ → static/MoZBULXFiTFzrY1JVK_Df}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/push-remote/preview/route"]={"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":"56053","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/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/client-page.js":{"id":7033,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/client-page.js":{"id":7033,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/client-segment.js":{"id":4547,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/client-segment.js":{"id":4547,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/error-boundary.js":{"id":4835,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":4835,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":2328,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":2328,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/layout-router.js":{"id":5244,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/layout-router.js":{"id":5244,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/render-from-template-context.js":{"id":3866,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":3866,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/lib/metadata/metadata-boundary.js":{"id":6213,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/lib/metadata/metadata-boundary.js":{"id":6213,"name":"*","chunks":[],"async":false},"/Users/karenredona/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-c9144179c6bd7d06.js","177","static/chunks/app/layout-8360fab69b848283.js"],"async":false},"/Users/karenredona/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-c9144179c6bd7d06.js","177","static/chunks/app/layout-8360fab69b848283.js"],"async":false},"/Users/karenredona/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-c9144179c6bd7d06.js","177","static/chunks/app/layout-8360fab69b848283.js"],"async":false},"/Users/karenredona/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-c9144179c6bd7d06.js","177","static/chunks/app/layout-8360fab69b848283.js"],"async":false},"/Users/karenredona/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-c9144179c6bd7d06.js","177","static/chunks/app/layout-8360fab69b848283.js"],"async":false},"/Users/karenredona/Desktop/d1studio/src/app/page.jsx":{"id":5612,"name":"*","chunks":["692","static/chunks/692-ede418e1d28a1394.js","958","static/chunks/958-98887928efebfdf7.js","735","static/chunks/735-c9144179c6bd7d06.js","974","static/chunks/app/page-2c28a255a4ecd8d4.js"],"async":false}},"entryCSSFiles":{"/Users/karenredona/Desktop/d1studio/src/":[],"/Users/karenredona/Desktop/d1studio/src/app/layout":[{"inlined":false,"path":"static/css/4957328384ed5c42.css"}],"/Users/karenredona/Desktop/d1studio/src/app/page":[],"/Users/karenredona/Desktop/d1studio/src/app/api/push-remote/preview/route":[]},"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["/api/push-remote/preview/route"]={"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":"93158","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/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/client-page.js":{"id":7033,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/client-page.js":{"id":7033,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/client-segment.js":{"id":4547,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/client-segment.js":{"id":4547,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/error-boundary.js":{"id":4835,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":4835,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":2328,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":2328,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/layout-router.js":{"id":5244,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/layout-router.js":{"id":5244,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/render-from-template-context.js":{"id":3866,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":3866,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/lib/metadata/metadata-boundary.js":{"id":6213,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/lib/metadata/metadata-boundary.js":{"id":6213,"name":"*","chunks":[],"async":false},"/Users/karenredona/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-8360fab69b848283.js"],"async":false},"/Users/karenredona/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-8360fab69b848283.js"],"async":false},"/Users/karenredona/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-8360fab69b848283.js"],"async":false},"/Users/karenredona/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-8360fab69b848283.js"],"async":false},"/Users/karenredona/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-8360fab69b848283.js"],"async":false},"/Users/karenredona/Desktop/d1studio/src/app/page.jsx":{"id":5612,"name":"*","chunks":["692","static/chunks/692-ede418e1d28a1394.js","176","static/chunks/176-9146975ef8699719.js","735","static/chunks/735-b885dfec6353171d.js","974","static/chunks/app/page-5990cb23b8bd27c4.js"],"async":false}},"entryCSSFiles":{"/Users/karenredona/Desktop/d1studio/src/":[],"/Users/karenredona/Desktop/d1studio/src/app/layout":[{"inlined":false,"path":"static/css/674bee6608c638e4.css"}],"/Users/karenredona/Desktop/d1studio/src/app/page":[],"/Users/karenredona/Desktop/d1studio/src/app/api/push-remote/preview/route":[]},"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,8 +1,33 @@
1
- "use strict";(()=>{var e={};e.id=58,e.ids=[58],e.modules={10846:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},44870:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},3295:e=>{e.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},29294:e=>{e.exports=require("next/dist/server/app-render/work-async-storage.external.js")},63033:e=>{e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},79428:e=>{e.exports=require("buffer")},79646:e=>{e.exports=require("child_process")},55511:e=>{e.exports=require("crypto")},94735:e=>{e.exports=require("events")},29021:e=>{e.exports=require("fs")},79748:e=>{e.exports=require("fs/promises")},81630:e=>{e.exports=require("http")},55591:e=>{e.exports=require("https")},21820:e=>{e.exports=require("os")},33873:e=>{e.exports=require("path")},27910:e=>{e.exports=require("stream")},41204:e=>{e.exports=require("string_decoder")},28354:e=>{e.exports=require("util")},74075:e=>{e.exports=require("zlib")},73024:e=>{e.exports=require("node:fs")},76760:e=>{e.exports=require("node:path")},1708:e=>{e.exports=require("node:process")},73136:e=>{e.exports=require("node:url")},5999:(e,r,t)=>{t.r(r),t.d(r,{patchFetch:()=>f,routeModule:()=>N,serverHooks:()=>g,workAsyncStorage:()=>T,workUnitAsyncStorage:()=>O});var s={};t.r(s),t.d(s,{OPTIONS:()=>E,POST:()=>R});var o=t(42706),n=t(28203),a=t(45994),i=t(39187),u=t(65949),d=t(19421),l=t(30961);let c={SYNTAX_ERROR:"SYNTAX_ERROR",EXECUTION_ERROR:"EXECUTION_ERROR",TABLE_NOT_FOUND:"TABLE_NOT_FOUND",TABLE_EXISTS:"TABLE_EXISTS",FOREIGN_KEY_ERROR:"FOREIGN_KEY_ERROR",UNIQUE_CONSTRAINT_ERROR:"UNIQUE_CONSTRAINT_ERROR",NOT_NULL_CONSTRAINT_ERROR:"NOT_NULL_CONSTRAINT_ERROR",CHECK_CONSTRAINT_ERROR:"CHECK_CONSTRAINT_ERROR",UNKNOWN_ERROR:"UNKNOWN_ERROR"};var p=t(81804);async function R(e){p.A.logRequest("POST","/api/query");try{let r;let t=process.env.D1_PROJECT_DIR;if(!t)return p.A.error("Project directory not configured"),i.NextResponse.json({error:"Project directory not configured"},{status:500});let{query:s}=await e.json();if(p.A.shouldLog("debug")&&p.A.debug("Received query:",s),!s?.trim())return i.NextResponse.json({success:!1,error:{message:"Query cannot be empty"}},{status:400});let o=await (0,u.S)(t);if(!o||!o.config)return p.A.error("No Wrangler configuration file found"),i.NextResponse.json({success:!1,error:{message:"No Wrangler configuration file found"}},{status:404});let n=o.config;if(!n.d1_databases?.length)return i.NextResponse.json({success:!1,error:{message:"No D1 databases configured"}},{status:404});let a=n.d1_databases[0].database_name,c=(0,d.mA)(s);if(!c.length)return i.NextResponse.json({success:!1,error:{message:"No valid SQL statements found"}},{status:400});c=c.map(d.Gq);let R=`
1
+ "use strict";(()=>{var e={};e.id=58,e.ids=[58],e.modules={10846:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},44870:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},3295:e=>{e.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},29294:e=>{e.exports=require("next/dist/server/app-render/work-async-storage.external.js")},63033:e=>{e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},79428:e=>{e.exports=require("buffer")},79646:e=>{e.exports=require("child_process")},94735:e=>{e.exports=require("events")},29021:e=>{e.exports=require("fs")},79748:e=>{e.exports=require("fs/promises")},81630:e=>{e.exports=require("http")},55591:e=>{e.exports=require("https")},21820:e=>{e.exports=require("os")},33873:e=>{e.exports=require("path")},27910:e=>{e.exports=require("stream")},41204:e=>{e.exports=require("string_decoder")},28354:e=>{e.exports=require("util")},74075:e=>{e.exports=require("zlib")},73024:e=>{e.exports=require("node:fs")},76760:e=>{e.exports=require("node:path")},1708:e=>{e.exports=require("node:process")},73136:e=>{e.exports=require("node:url")},5999:(e,r,t)=>{t.r(r),t.d(r,{patchFetch:()=>f,routeModule:()=>T,serverHooks:()=>m,workAsyncStorage:()=>N,workUnitAsyncStorage:()=>g});var a={};t.r(a),t.d(a,{OPTIONS:()=>R,POST:()=>p});var s=t(42706),o=t(28203),n=t(45994),i=t(39187),l=t(65949),c=t(19421),d=t(83159);let u={SYNTAX_ERROR:"SYNTAX_ERROR",EXECUTION_ERROR:"EXECUTION_ERROR",TABLE_NOT_FOUND:"TABLE_NOT_FOUND",TABLE_EXISTS:"TABLE_EXISTS",FOREIGN_KEY_ERROR:"FOREIGN_KEY_ERROR",UNIQUE_CONSTRAINT_ERROR:"UNIQUE_CONSTRAINT_ERROR",NOT_NULL_CONSTRAINT_ERROR:"NOT_NULL_CONSTRAINT_ERROR",CHECK_CONSTRAINT_ERROR:"CHECK_CONSTRAINT_ERROR",UNKNOWN_ERROR:"UNKNOWN_ERROR"};var E=t(81804);async function p(e){E.A.logRequest("POST","/api/query");try{let r;let t=process.env.D1_PROJECT_DIR;if(!t)return E.A.error("Project directory not configured"),i.NextResponse.json({error:"Project directory not configured"},{status:500});let{query:a}=await e.json();if(E.A.shouldLog("debug")&&E.A.debug("Received query:",a),!a?.trim())return i.NextResponse.json({success:!1,error:{message:"Query cannot be empty"}},{status:400});let s=await (0,l.S)(t);if(!s||!s.config)return E.A.error("No Wrangler configuration file found"),i.NextResponse.json({success:!1,error:{message:"No Wrangler configuration file found"}},{status:404});let o=s.config;if(!o.d1_databases?.length)return i.NextResponse.json({success:!1,error:{message:"No D1 databases configured"}},{status:404});let n=o.d1_databases[0].database_name,u=(0,c.mA)(a);if(!u.length)return i.NextResponse.json({success:!1,error:{message:"No valid SQL statements found"}},{status:400});u=u.map(c.Gq);let p=`
2
2
  CREATE TABLE IF NOT EXISTS d1_migrations (
3
3
  id INTEGER PRIMARY KEY AUTOINCREMENT,
4
4
  name TEXT NOT NULL UNIQUE,
5
5
  checksum TEXT NOT NULL,
6
6
  applied_at DATETIME DEFAULT CURRENT_TIMESTAMP
7
7
  );
8
- `;if(await (0,d.KK)(t,a,R),c.some(d.QQ)){let e=await (0,l.Gc)(t,a,c);r={success:!0,migrations:e,results:[{results:[]}]}}else{let e=[];for(let r of c){let s=await (0,d.KK)(t,a,r.sql);try{let r=JSON.parse(s),t=r[0]?.results||[];e.push(...t)}catch(e){continue}}r={success:!0,results:[{results:e}]}}return i.NextResponse.json(r)}catch(t){p.A.logError(t,"query-route");let e=function(e){if(console.debug("parseSQLError - Received error:",e),!e)return console.debug("parseSQLError - error is null or undefined."),{type:c.UNKNOWN_ERROR,message:"An unknown error occurred",details:{}};let r="",t=null,s=null,o=e.cmd||e.details&&e.details.command;if(o){let e=o.match(/--command="(.+?)"/s);e&&console.debug("parseSQLError - Extracted original query:",s=e[1].replace(/\\n/g,"\n"))}let n=e.stderr||e.details&&e.details.stderr;if(n){let a=n.replace(/\x1B\[[0-9;]*[a-zA-Z]/g,"");if(console.debug("parseSQLError - Cleaned stderr:",a),a.includes("env: node: No such file or directory"))return console.debug("parseSQLError - Detected 'env: node: No such file or directory' error."),{type:c.EXECUTION_ERROR,message:e.message||"Execution error: env: node: No such file or directory",details:{originalQuery:s,stderr:a}};let i=a.match(/near "([^"]+)": syntax error at offset (\d+)/);if(i){let[e,o,n]=i;return t=parseInt(n,10),r=`Syntax error near "${o}" at position ${t}`,console.debug("parseSQLError - Syntax error detected:",{near:o,offset:t}),{type:c.SYNTAX_ERROR,message:r,details:{originalQuery:s,errorLocation:{offset:t,near:o},stderr:a}}}if(a.includes("UNIQUE constraint failed")){let[e,r,t]=a.match(/UNIQUE constraint failed: (\w+)\.(\w+)/)||[];return console.debug("parseSQLError - UNIQUE constraint error detected:",{table:r,column:t}),{type:c.UNIQUE_CONSTRAINT_ERROR,message:`Unique constraint violation updating ${r}.${t}`,details:{originalQuery:s,stderr:a}}}if(a.includes("NOT NULL constraint failed")){let[e,r,t]=a.match(/NOT NULL constraint failed: (\w+)\.(\w+)/)||[];return console.debug("parseSQLError - NOT NULL constraint error detected:",{table:r,column:t}),{type:c.NOT_NULL_CONSTRAINT_ERROR,message:`NOT NULL constraint violation updating ${r}.${t}`,details:{originalQuery:s,stderr:a}}}if(a.includes("CHECK constraint failed")){let[e,r]=a.match(/CHECK constraint failed: (\w+)/)||[];return console.debug("parseSQLError - CHECK constraint error detected:",{constraintName:r}),{type:c.CHECK_CONSTRAINT_ERROR,message:`Check constraint violation updating ${r}`,details:{originalQuery:s,stderr:a}}}if(a.includes("FOREIGN KEY constraint failed")){console.debug("parseSQLError - FOREIGN KEY constraint error detected.");let e=/--command="([^"]+)"/.exec(o||""),r=e?e[1]:null,t={};if(r){let e=/UPDATE\s+(\w+)\s+SET\s+(\w+)\s*=/.exec(r);e&&(t={table:e[1],column:e[2]})}let s=t.table?`Foreign key constraint violation updating ${t.table}.${t.column}`:"Foreign key constraint violation";return{type:c.FOREIGN_KEY_ERROR,message:s,details:{...t,originalQuery:r,stderr:a}}}if(a.includes("no such table")){let[e,r]=a.match(/no such table: (\w+)/)||[];return console.debug("parseSQLError - Table not found error detected:",{table:r}),{type:c.TABLE_NOT_FOUND,message:`Table not found: ${r}`,details:{originalQuery:s,stderr:a}}}if(a.includes("already exists")){let[e,r]=a.match(/table (\w+) already exists/)||[];return console.debug("parseSQLError - Table exists error detected:",{table:r}),{type:c.TABLE_EXISTS,message:`Table already exists: ${r}`,details:{originalQuery:s,stderr:a}}}return console.debug("parseSQLError - No specific error match found. Using fallback for execution error."),{type:c.EXECUTION_ERROR,message:e.message||"Failed to execute SQL command",details:{originalQuery:s,stderr:a}}}return console.debug("parseSQLError - No stderr available; using default error handling."),{type:c.UNKNOWN_ERROR,message:e.message||"An unknown error occurred",details:{}}}(t),r=t.type===d.wU.VALIDATION_ERROR?400:t.type===d.wU.DEPENDENCY_ERROR?409:500;return i.NextResponse.json({success:!1,error:e},{status:r})}}async function E(){return new i.NextResponse(null,{status:204,headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"POST, OPTIONS","Access-Control-Allow-Headers":"Content-Type"}})}let N=new o.AppRouteRouteModule({definition:{kind:n.RouteKind.APP_ROUTE,page:"/api/query/route",pathname:"/api/query",filename:"route",bundlePath:"app/api/query/route"},resolvedPagePath:"/Users/karenredona/Desktop/d1studio/src/app/api/query/route.js",nextConfigOutput:"",userland:s}),{workAsyncStorage:T,workUnitAsyncStorage:O,serverHooks:g}=N;function f(){return(0,a.patchFetch)({workAsyncStorage:T,workUnitAsyncStorage:O})}}};var r=require("../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),s=r.X(0,[638,452,391,801],()=>t(5999));module.exports=s})();
8
+ `;if(await (0,c.KK)(t,n,p),u.some(c.QQ)){let e=await (0,d.Gc)(t,n,u);r={success:!0,migrations:e,results:[{results:[]}]}}else{let e=[];for(let r of u){let a=await (0,c.KK)(t,n,r.sql);try{let r=JSON.parse(a),t=r[0]?.results||[];e.push(...t)}catch(e){continue}}r={success:!0,results:[{results:e}]}}return i.NextResponse.json(r)}catch(t){E.A.logError(t,"query-route");let e=function(e){if(console.debug("parseSQLError - Received error:",e),!e)return console.debug("parseSQLError - error is null or undefined."),{type:u.UNKNOWN_ERROR,message:"An unknown error occurred",details:{}};let r="",t=null,a=null,s=e.cmd||e.details&&e.details.command;if(s){let e=s.match(/--command="(.+?)"/s);e&&console.debug("parseSQLError - Extracted original query:",a=e[1].replace(/\\n/g,"\n"))}let o=e.stderr||e.details&&e.details.stderr;if(o){let n=o.replace(/\x1B\[[0-9;]*[a-zA-Z]/g,"");if(console.debug("parseSQLError - Cleaned stderr:",n),n.includes("env: node: No such file or directory"))return console.debug("parseSQLError - Detected 'env: node: No such file or directory' error."),{type:u.EXECUTION_ERROR,message:e.message||"Execution error: env: node: No such file or directory",details:{originalQuery:a,stderr:n}};let i=n.match(/near "([^"]+)": syntax error at offset (\d+)/);if(i){let[e,s,o]=i;return t=parseInt(o,10),r=`Syntax error near "${s}" at position ${t}`,console.debug("parseSQLError - Syntax error detected:",{near:s,offset:t}),{type:u.SYNTAX_ERROR,message:r,details:{originalQuery:a,errorLocation:{offset:t,near:s},stderr:n}}}if(n.includes("UNIQUE constraint failed")){let[e,r,t]=n.match(/UNIQUE constraint failed: (\w+)\.(\w+)/)||[];return console.debug("parseSQLError - UNIQUE constraint error detected:",{table:r,column:t}),{type:u.UNIQUE_CONSTRAINT_ERROR,message:`Unique constraint violation updating ${r}.${t}`,details:{originalQuery:a,stderr:n}}}if(n.includes("NOT NULL constraint failed")){let[e,r,t]=n.match(/NOT NULL constraint failed: (\w+)\.(\w+)/)||[];return console.debug("parseSQLError - NOT NULL constraint error detected:",{table:r,column:t}),{type:u.NOT_NULL_CONSTRAINT_ERROR,message:`NOT NULL constraint violation updating ${r}.${t}`,details:{originalQuery:a,stderr:n}}}if(n.includes("CHECK constraint failed")){let[e,r]=n.match(/CHECK constraint failed: (\w+)/)||[];return console.debug("parseSQLError - CHECK constraint error detected:",{constraintName:r}),{type:u.CHECK_CONSTRAINT_ERROR,message:`Check constraint violation updating ${r}`,details:{originalQuery:a,stderr:n}}}if(n.includes("FOREIGN KEY constraint failed")){console.debug("parseSQLError - FOREIGN KEY constraint error detected.");let e=/--command="([^"]+)"/.exec(s||""),r=e?e[1]:null,t={};if(r){let e=/UPDATE\s+(\w+)\s+SET\s+(\w+)\s*=/.exec(r);e&&(t={table:e[1],column:e[2]})}let a=t.table?`Foreign key constraint violation updating ${t.table}.${t.column}`:"Foreign key constraint violation";return{type:u.FOREIGN_KEY_ERROR,message:a,details:{...t,originalQuery:r,stderr:n}}}if(n.includes("no such table")){let[e,r]=n.match(/no such table: (\w+)/)||[];return console.debug("parseSQLError - Table not found error detected:",{table:r}),{type:u.TABLE_NOT_FOUND,message:`Table not found: ${r}`,details:{originalQuery:a,stderr:n}}}if(n.includes("already exists")){let[e,r]=n.match(/table (\w+) already exists/)||[];return console.debug("parseSQLError - Table exists error detected:",{table:r}),{type:u.TABLE_EXISTS,message:`Table already exists: ${r}`,details:{originalQuery:a,stderr:n}}}return console.debug("parseSQLError - No specific error match found. Using fallback for execution error."),{type:u.EXECUTION_ERROR,message:e.message||"Failed to execute SQL command",details:{originalQuery:a,stderr:n}}}return console.debug("parseSQLError - No stderr available; using default error handling."),{type:u.UNKNOWN_ERROR,message:e.message||"An unknown error occurred",details:{}}}(t),r=t.type===c.wU.VALIDATION_ERROR?400:t.type===c.wU.DEPENDENCY_ERROR?409:500;return i.NextResponse.json({success:!1,error:e},{status:r})}}async function R(){return new i.NextResponse(null,{status:204,headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"POST, OPTIONS","Access-Control-Allow-Headers":"Content-Type"}})}let T=new s.AppRouteRouteModule({definition:{kind:o.RouteKind.APP_ROUTE,page:"/api/query/route",pathname:"/api/query",filename:"route",bundlePath:"app/api/query/route"},resolvedPagePath:"/Users/karenredona/Desktop/d1studio/src/app/api/query/route.js",nextConfigOutput:"",userland:a}),{workAsyncStorage:N,workUnitAsyncStorage:g,serverHooks:m}=T;function f(){return(0,n.patchFetch)({workAsyncStorage:N,workUnitAsyncStorage:g})}},83159:(e,r,t)=>{t.d(r,{hI:()=>m,Sl:()=>f,GS:()=>T,Gc:()=>O,k0:()=>E,CM:()=>g,ai:()=>N,JD:()=>R});var a=t(79748),s=t(28354),o=t(79646);let n=require("crypto");var i=t(33873),l=t(19421),c=t(44218),d=t(81804);let u=(0,s.promisify)(o.exec);async function E(e,r,t="local",a=!1){let s="remote"===t?"--remote":"--local",o="remote"===t?`
9
+ CREATE TABLE IF NOT EXISTS d1_migrations (
10
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
11
+ name TEXT NOT NULL UNIQUE,
12
+ applied_at DATETIME DEFAULT CURRENT_TIMESTAMP
13
+ );
14
+ `:`
15
+ CREATE TABLE IF NOT EXISTS d1_migrations (
16
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
17
+ name TEXT NOT NULL UNIQUE,
18
+ checksum TEXT NULL,
19
+ applied_at DATETIME DEFAULT CURRENT_TIMESTAMP
20
+ );
21
+ `;try{await u(`wrangler d1 execute ${r} ${s} --command="${o.replace(/"/g,'\\"')}"`,{cwd:e}),a&&await u(`wrangler d1 execute ${r} ${s} --command="${"DELETE FROM d1_migrations;".replace(/"/g,'\\"')}"`,{cwd:e})}catch(e){throw d.A.error(`Failed to initialize migrations table in ${t}:`,e),e}}function p(e){let r=new Date().toISOString().replace(/[^0-9]/g,"").slice(0,-3),t=e.type.toLowerCase().replace(/_/g,"-");if("CREATE_INDEX"===e.type){let t=e.description.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-_]/g,"");return`${r}_create-index_${t}.sql`}{let a=`${r}_${{"create-table":"create-table","alter-table":"alter-table","drop-table":"drop-table","drop-index":"drop-index","create-view":"create-view","drop-view":"drop-view","add-foreign-key":"add-foreign-key","drop-foreign-key":"drop-foreign-key","add-constraint":"add-constraint","drop-constraint":"drop-constraint"}[t]||t}_${e.tableName}`;return"ALTER_TABLE"===e.type&&e.description&&(a+=`_${e.description}`),(a=a.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-_]/g,""))+".sql"}}async function R(e){let r=await (0,a.readFile)(e,"utf8");try{let e=(0,l.By)(r);return(0,l.Gq)(e),{isValid:!0,statement:e}}catch(e){return{isValid:!1,errors:e}}}async function T(e,r,t){try{let a=await (0,l.KK)(e,r,"SELECT name, applied_at FROM d1_migrations ORDER BY applied_at;",t,!0);if("string"==typeof a){let e=a.indexOf("[");if(-1!==e){let r=a.substring(e),t=JSON.parse(r);return t[0]?.results||[]}}return[]}catch(e){throw{type:l.wU.EXECUTION_ERROR,message:"Failed to get remote migrations",details:{error:e.message,suggestions:["Check remote database permissions","Verify credentials and connection"]}}}}async function N(e,r,{name:t,checksum:a},s="local"){let o="remote"===s?"--remote":"--local";if("local"===s&&a)try{await u(`wrangler d1 execute ${r} ${o} --command="SELECT checksum FROM d1_migrations LIMIT 1;"`,{cwd:e}).catch(()=>!1)||await u(`wrangler d1 execute ${r} ${o} --command="ALTER TABLE d1_migrations ADD COLUMN checksum TEXT;"`,{cwd:e})}catch(e){}let n="remote"!==s&&a?`
22
+ INSERT OR REPLACE INTO d1_migrations (name, checksum, applied_at)
23
+ VALUES ('${t}', '${a}', CURRENT_TIMESTAMP);
24
+ `:`
25
+ INSERT OR REPLACE INTO d1_migrations (name, applied_at)
26
+ VALUES ('${t}', CURRENT_TIMESTAMP);
27
+ `;try{await u(`wrangler d1 execute ${r} ${o} --command="${n.replace(/"/g,'\\"')}"`,{cwd:e})}catch(e){throw d.A.error("Failed to track migration:",e),e}}async function g(e,r,{name:t,checksum:a},s={},o=!1){let n=o||!a?`
28
+ INSERT OR REPLACE INTO d1_migrations (name, applied_at)
29
+ VALUES ('${t}', CURRENT_TIMESTAMP);
30
+ `:`
31
+ INSERT OR REPLACE INTO d1_migrations (name, checksum, applied_at)
32
+ VALUES ('${t}', '${a}', CURRENT_TIMESTAMP);
33
+ `;try{await (0,l.KK)(e,r,n,s,o)}catch(e){throw{type:l.wU.EXECUTION_ERROR,message:`Failed to record migration ${t}`,details:{file:t,error:e.message,suggestions:["Check if migration is already recorded"]}}}}async function m(e,r){try{let t=await T(e,r,{}),a=new Map(t.map(e=>[e.name,e]));return{applied:Array.from(a.keys()),count:a.size}}catch(e){throw d.A.error("Failed to compare migrations:",e),e}}function f(e){return(0,n.createHash)("sha256").update(e).digest("hex")}async function O(e,r,t){try{let s=i.join(e,"migrations");await (0,a.mkdir)(s,{recursive:!0});let o=[],n=[],d=[];for(let e of t)e.type===l.Pg.DATA_MODIFICATION?d.push(e):n.push(e);let u=new Map,E="__no_table__";for(let e of n){let r=e.tableName?e.tableName.toLowerCase():E;u.has(r)||u.set(r,[]),u.get(r).push(e)}let R=[...u.keys()].filter(e=>e!==E),T=[];if(R.length>0){let e=R.map(e=>u.get(e)[0]);T=(0,c.IC)(e)}for(let t of T){for(let n of u.get(t)||[])try{if(n.type===l.Pg.DROP_TABLE&&!await (0,l.F9)(e,r,{},n.tableName,!1))throw Error(`no such table: ${n.tableName}`);let t=await (0,l.KK)(e,r,n.sql);if(t&&(t.toLowerCase().includes("syntax error")||t.toLowerCase().includes("sqlite_error")))throw Error(t);let c=p(n),d=i.join(s,c),u=(0,l.tn)(n.sql);await (0,a.writeFile)(d,u,"utf8");let E=f(n.sql);await N(e,r,{name:c,checksum:E},"local"),o.push({type:n.type,table:n.tableName,migration:c,checksum:E})}catch(e){throw e}u.delete(t)}if(u.has(E))for(let t of u.get(E))try{await (0,l.KK)(e,r,t.sql);let n=p(t),c=i.join(s,n),d=(0,l.tn)(t.sql);await (0,a.writeFile)(c,d,"utf8");let u=f(t.sql);await N(e,r,{name:n,checksum:u},"local"),o.push({type:t.type,table:t.tableName||null,migration:n,checksum:u})}catch(e){throw e}for(let t of d)try{await (0,l.KK)(e,r,t.sql),o.push({type:t.type,table:t.tableName||null,executed:!0})}catch(e){throw e}return o}catch(e){throw e}}}};var r=require("../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),a=r.X(0,[638,452,391,226],()=>t(5999));module.exports=a})();
@@ -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/compiled/next-server/app-route.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","../../../../package.json","../../../chunks/391.js","../../../chunks/452.js","../../../chunks/638.js","../../../chunks/801.js","../../../webpack-runtime.js","route_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/compiled/next-server/app-route.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","../../../../package.json","../../../chunks/226.js","../../../chunks/391.js","../../../chunks/452.js","../../../chunks/638.js","../../../webpack-runtime.js","route_client-reference-manifest.js"]}
@@ -1 +1 @@
1
- globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/query/route"]={"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":"56053","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/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/client-page.js":{"id":7033,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/client-page.js":{"id":7033,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/client-segment.js":{"id":4547,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/client-segment.js":{"id":4547,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/error-boundary.js":{"id":4835,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":4835,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":2328,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":2328,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/layout-router.js":{"id":5244,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/layout-router.js":{"id":5244,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/render-from-template-context.js":{"id":3866,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":3866,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/lib/metadata/metadata-boundary.js":{"id":6213,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/lib/metadata/metadata-boundary.js":{"id":6213,"name":"*","chunks":[],"async":false},"/Users/karenredona/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-c9144179c6bd7d06.js","177","static/chunks/app/layout-8360fab69b848283.js"],"async":false},"/Users/karenredona/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-c9144179c6bd7d06.js","177","static/chunks/app/layout-8360fab69b848283.js"],"async":false},"/Users/karenredona/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-c9144179c6bd7d06.js","177","static/chunks/app/layout-8360fab69b848283.js"],"async":false},"/Users/karenredona/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-c9144179c6bd7d06.js","177","static/chunks/app/layout-8360fab69b848283.js"],"async":false},"/Users/karenredona/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-c9144179c6bd7d06.js","177","static/chunks/app/layout-8360fab69b848283.js"],"async":false},"/Users/karenredona/Desktop/d1studio/src/app/page.jsx":{"id":5612,"name":"*","chunks":["692","static/chunks/692-ede418e1d28a1394.js","958","static/chunks/958-98887928efebfdf7.js","735","static/chunks/735-c9144179c6bd7d06.js","974","static/chunks/app/page-2c28a255a4ecd8d4.js"],"async":false}},"entryCSSFiles":{"/Users/karenredona/Desktop/d1studio/src/":[],"/Users/karenredona/Desktop/d1studio/src/app/layout":[{"inlined":false,"path":"static/css/4957328384ed5c42.css"}],"/Users/karenredona/Desktop/d1studio/src/app/page":[],"/Users/karenredona/Desktop/d1studio/src/app/api/query/route":[]},"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["/api/query/route"]={"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":"93158","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/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/client-page.js":{"id":7033,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/client-page.js":{"id":7033,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/client-segment.js":{"id":4547,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/client-segment.js":{"id":4547,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/error-boundary.js":{"id":4835,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":4835,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":2328,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":2328,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/layout-router.js":{"id":5244,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/layout-router.js":{"id":5244,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/render-from-template-context.js":{"id":3866,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":3866,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/lib/metadata/metadata-boundary.js":{"id":6213,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/lib/metadata/metadata-boundary.js":{"id":6213,"name":"*","chunks":[],"async":false},"/Users/karenredona/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-8360fab69b848283.js"],"async":false},"/Users/karenredona/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-8360fab69b848283.js"],"async":false},"/Users/karenredona/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-8360fab69b848283.js"],"async":false},"/Users/karenredona/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-8360fab69b848283.js"],"async":false},"/Users/karenredona/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-8360fab69b848283.js"],"async":false},"/Users/karenredona/Desktop/d1studio/src/app/page.jsx":{"id":5612,"name":"*","chunks":["692","static/chunks/692-ede418e1d28a1394.js","176","static/chunks/176-9146975ef8699719.js","735","static/chunks/735-b885dfec6353171d.js","974","static/chunks/app/page-5990cb23b8bd27c4.js"],"async":false}},"entryCSSFiles":{"/Users/karenredona/Desktop/d1studio/src/":[],"/Users/karenredona/Desktop/d1studio/src/app/layout":[{"inlined":false,"path":"static/css/674bee6608c638e4.css"}],"/Users/karenredona/Desktop/d1studio/src/app/page":[],"/Users/karenredona/Desktop/d1studio/src/app/api/query/route":[]},"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,5 +1,5 @@
1
- (()=>{var e={};e.id=175,e.ids=[175],e.modules={10846:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},44870:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},3295:e=>{"use strict";e.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},29294:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-async-storage.external.js")},63033:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},79428:e=>{"use strict";e.exports=require("buffer")},79646:e=>{"use strict";e.exports=require("child_process")},94735:e=>{"use strict";e.exports=require("events")},29021:e=>{"use strict";e.exports=require("fs")},79748:e=>{"use strict";e.exports=require("fs/promises")},81630:e=>{"use strict";e.exports=require("http")},55591:e=>{"use strict";e.exports=require("https")},21820:e=>{"use strict";e.exports=require("os")},33873:e=>{"use strict";e.exports=require("path")},27910:e=>{"use strict";e.exports=require("stream")},41204:e=>{"use strict";e.exports=require("string_decoder")},28354:e=>{"use strict";e.exports=require("util")},74075:e=>{"use strict";e.exports=require("zlib")},73024:e=>{"use strict";e.exports=require("node:fs")},76760:e=>{"use strict";e.exports=require("node:path")},1708:e=>{"use strict";e.exports=require("node:process")},73136:e=>{"use strict";e.exports=require("node:url")},32616:(e,r,t)=>{"use strict";t.r(r),t.d(r,{patchFetch:()=>b,routeModule:()=>E,serverHooks:()=>P,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>v});var s={};t.r(s),t.d(s,{GET:()=>q,OPTIONS:()=>y,dynamic:()=>h,runtime:()=>m});var a=t(42706),o=t(28203),n=t(45994),i=t(39187),u=t(28354),c=t(79646),l=t(65949),p=t(81804);class d{constructor(){this.queue=[],this.isProcessing=!1}async add(e){return new Promise((r,t)=>{this.queue.push({operation:e,resolve:r,reject:t}),this.processNext()})}async processNext(){if(this.isProcessing||0===this.queue.length)return;this.isProcessing=!0;let{operation:e,resolve:r,reject:t}=this.queue.shift();try{let t=await e();r(t)}catch(e){p.A.error("Error processing database queue operation:",e),t(e)}finally{this.isProcessing=!1,this.processNext()}}}let f=new d,g=(0,u.promisify)(c.exec),m="nodejs",h="force-dynamic",x=!1;async function w(e,r,t){try{for(;x;)await new Promise(e=>setTimeout(e,100));x=!0;let{stdout:s}=await g(`wrangler d1 execute ${t} --local --command="${e.replace(/"/g,'\\"')}" --json`,{cwd:r}),a=JSON.parse(s);return a[0]?.results||[]}catch(e){throw p.A.error("Query execution error:",e),e}finally{x=!1}}async function q(e,r){return f.add(async()=>{try{let{name:t}=await r.params,{searchParams:s}=new URL(e.url),a=parseInt(s.get("page"))||1,o=parseInt(s.get("limit"))||50,n=(a-1)*o,u=process.env.D1_PROJECT_DIR;if(!u)throw Error("Project directory not configured");let c=await (0,l.S)(u);if(!c||!c.config)throw Error("No Wrangler configuration file found");let p=c.config;if(!p.d1_databases?.length)throw Error("No D1 databases configured");let d=p.d1_databases[0].database_name,f=`PRAGMA table_info(${t});`,g=await w(f,u,d),m=`SELECT sql FROM sqlite_master WHERE type='table' AND name='${t}';`,h=await w(m,u,d),x=h[0]?.sql||"",q=function(e){let r;let t={},s=/CHECK\s*\(\s*(\w+)\s+IN\s*\((.*?)\)\s*\)/gi;for(;null!==(r=s.exec(e));){let e=r[1],s=r[2].split(",").map(e=>e.trim().replace(/^'|'$/g,""));t[e]=s}return t}(x),y=g.map(e=>({...e,check:q[e.name]||null})),E=`SELECT COUNT(*) as total FROM ${t};`,A=await w(E,u,d),v=A[0]?.total||0,P=g.find(e=>1===e.pk)?.name||g[0]?.name,b=`
1
+ (()=>{var e={};e.id=175,e.ids=[175],e.modules={10846:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},44870:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},3295:e=>{"use strict";e.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},29294:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-async-storage.external.js")},63033:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},79428:e=>{"use strict";e.exports=require("buffer")},79646:e=>{"use strict";e.exports=require("child_process")},94735:e=>{"use strict";e.exports=require("events")},29021:e=>{"use strict";e.exports=require("fs")},79748:e=>{"use strict";e.exports=require("fs/promises")},81630:e=>{"use strict";e.exports=require("http")},55591:e=>{"use strict";e.exports=require("https")},21820:e=>{"use strict";e.exports=require("os")},33873:e=>{"use strict";e.exports=require("path")},27910:e=>{"use strict";e.exports=require("stream")},41204:e=>{"use strict";e.exports=require("string_decoder")},28354:e=>{"use strict";e.exports=require("util")},74075:e=>{"use strict";e.exports=require("zlib")},73024:e=>{"use strict";e.exports=require("node:fs")},76760:e=>{"use strict";e.exports=require("node:path")},1708:e=>{"use strict";e.exports=require("node:process")},73136:e=>{"use strict";e.exports=require("node:url")},32616:(e,r,t)=>{"use strict";t.r(r),t.d(r,{patchFetch:()=>v,routeModule:()=>E,serverHooks:()=>A,workAsyncStorage:()=>b,workUnitAsyncStorage:()=>$});var s={};t.r(s),t.d(s,{GET:()=>q,OPTIONS:()=>y,dynamic:()=>h,runtime:()=>m});var o=t(42706),n=t(28203),a=t(45994),i=t(39187),u=t(28354),c=t(79646),l=t(65949),p=t(81804);class d{constructor(){this.queue=[],this.isProcessing=!1}async add(e){return new Promise((r,t)=>{this.queue.push({operation:e,resolve:r,reject:t}),this.processNext()})}async processNext(){if(this.isProcessing||0===this.queue.length)return;this.isProcessing=!0;let{operation:e,resolve:r,reject:t}=this.queue.shift();try{let t=await e();r(t)}catch(e){p.A.error("Error processing database queue operation:",e),t(e)}finally{this.isProcessing=!1,this.processNext()}}}let g=new d,f=(0,u.promisify)(c.exec),m="nodejs",h="force-dynamic",w=!1;async function x(e,r,t){try{for(;w;)await new Promise(e=>setTimeout(e,100));w=!0;let{stdout:s}=await f(`wrangler d1 execute ${t} --local --command="${e.replace(/"/g,'\\"')}" --json`,{cwd:r}),o=JSON.parse(s);return o[0]?.results||[]}catch(e){throw p.A.error("Query execution error:",e),e}finally{w=!1}}async function q(e,r){return g.add(async()=>{try{let{name:t}=await r.params,{searchParams:s}=new URL(e.url),o=parseInt(s.get("page"))||1,n=parseInt(s.get("limit"))||50,a=(o-1)*n,u=process.env.D1_PROJECT_DIR;if(!u)throw Error("Project directory not configured");let c=await (0,l.S)(u);if(!c||!c.config)throw Error("No Wrangler configuration file found");let p=c.config;if(!p.d1_databases?.length)throw Error("No D1 databases configured");let d=p.d1_databases[0].database_name,g=`PRAGMA table_info(${t});`,f=await x(g,u,d),m=`SELECT sql FROM sqlite_master WHERE type='table' AND name='${t}';`,h=await x(m,u,d),w=h[0]?.sql||"",q=function(e){let r;let t={},s=/CHECK\s*\(\s*(\w+)\s+IN\s*\((.*?)\)\s*\)/gi;for(;null!==(r=s.exec(e));){let e=r[1],s=r[2].split(",").map(e=>e.trim().replace(/^'|'$/g,""));t[e]=s}return t}(w),y=f.map(e=>({...e,check:q[e.name]||null})),E=`SELECT COUNT(*) as total FROM ${t};`,b=await x(E,u,d),$=b[0]?.total||0,A=f.find(e=>1===e.pk)?.name||f[0]?.name,v=`
2
2
  SELECT * FROM ${t}
3
- ORDER BY ${P} DESC
4
- LIMIT ${o} OFFSET ${n};
5
- `,j=await w(b,u,d);return i.NextResponse.json({success:!0,schema:y,data:j,meta:{tableName:t,total:v,page:a,limit:o,totalPages:Math.ceil(v/o),rowCount:j.length,columnCount:g.length}})}catch(e){return p.A.error("Error handling request:",e),i.NextResponse.json({success:!1,error:{message:e.message,details:e.stack}},{status:e.message.includes("not configured")?500:e.message.includes("not found")?404:500})}})}async function y(){return new i.NextResponse(null,{status:204,headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET, OPTIONS","Access-Control-Allow-Headers":"Content-Type"}})}let E=new a.AppRouteRouteModule({definition:{kind:o.RouteKind.APP_ROUTE,page:"/api/tables/[name]/route",pathname:"/api/tables/[name]",filename:"route",bundlePath:"app/api/tables/[name]/route"},resolvedPagePath:"/Users/karenredona/Desktop/d1studio/src/app/api/tables/[name]/route.js",nextConfigOutput:"",userland:s}),{workAsyncStorage:A,workUnitAsyncStorage:v,serverHooks:P}=E;function b(){return(0,n.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:v})}},96487:()=>{},78335:()=>{},65949:(e,r,t)=>{"use strict";t.d(r,{S:()=>l});var s=t(79748),a=t(43149),o=t(72537),n=t(26789),i=t(81804);let u=null,c=null;async function l(e){try{let r;if(!e||"string"!=typeof e)throw Error("Project path is required and must be a string");if(u&&c===e)return u;let t=null,l=null;for(let r of["wrangler.toml","wrangler.json","wrangler.jsonc"])if(t=await (0,a.dJ)(r,{cwd:e})){l=r;break}if(!t)return i.A.warn(`No Wrangler configuration file found in: ${e}`),null;i.A.info(`Found ${l} at: ${t}`);let p=await (0,s.readFile)(t,"utf-8");return l.endsWith(".toml")?r=(0,o.parse)(p):(l.endsWith(".jsonc")&&(p=(0,n.A)(p)),r=JSON.parse(p)),u={config:r,projectPath:e},c=e,u}catch(e){throw i.A.error(`Error reading Wrangler configuration: ${e.message}`),e}}},81804:(e,r,t)=>{"use strict";t.d(r,{A:()=>c});var s=t(26399);let{combine:a,timestamp:o,printf:n,colorize:i}=s.format,u=(process.env.DEBUG,n(({level:e,message:r,timestamp:t})=>`${t} ${e}: ${r}`)),c=s.createLogger({level:"warn",format:a(o({format:"YYYY-MM-DD HH:mm:ss"}),i(),u),transports:[new s.transports.Console({level:"warn",silent:!1})]})}};var r=require("../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),s=r.X(0,[638,452,391],()=>t(32616));module.exports=s})();
3
+ ORDER BY ${A} DESC
4
+ LIMIT ${n} OFFSET ${a};
5
+ `,P=await x(v,u,d);return i.NextResponse.json({success:!0,schema:y,data:P,meta:{tableName:t,total:$,page:o,limit:n,totalPages:Math.ceil($/n),rowCount:P.length,columnCount:f.length}})}catch(e){return p.A.error("Error handling request:",e),i.NextResponse.json({success:!1,error:{message:e.message,details:e.stack}},{status:e.message.includes("not configured")?500:e.message.includes("not found")?404:500})}})}async function y(){return new i.NextResponse(null,{status:204,headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET, OPTIONS","Access-Control-Allow-Headers":"Content-Type"}})}let E=new o.AppRouteRouteModule({definition:{kind:n.RouteKind.APP_ROUTE,page:"/api/tables/[name]/route",pathname:"/api/tables/[name]",filename:"route",bundlePath:"app/api/tables/[name]/route"},resolvedPagePath:"/Users/karenredona/Desktop/d1studio/src/app/api/tables/[name]/route.js",nextConfigOutput:"",userland:s}),{workAsyncStorage:b,workUnitAsyncStorage:$,serverHooks:A}=E;function v(){return(0,a.patchFetch)({workAsyncStorage:b,workUnitAsyncStorage:$})}},96487:()=>{},78335:()=>{},65949:(e,r,t)=>{"use strict";t.d(r,{S:()=>l});var s=t(79748),o=t(43149),n=t(72537),a=t(26789),i=t(81804);let u=null,c=null;async function l(e){try{let r;if(!e||"string"!=typeof e)throw Error("Project path is required and must be a string");if(u&&c===e)return u;let t=null,l=null;for(let r of["wrangler.toml","wrangler.json","wrangler.jsonc"])if(t=await (0,o.dJ)(r,{cwd:e})){l=r;break}if(!t)return i.A.warn(`No Wrangler configuration file found in: ${e}`),null;i.A.info(`Found ${l} at: ${t}`);let p=await (0,s.readFile)(t,"utf-8");return l.endsWith(".toml")?r=(0,n.parse)(p):(l.endsWith(".jsonc")&&(p=(0,a.A)(p)),r=JSON.parse(p)),u={config:r,projectPath:e},c=e,u}catch(e){throw i.A.error(`Error reading Wrangler configuration: ${e.message}`),e}}},81804:(e,r,t)=>{"use strict";t.d(r,{A:()=>p});var s=t(26399);let{combine:o,timestamp:n,printf:a,colorize:i}=s.format,u="true"===process.env.DEBUG,c=a(({level:e,message:r,timestamp:t,...s})=>{let o=`${t} ${e}: ${r}`;return Object.keys(s).length>0&&(o+=` ${JSON.stringify(s)}`),o}),l=s.createLogger({level:u?"debug":"warn",format:o(n({format:"YYYY-MM-DD HH:mm:ss"}),i(),c),transports:[new s.transports.Console({level:u?"debug":"warn",silent:!1})]});l.logRequest=(e,r,t={})=>{l.debug(`Request: ${e} ${r}`,t)},l.logError=(e,r="unknown")=>{l.error(`Error in ${r}: ${e.message}`,{error:e.stack||e.message,source:r})},l.shouldLog=e=>{let r=l.level,t={error:0,warn:1,info:2,debug:3};return t[e]<=t[r]};let p=l}};var r=require("../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),s=r.X(0,[638,452,391],()=>t(32616));module.exports=s})();
@@ -1 +1 @@
1
- globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/tables/[name]/route"]={"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":"56053","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/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/client-page.js":{"id":7033,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/client-page.js":{"id":7033,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/client-segment.js":{"id":4547,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/client-segment.js":{"id":4547,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/error-boundary.js":{"id":4835,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":4835,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":2328,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":2328,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/layout-router.js":{"id":5244,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/layout-router.js":{"id":5244,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/render-from-template-context.js":{"id":3866,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":3866,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/lib/metadata/metadata-boundary.js":{"id":6213,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/lib/metadata/metadata-boundary.js":{"id":6213,"name":"*","chunks":[],"async":false},"/Users/karenredona/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-c9144179c6bd7d06.js","177","static/chunks/app/layout-8360fab69b848283.js"],"async":false},"/Users/karenredona/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-c9144179c6bd7d06.js","177","static/chunks/app/layout-8360fab69b848283.js"],"async":false},"/Users/karenredona/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-c9144179c6bd7d06.js","177","static/chunks/app/layout-8360fab69b848283.js"],"async":false},"/Users/karenredona/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-c9144179c6bd7d06.js","177","static/chunks/app/layout-8360fab69b848283.js"],"async":false},"/Users/karenredona/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-c9144179c6bd7d06.js","177","static/chunks/app/layout-8360fab69b848283.js"],"async":false},"/Users/karenredona/Desktop/d1studio/src/app/page.jsx":{"id":5612,"name":"*","chunks":["692","static/chunks/692-ede418e1d28a1394.js","958","static/chunks/958-98887928efebfdf7.js","735","static/chunks/735-c9144179c6bd7d06.js","974","static/chunks/app/page-2c28a255a4ecd8d4.js"],"async":false}},"entryCSSFiles":{"/Users/karenredona/Desktop/d1studio/src/":[],"/Users/karenredona/Desktop/d1studio/src/app/layout":[{"inlined":false,"path":"static/css/4957328384ed5c42.css"}],"/Users/karenredona/Desktop/d1studio/src/app/page":[],"/Users/karenredona/Desktop/d1studio/src/app/api/tables/route":[],"/Users/karenredona/Desktop/d1studio/src/app/api/tables/[name]/route":[]},"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["/api/tables/[name]/route"]={"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":"93158","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/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/client-page.js":{"id":7033,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/client-page.js":{"id":7033,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/client-segment.js":{"id":4547,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/client-segment.js":{"id":4547,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/error-boundary.js":{"id":4835,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":4835,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":2328,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":2328,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/layout-router.js":{"id":5244,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/layout-router.js":{"id":5244,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/render-from-template-context.js":{"id":3866,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":3866,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/lib/metadata/metadata-boundary.js":{"id":6213,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/lib/metadata/metadata-boundary.js":{"id":6213,"name":"*","chunks":[],"async":false},"/Users/karenredona/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-8360fab69b848283.js"],"async":false},"/Users/karenredona/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-8360fab69b848283.js"],"async":false},"/Users/karenredona/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-8360fab69b848283.js"],"async":false},"/Users/karenredona/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-8360fab69b848283.js"],"async":false},"/Users/karenredona/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-8360fab69b848283.js"],"async":false},"/Users/karenredona/Desktop/d1studio/src/app/page.jsx":{"id":5612,"name":"*","chunks":["692","static/chunks/692-ede418e1d28a1394.js","176","static/chunks/176-9146975ef8699719.js","735","static/chunks/735-b885dfec6353171d.js","974","static/chunks/app/page-5990cb23b8bd27c4.js"],"async":false}},"entryCSSFiles":{"/Users/karenredona/Desktop/d1studio/src/":[],"/Users/karenredona/Desktop/d1studio/src/app/layout":[{"inlined":false,"path":"static/css/674bee6608c638e4.css"}],"/Users/karenredona/Desktop/d1studio/src/app/page":[],"/Users/karenredona/Desktop/d1studio/src/app/api/tables/route":[],"/Users/karenredona/Desktop/d1studio/src/app/api/tables/[name]/route":[]},"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,7 +1,7 @@
1
- (()=>{var e={};e.id=761,e.ids=[761],e.modules={10846:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},44870:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},3295:e=>{"use strict";e.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},29294:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-async-storage.external.js")},63033:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},79428:e=>{"use strict";e.exports=require("buffer")},79646:e=>{"use strict";e.exports=require("child_process")},94735:e=>{"use strict";e.exports=require("events")},29021:e=>{"use strict";e.exports=require("fs")},79748:e=>{"use strict";e.exports=require("fs/promises")},81630:e=>{"use strict";e.exports=require("http")},55591:e=>{"use strict";e.exports=require("https")},21820:e=>{"use strict";e.exports=require("os")},33873:e=>{"use strict";e.exports=require("path")},27910:e=>{"use strict";e.exports=require("stream")},41204:e=>{"use strict";e.exports=require("string_decoder")},28354:e=>{"use strict";e.exports=require("util")},74075:e=>{"use strict";e.exports=require("zlib")},73024:e=>{"use strict";e.exports=require("node:fs")},76760:e=>{"use strict";e.exports=require("node:path")},1708:e=>{"use strict";e.exports=require("node:process")},73136:e=>{"use strict";e.exports=require("node:url")},18343:(e,r,t)=>{"use strict";t.r(r),t.d(r,{patchFetch:()=>q,routeModule:()=>m,serverHooks:()=>b,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>h});var s={};t.r(s),t.d(s,{GET:()=>g,OPTIONS:()=>x});var o=t(42706),n=t(28203),a=t(45994),i=t(39187),u=t(28354),l=t(79646),c=t(65949),p=t(81804);let d=(0,u.promisify)(l.exec);async function f(e,r=3,t=1e3){for(let s=0;s<r;s++)try{return await e()}catch(e){if(s===r-1)throw e;if(e.message.includes("database is locked")){console.log(`Database locked, retrying in ${t}ms... (attempt ${s+1}/${r})`),await new Promise(e=>setTimeout(e,t));continue}throw e}}async function g(){p.A.logRequest("GET","/api/tables");try{var e;let r=process.env.D1_PROJECT_DIR;if(!r)return p.A.error("D1_PROJECT_DIR environment variable is not set"),i.NextResponse.json({error:"Project directory not configured"},{status:500});let t=await (0,c.S)(r);if(!t||!t.config)return p.A.error("No Wrangler configuration file found"),i.NextResponse.json({error:"No Wrangler configuration file found in project directory"},{status:404});let s=t.config;if(!s.d1_databases?.length)return i.NextResponse.json({error:"No D1 databases configured in Wrangler configuration"},{status:404});let o=s.d1_databases[0].database_name,n=`
1
+ (()=>{var e={};e.id=761,e.ids=[761],e.modules={10846:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},44870:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},3295:e=>{"use strict";e.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},29294:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-async-storage.external.js")},63033:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},79428:e=>{"use strict";e.exports=require("buffer")},79646:e=>{"use strict";e.exports=require("child_process")},94735:e=>{"use strict";e.exports=require("events")},29021:e=>{"use strict";e.exports=require("fs")},79748:e=>{"use strict";e.exports=require("fs/promises")},81630:e=>{"use strict";e.exports=require("http")},55591:e=>{"use strict";e.exports=require("https")},21820:e=>{"use strict";e.exports=require("os")},33873:e=>{"use strict";e.exports=require("path")},27910:e=>{"use strict";e.exports=require("stream")},41204:e=>{"use strict";e.exports=require("string_decoder")},28354:e=>{"use strict";e.exports=require("util")},74075:e=>{"use strict";e.exports=require("zlib")},73024:e=>{"use strict";e.exports=require("node:fs")},76760:e=>{"use strict";e.exports=require("node:path")},1708:e=>{"use strict";e.exports=require("node:process")},73136:e=>{"use strict";e.exports=require("node:url")},18343:(e,r,t)=>{"use strict";t.r(r),t.d(r,{patchFetch:()=>q,routeModule:()=>x,serverHooks:()=>h,workAsyncStorage:()=>b,workUnitAsyncStorage:()=>w});var s={};t.r(s),t.d(s,{GET:()=>f,OPTIONS:()=>m});var o=t(42706),n=t(28203),a=t(45994),i=t(39187),u=t(28354),l=t(79646),c=t(65949),d=t(81804);let p=(0,u.promisify)(l.exec);async function g(e,r=3,t=1e3){for(let s=0;s<r;s++)try{return await e()}catch(e){if(s===r-1)throw e;if(e.message.includes("database is locked")){console.log(`Database locked, retrying in ${t}ms... (attempt ${s+1}/${r})`),await new Promise(e=>setTimeout(e,t));continue}throw e}}async function f(){d.A.logRequest("GET","/api/tables");try{var e;let r=process.env.D1_PROJECT_DIR;if(!r)return d.A.error("D1_PROJECT_DIR environment variable is not set"),i.NextResponse.json({error:"Project directory not configured"},{status:500});let t=await (0,c.S)(r);if(!t||!t.config)return d.A.error("No Wrangler configuration file found"),i.NextResponse.json({error:"No Wrangler configuration file found in project directory"},{status:404});let s=t.config;if(!s.d1_databases?.length)return i.NextResponse.json({error:"No D1 databases configured in Wrangler configuration"},{status:404});let o=s.d1_databases[0].database_name,n=`
2
2
  SELECT name FROM sqlite_master
3
3
  WHERE type='table'
4
4
  AND name NOT LIKE 'sqlite_%'
5
5
  AND name NOT LIKE '_cf_%'
6
6
  ORDER BY name;
7
- `,{stdout:a}=await f(async()=>d(`wrangler d1 execute ${o} --local --command="${n}"`,{cwd:r,timeout:5e3})),u=(e=function(e){try{return JSON.parse(e)}catch(t){let r=-1!==e.indexOf("[")?e.indexOf("["):e.indexOf("{");if(-1===r)return null;try{let t=e.substring(r);return JSON.parse(t)}catch(e){return console.error("Error parsing JSON portion:",e),null}}}(a))?Array.isArray(e)&&e[0]?.results?e[0].results.map(e=>e.name):e.results?.[0]?.results?e.results[0].results.map(e=>e.name):[]:[];return i.NextResponse.json({success:!0,tables:u,debug:{projectDir:r,tableCount:u.length}})}catch(r){p.A.logError(r,"tables-route");let e={error:"Failed to fetch tables",details:r.message,debug:{errorCode:r.code,errorStack:r.stack}};return r.message.includes("database is locked")&&(e.error="Database is temporarily locked",e.retryAfter=1e3),i.NextResponse.json(e,{status:r.message.includes("database is locked")?503:500})}}async function x(){return new i.NextResponse(null,{status:204,headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET, OPTIONS","Access-Control-Allow-Headers":"Content-Type"}})}let m=new o.AppRouteRouteModule({definition:{kind:n.RouteKind.APP_ROUTE,page:"/api/tables/route",pathname:"/api/tables",filename:"route",bundlePath:"app/api/tables/route"},resolvedPagePath:"/Users/karenredona/Desktop/d1studio/src/app/api/tables/route.js",nextConfigOutput:"",userland:s}),{workAsyncStorage:w,workUnitAsyncStorage:h,serverHooks:b}=m;function q(){return(0,a.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:h})}},96487:()=>{},78335:()=>{},65949:(e,r,t)=>{"use strict";t.d(r,{S:()=>c});var s=t(79748),o=t(43149),n=t(72537),a=t(26789),i=t(81804);let u=null,l=null;async function c(e){try{let r;if(!e||"string"!=typeof e)throw Error("Project path is required and must be a string");if(u&&l===e)return u;let t=null,c=null;for(let r of["wrangler.toml","wrangler.json","wrangler.jsonc"])if(t=await (0,o.dJ)(r,{cwd:e})){c=r;break}if(!t)return i.A.warn(`No Wrangler configuration file found in: ${e}`),null;i.A.info(`Found ${c} at: ${t}`);let p=await (0,s.readFile)(t,"utf-8");return c.endsWith(".toml")?r=(0,n.parse)(p):(c.endsWith(".jsonc")&&(p=(0,a.A)(p)),r=JSON.parse(p)),u={config:r,projectPath:e},l=e,u}catch(e){throw i.A.error(`Error reading Wrangler configuration: ${e.message}`),e}}},81804:(e,r,t)=>{"use strict";t.d(r,{A:()=>l});var s=t(26399);let{combine:o,timestamp:n,printf:a,colorize:i}=s.format,u=(process.env.DEBUG,a(({level:e,message:r,timestamp:t})=>`${t} ${e}: ${r}`)),l=s.createLogger({level:"warn",format:o(n({format:"YYYY-MM-DD HH:mm:ss"}),i(),u),transports:[new s.transports.Console({level:"warn",silent:!1})]})}};var r=require("../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),s=r.X(0,[638,452,391],()=>t(18343));module.exports=s})();
7
+ `,{stdout:a}=await g(async()=>p(`wrangler d1 execute ${o} --local --command="${n}"`,{cwd:r,timeout:5e3})),u=(e=function(e){try{return JSON.parse(e)}catch(t){let r=-1!==e.indexOf("[")?e.indexOf("["):e.indexOf("{");if(-1===r)return null;try{let t=e.substring(r);return JSON.parse(t)}catch(e){return console.error("Error parsing JSON portion:",e),null}}}(a))?Array.isArray(e)&&e[0]?.results?e[0].results.map(e=>e.name):e.results?.[0]?.results?e.results[0].results.map(e=>e.name):[]:[];return i.NextResponse.json({success:!0,tables:u,debug:{projectDir:r,tableCount:u.length}})}catch(r){d.A.logError(r,"tables-route");let e={error:"Failed to fetch tables",details:r.message,debug:{errorCode:r.code,errorStack:r.stack}};return r.message.includes("database is locked")&&(e.error="Database is temporarily locked",e.retryAfter=1e3),i.NextResponse.json(e,{status:r.message.includes("database is locked")?503:500})}}async function m(){return new i.NextResponse(null,{status:204,headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET, OPTIONS","Access-Control-Allow-Headers":"Content-Type"}})}let x=new o.AppRouteRouteModule({definition:{kind:n.RouteKind.APP_ROUTE,page:"/api/tables/route",pathname:"/api/tables",filename:"route",bundlePath:"app/api/tables/route"},resolvedPagePath:"/Users/karenredona/Desktop/d1studio/src/app/api/tables/route.js",nextConfigOutput:"",userland:s}),{workAsyncStorage:b,workUnitAsyncStorage:w,serverHooks:h}=x;function q(){return(0,a.patchFetch)({workAsyncStorage:b,workUnitAsyncStorage:w})}},96487:()=>{},78335:()=>{},65949:(e,r,t)=>{"use strict";t.d(r,{S:()=>c});var s=t(79748),o=t(43149),n=t(72537),a=t(26789),i=t(81804);let u=null,l=null;async function c(e){try{let r;if(!e||"string"!=typeof e)throw Error("Project path is required and must be a string");if(u&&l===e)return u;let t=null,c=null;for(let r of["wrangler.toml","wrangler.json","wrangler.jsonc"])if(t=await (0,o.dJ)(r,{cwd:e})){c=r;break}if(!t)return i.A.warn(`No Wrangler configuration file found in: ${e}`),null;i.A.info(`Found ${c} at: ${t}`);let d=await (0,s.readFile)(t,"utf-8");return c.endsWith(".toml")?r=(0,n.parse)(d):(c.endsWith(".jsonc")&&(d=(0,a.A)(d)),r=JSON.parse(d)),u={config:r,projectPath:e},l=e,u}catch(e){throw i.A.error(`Error reading Wrangler configuration: ${e.message}`),e}}},81804:(e,r,t)=>{"use strict";t.d(r,{A:()=>d});var s=t(26399);let{combine:o,timestamp:n,printf:a,colorize:i}=s.format,u="true"===process.env.DEBUG,l=a(({level:e,message:r,timestamp:t,...s})=>{let o=`${t} ${e}: ${r}`;return Object.keys(s).length>0&&(o+=` ${JSON.stringify(s)}`),o}),c=s.createLogger({level:u?"debug":"warn",format:o(n({format:"YYYY-MM-DD HH:mm:ss"}),i(),l),transports:[new s.transports.Console({level:u?"debug":"warn",silent:!1})]});c.logRequest=(e,r,t={})=>{c.debug(`Request: ${e} ${r}`,t)},c.logError=(e,r="unknown")=>{c.error(`Error in ${r}: ${e.message}`,{error:e.stack||e.message,source:r})},c.shouldLog=e=>{let r=c.level,t={error:0,warn:1,info:2,debug:3};return t[e]<=t[r]};let d=c}};var r=require("../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),s=r.X(0,[638,452,391],()=>t(18343));module.exports=s})();
@@ -1 +1 @@
1
- globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/tables/route"]={"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":"56053","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/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/client-page.js":{"id":7033,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/client-page.js":{"id":7033,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/client-segment.js":{"id":4547,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/client-segment.js":{"id":4547,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/error-boundary.js":{"id":4835,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":4835,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":2328,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":2328,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/layout-router.js":{"id":5244,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/layout-router.js":{"id":5244,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/render-from-template-context.js":{"id":3866,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":3866,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/lib/metadata/metadata-boundary.js":{"id":6213,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/lib/metadata/metadata-boundary.js":{"id":6213,"name":"*","chunks":[],"async":false},"/Users/karenredona/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-c9144179c6bd7d06.js","177","static/chunks/app/layout-8360fab69b848283.js"],"async":false},"/Users/karenredona/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-c9144179c6bd7d06.js","177","static/chunks/app/layout-8360fab69b848283.js"],"async":false},"/Users/karenredona/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-c9144179c6bd7d06.js","177","static/chunks/app/layout-8360fab69b848283.js"],"async":false},"/Users/karenredona/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-c9144179c6bd7d06.js","177","static/chunks/app/layout-8360fab69b848283.js"],"async":false},"/Users/karenredona/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-c9144179c6bd7d06.js","177","static/chunks/app/layout-8360fab69b848283.js"],"async":false},"/Users/karenredona/Desktop/d1studio/src/app/page.jsx":{"id":5612,"name":"*","chunks":["692","static/chunks/692-ede418e1d28a1394.js","958","static/chunks/958-98887928efebfdf7.js","735","static/chunks/735-c9144179c6bd7d06.js","974","static/chunks/app/page-2c28a255a4ecd8d4.js"],"async":false}},"entryCSSFiles":{"/Users/karenredona/Desktop/d1studio/src/":[],"/Users/karenredona/Desktop/d1studio/src/app/layout":[{"inlined":false,"path":"static/css/4957328384ed5c42.css"}],"/Users/karenredona/Desktop/d1studio/src/app/page":[],"/Users/karenredona/Desktop/d1studio/src/app/api/tables/route":[]},"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["/api/tables/route"]={"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":"93158","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/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/client-page.js":{"id":7033,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/client-page.js":{"id":7033,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/client-segment.js":{"id":4547,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/client-segment.js":{"id":4547,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/error-boundary.js":{"id":4835,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":4835,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":2328,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":2328,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/layout-router.js":{"id":5244,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/layout-router.js":{"id":5244,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/client/components/render-from-template-context.js":{"id":3866,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":3866,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/lib/metadata/metadata-boundary.js":{"id":6213,"name":"*","chunks":[],"async":false},"/Users/karenredona/Desktop/d1studio/node_modules/next/dist/esm/lib/metadata/metadata-boundary.js":{"id":6213,"name":"*","chunks":[],"async":false},"/Users/karenredona/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-8360fab69b848283.js"],"async":false},"/Users/karenredona/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-8360fab69b848283.js"],"async":false},"/Users/karenredona/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-8360fab69b848283.js"],"async":false},"/Users/karenredona/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-8360fab69b848283.js"],"async":false},"/Users/karenredona/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-8360fab69b848283.js"],"async":false},"/Users/karenredona/Desktop/d1studio/src/app/page.jsx":{"id":5612,"name":"*","chunks":["692","static/chunks/692-ede418e1d28a1394.js","176","static/chunks/176-9146975ef8699719.js","735","static/chunks/735-b885dfec6353171d.js","974","static/chunks/app/page-5990cb23b8bd27c4.js"],"async":false}},"entryCSSFiles":{"/Users/karenredona/Desktop/d1studio/src/":[],"/Users/karenredona/Desktop/d1studio/src/app/layout":[{"inlined":false,"path":"static/css/674bee6608c638e4.css"}],"/Users/karenredona/Desktop/d1studio/src/app/page":[],"/Users/karenredona/Desktop/d1studio/src/app/api/tables/route":[]},"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":{}}