d1s 0.2.4 → 0.2.5
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.
- package/dist/.next/.next/BUILD_ID +1 -1
- package/dist/.next/.next/app-build-manifest.json +19 -19
- package/dist/.next/.next/app-path-routes-manifest.json +1 -1
- package/dist/.next/.next/build-manifest.json +2 -2
- package/dist/.next/.next/cache/.rscinfo +1 -1
- package/dist/.next/.next/cache/.tsbuildinfo +1 -1
- package/dist/.next/.next/cache/webpack/client-production/0.pack +0 -0
- package/dist/.next/.next/cache/webpack/client-production/1.pack +0 -0
- package/dist/.next/.next/cache/webpack/client-production/2.pack +0 -0
- package/dist/.next/.next/cache/webpack/client-production/index.pack +0 -0
- package/dist/.next/.next/cache/webpack/client-production/index.pack.old +0 -0
- package/dist/.next/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/dist/.next/.next/cache/webpack/server-production/0.pack +0 -0
- package/dist/.next/.next/cache/webpack/server-production/1.pack +0 -0
- package/dist/.next/.next/cache/webpack/server-production/index.pack +0 -0
- package/dist/.next/.next/cache/webpack/server-production/index.pack.old +0 -0
- package/dist/.next/.next/next-minimal-server.js.nft.json +1 -1
- package/dist/.next/.next/next-server.js.nft.json +1 -1
- package/dist/.next/.next/prerender-manifest.json +1 -1
- package/dist/.next/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/.next/.next/server/app/_not-found.html +1 -1
- package/dist/.next/.next/server/app/_not-found.rsc +2 -2
- package/dist/.next/.next/server/app/api/cloudflare/route.js +1 -1
- package/dist/.next/.next/server/app/api/cloudflare/route.js.nft.json +1 -1
- package/dist/.next/.next/server/app/api/cloudflare/route_client-reference-manifest.js +1 -1
- package/dist/.next/.next/server/app/api/databases/route.js +1 -1
- package/dist/.next/.next/server/app/api/databases/route.js.nft.json +1 -1
- package/dist/.next/.next/server/app/api/databases/route_client-reference-manifest.js +1 -1
- package/dist/.next/.next/server/app/api/migrations/sync/route.js +3 -3
- package/dist/.next/.next/server/app/api/migrations/sync/route.js.nft.json +1 -1
- package/dist/.next/.next/server/app/api/migrations/sync/route_client-reference-manifest.js +1 -1
- package/dist/.next/.next/server/app/api/migrations/sync-files/route.js +1 -1
- package/dist/.next/.next/server/app/api/migrations/sync-files/route.js.nft.json +1 -1
- package/dist/.next/.next/server/app/api/migrations/sync-files/route_client-reference-manifest.js +1 -1
- package/dist/.next/.next/server/app/api/pull-remote/confirm/route.js +1 -1
- package/dist/.next/.next/server/app/api/pull-remote/confirm/route.js.nft.json +1 -1
- package/dist/.next/.next/server/app/api/pull-remote/confirm/route_client-reference-manifest.js +1 -1
- package/dist/.next/.next/server/app/api/pull-remote/preview/route.js +1 -1
- package/dist/.next/.next/server/app/api/pull-remote/preview/route.js.nft.json +1 -1
- package/dist/.next/.next/server/app/api/pull-remote/preview/route_client-reference-manifest.js +1 -1
- package/dist/.next/.next/server/app/api/push-remote/confirm/route.js +2 -2
- package/dist/.next/.next/server/app/api/push-remote/confirm/route.js.nft.json +1 -1
- package/dist/.next/.next/server/app/api/push-remote/confirm/route_client-reference-manifest.js +1 -1
- package/dist/.next/.next/server/app/api/push-remote/preview/route.js +2 -2
- package/dist/.next/.next/server/app/api/push-remote/preview/route.js.nft.json +1 -1
- package/dist/.next/.next/server/app/api/push-remote/preview/route_client-reference-manifest.js +1 -1
- package/dist/.next/.next/server/app/api/query/route.js +2 -2
- package/dist/.next/.next/server/app/api/query/route.js.nft.json +1 -1
- package/dist/.next/.next/server/app/api/query/route_client-reference-manifest.js +1 -1
- package/dist/.next/.next/server/app/api/tables/[name]/route.js +4 -4
- package/dist/.next/.next/server/app/api/tables/[name]/route.js.nft.json +1 -1
- package/dist/.next/.next/server/app/api/tables/[name]/route_client-reference-manifest.js +1 -1
- package/dist/.next/.next/server/app/api/tables/route.js +2 -2
- package/dist/.next/.next/server/app/api/tables/route.js.nft.json +1 -1
- package/dist/.next/.next/server/app/api/tables/route_client-reference-manifest.js +1 -1
- package/dist/.next/.next/server/app/index.html +3 -3
- package/dist/.next/.next/server/app/index.rsc +3 -3
- package/dist/.next/.next/server/app/page.js +8 -8
- package/dist/.next/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/.next/.next/server/app-paths-manifest.json +4 -4
- package/dist/.next/.next/server/chunks/336.js +1 -1
- package/dist/.next/.next/server/chunks/{801.js → 603.js} +1 -1
- package/dist/.next/.next/server/chunks/686.js +23 -0
- package/dist/.next/.next/server/chunks/992.js +2 -2
- package/dist/.next/.next/server/pages/404.html +1 -1
- package/dist/.next/.next/server/pages/500.html +1 -1
- package/dist/.next/.next/server/server-reference-manifest.json +1 -1
- package/dist/.next/.next/server/webpack-runtime.js +1 -1
- package/dist/.next/.next/static/chunks/app/page-79049bfa6cc07e11.js +1 -0
- package/dist/.next/.next/static/css/cf41da7a0d47f779.css +3 -0
- package/dist/.next/.next/trace +3 -3
- package/dist/.next/BUILD_ID +1 -1
- package/dist/.next/app-build-manifest.json +18 -18
- package/dist/.next/app-path-routes-manifest.json +1 -1
- package/dist/.next/build-manifest.json +2 -2
- package/dist/.next/cache/.rscinfo +1 -1
- package/dist/.next/cache/.tsbuildinfo +1 -1
- package/dist/.next/cache/webpack/client-production/0.pack +0 -0
- package/dist/.next/cache/webpack/client-production/index.pack +0 -0
- package/dist/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/dist/.next/cache/webpack/server-production/0.pack +0 -0
- package/dist/.next/cache/webpack/server-production/index.pack +0 -0
- package/dist/.next/next-minimal-server.js.nft.json +1 -1
- package/dist/.next/next-server.js.nft.json +1 -1
- package/dist/.next/prerender-manifest.json +1 -1
- package/dist/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/_not-found.html +1 -1
- package/dist/.next/server/app/_not-found.rsc +2 -2
- package/dist/.next/server/app/api/cloudflare/route.js +1 -1
- package/dist/.next/server/app/api/cloudflare/route.js.nft.json +1 -1
- package/dist/.next/server/app/api/cloudflare/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/databases/route.js +1 -1
- package/dist/.next/server/app/api/databases/route.js.nft.json +1 -1
- package/dist/.next/server/app/api/databases/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/migrations/sync/route.js +3 -3
- package/dist/.next/server/app/api/migrations/sync/route.js.nft.json +1 -1
- package/dist/.next/server/app/api/migrations/sync/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/migrations/sync-files/route.js +1 -1
- package/dist/.next/server/app/api/migrations/sync-files/route.js.nft.json +1 -1
- package/dist/.next/server/app/api/migrations/sync-files/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/pull-remote/confirm/route.js +1 -1
- package/dist/.next/server/app/api/pull-remote/confirm/route.js.nft.json +1 -1
- package/dist/.next/server/app/api/pull-remote/confirm/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/pull-remote/preview/route.js +1 -1
- package/dist/.next/server/app/api/pull-remote/preview/route.js.nft.json +1 -1
- package/dist/.next/server/app/api/pull-remote/preview/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/push-remote/confirm/route.js +2 -2
- package/dist/.next/server/app/api/push-remote/confirm/route.js.nft.json +1 -1
- package/dist/.next/server/app/api/push-remote/confirm/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/push-remote/preview/route.js +2 -2
- package/dist/.next/server/app/api/push-remote/preview/route.js.nft.json +1 -1
- package/dist/.next/server/app/api/push-remote/preview/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/query/route.js +2 -2
- package/dist/.next/server/app/api/query/route.js.nft.json +1 -1
- package/dist/.next/server/app/api/query/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/tables/[name]/route.js +4 -4
- package/dist/.next/server/app/api/tables/[name]/route.js.nft.json +1 -1
- package/dist/.next/server/app/api/tables/[name]/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/tables/route.js +2 -2
- package/dist/.next/server/app/api/tables/route.js.nft.json +1 -1
- package/dist/.next/server/app/api/tables/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/index.html +3 -3
- package/dist/.next/server/app/index.rsc +3 -3
- package/dist/.next/server/app/page.js +8 -8
- package/dist/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app-paths-manifest.json +7 -7
- package/dist/.next/server/chunks/{801.js → 603.js} +11 -11
- package/dist/.next/server/chunks/686.js +23 -0
- package/dist/.next/server/pages/404.html +1 -1
- package/dist/.next/server/pages/500.html +1 -1
- package/dist/.next/server/server-reference-manifest.json +1 -1
- package/dist/.next/server/webpack-runtime.js +1 -1
- package/dist/.next/static/chunks/app/page-79049bfa6cc07e11.js +1 -0
- package/dist/.next/static/css/cf41da7a0d47f779.css +3 -0
- package/dist/.next/trace +14 -13
- package/dist/app/api/databases/route.js +1 -1
- package/dist/app/api/pull-remote/confirm/route.js +20 -20
- package/dist/app/api/push-remote/confirm/route.js +1 -1
- package/dist/app/api/push-remote/preview/route.js +1 -1
- package/dist/app/api/query/route.js +7 -7
- package/dist/app/app/page.jsx +3 -6
- package/dist/app/page.jsx +3 -6
- package/dist/d1-studio.js +42 -87
- package/dist/lib/find-wrangler-config.js +10 -9
- package/dist/lib/logger.js +19 -0
- package/package.json +1 -1
- package/scripts/studio.js +42 -87
- package/src/app/page.jsx +3 -6
- package/src/components/sidebar.jsx +108 -92
- package/src/lib/find-wrangler-config.js +10 -9
- package/src/lib/logger.js +19 -0
- package/dist/.next/.next/cache/webpack/client-production/3.pack +0 -0
- package/dist/.next/.next/cache/webpack/client-production/4.pack +0 -0
- package/dist/.next/.next/cache/webpack/client-production/5.pack +0 -0
- package/dist/.next/.next/cache/webpack/client-production/6.pack +0 -0
- package/dist/.next/.next/cache/webpack/server-production/2.pack +0 -0
- package/dist/.next/.next/cache/webpack/server-production/3.pack +0 -0
- package/dist/.next/.next/cache/webpack/server-production/4.pack +0 -0
- package/dist/.next/.next/cache/webpack/server-production/5.pack +0 -0
- package/dist/.next/.next/cache/webpack/server-production/6.pack +0 -0
- package/dist/.next/.next/server/chunks/973.js +0 -2
- package/dist/.next/.next/static/_t0S4u4KzUwKctaxLKvx4/_buildManifest.js +0 -1
- package/dist/.next/.next/static/_t0S4u4KzUwKctaxLKvx4/_ssgManifest.js +0 -1
- package/dist/.next/.next/static/chunks/app/page-75081ac7a88cb706.js +0 -1
- package/dist/.next/.next/static/css/c51a7ef325e30c16.css +0 -3
- package/dist/.next/.next/static/fSVNB2iNhKcZdXXgESWZk/_buildManifest.js +0 -1
- package/dist/.next/.next/static/fSVNB2iNhKcZdXXgESWZk/_ssgManifest.js +0 -1
- package/dist/.next/.next/static/xzPddcyKcodbwNX_sKljr/_buildManifest.js +0 -1
- package/dist/.next/.next/static/xzPddcyKcodbwNX_sKljr/_ssgManifest.js +0 -1
- package/dist/.next/server/chunks/973.js +0 -2
- package/dist/.next/static/OmPVuV0d1lrcjSBQzxkdH/_buildManifest.js +0 -1
- package/dist/.next/static/OmPVuV0d1lrcjSBQzxkdH/_ssgManifest.js +0 -1
- package/dist/.next/static/chunks/app/page-75081ac7a88cb706.js +0 -1
- package/dist/.next/static/css/c51a7ef325e30c16.css +0 -3
- /package/dist/.next/.next/static/{ODMSSwVqLoDcBgbFHUjr8 → q6WmQmyONe88bMN0_jrC2}/_buildManifest.js +0 -0
- /package/dist/.next/.next/static/{ODMSSwVqLoDcBgbFHUjr8 → q6WmQmyONe88bMN0_jrC2}/_ssgManifest.js +0 -0
- /package/dist/.next/{.next/static/YIuXI2CxMwg2fuuUEBsXL → static/Tk1fnz_CXLavm23ZEeChG}/_buildManifest.js +0 -0
- /package/dist/.next/{.next/static/YIuXI2CxMwg2fuuUEBsXL → static/Tk1fnz_CXLavm23ZEeChG}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/page"]={"moduleLoading":{"prefix":"/_next/","crossOrigin":null},"ssrModuleMapping":{"33":{"*":{"id":"2899","name":"*","chunks":[],"async":false}},"2328":{"*":{"id":"7174","name":"*","chunks":[],"async":false}},"2624":{"*":{"id":"7135","name":"*","chunks":[],"async":false}},"3866":{"*":{"id":"7190","name":"*","chunks":[],"async":false}},"4547":{"*":{"id":"3875","name":"*","chunks":[],"async":false}},"4835":{"*":{"id":"8903","name":"*","chunks":[],"async":false}},"5244":{"*":{"id":"4178","name":"*","chunks":[],"async":false}},"6124":{"*":{"id":"2652","name":"*","chunks":[],"async":false}},"6213":{"*":{"id":"1365","name":"*","chunks":[],"async":false}},"7033":{"*":{"id":"6959","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/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":2624,"name":"*","chunks":["692","static/chunks/692-ede418e1d28a1394.js","422","static/chunks/422-6fa3c14fc64ad67b.js","735","static/chunks/735-c9144179c6bd7d06.js","974","static/chunks/app/page-
|
|
1
|
+
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/page"]={"moduleLoading":{"prefix":"/_next/","crossOrigin":null},"ssrModuleMapping":{"33":{"*":{"id":"2899","name":"*","chunks":[],"async":false}},"2328":{"*":{"id":"7174","name":"*","chunks":[],"async":false}},"2624":{"*":{"id":"7135","name":"*","chunks":[],"async":false}},"3866":{"*":{"id":"7190","name":"*","chunks":[],"async":false}},"4547":{"*":{"id":"3875","name":"*","chunks":[],"async":false}},"4835":{"*":{"id":"8903","name":"*","chunks":[],"async":false}},"5244":{"*":{"id":"4178","name":"*","chunks":[],"async":false}},"6124":{"*":{"id":"2652","name":"*","chunks":[],"async":false}},"6213":{"*":{"id":"1365","name":"*","chunks":[],"async":false}},"7033":{"*":{"id":"6959","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/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":2624,"name":"*","chunks":["692","static/chunks/692-ede418e1d28a1394.js","422","static/chunks/422-6fa3c14fc64ad67b.js","735","static/chunks/735-c9144179c6bd7d06.js","974","static/chunks/app/page-79049bfa6cc07e11.js"],"async":false}},"entryCSSFiles":{"/Users/karenredona/Desktop/d1studio/src/":[],"/Users/karenredona/Desktop/d1studio/src/app/layout":[{"inlined":false,"path":"static/css/cf41da7a0d47f779.css"}],"/Users/karenredona/Desktop/d1studio/src/app/page":[]},"rscModuleMapping":{"33":{"*":{"id":"1831","name":"*","chunks":[],"async":false}},"347":{"*":{"id":"1135","name":"*","chunks":[],"async":false}},"2328":{"*":{"id":"802","name":"*","chunks":[],"async":false}},"2624":{"*":{"id":"8868","name":"*","chunks":[],"async":false}},"3866":{"*":{"id":"8530","name":"*","chunks":[],"async":false}},"4547":{"*":{"id":"4863","name":"*","chunks":[],"async":false}},"4835":{"*":{"id":"5155","name":"*","chunks":[],"async":false}},"5244":{"*":{"id":"9350","name":"*","chunks":[],"async":false}},"6124":{"*":{"id":"3164","name":"*","chunks":[],"async":false}},"6213":{"*":{"id":"8921","name":"*","chunks":[],"async":false}},"7033":{"*":{"id":"3219","name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{}}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
-
"/api/databases/route": "app/api/databases/route.js",
|
|
3
|
-
"/api/migrations/sync-files/route": "app/api/migrations/sync-files/route.js",
|
|
4
|
-
"/_not-found/page": "app/_not-found/page.js",
|
|
5
|
-
"/api/cloudflare/route": "app/api/cloudflare/route.js",
|
|
6
2
|
"/api/migrations/sync/route": "app/api/migrations/sync/route.js",
|
|
3
|
+
"/api/cloudflare/route": "app/api/cloudflare/route.js",
|
|
4
|
+
"/_not-found/page": "app/_not-found/page.js",
|
|
5
|
+
"/api/migrations/sync-files/route": "app/api/migrations/sync-files/route.js",
|
|
6
|
+
"/api/databases/route": "app/api/databases/route.js",
|
|
7
7
|
"/api/pull-remote/confirm/route": "app/api/pull-remote/confirm/route.js",
|
|
8
|
-
"/api/pull-remote/preview/route": "app/api/pull-remote/preview/route.js",
|
|
9
|
-
"/api/push-remote/confirm/route": "app/api/push-remote/confirm/route.js",
|
|
10
|
-
"/api/push-remote/preview/route": "app/api/push-remote/preview/route.js",
|
|
11
8
|
"/api/query/route": "app/api/query/route.js",
|
|
9
|
+
"/api/push-remote/preview/route": "app/api/push-remote/preview/route.js",
|
|
10
|
+
"/api/push-remote/confirm/route": "app/api/push-remote/confirm/route.js",
|
|
11
|
+
"/api/pull-remote/preview/route": "app/api/pull-remote/preview/route.js",
|
|
12
12
|
"/api/tables/route": "app/api/tables/route.js",
|
|
13
13
|
"/api/tables/[name]/route": "app/api/tables/[name]/route.js",
|
|
14
14
|
"/page": "app/page.js"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
exports.id=
|
|
1
|
+
exports.id=603,exports.ids=[603],exports.modules={6487:()=>{},8335:()=>{},9999:(e,t,r)=>{"use strict";r.d(t,{S:()=>u});var a=r(9748),s=r(3149),i=r(2537),n=r(6789),l=r(6399);let{combine:E,timestamp:o,printf:c,colorize:m}=l.format,T=c(({level:e,message:t,timestamp:r})=>`${r} ${e}: ${t}`),d=l.createLogger({level:"info",format:E(o({format:"YYYY-MM-DD HH:mm:ss"}),m(),T),transports:[new l.transports.Console]});async function u(e){try{let t;if(!e||"string"!=typeof e)throw Error("Project path is required and must be a string");let r=null,l=null;for(let t of["wrangler.toml","wrangler.json","wrangler.jsonc"])if(r=await (0,s.dJ)(t,{cwd:e})){l=t;break}if(!r)return d.warn(`No Wrangler configuration file found in: ${e}`),null;d.info(`Found ${l} at: ${r}`);let E=await (0,a.readFile)(r,"utf-8");return l.endsWith(".toml")?t=(0,i.parse)(E):(l.endsWith(".jsonc")&&(E=(0,n.A)(E)),t=JSON.parse(E)),{config:t,projectPath:e}}catch(e){throw d.error(`Error reading Wrangler configuration: ${e.message}`),e}}},961:(e,t,r)=>{"use strict";r.d(t,{CM:()=>p,GS:()=>u,Gc:()=>A,JD:()=>d,Sl:()=>N,ai:()=>R,hI:()=>f,k0:()=>m});var a=r(9748),s=r(8354),i=r(9646),n=r(5511),l=r(3873),E=r(9421),o=r(4218);let c=(0,s.promisify)(i.exec);async function m(e,t,r="local",a=!1){let s="remote"===r?"--remote":"--local",i="remote"===r?`
|
|
2
2
|
CREATE TABLE IF NOT EXISTS d1_migrations (
|
|
3
3
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
4
4
|
name TEXT NOT NULL UNIQUE,
|
|
@@ -11,7 +11,7 @@ exports.id=801,exports.ids=[801],exports.modules={6487:()=>{},8335:()=>{},5949:(
|
|
|
11
11
|
checksum TEXT NULL,
|
|
12
12
|
applied_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
|
13
13
|
);
|
|
14
|
-
`;try{await c(`wrangler d1 execute ${t} ${s} --command="${i.replace(/"/g,'\\"')}"`,{cwd:e}),a&&await c(`wrangler d1 execute ${t} ${s} --command="${"DELETE FROM d1_migrations;".replace(/"/g,'\\"')}"`,{cwd:e})}catch(e){throw console.error(`Failed to initialize migrations table in ${r}:`,e),e}}function T(e){let t=new Date().toISOString().replace(/[^0-9]/g,"").slice(0,-3),r=e.type.toLowerCase().replace(/_/g,"-");if("CREATE_INDEX"===e.type){let r=e.description.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-_]/g,"");return`${t}_create-index_${r}.sql`}{let a=`${t}_${{"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"}[r]||r}_${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 d(e){let t=await (0,a.readFile)(e,"utf8");try{let e=(0,
|
|
14
|
+
`;try{await c(`wrangler d1 execute ${t} ${s} --command="${i.replace(/"/g,'\\"')}"`,{cwd:e}),a&&await c(`wrangler d1 execute ${t} ${s} --command="${"DELETE FROM d1_migrations;".replace(/"/g,'\\"')}"`,{cwd:e})}catch(e){throw console.error(`Failed to initialize migrations table in ${r}:`,e),e}}function T(e){let t=new Date().toISOString().replace(/[^0-9]/g,"").slice(0,-3),r=e.type.toLowerCase().replace(/_/g,"-");if("CREATE_INDEX"===e.type){let r=e.description.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-_]/g,"");return`${t}_create-index_${r}.sql`}{let a=`${t}_${{"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"}[r]||r}_${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 d(e){let t=await (0,a.readFile)(e,"utf8");try{let e=(0,E.By)(t);return(0,E.Gq)(e),{isValid:!0,statement:e}}catch(e){return{isValid:!1,errors:e}}}async function u(e,t,r){try{let a=await (0,E.KK)(e,t,"SELECT name, applied_at FROM d1_migrations ORDER BY applied_at;",r,!0);if("string"==typeof a){let e=a.indexOf("[");if(-1!==e){let t=a.substring(e),r=JSON.parse(t);return r[0]?.results||[]}}return[]}catch(e){throw{type:E.wU.EXECUTION_ERROR,message:"Failed to get remote migrations",details:{error:e.message,suggestions:["Check remote database permissions","Verify credentials and connection"]}}}}async function R(e,t,{name:r,checksum:a},s="local"){let i="remote"===s?"--remote":"--local";if("local"===s&&a)try{await c(`wrangler d1 execute ${t} ${i} --command="SELECT checksum FROM d1_migrations LIMIT 1;"`,{cwd:e}).catch(()=>!1)||await c(`wrangler d1 execute ${t} ${i} --command="ALTER TABLE d1_migrations ADD COLUMN checksum TEXT;"`,{cwd:e})}catch(e){}let n="remote"!==s&&a?`
|
|
15
15
|
INSERT OR REPLACE INTO d1_migrations (name, checksum, applied_at)
|
|
16
16
|
VALUES ('${r}', '${a}', CURRENT_TIMESTAMP);
|
|
17
17
|
`:`
|
|
@@ -23,13 +23,13 @@ exports.id=801,exports.ids=[801],exports.modules={6487:()=>{},8335:()=>{},5949:(
|
|
|
23
23
|
`:`
|
|
24
24
|
INSERT OR REPLACE INTO d1_migrations (name, checksum, applied_at)
|
|
25
25
|
VALUES ('${r}', '${a}', CURRENT_TIMESTAMP);
|
|
26
|
-
`;try{await (0,
|
|
26
|
+
`;try{await (0,E.KK)(e,t,n,s,i)}catch(e){throw{type:E.wU.EXECUTION_ERROR,message:`Failed to record migration ${r}`,details:{file:r,error:e.message,suggestions:["Check if migration is already recorded"]}}}}async function f(e,t){try{let r=await u(e,t,{}),a=new Map(r.map(e=>[e.name,e]));return{applied:Array.from(a.keys()),count:a.size}}catch(e){throw console.error("Failed to compare migrations:",e),e}}function N(e){return(0,n.createHash)("sha256").update(e).digest("hex")}async function A(e,t,r){try{let s=l.join(e,"migrations");await (0,a.mkdir)(s,{recursive:!0});let i=[],n=[],c=[];for(let e of r)e.type===E.Pg.DATA_MODIFICATION?c.push(e):n.push(e);let m=new Map,d="__no_table__";for(let e of n){let t=e.tableName?e.tableName.toLowerCase():d;m.has(t)||m.set(t,[]),m.get(t).push(e)}let u=[...m.keys()].filter(e=>e!==d),p=[];if(u.length>0){let e=u.map(e=>m.get(e)[0]);p=(0,o.IC)(e)}for(let r of p){for(let n of m.get(r)||[])try{if(n.type===E.Pg.DROP_TABLE&&!await (0,E.F9)(e,t,{},n.tableName,!1))throw Error(`no such table: ${n.tableName}`);let r=await (0,E.KK)(e,t,n.sql);if(r&&(r.toLowerCase().includes("syntax error")||r.toLowerCase().includes("sqlite_error")))throw Error(r);let o=T(n),c=l.join(s,o),m=(0,E.tn)(n.sql);await (0,a.writeFile)(c,m,"utf8");let d=N(n.sql);await R(e,t,{name:o,checksum:d},"local"),i.push({type:n.type,table:n.tableName,migration:o,checksum:d})}catch(e){throw e}m.delete(r)}if(m.has(d))for(let r of m.get(d))try{await (0,E.KK)(e,t,r.sql);let n=T(r),o=l.join(s,n),c=(0,E.tn)(r.sql);await (0,a.writeFile)(o,c,"utf8");let m=N(r.sql);await R(e,t,{name:n,checksum:m},"local"),i.push({type:r.type,table:r.tableName||null,migration:n,checksum:m})}catch(e){throw e}for(let r of c)try{await (0,E.KK)(e,t,r.sql),i.push({type:r.type,table:r.tableName||null,executed:!0})}catch(e){throw e}return i}catch(e){throw e}}},4218:(e,t,r)=>{"use strict";r.d(t,{IC:()=>i,ZX:()=>s});var a=r(9421);async function s(e,t,r={},i=!1){let n=`
|
|
27
27
|
SELECT name, type, sql
|
|
28
28
|
FROM sqlite_master
|
|
29
29
|
WHERE type IN ('table', 'index', 'trigger')
|
|
30
30
|
AND name NOT LIKE 'sqlite_%'
|
|
31
31
|
AND name != 'd1_migrations';
|
|
32
|
-
`;try{let s=await (0,a.KK)(e,t,n,r,i),l=JSON.parse(s);return l[0]?.results||[]}catch(e){throw{type:a.wU.EXECUTION_ERROR,message:"Failed to get current schema",details:{error:e.message,suggestions:["Check database permissions"]}}}}function i(e){let t=new Map;return e.filter(e=>"DATA_MODIFICATION"!==e.type).forEach(e=>{let r=(e.name||e.tableName).toLowerCase();if(t.has(r)||t.set(r,new Set),"CREATE_TABLE"===e.type){let a=e.sql.match(/FOREIGN\s+KEY\s*\([^)]+\)\s+REFERENCES\s+(\w+)/gi);a&&a.forEach(e=>{let a=e.match(/REFERENCES\s+(\w+)/i)[1].toLowerCase();t.get(r).add(a)})}}),function(e){let t=[],r=new Set,a=new Set;for(let s of e.keys())r.has(s)||function s(i){if(a.has(i))throw Error(`Circular dependency detected for table: ${i}`);if(!r.has(i)){for(let t of(a.add(i),e.get(i)||new Set)){if(!e.has(t))throw Error(`Missing table dependency: ${t}`);s(t)}a.delete(i),r.add(i),t.push(i)}}(s);return t}(t)}},9421:(e,t,r)=>{"use strict";r.d(t,{By:()=>
|
|
32
|
+
`;try{let s=await (0,a.KK)(e,t,n,r,i),l=JSON.parse(s);return l[0]?.results||[]}catch(e){throw{type:a.wU.EXECUTION_ERROR,message:"Failed to get current schema",details:{error:e.message,suggestions:["Check database permissions"]}}}}function i(e){let t=new Map;return e.filter(e=>"DATA_MODIFICATION"!==e.type).forEach(e=>{let r=(e.name||e.tableName).toLowerCase();if(t.has(r)||t.set(r,new Set),"CREATE_TABLE"===e.type){let a=e.sql.match(/FOREIGN\s+KEY\s*\([^)]+\)\s+REFERENCES\s+(\w+)/gi);a&&a.forEach(e=>{let a=e.match(/REFERENCES\s+(\w+)/i)[1].toLowerCase();t.get(r).add(a)})}}),function(e){let t=[],r=new Set,a=new Set;for(let s of e.keys())r.has(s)||function s(i){if(a.has(i))throw Error(`Circular dependency detected for table: ${i}`);if(!r.has(i)){for(let t of(a.add(i),e.get(i)||new Set)){if(!e.has(t))throw Error(`Missing table dependency: ${t}`);s(t)}a.delete(i),r.add(i),t.push(i)}}(s);return t}(t)}},9421:(e,t,r)=>{"use strict";r.d(t,{By:()=>o,F9:()=>R,Gq:()=>c,KK:()=>f,Pg:()=>n,QQ:()=>E,bp:()=>u,mA:()=>p,sP:()=>h,tn:()=>I,wU:()=>l,z6:()=>N});var a=r(8354),s=r(9646);let i=(0,a.promisify)(s.exec),n={CREATE_TABLE:"CREATE_TABLE",ALTER_TABLE:"ALTER_TABLE",DROP_TABLE:"DROP_TABLE",CREATE_INDEX:"CREATE_INDEX",DROP_INDEX:"DROP_INDEX",DATA_MODIFICATION:"DATA_MODIFICATION"},l={VALIDATION_ERROR:"VALIDATION_ERROR",SYNTAX_ERROR:"SYNTAX_ERROR",EXECUTION_ERROR:"EXECUTION_ERROR",DEPENDENCY_ERROR:"DEPENDENCY_ERROR"};function E(e){return e.type!==n.DATA_MODIFICATION}function o(e){let t=e.trim().replace(/\s+/g," "),r=t.toUpperCase();if(r.startsWith("CREATE TABLE"))return{type:n.CREATE_TABLE,tableName:m(t,"CREATE TABLE"),sql:t,description:"create-table"};if(r.startsWith("ALTER TABLE")){let e=m(t,"ALTER TABLE"),a="";if(r.includes("RENAME")){let e=t.match(/RENAME\s+(?:COLUMN\s+)?([\w$]+)\s+TO\s+([\w$]+)/i);e&&(a=`rename-${e[1]}-to-${e[2]}`)}else if(r.includes("ADD COLUMN")){let e=t.match(/ADD\s+COLUMN\s+([\w$]+)(\s+[\w()]+)?/i);if(e){let t=e[1],r=e[2]?e[2].trim().replace(/\s+/g,"-"):"";a=r?`add-${t}-${r}`:`add-${t}`}}else if(r.includes("DROP COLUMN")){let e=t.match(/DROP\s+COLUMN\s+([\w$]+)/i);e&&(a=`drop-${e[1]}`)}else if(r.includes("MODIFY COLUMN")||r.includes("CHANGE COLUMN")){let e=t.match(/(?:MODIFY|CHANGE)\s+COLUMN\s+([\w$]+)(\s+[\w()]+)?/i);if(e){let t=e[1],r=e[2]?e[2].trim().replace(/\s+/g,"-"):"";a=r?`modify-${t}-to-${r}`:`modify-${t}`}}return{type:n.ALTER_TABLE,tableName:e,sql:t,description:a}}if(r.startsWith("DROP TABLE"))return{type:n.DROP_TABLE,tableName:m(t,"DROP TABLE"),sql:t,description:"drop-table"};if(r.startsWith("CREATE INDEX")||r.startsWith("CREATE UNIQUE INDEX")){let e=T(t),r=t.match(/INDEX\s+(?:IF\s+NOT\s+EXISTS\s+)?([\w$]+)/i),a=r?r[1]:"",s=t.match(/ON\s+[\w$]+\s*\(([^)]+)\)/i),i=(s?s[1].trim():"").replace(/\s+/g,"").replace(/,/g,"-").toLowerCase(),l=a;return i&&!l.toLowerCase().includes(i)&&(l+=`-${i}`),{type:n.CREATE_INDEX,tableName:e,sql:t,description:l}}if(r.startsWith("DROP INDEX")){let e=T(t),r=t.match(/DROP\s+INDEX\s+(?:IF\s+EXISTS\s+)?([\w$]+)/i),a=r?r[1]:"";return{type:n.DROP_INDEX,tableName:e,sql:t,description:a?`drop-index-${a}`:"drop-index"}}return{type:n.DATA_MODIFICATION,sql:t,description:"data-modification"}}function c(e){if(e.type!==n.DATA_MODIFICATION&&!e.tableName)throw{type:l.VALIDATION_ERROR,message:`Invalid SQL statement: unable to determine table name for "${e.type}".`,details:{sql:e.sql}};return e}function m(e,t){let r=e.match(RegExp(`${t}\\s+(?:IF\\s+(?:NOT\\s+)?EXISTS\\s+)?([\\w_]+)`,"i"));return r?r[1]:null}function T(e){let t=e.match(/ON\s+([\w_]+)/i);return t?t[1]:null}async function d(e){let t=e.match(/^\d+_create[-_]table[_-](.+)\.sql$/i);return t||(t=e.match(/^\d+_create[-](.+)-table\.sql$/i))||(t=e.match(/^\d+_alter[-_]table[_-](.+?)(?:[_-].+)?\.sql$/i))||(t=e.match(/^\d+_alter[-](.+?)-table(?:[_-].+)?\.sql$/i))||(t=e.match(/^\d+_create[-_]index[-_](.+)\.sql$/i))?t[1]:null}function u(e){return e.split("\n").filter(e=>!e.trim().startsWith("--")).join("\n").trim()}async function R(e,t,r,a,s=!1){let i=`SELECT name FROM sqlite_master WHERE type='table' AND name = '${a}' COLLATE NOCASE;`,n=await f(e,t,i,r,s);try{let e=n.indexOf("[");if(-1!==e){let t=n.substring(e),r=JSON.parse(t);return(r[0]?.results||[]).length>0}return!1}catch(e){return console.error("Error parsing tableExists result:",e),!1}}function p(e){return e.replace(/--.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"").trim().split(";").map(e=>e.trim()).filter(e=>e.length>0).map(e=>o(e+";"))}async function f(e,t,r,a={},s=!1){try{let n=r.trim().replace(/\s+/g," "),l=n.toUpperCase();(l.startsWith("CREATE INDEX")||l.startsWith("CREATE UNIQUE INDEX"))&&!l.includes("IF NOT EXISTS")&&(n=l.startsWith("CREATE UNIQUE INDEX")?n.replace(/CREATE\s+UNIQUE\s+INDEX/i,"CREATE UNIQUE INDEX IF NOT EXISTS"):n.replace(/CREATE\s+INDEX/i,"CREATE INDEX IF NOT EXISTS"));let E="win32"===process.platform,o=`${E?"npx.cmd":"npx"} wrangler d1 execute ${t} ${s?"--remote":"--local"} --command="${n.replace(/"/g,'\\"')}"`,c={cwd:e,env:{...process.env,...a},maxBuffer:0xa00000,shell:!0};console.log("Executing command:",o);let{stdout:m,stderr:T}=await i(o,c);if(T&&!T.includes("\uD83C\uDF00"))throw Error(T);try{let e=m.indexOf("[");if(-1!==e)return m.substring(e)}catch(e){console.warn("JSON parse warning:",e)}return m}catch(e){throw console.error("SQL Execution error:",e),{type:l.EXECUTION_ERROR,message:"Failed to execute SQL command",details:{command:e.cmd,stderr:e.stderr,stdout:e.stdout,originalError:e.message,suggestions:["Ensure Node.js and Wrangler are installed","Check npx in PATH","Verify the D1 database exists and is configured","Check wrangler.toml configuration"]}}}}function N(e){let t=e.trim(),r=t.toUpperCase();return r.startsWith("CREATE TABLE")?function(e){let t=e.match(/CREATE\s+TABLE\s+(?:IF\s+NOT\s+EXISTS\s+)?(\w+)\s*\(([\s\S]*)\)/i);if(!t)return e;let[,r,a]=t,s=A(a).map(e=>e.trim()).filter(Boolean);return`CREATE TABLE ${r} (
|
|
33
33
|
${s.join(",\n ")}
|
|
34
34
|
);`}(t):r.startsWith("CREATE INDEX")||r.startsWith("CREATE UNIQUE INDEX")?function(e){let t=e.match(/CREATE\s+(UNIQUE\s+)?INDEX\s+(?:IF\s+NOT\s+EXISTS\s+)?(\w+)\s+ON\s+(\w+)\s*\((.*)\)/i);if(!t)return e;let[,r,a,s,i]=t,n=i.split(",").map(e=>e.trim()).join(", ");return`CREATE ${r||""}INDEX ${a} ON ${s} (${n});`}(t):r.startsWith("ALTER TABLE")?function(e){let t=e.match(/ALTER\s+TABLE\s+(\w+)\s+(.*)/i);if(!t)return e;let[,r,a]=t,s=A(a);return 1===s.length?`ALTER TABLE ${r} ${s[0]};`:`ALTER TABLE ${r}
|
|
35
35
|
${s.map((e,t)=>` ${e}${t<s.length-1?",":";"}`).join("\n")}`}(t):r.startsWith("DROP TABLE")||r.startsWith("DROP INDEX")?function(e){let t=e.match(/DROP\s+(TABLE|INDEX)\s+(?:IF\s+EXISTS\s+)?(\w+)/i);if(!t)return e;let[,r,a]=t;return`DROP ${r} IF EXISTS ${a};`}(t):r.startsWith("INSERT INTO")?function(e){let t=e.match(/INSERT\s+INTO\s+(\w+)\s*(\([^)]+\))?\s*VALUES\s*(.+)/i);if(!t)return e;let[,r,a,s]=t,i=A(s);return`INSERT INTO ${r}${a?` ${a}`:""}
|
|
@@ -40,16 +40,16 @@ ${i.map(e=>` ${e.trim()}`).join(",\n")}`;return s&&(n+=`
|
|
|
40
40
|
WHERE
|
|
41
41
|
${s.trim()}`),n+";"}(t):r.startsWith("DELETE FROM")?function(e){let t=e.match(/DELETE\s+FROM\s+(\w+)(?:\s+WHERE\s+(.+))?$/i);if(!t)return e;let[,r,a]=t,s=`DELETE FROM ${r}`;return a&&(s+=`
|
|
42
42
|
WHERE
|
|
43
|
-
${a.trim()}`),s+";"}(t):r.startsWith("SELECT")?function(e){let t=e.match(/SELECT\s+(.+?)\s+FROM\s+(.+?)(?:\s+WHERE\s+(.+?))?(?:\s+GROUP\s+BY\s+(.+?))?(?:\s+HAVING\s+(.+?))?(?:\s+ORDER\s+BY\s+(.+?))?(?:\s+LIMIT\s+(.+?))?$/i);if(!t)return e;let[,r,a,s,i,n,l,
|
|
43
|
+
${a.trim()}`),s+";"}(t):r.startsWith("SELECT")?function(e){let t=e.match(/SELECT\s+(.+?)\s+FROM\s+(.+?)(?:\s+WHERE\s+(.+?))?(?:\s+GROUP\s+BY\s+(.+?))?(?:\s+HAVING\s+(.+?))?(?:\s+ORDER\s+BY\s+(.+?))?(?:\s+LIMIT\s+(.+?))?$/i);if(!t)return e;let[,r,a,s,i,n,l,E]=t,o=`SELECT
|
|
44
44
|
${r.split(",").map(e=>e.trim()).join(",\n ")}
|
|
45
45
|
FROM
|
|
46
|
-
${a.trim()}`;return s&&(
|
|
46
|
+
${a.trim()}`;return s&&(o+=`
|
|
47
47
|
WHERE
|
|
48
|
-
${s.trim()}`),i&&(
|
|
48
|
+
${s.trim()}`),i&&(o+=`
|
|
49
49
|
GROUP BY
|
|
50
|
-
${i.trim()}`),n&&(
|
|
50
|
+
${i.trim()}`),n&&(o+=`
|
|
51
51
|
HAVING
|
|
52
|
-
${n.trim()}`),l&&(
|
|
52
|
+
${n.trim()}`),l&&(o+=`
|
|
53
53
|
ORDER BY
|
|
54
|
-
${l.trim()}`),
|
|
55
|
-
LIMIT ${
|
|
54
|
+
${l.trim()}`),E&&(o+=`
|
|
55
|
+
LIMIT ${E.trim()}`),o+";"}(t):t+";"}function A(e){let t=[],r="",a=0,s=!1,i="";for(let n of e)'"'===n&&"\\"!==i&&(s=!s),!s&&("("===n&&a++,")"===n&&a--),","!==n||0!==a||s?r+=n:(t.push(r.trim()),r=""),i=n;return r.trim()&&t.push(r.trim()),t}function I(e){return e.split(";").map(e=>e.trim()).filter(e=>e.length>0).map(e=>N(e)).join("\n\n")+"\n"}async function h(e,t,r,a){try{let s;let i=await d(r);if(i){let r=await f(e,t,`SELECT sql FROM sqlite_master WHERE type='table' AND name='${i}';`,a,!0);try{let e=JSON.parse(r);s=e[0]?.results?.[0]?.sql}catch(e){console.error("Error parsing sqlite_master result:",e)}}if(!s&&r.includes("create-index")){let i=r.match(/create-index[-_]([^_.]+)/);if(i){let r=await f(e,t,`SELECT sql FROM sqlite_master WHERE type='index' AND name='${i[1]}';`,a,!0),n=JSON.parse(r);s=n[0]?.results?.[0]?.sql}}if(!s&&i){let r=await f(e,t,`SELECT sql FROM sqlite_master WHERE name LIKE '%${i}%' LIMIT 1;`,a,!0);try{let e=JSON.parse(r);s=e[0]?.results?.[0]?.sql}catch(e){console.error("Error parsing fallback result:",e)}}if(!s)throw Error(`Could not retrieve SQL content for migration: ${r}`);return s+";"}catch(e){throw{type:l.EXECUTION_ERROR,message:`Failed to get migration file content: ${e.message}`,details:{file:r,error:e.message,suggestions:["Check if the table exists in the remote database","Verify the migration filename follows the expected pattern","Ensure you have permissions to access the remote database"]}}}}}};
|