d1s 0.2.8 → 0.2.10
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 +49 -42
- package/dist/.next/.next/app-path-routes-manifest.json +1 -1
- package/dist/.next/.next/build-manifest.json +3 -3
- 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/3.pack +0 -0
- package/dist/.next/.next/cache/webpack/client-production/4.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/2.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/required-server-files.json +1 -1
- package/dist/.next/.next/server/app/_not-found/page.js +1 -1
- package/dist/.next/.next/server/app/_not-found/page.js.nft.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 +4 -4
- package/dist/.next/.next/server/app/api/cloudflare/route.js +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_client-reference-manifest.js +1 -1
- package/dist/.next/.next/server/app/api/migrations/sync/route.js +28 -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 +26 -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-data/confirm/route.js +1 -0
- package/dist/.next/.next/server/app/api/pull-data/confirm/route.js.nft.json +1 -0
- package/dist/.next/.next/server/app/api/pull-data/confirm/route_client-reference-manifest.js +1 -0
- package/dist/.next/.next/server/app/api/pull-remote/confirm/route.js +26 -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 +26 -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 +28 -3
- 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 +28 -3
- 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 +27 -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_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_client-reference-manifest.js +1 -1
- package/dist/.next/.next/server/app/api/update/route.js +1 -5
- package/dist/.next/.next/server/app/api/update/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 +5 -5
- package/dist/.next/.next/server/app/page.js +10 -10
- package/dist/.next/.next/server/app/page.js.nft.json +1 -1
- package/dist/.next/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/.next/.next/server/app-paths-manifest.json +5 -4
- package/dist/.next/.next/server/chunks/226.js +30 -0
- package/dist/.next/.next/server/chunks/90.js +1 -0
- package/dist/.next/.next/server/chunks/992.js +1 -1
- package/dist/.next/.next/server/middleware-build-manifest.js +1 -1
- package/dist/.next/.next/server/next-font-manifest.js +1 -1
- package/dist/.next/.next/server/next-font-manifest.json +1 -1
- 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/pages-manifest.json +1 -1
- package/dist/.next/.next/server/server-reference-manifest.json +1 -1
- package/dist/.next/.next/static/5dBGGUmK5q7of4h5Rahrg/_buildManifest.js +1 -0
- package/dist/.next/.next/static/PflNFnmFsNegSqhzjI6lA/_buildManifest.js +1 -0
- package/dist/.next/.next/static/chunks/{958-98887928efebfdf7.js → 700-dc8f9f08b166c5e6.js} +1 -1
- package/dist/.next/.next/static/chunks/{735-c9144179c6bd7d06.js → 735-b885dfec6353171d.js} +1 -1
- package/dist/.next/.next/static/chunks/app/api/cloudflare/route-b77846f372b01f38.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/databases/route-407794f8145d9a0b.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/migrations/sync/route-9f480f5590369a8f.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/migrations/sync-files/route-92010db279b4dd8e.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/pull-data/confirm/route-a02fe6d3cdd0a535.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/pull-remote/confirm/route-f401a03507d1da50.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/pull-remote/preview/route-3c53814b5cb8b6b0.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/push-remote/confirm/route-8f359249e907c63b.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/push-remote/preview/route-b51bf94f39c17a9d.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/query/route-87bae2d4aebaf859.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/tables/[name]/route-d20ca163b9c03e7c.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/tables/route-0f46f911562abcdf.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/update/route-14edc1917760bce0.js +1 -0
- package/dist/.next/.next/static/chunks/app/layout-be6ee67cf0c92654.js +1 -0
- package/dist/.next/.next/static/chunks/app/page-16ec561fc8bebb5d.js +1 -0
- package/dist/.next/.next/static/chunks/{main-app-d36cdfb402b40f13.js → main-app-fa35024de9bd9284.js} +1 -1
- package/dist/.next/.next/static/css/0c512cea5f3d317a.css +3 -0
- package/dist/.next/.next/static/p8875OZM4iDNsPzmoyLe7/_buildManifest.js +1 -0
- package/dist/.next/.next/trace +3 -3
- package/dist/.next/.next/types/app/api/cloudflare/route.ts +1 -1
- package/dist/.next/.next/types/app/api/databases/route.ts +1 -1
- package/dist/.next/.next/types/app/api/migrations/sync/route.ts +1 -1
- package/dist/.next/.next/types/app/api/migrations/sync-files/route.ts +1 -1
- package/dist/.next/.next/types/app/api/pull-data/confirm/route.ts +347 -0
- package/dist/.next/.next/types/app/api/pull-remote/confirm/route.ts +1 -1
- package/dist/.next/.next/types/app/api/pull-remote/preview/route.ts +1 -1
- package/dist/.next/.next/types/app/api/push-remote/confirm/route.ts +1 -1
- package/dist/.next/.next/types/app/api/push-remote/preview/route.ts +1 -1
- package/dist/.next/.next/types/app/api/query/route.ts +1 -1
- package/dist/.next/.next/types/app/api/tables/[name]/route.ts +1 -1
- package/dist/.next/.next/types/app/api/tables/route.ts +1 -1
- package/dist/.next/.next/types/app/api/update/route.ts +1 -1
- package/dist/.next/.next/types/app/page.ts +1 -1
- package/dist/.next/BUILD_ID +1 -1
- package/dist/.next/app-build-manifest.json +53 -39
- package/dist/.next/app-path-routes-manifest.json +1 -1
- package/dist/.next/build-manifest.json +3 -3
- 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/required-server-files.json +1 -1
- package/dist/.next/server/app/_not-found/page.js +1 -1
- package/dist/.next/server/app/_not-found/page.js.nft.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 +4 -4
- 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 +28 -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 +26 -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-data/confirm/route.js +1 -0
- package/dist/.next/server/app/api/pull-data/confirm/route.js.nft.json +1 -0
- package/dist/.next/server/app/api/pull-data/confirm/route_client-reference-manifest.js +1 -0
- package/dist/.next/server/app/api/pull-remote/confirm/route.js +26 -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 +26 -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 +28 -3
- 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 +28 -3
- 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 +27 -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 +3 -3
- 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/api/update/route.js +1 -0
- package/dist/.next/server/app/api/update/route.js.nft.json +1 -0
- package/dist/.next/server/app/api/update/route_client-reference-manifest.js +1 -0
- package/dist/.next/server/app/index.html +3 -3
- package/dist/.next/server/app/index.rsc +5 -5
- package/dist/.next/server/app/page.js +13 -11
- package/dist/.next/server/app/page.js.nft.json +1 -1
- package/dist/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app-paths-manifest.json +6 -4
- package/dist/.next/server/chunks/226.js +30 -0
- package/dist/.next/server/chunks/391.js +23 -0
- package/dist/.next/server/chunks/452.js +1 -0
- package/dist/.next/server/chunks/627.js +3 -3
- package/dist/.next/server/chunks/638.js +3 -3
- package/dist/.next/server/chunks/90.js +1 -0
- package/dist/.next/server/chunks/992.js +3 -3
- package/dist/.next/server/middleware-build-manifest.js +1 -1
- package/dist/.next/server/next-font-manifest.js +1 -1
- package/dist/.next/server/next-font-manifest.json +1 -1
- package/dist/.next/server/pages/404.html +1 -1
- package/dist/.next/server/pages/500.html +1 -1
- package/dist/.next/server/pages/_app.js +1 -1
- package/dist/.next/server/pages/_document.js +1 -1
- package/dist/.next/server/pages/_error.js +1 -1
- package/dist/.next/server/server-reference-manifest.json +1 -1
- package/dist/.next/static/chunks/700-dc8f9f08b166c5e6.js +1 -0
- package/dist/.next/static/chunks/{735-c9144179c6bd7d06.js → 735-b885dfec6353171d.js} +1 -1
- package/dist/.next/static/chunks/app/api/cloudflare/route-b77846f372b01f38.js +1 -0
- package/dist/.next/static/chunks/app/api/databases/route-407794f8145d9a0b.js +1 -0
- package/dist/.next/static/chunks/app/api/migrations/sync/route-9f480f5590369a8f.js +1 -0
- package/dist/.next/static/chunks/app/api/migrations/sync-files/route-92010db279b4dd8e.js +1 -0
- package/dist/.next/static/chunks/app/api/pull-data/confirm/route-a02fe6d3cdd0a535.js +1 -0
- package/dist/.next/static/chunks/app/api/pull-remote/confirm/route-f401a03507d1da50.js +1 -0
- package/dist/.next/static/chunks/app/api/pull-remote/preview/route-3c53814b5cb8b6b0.js +1 -0
- package/dist/.next/static/chunks/app/api/push-remote/confirm/route-8f359249e907c63b.js +1 -0
- package/dist/.next/static/chunks/app/api/push-remote/preview/route-b51bf94f39c17a9d.js +1 -0
- package/dist/.next/static/chunks/app/api/query/route-87bae2d4aebaf859.js +1 -0
- package/dist/.next/static/chunks/app/api/tables/[name]/route-d20ca163b9c03e7c.js +1 -0
- package/dist/.next/static/chunks/app/api/tables/route-0f46f911562abcdf.js +1 -0
- package/dist/.next/static/chunks/app/api/update/route-14edc1917760bce0.js +1 -0
- package/dist/.next/static/chunks/app/layout-be6ee67cf0c92654.js +1 -0
- package/dist/.next/static/chunks/app/page-16ec561fc8bebb5d.js +1 -0
- package/dist/.next/static/chunks/{main-app-d36cdfb402b40f13.js → main-app-fa35024de9bd9284.js} +1 -1
- package/dist/.next/static/css/0c512cea5f3d317a.css +3 -0
- package/dist/.next/static 2/5dBGGUmK5q7of4h5Rahrg/_buildManifest.js +1 -0
- package/dist/.next/trace +16 -14
- package/dist/.next/types/app/api/cloudflare/route.ts +1 -1
- package/dist/.next/types/app/api/databases/route.ts +1 -1
- package/dist/.next/types/app/api/migrations/sync/route.ts +1 -1
- package/dist/.next/types/app/api/migrations/sync-files/route.ts +1 -1
- package/dist/.next/types/app/api/pull-data/confirm/route.ts +347 -0
- package/dist/.next/types/app/api/pull-remote/confirm/route.ts +1 -1
- package/dist/.next/types/app/api/pull-remote/preview/route.ts +1 -1
- package/dist/.next/types/app/api/push-remote/confirm/route.ts +1 -1
- package/dist/.next/types/app/api/push-remote/preview/route.ts +1 -1
- package/dist/.next/types/app/api/query/route.ts +1 -1
- package/dist/.next/types/app/api/tables/[name]/route.ts +1 -1
- package/dist/.next/types/app/api/tables/route.ts +1 -1
- package/dist/.next/types/app/api/update/route.ts +347 -0
- package/dist/.next/types/app/page.ts +1 -1
- package/dist/app/api/pull-data/confirm/route.js +230 -0
- package/dist/app/api/update/route.js +45 -0
- package/dist/app/app/api/pull-data/confirm/route.js +230 -0
- package/dist/app/app/api/update/route.js +40 -6
- package/dist/app/app/page.jsx +21 -17
- package/dist/app/page.jsx +24 -14
- package/dist/d1-studio.js +8 -195
- package/dist/lib/logger.js +35 -5
- package/dist/lib/sql-operations.js +107 -24
- package/dist/lib/version-utils.js +34 -0
- package/package.json +2 -2
- package/scripts/studio.js +8 -195
- package/src/app/api/pull-data/confirm/route.js +230 -0
- package/src/app/api/update/route.js +40 -6
- package/src/app/page.jsx +21 -17
- package/src/components/environment-handler.jsx +70 -16
- package/src/components/environment-select.jsx +6 -3
- package/src/components/pull-preview-toast.jsx +90 -63
- package/src/components/sidebar.jsx +27 -25
- package/src/components/update-banner.jsx +70 -41
- package/src/context/database-context.js +4 -4
- package/src/lib/logger.js +35 -5
- package/src/lib/sql-operations.js +107 -24
- package/src/lib/version-utils.js +34 -0
- package/dist/.next/.next/cache/webpack/client-development/0.pack.gz +0 -0
- package/dist/.next/.next/cache/webpack/client-development/1.pack.gz +0 -0
- package/dist/.next/.next/cache/webpack/client-development/2.pack.gz +0 -0
- package/dist/.next/.next/cache/webpack/client-development/3.pack.gz +0 -0
- package/dist/.next/.next/cache/webpack/client-development/4.pack.gz +0 -0
- package/dist/.next/.next/cache/webpack/client-development/index.pack.gz +0 -0
- package/dist/.next/.next/cache/webpack/client-development/index.pack.gz.old +0 -0
- package/dist/.next/.next/cache/webpack/client-production/10.pack +0 -0
- package/dist/.next/.next/cache/webpack/client-production/11.pack +0 -0
- package/dist/.next/.next/cache/webpack/client-production/12.pack +0 -0
- package/dist/.next/.next/cache/webpack/client-production/13.pack +0 -0
- package/dist/.next/.next/cache/webpack/client-production/14.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/client-production/7.pack +0 -0
- package/dist/.next/.next/cache/webpack/client-production/8.pack +0 -0
- package/dist/.next/.next/cache/webpack/client-production/9.pack +0 -0
- package/dist/.next/.next/cache/webpack/server-development/0.pack.gz +0 -0
- package/dist/.next/.next/cache/webpack/server-development/1.pack.gz +0 -0
- package/dist/.next/.next/cache/webpack/server-development/2.pack.gz +0 -0
- package/dist/.next/.next/cache/webpack/server-development/3.pack.gz +0 -0
- package/dist/.next/.next/cache/webpack/server-development/4.pack.gz +0 -0
- package/dist/.next/.next/cache/webpack/server-development/index.pack.gz +0 -0
- package/dist/.next/.next/cache/webpack/server-development/index.pack.gz.old +0 -0
- package/dist/.next/.next/cache/webpack/server-production/10.pack +0 -0
- package/dist/.next/.next/cache/webpack/server-production/11.pack +0 -0
- package/dist/.next/.next/cache/webpack/server-production/12.pack +0 -0
- package/dist/.next/.next/cache/webpack/server-production/13.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/cache/webpack/server-production/7.pack +0 -0
- package/dist/.next/.next/cache/webpack/server-production/8.pack +0 -0
- package/dist/.next/.next/cache/webpack/server-production/9.pack +0 -0
- package/dist/.next/.next/server/chunks/336.js +0 -1
- package/dist/.next/.next/server/chunks/686.js +0 -23
- package/dist/.next/.next/server/chunks/801.js +0 -55
- package/dist/.next/.next/static/IWRJZhjf8U8mjzz4h0VNE/_buildManifest.js +0 -1
- package/dist/.next/.next/static/JrwgdSDcipr0Zh7k19Cj_/_buildManifest.js +0 -1
- package/dist/.next/.next/static/chunks/422-6fa3c14fc64ad67b.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/cloudflare/route-3458d78022185d7f.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/cloudflare/route-5133155a604f2719.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/databases/route-63a31080b565794e.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/databases/route-64255424877a9f72.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/migrations/sync/route-03766b3afcf043ba.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/migrations/sync/route-d97667565b4a59b6.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/migrations/sync-files/route-02fa291c8000dadf.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/migrations/sync-files/route-7089bcbfeb6b5260.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/pull-remote/confirm/route-7e05bb8920127abe.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/pull-remote/confirm/route-9143e6e4c3f05162.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/pull-remote/preview/route-0fa15f783e8a306c.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/pull-remote/preview/route-c963d143a51aed66.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/push-remote/confirm/route-072132c0a6cb3df3.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/push-remote/confirm/route-96691f1880e4ed14.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/push-remote/preview/route-a798679c67374552.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/push-remote/preview/route-ca6bf35aa72661ee.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/query/route-1466f6b7ffd8b6c0.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/query/route-e90d0030a5083e20.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/tables/[name]/route-1efe63e73b480e58.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/tables/[name]/route-898d3f85fc8544c4.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/tables/route-3772b4f480c4b4a4.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/tables/route-91650359fc3735cb.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/update/route-504d663df9124f97.js +0 -1
- package/dist/.next/.next/static/chunks/app/layout-8360fab69b848283.js +0 -1
- package/dist/.next/.next/static/chunks/app/page-2c28a255a4ecd8d4.js +0 -1
- package/dist/.next/.next/static/chunks/app/page-3db7feef57019055.js +0 -1
- package/dist/.next/.next/static/chunks/app/page-79049bfa6cc07e11.js +0 -1
- package/dist/.next/.next/static/css/4957328384ed5c42.css +0 -3
- package/dist/.next/.next/static/css/cf41da7a0d47f779.css +0 -3
- package/dist/.next/.next/static/gc8l1G6KXOeLLOM7VJip6/_buildManifest.js +0 -1
- package/dist/.next/.next/static/kYsJoni86CJWDuTkc1xU6/_buildManifest.js +0 -1
- package/dist/.next/.next/static/scC5qwQC9H7rR1groM0Q-/_buildManifest.js +0 -1
- package/dist/.next/.next/static/scC5qwQC9H7rR1groM0Q-/_ssgManifest.js +0 -1
- package/dist/.next/.next/static/tEHOI_-t-iqfJClNzuo9m/_buildManifest.js +0 -1
- package/dist/.next/.next/static/tEHOI_-t-iqfJClNzuo9m/_ssgManifest.js +0 -1
- package/dist/.next/.next/static/vin2VQs5pM_dH2e2_I7AN/_buildManifest.js +0 -1
- package/dist/.next/.next/static/vin2VQs5pM_dH2e2_I7AN/_ssgManifest.js +0 -1
- package/dist/.next/.next/static/wHKwQhaxin5_i06GFVDHb/_buildManifest.js +0 -1
- package/dist/.next/.next/static/wHKwQhaxin5_i06GFVDHb/_ssgManifest.js +0 -1
- package/dist/.next/.next/static/xW4MspD8XibrhXDi_q2IO/_buildManifest.js +0 -1
- package/dist/.next/.next/static/xW4MspD8XibrhXDi_q2IO/_ssgManifest.js +0 -1
- package/dist/.next/server/chunks/336.js +0 -1
- package/dist/.next/server/chunks/686.js +0 -23
- package/dist/.next/server/chunks/801.js +0 -55
- package/dist/.next/static/ZwNOdZJ0LOtE0AJMNWwzY/_buildManifest.js +0 -1
- package/dist/.next/static/ZwNOdZJ0LOtE0AJMNWwzY/_ssgManifest.js +0 -1
- package/dist/.next/static/chunks/422-6fa3c14fc64ad67b.js +0 -1
- package/dist/.next/static/chunks/app/api/cloudflare/route-3458d78022185d7f.js +0 -1
- package/dist/.next/static/chunks/app/api/databases/route-64255424877a9f72.js +0 -1
- package/dist/.next/static/chunks/app/api/migrations/sync/route-03766b3afcf043ba.js +0 -1
- package/dist/.next/static/chunks/app/api/migrations/sync-files/route-02fa291c8000dadf.js +0 -1
- package/dist/.next/static/chunks/app/api/pull-remote/confirm/route-7e05bb8920127abe.js +0 -1
- package/dist/.next/static/chunks/app/api/pull-remote/preview/route-0fa15f783e8a306c.js +0 -1
- package/dist/.next/static/chunks/app/api/push-remote/confirm/route-96691f1880e4ed14.js +0 -1
- package/dist/.next/static/chunks/app/api/push-remote/preview/route-a798679c67374552.js +0 -1
- package/dist/.next/static/chunks/app/api/query/route-e90d0030a5083e20.js +0 -1
- package/dist/.next/static/chunks/app/api/tables/[name]/route-1efe63e73b480e58.js +0 -1
- package/dist/.next/static/chunks/app/api/tables/route-3772b4f480c4b4a4.js +0 -1
- package/dist/.next/static/chunks/app/layout-8360fab69b848283.js +0 -1
- package/dist/.next/static/chunks/app/page-79049bfa6cc07e11.js +0 -1
- package/dist/.next/static/css/cf41da7a0d47f779.css +0 -3
- /package/dist/.next/.next/static/{IWRJZhjf8U8mjzz4h0VNE → 5dBGGUmK5q7of4h5Rahrg}/_ssgManifest.js +0 -0
- /package/dist/.next/.next/static/{JrwgdSDcipr0Zh7k19Cj_ → PflNFnmFsNegSqhzjI6lA}/_ssgManifest.js +0 -0
- /package/dist/.next/.next/static/{gc8l1G6KXOeLLOM7VJip6 → p8875OZM4iDNsPzmoyLe7}/_ssgManifest.js +0 -0
- /package/dist/.next/{.next/static/kYsJoni86CJWDuTkc1xU6 → static 2/5dBGGUmK5q7of4h5Rahrg}/_ssgManifest.js +0 -0
|
@@ -1,11 +1,45 @@
|
|
|
1
1
|
// app/api/update/route.js
|
|
2
2
|
import { NextResponse } from 'next/server';
|
|
3
|
-
import updateNotifier from 'update-notifier';
|
|
4
3
|
import pkg from '../../../../package.json' assert { type: 'json' };
|
|
5
4
|
|
|
6
5
|
export async function GET() {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
try {
|
|
7
|
+
// Get current version from package.json
|
|
8
|
+
const currentVersion = pkg.version;
|
|
9
|
+
|
|
10
|
+
// Fetch the latest version from npm registry
|
|
11
|
+
const response = await fetch('https://registry.npmjs.org/d1s/latest', {
|
|
12
|
+
headers: {
|
|
13
|
+
'Accept': 'application/json',
|
|
14
|
+
'User-Agent': 'd1-studio'
|
|
15
|
+
},
|
|
16
|
+
// Add cache control to prevent excessive requests
|
|
17
|
+
cache: 'no-cache'
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
if (!response.ok) {
|
|
21
|
+
throw new Error('Failed to check for updates');
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const data = await response.json();
|
|
25
|
+
const latestVersion = data.version;
|
|
26
|
+
|
|
27
|
+
// Compare versions - only return update info if there's a newer version
|
|
28
|
+
if (latestVersion && currentVersion && latestVersion !== currentVersion) {
|
|
29
|
+
console.log(`Update available: ${currentVersion} → ${latestVersion}`);
|
|
30
|
+
return NextResponse.json({
|
|
31
|
+
update: {
|
|
32
|
+
latest: latestVersion,
|
|
33
|
+
current: currentVersion
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// No update available
|
|
39
|
+
return NextResponse.json({ update: null });
|
|
40
|
+
} catch (error) {
|
|
41
|
+
console.error('Error checking for updates:', error);
|
|
42
|
+
// Return null on error to prevent banner from showing
|
|
43
|
+
return NextResponse.json({ update: null });
|
|
44
|
+
}
|
|
45
|
+
}
|
package/src/app/page.jsx
CHANGED
|
@@ -7,7 +7,6 @@ import { SQLEditor } from '../components/sql-editor';
|
|
|
7
7
|
import { TableView } from '../components/table-view';
|
|
8
8
|
import UpdateBanner from '@/components/update-banner';
|
|
9
9
|
|
|
10
|
-
|
|
11
10
|
export default function StudioPage() {
|
|
12
11
|
const [currentView, setCurrentView] = useState('sql-editor');
|
|
13
12
|
const [selectedTable, setSelectedTable] = useState(null);
|
|
@@ -18,23 +17,28 @@ export default function StudioPage() {
|
|
|
18
17
|
};
|
|
19
18
|
|
|
20
19
|
return (
|
|
21
|
-
<div className="min-h-screen bg-background">
|
|
22
|
-
{/*
|
|
20
|
+
<div className="flex flex-col min-h-screen bg-background">
|
|
21
|
+
{/* Banner */}
|
|
23
22
|
<UpdateBanner />
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
)
|
|
37
|
-
|
|
23
|
+
|
|
24
|
+
{/* Main layout with adjusted positioning for banner */}
|
|
25
|
+
<div className="flex flex-1 mt-[var(--banner-height,0px)]">
|
|
26
|
+
{/* Sidebar with adjusted height */}
|
|
27
|
+
<AppSidebar
|
|
28
|
+
className="w-64 border-r fixed top-[var(--banner-height,0px)] h-[calc(100vh-var(--banner-height,0px))]"
|
|
29
|
+
currentView={currentView}
|
|
30
|
+
onNavigate={setCurrentView}
|
|
31
|
+
onTableSelect={handleTableSelect}
|
|
32
|
+
/>
|
|
33
|
+
|
|
34
|
+
{/* Main content with adjusted margin-top and height */}
|
|
35
|
+
<main className="ml-64 flex-1 h-[calc(100vh-var(--banner-height,0px))]">
|
|
36
|
+
{currentView === 'sql-editor' && <SQLEditor />}
|
|
37
|
+
{currentView === 'table-view' && selectedTable && (
|
|
38
|
+
<TableView tableName={selectedTable} />
|
|
39
|
+
)}
|
|
40
|
+
</main>
|
|
41
|
+
</div>
|
|
38
42
|
</div>
|
|
39
43
|
);
|
|
40
44
|
}
|
|
@@ -18,11 +18,14 @@ const ErrorTypes = {
|
|
|
18
18
|
export function useEnvironmentController() {
|
|
19
19
|
const [isConnecting, setIsConnecting] = useState(false);
|
|
20
20
|
const [isPushing, setIsPushing] = useState(false);
|
|
21
|
+
// New state for data pull status
|
|
22
|
+
const [isDataPulling, setIsDataPulling] = useState(false);
|
|
21
23
|
const [showPreview, setShowPreview] = useState(false);
|
|
22
24
|
const [previewData, setPreviewData] = useState(null);
|
|
23
25
|
const [previewError, setPreviewError] = useState(null);
|
|
24
|
-
const [previewType, setPreviewType] = useState(null);
|
|
26
|
+
const [previewType, setPreviewType] = useState(null);
|
|
25
27
|
const [previewSuccess, setPreviewSuccess] = useState(null);
|
|
28
|
+
const [environment, setEnvironment] = useState('local');
|
|
26
29
|
const { toast } = useToast();
|
|
27
30
|
const { refreshTables } = useDatabase();
|
|
28
31
|
|
|
@@ -93,7 +96,7 @@ export function useEnvironmentController() {
|
|
|
93
96
|
}
|
|
94
97
|
};
|
|
95
98
|
|
|
96
|
-
//
|
|
99
|
+
// Update the confirmPush function:
|
|
97
100
|
const confirmPush = async () => {
|
|
98
101
|
try {
|
|
99
102
|
setIsPushing(true);
|
|
@@ -113,7 +116,7 @@ export function useEnvironmentController() {
|
|
|
113
116
|
if (!data.success) {
|
|
114
117
|
throw new Error(data.error?.message || 'Failed to confirm push');
|
|
115
118
|
}
|
|
116
|
-
|
|
119
|
+
|
|
117
120
|
// Update the preview data to show applied status
|
|
118
121
|
setPreviewData(prev => ({
|
|
119
122
|
...prev,
|
|
@@ -122,12 +125,16 @@ export function useEnvironmentController() {
|
|
|
122
125
|
action: item.action === 'will be applied' ? 'applied' : item.action
|
|
123
126
|
}))
|
|
124
127
|
}));
|
|
125
|
-
|
|
126
|
-
// Set success message instead of showing toast
|
|
128
|
+
|
|
127
129
|
setPreviewSuccess(`Applied ${data.details.applied} migration(s), skipped ${data.details.skipped}.`);
|
|
130
|
+
|
|
131
|
+
// Reset environment after success
|
|
132
|
+
setEnvironment('local');
|
|
128
133
|
} catch (error) {
|
|
129
134
|
console.error("Push to remote confirm failed:", error);
|
|
130
135
|
setPreviewError(error);
|
|
136
|
+
// Reset environment after error
|
|
137
|
+
setEnvironment('local');
|
|
131
138
|
} finally {
|
|
132
139
|
setIsPushing(false);
|
|
133
140
|
}
|
|
@@ -169,11 +176,13 @@ export function useEnvironmentController() {
|
|
|
169
176
|
}
|
|
170
177
|
};
|
|
171
178
|
|
|
172
|
-
//
|
|
179
|
+
// In confirmPull function, add environment reset:
|
|
173
180
|
const confirmPull = async () => {
|
|
174
181
|
try {
|
|
175
182
|
setIsPushing(true);
|
|
183
|
+
setEnvironment('pull'); // Ensure correct state during pull
|
|
176
184
|
setPreviewError(null);
|
|
185
|
+
setPreviewSuccess(null);
|
|
177
186
|
|
|
178
187
|
const credentials = await validateStoredCredentials();
|
|
179
188
|
if (!credentials) throw new Error("No valid credentials found");
|
|
@@ -189,25 +198,61 @@ export function useEnvironmentController() {
|
|
|
189
198
|
throw new Error(data.error?.message || 'Failed to confirm pull');
|
|
190
199
|
}
|
|
191
200
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
201
|
+
setPreviewSuccess(`Pull migrations applied successfully.`);
|
|
202
|
+
|
|
203
|
+
setPreviewData(prev => ({
|
|
204
|
+
...prev,
|
|
205
|
+
preview: prev.preview.map(item => ({
|
|
206
|
+
...item,
|
|
207
|
+
action: item.action === 'will be applied' ? 'applied' : item.action
|
|
208
|
+
}))
|
|
209
|
+
}));
|
|
210
|
+
|
|
197
211
|
await refreshTables();
|
|
212
|
+
|
|
198
213
|
} catch (error) {
|
|
199
214
|
console.error("Pull to remote confirm failed:", error);
|
|
200
215
|
setPreviewError(error);
|
|
201
|
-
toast({
|
|
202
|
-
title: "Migration Failed",
|
|
203
|
-
description: error.message || "Failed to pull migrations from remote",
|
|
204
|
-
variant: "destructive",
|
|
205
|
-
});
|
|
206
216
|
} finally {
|
|
207
217
|
setIsPushing(false);
|
|
218
|
+
setEnvironment('local'); // Reset to local regardless of success/failure
|
|
208
219
|
}
|
|
209
220
|
};
|
|
210
221
|
|
|
222
|
+
// In confirmDataPull function, add syncing state:
|
|
223
|
+
const confirmDataPull = async () => {
|
|
224
|
+
try {
|
|
225
|
+
setIsDataPulling(true);
|
|
226
|
+
setEnvironment('syncing'); // Set environment to syncing during data pull
|
|
227
|
+
setPreviewError(null);
|
|
228
|
+
setPreviewSuccess(null);
|
|
229
|
+
|
|
230
|
+
const credentials = await validateStoredCredentials();
|
|
231
|
+
if (!credentials) throw new Error("No valid credentials found");
|
|
232
|
+
|
|
233
|
+
const response = await fetch("/api/pull-data/confirm", {
|
|
234
|
+
method: "POST",
|
|
235
|
+
headers: { "Content-Type": "application/json" },
|
|
236
|
+
body: JSON.stringify(credentials)
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
const data = await response.json();
|
|
240
|
+
if (!data.success) {
|
|
241
|
+
throw new Error(data.error?.message || 'Failed to confirm data pull');
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
setPreviewSuccess("Remote data synced successfully.");
|
|
245
|
+
await refreshTables();
|
|
246
|
+
|
|
247
|
+
} catch (error) {
|
|
248
|
+
console.error("Data pull confirm failed:", error);
|
|
249
|
+
setPreviewError(error);
|
|
250
|
+
} finally {
|
|
251
|
+
setIsDataPulling(false);
|
|
252
|
+
setEnvironment('local'); // Reset to local regardless of success/failure
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
|
|
211
256
|
// Connect to Cloudflare
|
|
212
257
|
async function connectToCloudflare(credentials) {
|
|
213
258
|
try {
|
|
@@ -240,14 +285,18 @@ export function useEnvironmentController() {
|
|
|
240
285
|
}
|
|
241
286
|
}
|
|
242
287
|
|
|
288
|
+
// Update PreviewUI to pass onDataPull and isDataPulling for pull previews.
|
|
243
289
|
const PreviewUI = showPreview && (
|
|
244
290
|
previewType === "pull" ? (
|
|
245
291
|
<PullPreviewToast
|
|
246
292
|
preview={previewData?.preview || []}
|
|
247
293
|
onConfirm={confirmPull}
|
|
294
|
+
onDataPull={confirmDataPull} // pass the new data pull handler
|
|
248
295
|
onCancel={clearPreviewState}
|
|
249
296
|
isConfirming={isPushing}
|
|
297
|
+
isDataPulling={isDataPulling}
|
|
250
298
|
error={previewError}
|
|
299
|
+
success={previewSuccess}
|
|
251
300
|
isLoading={isPushing && !previewData?.preview?.length}
|
|
252
301
|
/>
|
|
253
302
|
) : (
|
|
@@ -266,13 +315,18 @@ export function useEnvironmentController() {
|
|
|
266
315
|
return {
|
|
267
316
|
isConnecting,
|
|
268
317
|
isPushing,
|
|
318
|
+
isDataPulling,
|
|
269
319
|
showPreview,
|
|
270
320
|
previewError,
|
|
321
|
+
environment, // Add this
|
|
322
|
+
setEnvironment, // Add this if needed
|
|
271
323
|
pushToRemote,
|
|
272
324
|
pullToRemotePreview,
|
|
273
325
|
confirmPull,
|
|
326
|
+
confirmDataPull, // export the new function
|
|
274
327
|
connectToCloudflare,
|
|
275
328
|
validateStoredCredentials,
|
|
276
329
|
PreviewUI
|
|
277
330
|
};
|
|
278
331
|
}
|
|
332
|
+
|
|
@@ -20,17 +20,20 @@ export function EnvironmentSelect({
|
|
|
20
20
|
onValueChange={onValueChange}
|
|
21
21
|
disabled={disabled || isLoading || showPreview}
|
|
22
22
|
>
|
|
23
|
-
<SelectTrigger className="w-
|
|
23
|
+
<SelectTrigger className="w-full bg-white border-neutral-200 font-medium">
|
|
24
24
|
<div className="flex items-center gap-1 text-sm">
|
|
25
25
|
{isLoading || showPreview ? (
|
|
26
26
|
<>
|
|
27
27
|
<Loader2 className="h-4 w-4 animate-spin text-muted-foreground" />
|
|
28
28
|
<span className="text-muted-foreground font-medium">
|
|
29
|
-
{value === "pull" ? "Pulling..." :
|
|
29
|
+
{value === "pull" ? "Pulling..." :
|
|
30
|
+
value === "syncing" ? "Syncing..." :
|
|
31
|
+
value === "production" ? "Pushing..." :
|
|
32
|
+
"Loading..."}
|
|
30
33
|
</span>
|
|
31
34
|
</>
|
|
32
35
|
) : (
|
|
33
|
-
<SelectValue placeholder="Environment" />
|
|
36
|
+
<SelectValue placeholder="Environment" className="w-full" />
|
|
34
37
|
)}
|
|
35
38
|
</div>
|
|
36
39
|
</SelectTrigger>
|
|
@@ -1,26 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
// components/pull-preview-toast.jsx
|
|
2
2
|
|
|
3
3
|
import React, { useEffect, useState } from "react";
|
|
4
4
|
import { Button } from "@/components/ui/button";
|
|
5
5
|
import { ScrollArea } from "@/components/ui/scroll-area";
|
|
6
|
-
import {
|
|
7
|
-
Table,
|
|
8
|
-
TableBody,
|
|
9
|
-
TableCell,
|
|
10
|
-
TableHead,
|
|
11
|
-
TableHeader,
|
|
12
|
-
TableRow,
|
|
13
|
-
} from "@/components/ui/table";
|
|
14
|
-
import { FileText, Loader2 } from "lucide-react";
|
|
6
|
+
import { FileText, Loader2, X } from "lucide-react";
|
|
15
7
|
import { cn } from "@/lib/utils";
|
|
16
8
|
|
|
17
9
|
export function PullPreviewToast({
|
|
18
10
|
preview = [],
|
|
19
11
|
onConfirm,
|
|
20
12
|
onCancel,
|
|
13
|
+
onDataPull,
|
|
21
14
|
isConfirming,
|
|
15
|
+
isDataPulling,
|
|
22
16
|
error,
|
|
23
17
|
isLoading,
|
|
18
|
+
success,
|
|
24
19
|
}) {
|
|
25
20
|
console.log("PullPreviewToast rendered with:", {
|
|
26
21
|
previewLength: preview.length,
|
|
@@ -66,7 +61,6 @@ export function PullPreviewToast({
|
|
|
66
61
|
<div className="fixed bottom-4 right-4 z-50 w-[600px]">
|
|
67
62
|
<div className="rounded-lg border bg-destructive/15 p-4">
|
|
68
63
|
<div className="flex items-center gap-2">
|
|
69
|
-
<FileText className="h-5 w-5 text-destructive" />
|
|
70
64
|
<p className="text-sm font-medium text-destructive">
|
|
71
65
|
No preview data available
|
|
72
66
|
</p>
|
|
@@ -86,6 +80,10 @@ export function PullPreviewToast({
|
|
|
86
80
|
const totalMigrations = sqlMigrations.length;
|
|
87
81
|
console.log("Migration stats:", { totalMigrations });
|
|
88
82
|
|
|
83
|
+
// Determine if sync button should be enabled
|
|
84
|
+
// Only enable if pull was successful and not currently pulling data
|
|
85
|
+
const isSyncEnabled = success && !isDataPulling && !error;
|
|
86
|
+
|
|
89
87
|
return (
|
|
90
88
|
<div className="fixed bottom-4 right-4 z-50 font-sans w-[600px]">
|
|
91
89
|
<div
|
|
@@ -94,28 +92,44 @@ export function PullPreviewToast({
|
|
|
94
92
|
error ? "bg-destructive/15" : "bg-background"
|
|
95
93
|
)}
|
|
96
94
|
>
|
|
97
|
-
<div className="flex items-start gap-
|
|
95
|
+
<div className="flex items-start gap-x-1">
|
|
98
96
|
<div className="flex-1 space-y-3">
|
|
99
|
-
{/* Header */}
|
|
97
|
+
{/* Header with Close Button */}
|
|
100
98
|
<div className="space-y-1">
|
|
101
|
-
<
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
99
|
+
<div className="flex items-center justify-between">
|
|
100
|
+
<h5
|
|
101
|
+
className={cn(
|
|
102
|
+
"font-medium",
|
|
103
|
+
error ? "text-destructive" : "text-neutral-900"
|
|
104
|
+
)}
|
|
105
|
+
>
|
|
106
|
+
{error ? "Pull Migration Error" : "Pull Migration Preview"}
|
|
107
|
+
</h5>
|
|
108
|
+
<button
|
|
109
|
+
onClick={onCancel}
|
|
110
|
+
className="text-neutral-500 hover:text-neutral-900 p-1 rounded-md hover:bg-neutral-100"
|
|
111
|
+
>
|
|
112
|
+
<X className="h-4 w-4" />
|
|
113
|
+
</button>
|
|
114
|
+
</div>
|
|
109
115
|
<p
|
|
110
116
|
className={cn(
|
|
111
117
|
"text-sm",
|
|
112
118
|
error ? "text-destructive/80" : "text-neutral-700"
|
|
113
119
|
)}
|
|
114
120
|
>
|
|
115
|
-
{
|
|
116
|
-
? error.message
|
|
117
|
-
: `${totalMigrations} migration(s) will be applied`}
|
|
121
|
+
{`${totalMigrations} migration(s) will be applied`}
|
|
118
122
|
</p>
|
|
123
|
+
{error && (
|
|
124
|
+
<p className="text-sm text-destructive font-medium mt-1">
|
|
125
|
+
{error.message}
|
|
126
|
+
</p>
|
|
127
|
+
)}
|
|
128
|
+
{success && (
|
|
129
|
+
<p className="text-sm text-green-700 font-medium mt-1">
|
|
130
|
+
{success}
|
|
131
|
+
</p>
|
|
132
|
+
)}
|
|
119
133
|
</div>
|
|
120
134
|
|
|
121
135
|
{/* Migration Details */}
|
|
@@ -129,54 +143,67 @@ export function PullPreviewToast({
|
|
|
129
143
|
|
|
130
144
|
{isDetailsOpen && (
|
|
131
145
|
<ScrollArea className="h-[480px] mt-2 rounded border border-neutral-200">
|
|
132
|
-
<
|
|
133
|
-
<
|
|
134
|
-
<
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
</TableRow>
|
|
138
|
-
</TableHeader>
|
|
139
|
-
<TableBody>
|
|
146
|
+
<div className="w-full">
|
|
147
|
+
<div className="bg-neutral-50 border-b px-4 py-2">
|
|
148
|
+
<div className="text-sm font-medium text-neutral-600">Migration</div>
|
|
149
|
+
</div>
|
|
150
|
+
<div>
|
|
140
151
|
{sqlMigrations.map((item, index) => (
|
|
141
|
-
<
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
<
|
|
152
|
+
<div
|
|
153
|
+
key={index}
|
|
154
|
+
className="px-4 py-2 border-b last:border-0"
|
|
155
|
+
>
|
|
156
|
+
<div className="font-mono text-xs">
|
|
146
157
|
{item.migration || item.name}
|
|
147
|
-
</
|
|
148
|
-
</
|
|
158
|
+
</div>
|
|
159
|
+
</div>
|
|
149
160
|
))}
|
|
150
|
-
</
|
|
151
|
-
</
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
152
163
|
</ScrollArea>
|
|
153
164
|
)}
|
|
154
165
|
</div>
|
|
155
166
|
|
|
156
167
|
{/* Action Buttons */}
|
|
157
|
-
<div className="flex gap-2 pt-1">
|
|
158
|
-
<
|
|
159
|
-
onClick={onConfirm}
|
|
160
|
-
disabled={isConfirming}
|
|
161
|
-
className="flex-1"
|
|
162
|
-
>
|
|
163
|
-
{isConfirming ? (
|
|
164
|
-
<>
|
|
165
|
-
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
|
|
166
|
-
Confirming...
|
|
167
|
-
</>
|
|
168
|
-
) : (
|
|
169
|
-
"Confirm Pull"
|
|
170
|
-
)}
|
|
171
|
-
</Button>
|
|
168
|
+
<div className="flex flex-col gap-2 pt-1">
|
|
169
|
+
<div className="flex gap-2">
|
|
172
170
|
<Button
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
171
|
+
onClick={onConfirm}
|
|
172
|
+
disabled={isConfirming}
|
|
173
|
+
className={`flex-1 ${isConfirming ? "cursor-not-allowed opacity-50" : ""}`}
|
|
174
|
+
>
|
|
175
|
+
{isConfirming ? (
|
|
176
|
+
<>
|
|
177
|
+
<Loader2 className="h-4 w-4 animate-spin" />
|
|
178
|
+
Confirming...
|
|
179
|
+
</>
|
|
180
|
+
) : (
|
|
181
|
+
"Confirm Pull"
|
|
182
|
+
)}
|
|
183
|
+
</Button>
|
|
184
|
+
|
|
185
|
+
{/* Right column - Sync data and description */}
|
|
186
|
+
<div className="flex-1 flex flex-col gap-2">
|
|
187
|
+
<Button
|
|
188
|
+
onClick={onDataPull}
|
|
189
|
+
disabled={!isSyncEnabled}
|
|
190
|
+
variant="outline"
|
|
191
|
+
className={`w-full ${!isSyncEnabled ? "cursor-not-allowed opacity-50" : ""}`}
|
|
192
|
+
>
|
|
193
|
+
{isDataPulling ? (
|
|
194
|
+
<>
|
|
195
|
+
<Loader2 className="h-4 w-4 animate-spin" />
|
|
196
|
+
Syncing remote data...
|
|
197
|
+
</>
|
|
198
|
+
) : (
|
|
199
|
+
"Sync remote data"
|
|
200
|
+
)}
|
|
201
|
+
</Button>
|
|
202
|
+
<p className="text-xs text-neutral-500 text-center">
|
|
203
|
+
75 records per table
|
|
204
|
+
</p>
|
|
205
|
+
</div>
|
|
206
|
+
</div>
|
|
180
207
|
</div>
|
|
181
208
|
</div>
|
|
182
209
|
</div>
|
|
@@ -133,27 +133,15 @@ export function AppSidebar({
|
|
|
133
133
|
|
|
134
134
|
return (
|
|
135
135
|
<>
|
|
136
|
-
|
|
136
|
+
{/* The sidebar now has top position adjusted for the banner */}
|
|
137
|
+
<aside className={`${className} top-[var(--banner-height,0px)] left-0 h-[calc(100vh-var(--banner-height,0px))] bg-neutral-50 p-4`}>
|
|
137
138
|
<div className="flex flex-col h-full font-sans">
|
|
138
139
|
{/* Header */}
|
|
139
|
-
<div className="flex items-center gap-2 mb-
|
|
140
|
+
<div className="flex items-center gap-2 mb-4">
|
|
140
141
|
<Table2 className="h-5 w-5" />
|
|
141
142
|
<span className="font-mono font-bold text-sm">d1-studio</span>
|
|
142
143
|
</div>
|
|
143
144
|
|
|
144
|
-
{/* SQL Editor Section */}
|
|
145
|
-
<div className="mb-6">
|
|
146
|
-
<button
|
|
147
|
-
className={`w-full flex items-center gap-x-1 border rounded-md text-sm font-medium transition-colors px-2 py-2
|
|
148
|
-
${currentView === 'sql-editor' ? 'bg-neutral-900 text-white' : 'bg-white hover:bg-neutral-100'}`}
|
|
149
|
-
onClick={() => onNavigate('sql-editor')}
|
|
150
|
-
disabled={isTableLoading}
|
|
151
|
-
>
|
|
152
|
-
<TerminalSquare className="h-[16px] w-[16px]" />
|
|
153
|
-
SQL editor
|
|
154
|
-
</button>
|
|
155
|
-
</div>
|
|
156
|
-
|
|
157
145
|
{/* Error Message */}
|
|
158
146
|
{error && (
|
|
159
147
|
<Alert variant="destructive" className="mb-4">
|
|
@@ -162,16 +150,17 @@ export function AppSidebar({
|
|
|
162
150
|
</Alert>
|
|
163
151
|
)}
|
|
164
152
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
<div>
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
{databases[0]?.database_name || 'No database found'}
|
|
171
|
-
</div>
|
|
153
|
+
{/* Database Section */}
|
|
154
|
+
<div className="mb-2">
|
|
155
|
+
<div className="text-xs text-muted-foreground mb-1">Database name</div>
|
|
156
|
+
<div className="font-semibold text-sm">
|
|
157
|
+
{databases[0]?.database_name || 'No database found'}
|
|
172
158
|
</div>
|
|
173
|
-
|
|
174
|
-
|
|
159
|
+
</div>
|
|
160
|
+
|
|
161
|
+
{/* Environment Section - Full Width */}
|
|
162
|
+
<div className="mb-6">
|
|
163
|
+
<EnvironmentSelect className="w-full"
|
|
175
164
|
value={environment}
|
|
176
165
|
onValueChange={handleEnvironmentChange}
|
|
177
166
|
isLoading={isPushing}
|
|
@@ -179,9 +168,22 @@ export function AppSidebar({
|
|
|
179
168
|
showPreview={showPreview}
|
|
180
169
|
/>
|
|
181
170
|
</div>
|
|
171
|
+
|
|
172
|
+
{/* SQL Editor Section */}
|
|
173
|
+
<div className="mb-3">
|
|
174
|
+
<button
|
|
175
|
+
className={`w-full flex items-center gap-x-1 border rounded-md text-sm font-medium transition-colors px-2 py-2
|
|
176
|
+
${currentView === 'sql-editor' ? 'bg-neutral-900 text-white' : 'bg-white hover:bg-neutral-100'}`}
|
|
177
|
+
onClick={() => onNavigate('sql-editor')}
|
|
178
|
+
disabled={isTableLoading}
|
|
179
|
+
>
|
|
180
|
+
<TerminalSquare className="h-[16px] w-[16px]" />
|
|
181
|
+
SQL editor
|
|
182
|
+
</button>
|
|
183
|
+
</div>
|
|
182
184
|
|
|
183
185
|
{/* Search Section */}
|
|
184
|
-
<div className="relative mb-
|
|
186
|
+
<div className="relative mb-3 bg-white">
|
|
185
187
|
<Search className="absolute left-2 top-2.5 h-4 w-4 text-neutral-500" />
|
|
186
188
|
<Input
|
|
187
189
|
placeholder="Search tables"
|