d1s 0.2.13 → 0.3.1
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/README.md +18 -1
- package/dist/.next/.next/BUILD_ID +1 -1
- package/dist/.next/.next/app-build-manifest.json +119 -77
- package/dist/.next/.next/app-path-routes-manifest.json +1 -1
- package/dist/.next/.next/build-manifest.json +7 -7
- package/dist/.next/.next/cache/.rscinfo +1 -1
- package/dist/.next/.next/cache/.tsbuildinfo +1 -1
- 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/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/0.pack +0 -0
- package/dist/.next/.next/cache/webpack/client-production/1.pack +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/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/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/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-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/index.pack.gz +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/3.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/react-loadable-manifest.json +11 -1
- package/dist/.next/.next/required-server-files.json +1 -1
- package/dist/.next/.next/routes-manifest.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 +5 -5
- 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/list/route.js +26 -0
- package/dist/.next/.next/server/app/api/migrations/list/route.js.nft.json +1 -0
- package/dist/.next/.next/server/app/api/migrations/list/route_client-reference-manifest.js +1 -0
- package/dist/.next/.next/server/app/api/migrations/sync/route.js +5 -5
- 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 +4 -4
- 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/pro/route.js +1 -0
- package/dist/.next/.next/server/app/api/pro/route.js.nft.json +1 -0
- package/dist/.next/.next/server/app/api/pro/route_client-reference-manifest.js +1 -0
- package/dist/.next/.next/server/app/api/pull-data/confirm/route.js +1 -1
- package/dist/.next/.next/server/app/api/pull-data/confirm/route.js.nft.json +1 -1
- package/dist/.next/.next/server/app/api/pull-data/confirm/route_client-reference-manifest.js +1 -1
- package/dist/.next/.next/server/app/api/pull-remote/confirm/route.js +4 -4
- 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 +4 -4
- 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 +6 -6
- 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 +6 -6
- 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 +9 -9
- 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/schema/route.js +1 -0
- package/dist/.next/.next/server/app/api/schema/route.js.nft.json +1 -0
- package/dist/.next/.next/server/app/api/schema/route_client-reference-manifest.js +1 -0
- package/dist/.next/.next/server/app/api/tables/[name]/import/route.js +1 -0
- package/dist/.next/.next/server/app/api/tables/[name]/import/route.js.nft.json +1 -0
- package/dist/.next/.next/server/app/api/tables/[name]/import/route_client-reference-manifest.js +1 -0
- package/dist/.next/.next/server/app/api/tables/[name]/route.js +5 -5
- 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/api/time-travel/preview/route.js +1 -0
- package/dist/.next/.next/server/app/api/time-travel/preview/route.js.nft.json +1 -0
- package/dist/.next/.next/server/app/api/time-travel/preview/route_client-reference-manifest.js +1 -0
- package/dist/.next/.next/server/app/api/time-travel/restore/route.js +1 -0
- package/dist/.next/.next/server/app/api/time-travel/restore/route.js.nft.json +1 -0
- package/dist/.next/.next/server/app/api/time-travel/restore/route_client-reference-manifest.js +1 -0
- package/dist/.next/.next/server/app/api/update/route.js +1 -1
- package/dist/.next/.next/server/app/api/update/route.js.nft.json +1 -1
- package/dist/.next/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
- package/dist/.next/.next/server/app/index.html +5 -3
- package/dist/.next/.next/server/app/index.rsc +6 -6
- package/dist/.next/.next/server/app/page.js +15 -15
- 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 +8 -2
- package/dist/.next/.next/server/chunks/226.js +12 -12
- package/dist/.next/.next/server/chunks/452.js +1 -1
- package/dist/.next/.next/server/chunks/487.js +1 -0
- package/dist/.next/.next/server/chunks/572.js +1 -1
- package/dist/.next/.next/server/chunks/992.js +2 -2
- package/dist/.next/.next/server/chunks/{638.js → 994.js} +3 -3
- package/dist/.next/.next/server/middleware-build-manifest.js +1 -1
- package/dist/.next/.next/server/middleware-react-loadable-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/server-reference-manifest.json +1 -1
- package/dist/.next/.next/static/-OO4tE7EKr8o62Bne-ODo/_buildManifest.js +1 -0
- package/dist/.next/.next/static/3kAeIJC56X7aw1Fk5_OXO/_buildManifest.js +1 -0
- package/dist/.next/.next/static/J8r9W6xxmYYvuKehItNuW/_buildManifest.js +1 -0
- package/dist/.next/.next/static/ZmKZbpam0G_d3SphfZPJ7/_buildManifest.js +1 -0
- package/dist/.next/.next/static/arc9h7hbaQzL1Dl0iuVrT/_buildManifest.js +1 -0
- package/dist/.next/.next/static/chunks/1a258343.3b3e7ba5ba0bd0d2.js +1 -0
- package/dist/.next/.next/static/chunks/345.8fc37569d5708622.js +1 -0
- package/dist/.next/.next/static/chunks/480-85b6c8ae3f51b156.js +1 -0
- package/dist/.next/.next/static/chunks/52.2cdc9bdb75e1fc2e.js +1 -0
- package/dist/.next/.next/static/chunks/803-a2fcfbd00e6b3b38.js +1 -0
- package/dist/.next/.next/static/chunks/{92-5f7522943fcb72a8.js → 92-a84bdac2be7c8d7a.js} +1 -1
- package/dist/.next/.next/static/chunks/app/api/cloudflare/route-d0c1dc2a9e7dce36.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/databases/route-cd322321212797cf.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/migrations/list/route-cd710ff75b6bcd02.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/migrations/sync/route-ee522f232b9f0a9c.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/migrations/sync-files/route-79ee2c26f87d3bc7.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/pro/route-c90c1f901fc00d38.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/pull-data/confirm/route-118764086af798f8.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/pull-remote/confirm/route-2b0ade4ebfcea0bc.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/pull-remote/preview/route-342db7ea13e6f447.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/push-remote/confirm/route-b778c053bd515abd.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/push-remote/preview/route-ab090482f299f57f.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/query/route-4d21a8b1d34491f1.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/schema/route-cb17a387d6b557ad.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/tables/[name]/import/route-510472de7a5c29bd.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/tables/[name]/route-6a1fa95c303ce0de.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/tables/route-daa975df4ea8e8f8.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/time-travel/preview/route-5787d7e8f17bd539.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/time-travel/restore/route-84b64a27e831e21c.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/update/route-54ee900537982652.js +1 -0
- package/dist/.next/.next/static/chunks/app/{layout-40ec07d04681ba81.js → layout-f0ec4d636ee0f763.js} +1 -1
- package/dist/.next/.next/static/chunks/app/page-358bf2112802ff85.js +1 -0
- package/dist/.next/.next/static/chunks/app/page-3ec9d72ecb052d39.js +1 -0
- package/dist/.next/.next/static/chunks/webpack-024900a94af4f0a7.js +1 -0
- package/dist/.next/.next/static/css/2c165a0ede9b2442.css +3 -0
- package/dist/.next/.next/static/css/32df9a4d493f8b0f.css +31 -0
- package/dist/.next/.next/static/f_PVCmmSeM5SwW3M1tw7Q/_buildManifest.js +1 -0
- package/dist/.next/.next/static/fiesjBWbrmSSyLf4biwrX/_buildManifest.js +1 -0
- package/dist/.next/.next/static/ft39e6W6vSgUL7peRo7pE/_buildManifest.js +1 -0
- package/dist/.next/.next/static/media/4cf2300e9c8272f7-s.p.woff2 +0 -0
- package/dist/.next/.next/static/u7ssdTycF4iQ-w-pQZhxg/_buildManifest.js +1 -0
- package/dist/.next/.next/static/v-i2YsOGT890zutOSiqqK/_buildManifest.js +1 -0
- package/dist/.next/.next/trace +3 -3
- package/dist/.next/.next/types/app/api/migrations/list/route.ts +347 -0
- package/dist/.next/.next/types/app/api/pro/route.ts +347 -0
- package/dist/.next/.next/types/app/api/schema/route.ts +347 -0
- package/dist/.next/.next/types/app/api/tables/[name]/import/route.ts +347 -0
- package/dist/.next/.next/types/app/api/time-travel/preview/route.ts +347 -0
- package/dist/.next/.next/types/app/api/time-travel/restore/route.ts +347 -0
- package/dist/.next/BUILD_ID +1 -1
- package/dist/.next/app-build-manifest.json +122 -80
- package/dist/.next/app-path-routes-manifest.json +1 -1
- package/dist/.next/build-manifest.json +7 -7
- 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/react-loadable-manifest.json +11 -1
- package/dist/.next/required-server-files.json +1 -1
- package/dist/.next/routes-manifest.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 +5 -5
- 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/list/route.js +26 -0
- package/dist/.next/server/app/api/migrations/list/route.js.nft.json +1 -0
- package/dist/.next/server/app/api/migrations/list/route_client-reference-manifest.js +1 -0
- package/dist/.next/server/app/api/migrations/sync/route.js +5 -5
- 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 +4 -4
- 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/pro/route.js +1 -0
- package/dist/.next/server/app/api/pro/route.js.nft.json +1 -0
- package/dist/.next/server/app/api/pro/route_client-reference-manifest.js +1 -0
- package/dist/.next/server/app/api/pull-data/confirm/route.js +1 -1
- package/dist/.next/server/app/api/pull-data/confirm/route.js.nft.json +1 -1
- package/dist/.next/server/app/api/pull-data/confirm/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/pull-remote/confirm/route.js +4 -4
- 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 +4 -4
- 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 +6 -6
- 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 +6 -6
- 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 +9 -9
- 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/schema/route.js +1 -0
- package/dist/.next/server/app/api/schema/route.js.nft.json +1 -0
- package/dist/.next/server/app/api/schema/route_client-reference-manifest.js +1 -0
- package/dist/.next/server/app/api/tables/[name]/import/route.js +1 -0
- package/dist/.next/server/app/api/tables/[name]/import/route.js.nft.json +1 -0
- package/dist/.next/server/app/api/tables/[name]/import/route_client-reference-manifest.js +1 -0
- package/dist/.next/server/app/api/tables/[name]/route.js +5 -5
- 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/time-travel/preview/route.js +1 -0
- package/dist/.next/server/app/api/time-travel/preview/route.js.nft.json +1 -0
- package/dist/.next/server/app/api/time-travel/preview/route_client-reference-manifest.js +1 -0
- package/dist/.next/server/app/api/time-travel/restore/route.js +1 -0
- package/dist/.next/server/app/api/time-travel/restore/route.js.nft.json +1 -0
- package/dist/.next/server/app/api/time-travel/restore/route_client-reference-manifest.js +1 -0
- package/dist/.next/server/app/api/update/route.js +1 -1
- package/dist/.next/server/app/api/update/route.js.nft.json +1 -1
- package/dist/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/index.html +5 -3
- package/dist/.next/server/app/index.rsc +6 -6
- package/dist/.next/server/app/page.js +15 -15
- 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 +11 -5
- package/dist/.next/server/chunks/226.js +12 -12
- package/dist/.next/server/chunks/391.js +1 -1
- package/dist/.next/server/chunks/452.js +1 -1
- package/dist/.next/server/chunks/487.js +1 -0
- package/dist/.next/server/chunks/572.js +1 -1
- package/dist/.next/server/chunks/992.js +3 -3
- package/dist/.next/server/chunks/{638.js → 994.js} +3 -3
- package/dist/.next/server/middleware-build-manifest.js +1 -1
- package/dist/.next/server/middleware-react-loadable-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-manifest.json +1 -1
- package/dist/.next/server/server-reference-manifest.json +1 -1
- package/dist/.next/static/chunks/1a258343.3b3e7ba5ba0bd0d2.js +1 -0
- package/dist/.next/static/chunks/345.8fc37569d5708622.js +1 -0
- package/dist/.next/static/chunks/480-85b6c8ae3f51b156.js +1 -0
- package/dist/.next/static/chunks/52.2cdc9bdb75e1fc2e.js +1 -0
- package/dist/.next/static/chunks/803-a2fcfbd00e6b3b38.js +1 -0
- package/dist/.next/static/chunks/{92-5f7522943fcb72a8.js → 92-a84bdac2be7c8d7a.js} +1 -1
- package/dist/.next/static/chunks/app/api/cloudflare/route-d0c1dc2a9e7dce36.js +1 -0
- package/dist/.next/static/chunks/app/api/databases/route-cd322321212797cf.js +1 -0
- package/dist/.next/static/chunks/app/api/migrations/list/route-cd710ff75b6bcd02.js +1 -0
- package/dist/.next/static/chunks/app/api/migrations/sync/route-ee522f232b9f0a9c.js +1 -0
- package/dist/.next/static/chunks/app/api/migrations/sync-files/route-79ee2c26f87d3bc7.js +1 -0
- package/dist/.next/static/chunks/app/api/pro/route-c90c1f901fc00d38.js +1 -0
- package/dist/.next/static/chunks/app/api/pull-data/confirm/route-118764086af798f8.js +1 -0
- package/dist/.next/static/chunks/app/api/pull-remote/confirm/route-2b0ade4ebfcea0bc.js +1 -0
- package/dist/.next/static/chunks/app/api/pull-remote/preview/route-342db7ea13e6f447.js +1 -0
- package/dist/.next/static/chunks/app/api/push-remote/confirm/route-b778c053bd515abd.js +1 -0
- package/dist/.next/static/chunks/app/api/push-remote/preview/route-ab090482f299f57f.js +1 -0
- package/dist/.next/static/chunks/app/api/query/route-4d21a8b1d34491f1.js +1 -0
- package/dist/.next/static/chunks/app/api/schema/route-cb17a387d6b557ad.js +1 -0
- package/dist/.next/static/chunks/app/api/tables/[name]/import/route-510472de7a5c29bd.js +1 -0
- package/dist/.next/static/chunks/app/api/tables/[name]/route-6a1fa95c303ce0de.js +1 -0
- package/dist/.next/static/chunks/app/api/tables/route-daa975df4ea8e8f8.js +1 -0
- package/dist/.next/static/chunks/app/api/time-travel/preview/route-5787d7e8f17bd539.js +1 -0
- package/dist/.next/static/chunks/app/api/time-travel/restore/route-84b64a27e831e21c.js +1 -0
- package/dist/.next/static/chunks/app/api/update/route-54ee900537982652.js +1 -0
- package/dist/.next/static/chunks/app/{layout-40ec07d04681ba81.js → layout-f0ec4d636ee0f763.js} +1 -1
- package/dist/.next/static/chunks/app/page-358bf2112802ff85.js +1 -0
- package/dist/.next/static/chunks/webpack-024900a94af4f0a7.js +1 -0
- package/dist/.next/static/css/2c165a0ede9b2442.css +3 -0
- package/dist/.next/static/css/32df9a4d493f8b0f.css +31 -0
- package/dist/.next/static/media/4cf2300e9c8272f7-s.p.woff2 +0 -0
- package/dist/.next/static/zh4Fz2tbm8GRka4woRrGp/_buildManifest.js +1 -0
- package/dist/.next/static/zh4Fz2tbm8GRka4woRrGp/_ssgManifest.js +1 -0
- package/dist/.next/trace +18 -3
- package/dist/.next/types/app/api/migrations/list/route.ts +347 -0
- package/dist/.next/types/app/api/pro/route.ts +347 -0
- package/dist/.next/types/app/api/schema/route.ts +347 -0
- package/dist/.next/types/app/api/tables/[name]/import/route.ts +347 -0
- package/dist/.next/types/app/api/time-travel/preview/route.ts +347 -0
- package/dist/.next/types/app/api/time-travel/restore/route.ts +347 -0
- package/dist/app/api/databases/route.js +2 -1
- package/dist/app/api/migrations/list/route.js +137 -0
- package/dist/app/api/migrations/sync-files/route.js +2 -1
- package/dist/app/api/pro/route.js +7 -0
- package/dist/app/api/pull-remote/confirm/route.js +138 -146
- package/dist/app/api/pull-remote/preview/route.js +49 -84
- package/dist/app/api/push-remote/confirm/route.js +31 -12
- package/dist/app/api/push-remote/preview/route.js +27 -12
- package/dist/app/api/query/route.js +24 -13
- package/dist/app/api/schema/route.js +63 -0
- package/dist/app/api/tables/[name]/import/route.js +112 -0
- package/dist/app/api/tables/[name]/route.js +38 -29
- package/dist/app/api/tables/route.js +29 -16
- package/dist/app/api/time-travel/preview/route.js +122 -0
- package/dist/app/api/time-travel/restore/route.js +106 -0
- package/dist/app/page.jsx +26 -8
- package/dist/d1-studio.js +129 -23
- package/dist/lib/license.js +99 -71
- package/dist/lib/local-db.js +223 -0
- package/dist/lib/migrations.js +40 -2
- package/dist/lib/parse-sql-error.js +99 -160
- package/dist/lib/sql-operations.js +28 -10
- package/dist/lib/telemetry.js +39 -0
- package/package.json +6 -2
- package/dist/.next/.next/static/FEsQ9jwPUQv5A3fwg6Opl/_buildManifest.js +0 -1
- package/dist/.next/.next/static/Y9mYu4WBghepP5oT_3OdR/_buildManifest.js +0 -1
- package/dist/.next/.next/static/ae3gNmoSGm-R5LJC4UagI/_buildManifest.js +0 -1
- package/dist/.next/.next/static/bKfUJeuvAQlBmR3TjrfkH/_buildManifest.js +0 -1
- package/dist/.next/.next/static/chunks/576-18a2209e1ed26aad.js +0 -1
- package/dist/.next/.next/static/chunks/735-b885dfec6353171d.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/cloudflare/route-b77846f372b01f38.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/databases/route-407794f8145d9a0b.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/migrations/sync/route-9f480f5590369a8f.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/migrations/sync-files/route-92010db279b4dd8e.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/pull-data/confirm/route-a02fe6d3cdd0a535.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/pull-remote/confirm/route-f401a03507d1da50.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/pull-remote/preview/route-3c53814b5cb8b6b0.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/push-remote/confirm/route-8f359249e907c63b.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/push-remote/preview/route-b51bf94f39c17a9d.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/query/route-87bae2d4aebaf859.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/tables/[name]/route-d20ca163b9c03e7c.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/tables/route-0f46f911562abcdf.js +0 -1
- package/dist/.next/.next/static/chunks/app/api/update/route-14edc1917760bce0.js +0 -1
- package/dist/.next/.next/static/chunks/app/page-f05cd0fc436bf9bc.js +0 -1
- package/dist/.next/.next/static/chunks/app/page-f2bc307c0d8acdaa.js +0 -1
- package/dist/.next/.next/static/chunks/webpack-c76ac1e586b2802a.js +0 -1
- package/dist/.next/.next/static/css/7c16f57d325d0d7d.css +0 -3
- package/dist/.next/.next/static/ejYPqJ2kVicVp5EFWOZIC/_buildManifest.js +0 -1
- package/dist/.next/.next/static/gABGrAoO8IPArDo_Ns_7g/_buildManifest.js +0 -1
- package/dist/.next/.next/static/gh-QfIUVo4FTTduYCVKT6/_buildManifest.js +0 -1
- package/dist/.next/.next/static/media/569ce4b8f30dc480-s.p.woff2 +0 -0
- package/dist/.next/.next/static/thaCy2qVeNqYYhdayr13C/_buildManifest.js +0 -1
- package/dist/.next/.next/static/ybCx6L6gHqtODbKmlhU-d/_buildManifest.js +0 -1
- package/dist/.next/cache/webpack/client-production/1.pack +0 -0
- package/dist/.next/cache/webpack/client-production/2.pack +0 -0
- package/dist/.next/cache/webpack/client-production/index.pack.old +0 -0
- package/dist/.next/static/IX-QLbm7scYnyqWeeimal/_buildManifest.js +0 -1
- package/dist/.next/static/chunks/576-18a2209e1ed26aad.js +0 -1
- package/dist/.next/static/chunks/735-b885dfec6353171d.js +0 -1
- package/dist/.next/static/chunks/app/api/cloudflare/route-b77846f372b01f38.js +0 -1
- package/dist/.next/static/chunks/app/api/databases/route-407794f8145d9a0b.js +0 -1
- package/dist/.next/static/chunks/app/api/migrations/sync/route-9f480f5590369a8f.js +0 -1
- package/dist/.next/static/chunks/app/api/migrations/sync-files/route-92010db279b4dd8e.js +0 -1
- package/dist/.next/static/chunks/app/api/pull-data/confirm/route-a02fe6d3cdd0a535.js +0 -1
- package/dist/.next/static/chunks/app/api/pull-remote/confirm/route-f401a03507d1da50.js +0 -1
- package/dist/.next/static/chunks/app/api/pull-remote/preview/route-3c53814b5cb8b6b0.js +0 -1
- package/dist/.next/static/chunks/app/api/push-remote/confirm/route-8f359249e907c63b.js +0 -1
- package/dist/.next/static/chunks/app/api/push-remote/preview/route-b51bf94f39c17a9d.js +0 -1
- package/dist/.next/static/chunks/app/api/query/route-87bae2d4aebaf859.js +0 -1
- package/dist/.next/static/chunks/app/api/tables/[name]/route-d20ca163b9c03e7c.js +0 -1
- package/dist/.next/static/chunks/app/api/tables/route-0f46f911562abcdf.js +0 -1
- package/dist/.next/static/chunks/app/api/update/route-14edc1917760bce0.js +0 -1
- package/dist/.next/static/chunks/app/page-f05cd0fc436bf9bc.js +0 -1
- package/dist/.next/static/chunks/webpack-c76ac1e586b2802a.js +0 -1
- package/dist/.next/static/css/7c16f57d325d0d7d.css +0 -3
- package/dist/.next/static/media/569ce4b8f30dc480-s.p.woff2 +0 -0
- /package/dist/.next/.next/static/{FEsQ9jwPUQv5A3fwg6Opl → -OO4tE7EKr8o62Bne-ODo}/_ssgManifest.js +0 -0
- /package/dist/.next/.next/static/{Y9mYu4WBghepP5oT_3OdR → 3kAeIJC56X7aw1Fk5_OXO}/_ssgManifest.js +0 -0
- /package/dist/.next/.next/static/{ae3gNmoSGm-R5LJC4UagI → J8r9W6xxmYYvuKehItNuW}/_ssgManifest.js +0 -0
- /package/dist/.next/.next/static/{bKfUJeuvAQlBmR3TjrfkH → ZmKZbpam0G_d3SphfZPJ7}/_ssgManifest.js +0 -0
- /package/dist/.next/.next/static/{ejYPqJ2kVicVp5EFWOZIC → arc9h7hbaQzL1Dl0iuVrT}/_ssgManifest.js +0 -0
- /package/dist/.next/.next/static/chunks/{4bd1b696-8c908eb707f85a27.js → 4bd1b696-124ea104c06f6cea.js} +0 -0
- /package/dist/.next/.next/static/chunks/{517-3b698a5d3da06ff7.js → 517-c876ce2f00030cd0.js} +0 -0
- /package/dist/.next/.next/static/chunks/{692-ede418e1d28a1394.js → 692-9e59d546afd11ec3.js} +0 -0
- /package/dist/.next/.next/static/chunks/app/_not-found/{page-b786c3dd79ad15a5.js → page-3e24b81707d98126.js} +0 -0
- /package/dist/.next/.next/static/{gABGrAoO8IPArDo_Ns_7g → f_PVCmmSeM5SwW3M1tw7Q}/_ssgManifest.js +0 -0
- /package/dist/.next/.next/static/{gh-QfIUVo4FTTduYCVKT6 → fiesjBWbrmSSyLf4biwrX}/_ssgManifest.js +0 -0
- /package/dist/.next/.next/static/{thaCy2qVeNqYYhdayr13C → ft39e6W6vSgUL7peRo7pE}/_ssgManifest.js +0 -0
- /package/dist/.next/.next/static/{ybCx6L6gHqtODbKmlhU-d → u7ssdTycF4iQ-w-pQZhxg}/_ssgManifest.js +0 -0
- /package/dist/.next/{static/IX-QLbm7scYnyqWeeimal → .next/static/v-i2YsOGT890zutOSiqqK}/_ssgManifest.js +0 -0
- /package/dist/.next/static/chunks/{4bd1b696-8c908eb707f85a27.js → 4bd1b696-124ea104c06f6cea.js} +0 -0
- /package/dist/.next/static/chunks/{517-3b698a5d3da06ff7.js → 517-c876ce2f00030cd0.js} +0 -0
- /package/dist/.next/static/chunks/{692-ede418e1d28a1394.js → 692-9e59d546afd11ec3.js} +0 -0
- /package/dist/.next/static/chunks/app/_not-found/{page-b786c3dd79ad15a5.js → page-3e24b81707d98126.js} +0 -0
package/dist/lib/migrations.js
CHANGED
|
@@ -151,11 +151,23 @@ export async function getRemoteMigrations(projectDir, databaseName, env) {
|
|
|
151
151
|
}
|
|
152
152
|
return [];
|
|
153
153
|
} catch (error) {
|
|
154
|
+
// Collect all error text — executeSQL wraps the real wrangler error in details
|
|
155
|
+
const msg = [
|
|
156
|
+
error.message,
|
|
157
|
+
error.details?.originalError,
|
|
158
|
+
error.details?.stderr,
|
|
159
|
+
error.details?.stdout,
|
|
160
|
+
].filter(Boolean).join(' ');
|
|
161
|
+
|
|
162
|
+
// d1_migrations table doesn't exist yet — no migrations have been pushed remotely
|
|
163
|
+
if (msg.includes('no such table') || msg.includes('d1_migrations')) {
|
|
164
|
+
return [];
|
|
165
|
+
}
|
|
154
166
|
throw {
|
|
155
167
|
type: ErrorTypes.EXECUTION_ERROR,
|
|
156
168
|
message: 'Failed to get remote migrations',
|
|
157
169
|
details: {
|
|
158
|
-
error:
|
|
170
|
+
error: msg || 'Failed to execute SQL command',
|
|
159
171
|
suggestions: [
|
|
160
172
|
'Check remote database permissions',
|
|
161
173
|
'Verify credentials and connection'
|
|
@@ -281,13 +293,39 @@ export async function compareMigrations(projectDir, databaseName) {
|
|
|
281
293
|
/**
|
|
282
294
|
* Generates a SHA256 checksum for migration content.
|
|
283
295
|
*
|
|
284
|
-
* @param {string} content
|
|
296
|
+
* @param {string} content
|
|
285
297
|
* @returns {string}
|
|
286
298
|
*/
|
|
287
299
|
export function createChecksum(content) {
|
|
288
300
|
return createHash('sha256').update(content).digest('hex');
|
|
289
301
|
}
|
|
290
302
|
|
|
303
|
+
/**
|
|
304
|
+
* Ensures the d1_migrations table has a checksum column.
|
|
305
|
+
* Wrangler creates the table without it; d1studio adds it on first use.
|
|
306
|
+
*
|
|
307
|
+
* @param {string} projectDir
|
|
308
|
+
* @param {string} databaseName
|
|
309
|
+
*/
|
|
310
|
+
export async function ensureChecksumColumn(projectDir, databaseName) {
|
|
311
|
+
try {
|
|
312
|
+
await execAsync(
|
|
313
|
+
`wrangler d1 execute ${databaseName} --local --command="SELECT checksum FROM d1_migrations LIMIT 1;"`,
|
|
314
|
+
{ cwd: projectDir }
|
|
315
|
+
);
|
|
316
|
+
} catch {
|
|
317
|
+
// Column doesn't exist — add it
|
|
318
|
+
try {
|
|
319
|
+
await execAsync(
|
|
320
|
+
`wrangler d1 execute ${databaseName} --local --command="ALTER TABLE d1_migrations ADD COLUMN checksum TEXT;"`,
|
|
321
|
+
{ cwd: projectDir }
|
|
322
|
+
);
|
|
323
|
+
} catch {
|
|
324
|
+
// Ignore if column already exists or table doesn't exist yet
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
291
329
|
/**
|
|
292
330
|
* Processes schema changes (DDL) and creates migration files.
|
|
293
331
|
* Uses a stable naming convention:
|
|
@@ -3,11 +3,7 @@
|
|
|
3
3
|
import { SQLErrorTypes } from './sql-error-types';
|
|
4
4
|
|
|
5
5
|
export function parseSQLError(error) {
|
|
6
|
-
console.debug("parseSQLError - Received error:", error);
|
|
7
|
-
|
|
8
|
-
// Defensive check in case error is null/undefined
|
|
9
6
|
if (!error) {
|
|
10
|
-
console.debug("parseSQLError - error is null or undefined.");
|
|
11
7
|
return {
|
|
12
8
|
type: SQLErrorTypes.UNKNOWN_ERROR,
|
|
13
9
|
message: 'An unknown error occurred',
|
|
@@ -15,186 +11,129 @@ export function parseSQLError(error) {
|
|
|
15
11
|
};
|
|
16
12
|
}
|
|
17
13
|
|
|
18
|
-
let errorMessage = '';
|
|
19
|
-
let offset = null;
|
|
20
|
-
let nearText = null;
|
|
21
14
|
let originalQuery = null;
|
|
22
15
|
|
|
23
|
-
//
|
|
16
|
+
// Extract the SQL query from the wrangler command string
|
|
24
17
|
const cmd = error.cmd || (error.details && error.details.command);
|
|
25
18
|
if (cmd) {
|
|
26
|
-
const queryMatch = cmd.match(/--command="(.+?)"/s);
|
|
19
|
+
const queryMatch = cmd.match(/--command="(.+?)"\s*--json/s);
|
|
27
20
|
if (queryMatch) {
|
|
28
|
-
originalQuery = queryMatch[1].replace(/\\n/g, '\n');
|
|
29
|
-
console.debug("parseSQLError - Extracted original query:", originalQuery);
|
|
21
|
+
originalQuery = queryMatch[1].replace(/\\n/g, '\n').replace(/\\"/g, '"');
|
|
30
22
|
}
|
|
31
23
|
}
|
|
32
24
|
|
|
33
|
-
//
|
|
25
|
+
// Parse wrangler stdout JSON error format: {"error":{"text":"..."}}
|
|
26
|
+
const rawStdout = error.stdout || (error.details && error.details.stdout);
|
|
27
|
+
if (rawStdout) {
|
|
28
|
+
try {
|
|
29
|
+
const parsed = JSON.parse(rawStdout.trim());
|
|
30
|
+
const errorText = parsed?.error?.text || '';
|
|
31
|
+
if (errorText) {
|
|
32
|
+
return classifyErrorText(errorText, originalQuery, cmd);
|
|
33
|
+
}
|
|
34
|
+
} catch { /* not wrangler JSON format, fall through */ }
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Parse stderr (legacy path)
|
|
34
38
|
const rawStderr = error.stderr || (error.details && error.details.stderr);
|
|
35
39
|
if (rawStderr) {
|
|
36
|
-
// Remove ANSI escape codes
|
|
37
40
|
const cleanStderr = rawStderr.replace(/\x1B\[[0-9;]*[a-zA-Z]/g, '');
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
// Check for "env: node: No such file or directory" error
|
|
41
|
-
if (cleanStderr.includes('env: node: No such file or directory')) {
|
|
42
|
-
console.debug("parseSQLError - Detected 'env: node: No such file or directory' error.");
|
|
43
|
-
return {
|
|
44
|
-
type: SQLErrorTypes.EXECUTION_ERROR,
|
|
45
|
-
message: error.message || 'Execution error: env: node: No such file or directory',
|
|
46
|
-
details: {
|
|
47
|
-
originalQuery,
|
|
48
|
-
stderr: cleanStderr
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
}
|
|
41
|
+
return classifyErrorText(cleanStderr, originalQuery, cmd);
|
|
42
|
+
}
|
|
52
43
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
errorMessage = `Syntax error near "${near}" at position ${offset}`;
|
|
59
|
-
console.debug("parseSQLError - Syntax error detected:", { near, offset });
|
|
60
|
-
return {
|
|
61
|
-
type: SQLErrorTypes.SYNTAX_ERROR,
|
|
62
|
-
message: errorMessage,
|
|
63
|
-
details: {
|
|
64
|
-
originalQuery,
|
|
65
|
-
errorLocation: { offset, near },
|
|
66
|
-
stderr: cleanStderr
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
}
|
|
44
|
+
// better-sqlite3 throws plain Error objects — message is the constraint text
|
|
45
|
+
const msg = error.message || (error.details && error.details.originalError) || '';
|
|
46
|
+
if (msg) {
|
|
47
|
+
return classifyErrorText(msg, originalQuery, cmd);
|
|
48
|
+
}
|
|
70
49
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
type: SQLErrorTypes.UNIQUE_CONSTRAINT_ERROR,
|
|
78
|
-
message: `Unique constraint violation updating ${table}.${column}`,
|
|
79
|
-
details: {
|
|
80
|
-
originalQuery,
|
|
81
|
-
stderr: cleanStderr
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
}
|
|
50
|
+
return {
|
|
51
|
+
type: SQLErrorTypes.UNKNOWN_ERROR,
|
|
52
|
+
message: error.message || 'An unknown error occurred',
|
|
53
|
+
details: {}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
85
56
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
details: {
|
|
95
|
-
originalQuery,
|
|
96
|
-
stderr: cleanStderr
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
}
|
|
57
|
+
function classifyErrorText(text, originalQuery, cmd) {
|
|
58
|
+
if (text.includes('env: node: No such file or directory')) {
|
|
59
|
+
return {
|
|
60
|
+
type: SQLErrorTypes.EXECUTION_ERROR,
|
|
61
|
+
message: 'Node.js not found — ensure Node.js is installed and in PATH',
|
|
62
|
+
details: { originalQuery }
|
|
63
|
+
};
|
|
64
|
+
}
|
|
100
65
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
originalQuery,
|
|
111
|
-
stderr: cleanStderr
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
}
|
|
66
|
+
const syntaxMatch = text.match(/near "([^"]+)": syntax error(?:\s+at offset (\d+))?/);
|
|
67
|
+
if (syntaxMatch) {
|
|
68
|
+
const [, near, offset] = syntaxMatch;
|
|
69
|
+
return {
|
|
70
|
+
type: SQLErrorTypes.SYNTAX_ERROR,
|
|
71
|
+
message: `Syntax error near "${near}"${offset ? ` at position ${offset}` : ''}`,
|
|
72
|
+
details: { originalQuery, errorLocation: { near, offset: offset ? parseInt(offset) : null } }
|
|
73
|
+
};
|
|
74
|
+
}
|
|
115
75
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
let details = {};
|
|
126
|
-
if (query) {
|
|
127
|
-
const updateMatch = /UPDATE\s+(\w+)\s+SET\s+(\w+)\s*=/.exec(query);
|
|
128
|
-
if (updateMatch) {
|
|
129
|
-
details = {
|
|
130
|
-
table: updateMatch[1],
|
|
131
|
-
column: updateMatch[2]
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
}
|
|
76
|
+
if (text.includes('UNIQUE constraint failed')) {
|
|
77
|
+
const match = text.match(/UNIQUE constraint failed: ([\w.]+)/);
|
|
78
|
+
const [, col] = match || [];
|
|
79
|
+
return {
|
|
80
|
+
type: SQLErrorTypes.UNIQUE_CONSTRAINT_ERROR,
|
|
81
|
+
message: `UNIQUE constraint failed: ${col || 'unknown column'}`,
|
|
82
|
+
details: { originalQuery }
|
|
83
|
+
};
|
|
84
|
+
}
|
|
135
85
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
...details,
|
|
146
|
-
originalQuery: query,
|
|
147
|
-
stderr: cleanStderr
|
|
148
|
-
}
|
|
149
|
-
};
|
|
150
|
-
}
|
|
86
|
+
if (text.includes('NOT NULL constraint failed')) {
|
|
87
|
+
const match = text.match(/NOT NULL constraint failed: ([\w.]+)/);
|
|
88
|
+
const [, col] = match || [];
|
|
89
|
+
return {
|
|
90
|
+
type: SQLErrorTypes.NOT_NULL_CONSTRAINT_ERROR,
|
|
91
|
+
message: `NOT NULL constraint failed: ${col || 'unknown column'}`,
|
|
92
|
+
details: { originalQuery }
|
|
93
|
+
};
|
|
94
|
+
}
|
|
151
95
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
originalQuery,
|
|
162
|
-
stderr: cleanStderr
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
}
|
|
96
|
+
if (text.includes('CHECK constraint failed')) {
|
|
97
|
+
const match = text.match(/CHECK constraint failed: (\S+)/);
|
|
98
|
+
const [, name] = match || [];
|
|
99
|
+
return {
|
|
100
|
+
type: SQLErrorTypes.CHECK_CONSTRAINT_ERROR,
|
|
101
|
+
message: `CHECK constraint failed: ${name || 'unknown constraint'}`,
|
|
102
|
+
details: { originalQuery }
|
|
103
|
+
};
|
|
104
|
+
}
|
|
166
105
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
message: `Table already exists: ${table}`,
|
|
175
|
-
details: {
|
|
176
|
-
originalQuery,
|
|
177
|
-
stderr: cleanStderr
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
}
|
|
106
|
+
if (text.includes('FOREIGN KEY constraint failed')) {
|
|
107
|
+
return {
|
|
108
|
+
type: SQLErrorTypes.FOREIGN_KEY_ERROR,
|
|
109
|
+
message: 'FOREIGN KEY constraint failed',
|
|
110
|
+
details: { originalQuery }
|
|
111
|
+
};
|
|
112
|
+
}
|
|
181
113
|
|
|
182
|
-
|
|
183
|
-
|
|
114
|
+
if (text.includes('no such table')) {
|
|
115
|
+
const match = text.match(/no such table: (\S+)/);
|
|
116
|
+
const [, table] = match || [];
|
|
184
117
|
return {
|
|
185
|
-
type: SQLErrorTypes.
|
|
186
|
-
message:
|
|
187
|
-
details: {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
118
|
+
type: SQLErrorTypes.TABLE_NOT_FOUND,
|
|
119
|
+
message: `Table not found: ${table || 'unknown'}`,
|
|
120
|
+
details: { originalQuery }
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if (text.includes('already exists')) {
|
|
125
|
+
const match = text.match(/table (\w+) already exists/);
|
|
126
|
+
const [, table] = match || [];
|
|
127
|
+
return {
|
|
128
|
+
type: SQLErrorTypes.TABLE_EXISTS,
|
|
129
|
+
message: `Table already exists: ${table || 'unknown'}`,
|
|
130
|
+
details: { originalQuery }
|
|
191
131
|
};
|
|
192
132
|
}
|
|
193
133
|
|
|
194
|
-
console.debug("parseSQLError - No stderr available; using default error handling.");
|
|
195
134
|
return {
|
|
196
|
-
type: SQLErrorTypes.
|
|
197
|
-
message:
|
|
198
|
-
details: {}
|
|
135
|
+
type: SQLErrorTypes.EXECUTION_ERROR,
|
|
136
|
+
message: text.replace(/:\s*SQLITE_\w+$/, '').trim() || 'Failed to execute SQL command',
|
|
137
|
+
details: { originalQuery }
|
|
199
138
|
};
|
|
200
139
|
}
|
|
@@ -210,9 +210,8 @@ export async function extractTableNameFromMigration(filename) {
|
|
|
210
210
|
|
|
211
211
|
export function removeSQLComments(sql) {
|
|
212
212
|
return sql
|
|
213
|
-
.
|
|
214
|
-
.
|
|
215
|
-
.join('\n')
|
|
213
|
+
.replace(/--[^\r\n]*/g, '') // strip -- comments (inline and full-line)
|
|
214
|
+
.replace(/\/\*[\s\S]*?\*\//g, '') // strip /* */ block comments
|
|
216
215
|
.trim();
|
|
217
216
|
}
|
|
218
217
|
|
|
@@ -275,10 +274,16 @@ export function parseQuery(query) {
|
|
|
275
274
|
* Executes a SQL command via Wrangler.
|
|
276
275
|
* Supports both local and remote execution.
|
|
277
276
|
*/
|
|
278
|
-
export async function executeSQL(projectDir, databaseName, sql, env = {}, remote = false) {
|
|
277
|
+
export async function executeSQL(projectDir, databaseName, sql, env = {}, remote = false, dbConfig = null) {
|
|
279
278
|
try {
|
|
280
|
-
//
|
|
281
|
-
|
|
279
|
+
// Strip SQL comments before collapsing whitespace.
|
|
280
|
+
// IMPORTANT: must happen before replace(/\s+/g,' ') — once newlines are gone,
|
|
281
|
+
// inline `--` comments would extend to end-of-input and corrupt the statement.
|
|
282
|
+
let cleanSQL = sql
|
|
283
|
+
.replace(/--[^\r\n]*/g, '') // strip -- line comments (inline and full-line)
|
|
284
|
+
.replace(/\/\*[\s\S]*?\*\//g, '') // strip /* */ block comments
|
|
285
|
+
.trim()
|
|
286
|
+
.replace(/\s+/g, ' ');
|
|
282
287
|
const upperSQL = cleanSQL.toUpperCase();
|
|
283
288
|
|
|
284
289
|
// If it's an index creation and doesn't already have IF NOT EXISTS, add it.
|
|
@@ -296,16 +301,24 @@ export async function executeSQL(projectDir, databaseName, sql, env = {}, remote
|
|
|
296
301
|
throw new Error('Invalid database name for security reasons');
|
|
297
302
|
}
|
|
298
303
|
|
|
304
|
+
// Try direct SQLite access first for local queries (fast path, no process spawning)
|
|
305
|
+
if (!remote && dbConfig) {
|
|
306
|
+
const { executeLocalSQL } = await import('@/lib/local-db.js');
|
|
307
|
+
const localOutput = executeLocalSQL(projectDir, dbConfig, cleanSQL);
|
|
308
|
+
if (localOutput !== null) return localOutput;
|
|
309
|
+
}
|
|
310
|
+
|
|
299
311
|
const isWindows = process.platform === 'win32';
|
|
300
312
|
const npxCommand = isWindows ? 'npx.cmd' : 'npx';
|
|
301
313
|
const executionFlag = remote ? '--remote' : '--local';
|
|
302
314
|
|
|
303
315
|
// Additional SQL escape for shell command execution
|
|
304
316
|
const shellEscapedSQL = cleanSQL.replace(/"/g, '\\"').replace(/\$/g, '\\$');
|
|
305
|
-
const command = `${npxCommand} wrangler d1 execute ${databaseName} ${executionFlag} --command="${shellEscapedSQL}"`;
|
|
317
|
+
const command = `${npxCommand} wrangler d1 execute ${databaseName} ${executionFlag} --command="${shellEscapedSQL}" --json`;
|
|
306
318
|
|
|
307
|
-
|
|
308
|
-
|
|
319
|
+
if (remote) {
|
|
320
|
+
console.log(`[executeSQL --remote] ${command}`);
|
|
321
|
+
} else if (logger.shouldLog('debug')) {
|
|
309
322
|
logger.debug('Executing command:', command);
|
|
310
323
|
}
|
|
311
324
|
|
|
@@ -317,6 +330,9 @@ export async function executeSQL(projectDir, databaseName, sql, env = {}, remote
|
|
|
317
330
|
};
|
|
318
331
|
// console.log('Executing command:', command);
|
|
319
332
|
const { stdout, stderr } = await execAsync(command, execOptions);
|
|
333
|
+
if (remote && stderr) {
|
|
334
|
+
console.log(`[executeSQL --remote stderr]: ${stderr.substring(0, 800)}`);
|
|
335
|
+
}
|
|
320
336
|
if (stderr && !stderr.includes('🌀')) {
|
|
321
337
|
throw new Error(stderr);
|
|
322
338
|
}
|
|
@@ -330,7 +346,9 @@ export async function executeSQL(projectDir, databaseName, sql, env = {}, remote
|
|
|
330
346
|
}
|
|
331
347
|
return stdout;
|
|
332
348
|
} catch (error) {
|
|
333
|
-
|
|
349
|
+
if (logger.shouldLog('debug')) {
|
|
350
|
+
logger.debug('SQL execution error:', error.message || error);
|
|
351
|
+
}
|
|
334
352
|
// Instead of creating a new error object, preserve the original error details
|
|
335
353
|
throw {
|
|
336
354
|
type: ErrorTypes.EXECUTION_ERROR,
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { randomUUID } from 'crypto';
|
|
2
|
+
import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs';
|
|
3
|
+
import { homedir } from 'os';
|
|
4
|
+
import { join } from 'path';
|
|
5
|
+
|
|
6
|
+
const CONFIG_DIR = join(homedir(), '.d1-studio');
|
|
7
|
+
const CONFIG_FILE = join(CONFIG_DIR, 'config.json');
|
|
8
|
+
const TRACK_URL = 'https://d1-studio.com/api/track';
|
|
9
|
+
|
|
10
|
+
function getInstallId() {
|
|
11
|
+
if (!existsSync(CONFIG_DIR)) mkdirSync(CONFIG_DIR, { recursive: true });
|
|
12
|
+
if (existsSync(CONFIG_FILE)) {
|
|
13
|
+
try {
|
|
14
|
+
const data = JSON.parse(readFileSync(CONFIG_FILE, 'utf8'));
|
|
15
|
+
if (data.installId) return data.installId;
|
|
16
|
+
} catch {}
|
|
17
|
+
}
|
|
18
|
+
const installId = randomUUID();
|
|
19
|
+
writeFileSync(CONFIG_FILE, JSON.stringify({ installId }));
|
|
20
|
+
return installId;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export async function trackEvent(event, version) {
|
|
24
|
+
if (process.env.D1_STUDIO_NO_TELEMETRY) return;
|
|
25
|
+
try {
|
|
26
|
+
await fetch(TRACK_URL, {
|
|
27
|
+
method: 'POST',
|
|
28
|
+
headers: { 'Content-Type': 'application/json' },
|
|
29
|
+
body: JSON.stringify({
|
|
30
|
+
installId: getInstallId(),
|
|
31
|
+
event,
|
|
32
|
+
version,
|
|
33
|
+
node: process.version,
|
|
34
|
+
platform: process.platform,
|
|
35
|
+
}),
|
|
36
|
+
signal: AbortSignal.timeout(3000),
|
|
37
|
+
});
|
|
38
|
+
} catch {} // silent fail, never block the user
|
|
39
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "d1s",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Manage your Cloudflare D1 database locally, lightning fast.",
|
|
6
6
|
"main": "./dist/d1-studio.js",
|
|
@@ -11,10 +11,12 @@
|
|
|
11
11
|
"dev": "next dev",
|
|
12
12
|
"build": "next build",
|
|
13
13
|
"build:cli": "npm run build && mkdir -p dist/lib && mkdir -p dist/app && cp -r src/lib/* dist/lib/ && cp -r src/app/* dist/app/ && cp scripts/studio.js dist/d1-studio.js && cp -r .next dist/.next && chmod +x dist/d1-studio.js",
|
|
14
|
+
"rebuild": "rm -rf .next dist && npm run build:cli",
|
|
14
15
|
"start": "next start",
|
|
15
16
|
"prepare": "npm run build:cli",
|
|
16
17
|
"link": "npm link",
|
|
17
18
|
"test": "node scripts/test.js",
|
|
19
|
+
"test:api": "node tests/run-tests.mjs",
|
|
18
20
|
"test:cli": "d1-studio --version",
|
|
19
21
|
"test:all": "npm run test && npm run test:cli",
|
|
20
22
|
"build:all": "npm run build && npm run build:cli",
|
|
@@ -59,7 +61,9 @@
|
|
|
59
61
|
"@radix-ui/react-tabs": "^1.1.2",
|
|
60
62
|
"@radix-ui/react-toast": "^1.2.5",
|
|
61
63
|
"@radix-ui/react-tooltip": "^1.1.7",
|
|
64
|
+
"@xyflow/react": "^12.10.1",
|
|
62
65
|
"axios": "^1.7.9",
|
|
66
|
+
"better-sqlite3": "^12.8.0",
|
|
63
67
|
"chalk": "^4.1.2",
|
|
64
68
|
"class-variance-authority": "^0.7.1",
|
|
65
69
|
"clsx": "^2.1.1",
|
|
@@ -91,4 +95,4 @@
|
|
|
91
95
|
"tailwindcss": "^3.4.1",
|
|
92
96
|
"wrangler": "^3.107.3"
|
|
93
97
|
}
|
|
94
|
-
}
|
|
98
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
self.__BUILD_MANIFEST=function(e,r,t,_){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},__routerFilterStatic:{numItems:14,errorRate:1e-4,numBits:269,numHashes:14,bitArray:[1,1,0,0,0,1,e,r,e,e,e,r,r,e,e,e,e,e,e,r,e,e,r,r,r,r,e,e,e,r,e,e,r,e,r,r,e,e,r,e,r,e,e,e,r,e,e,e,e,e,e,e,r,r,e,r,r,e,e,e,r,e,e,r,e,r,r,r,e,e,r,e,e,r,e,r,e,r,e,e,e,e,e,r,e,r,r,r,r,r,e,r,e,r,e,e,e,r,r,r,r,r,e,e,e,e,r,r,e,r,r,e,e,r,e,e,r,r,e,e,e,e,r,r,r,r,e,r,r,e,r,r,r,e,r,e,r,e,r,e,e,e,r,r,e,e,r,e,r,e,r,e,e,r,e,e,r,r,r,e,r,r,r,r,e,e,e,r,r,e,r,e,e,r,e,e,e,r,r,r,e,e,r,e,r,r,r,e,r,e,e,e,e,e,e,r,e,r,r,e,e,r,e,r,r,e,r,e,r,r,r,e,r,e,e,e,r,e,e,e,e,r,e,e,r,e,r,e,r,e,r,e,e,r,r,r,r,e,e,r,r,e,r,r,r,r,r,e,e,r,r,r,e,r,e,e,e,e,r,e,e,r,r,r,r,e,e,e,r]},__routerFilterDynamic:{numItems:e,errorRate:1e-4,numBits:20,numHashes:14,bitArray:[e,r,r,e,r,e,e,r,e,e,e,r,r,r,r,e,e,e,e,e]},"/_error":["static/chunks/pages/_error-9b7125ad1a1e68fa.js"],sortedPages:["/_app","/_error"]}}(1,0,14,0),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
self.__BUILD_MANIFEST=function(e,r,t,_){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},__routerFilterStatic:{numItems:14,errorRate:1e-4,numBits:269,numHashes:14,bitArray:[1,1,0,0,0,1,e,r,e,e,e,r,r,e,e,e,e,e,e,r,e,e,r,r,r,r,e,e,e,r,e,e,r,e,r,r,e,e,r,e,r,e,e,e,r,e,e,e,e,e,e,e,r,r,e,r,r,e,e,e,r,e,e,r,e,r,r,r,e,e,r,e,e,r,e,r,e,r,e,e,e,e,e,r,e,r,r,r,r,r,e,r,e,r,e,e,e,r,r,r,r,r,e,e,e,e,r,r,e,r,r,e,e,r,e,e,r,r,e,e,e,e,r,r,r,r,e,r,r,e,r,r,r,e,r,e,r,e,r,e,e,e,r,r,e,e,r,e,r,e,r,e,e,r,e,e,r,r,r,e,r,r,r,r,e,e,e,r,r,e,r,e,e,r,e,e,e,r,r,r,e,e,r,e,r,r,r,e,r,e,e,e,e,e,e,r,e,r,r,e,e,r,e,r,r,e,r,e,r,r,r,e,r,e,e,e,r,e,e,e,e,r,e,e,r,e,r,e,r,e,r,e,e,r,r,r,r,e,e,r,r,e,r,r,r,r,r,e,e,r,r,r,e,r,e,e,e,e,r,e,e,r,r,r,r,e,e,e,r]},__routerFilterDynamic:{numItems:e,errorRate:1e-4,numBits:20,numHashes:14,bitArray:[e,r,r,e,r,e,e,r,e,e,e,r,r,r,r,e,e,e,e,e]},"/_error":["static/chunks/pages/_error-9b7125ad1a1e68fa.js"],sortedPages:["/_app","/_error"]}}(1,0,14,0),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
self.__BUILD_MANIFEST=function(e,r,t,_){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},__routerFilterStatic:{numItems:14,errorRate:1e-4,numBits:269,numHashes:14,bitArray:[1,1,0,0,0,1,e,r,e,e,e,r,r,e,e,e,e,e,e,r,e,e,r,r,r,r,e,e,e,r,e,e,r,e,r,r,e,e,r,e,r,e,e,e,r,e,e,e,e,e,e,e,r,r,e,r,r,e,e,e,r,e,e,r,e,r,r,r,e,e,r,e,e,r,e,r,e,r,e,e,e,e,e,r,e,r,r,r,r,r,e,r,e,r,e,e,e,r,r,r,r,r,e,e,e,e,r,r,e,r,r,e,e,r,e,e,r,r,e,e,e,e,r,r,r,r,e,r,r,e,r,r,r,e,r,e,r,e,r,e,e,e,r,r,e,e,r,e,r,e,r,e,e,r,e,e,r,r,r,e,r,r,r,r,e,e,e,r,r,e,r,e,e,r,e,e,e,r,r,r,e,e,r,e,r,r,r,e,r,e,e,e,e,e,e,r,e,r,r,e,e,r,e,r,r,e,r,e,r,r,r,e,r,e,e,e,r,e,e,e,e,r,e,e,r,e,r,e,r,e,r,e,e,r,r,r,r,e,e,r,r,e,r,r,r,r,r,e,e,r,r,r,e,r,e,e,e,e,r,e,e,r,r,r,r,e,e,e,r]},__routerFilterDynamic:{numItems:e,errorRate:1e-4,numBits:20,numHashes:14,bitArray:[e,r,r,e,r,e,e,r,e,e,e,r,r,r,r,e,e,e,e,e]},"/_error":["static/chunks/pages/_error-9b7125ad1a1e68fa.js"],sortedPages:["/_app","/_error"]}}(1,0,14,0),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
self.__BUILD_MANIFEST=function(e,r,t,_){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},__routerFilterStatic:{numItems:14,errorRate:1e-4,numBits:269,numHashes:14,bitArray:[1,1,0,0,0,1,e,r,e,e,e,r,r,e,e,e,e,e,e,r,e,e,r,r,r,r,e,e,e,r,e,e,r,e,r,r,e,e,r,e,r,e,e,e,r,e,e,e,e,e,e,e,r,r,e,r,r,e,e,e,r,e,e,r,e,r,r,r,e,e,r,e,e,r,e,r,e,r,e,e,e,e,e,r,e,r,r,r,r,r,e,r,e,r,e,e,e,r,r,r,r,r,e,e,e,e,r,r,e,r,r,e,e,r,e,e,r,r,e,e,e,e,r,r,r,r,e,r,r,e,r,r,r,e,r,e,r,e,r,e,e,e,r,r,e,e,r,e,r,e,r,e,e,r,e,e,r,r,r,e,r,r,r,r,e,e,e,r,r,e,r,e,e,r,e,e,e,r,r,r,e,e,r,e,r,r,r,e,r,e,e,e,e,e,e,r,e,r,r,e,e,r,e,r,r,e,r,e,r,r,r,e,r,e,e,e,r,e,e,e,e,r,e,e,r,e,r,e,r,e,r,e,e,r,r,r,r,e,e,r,r,e,r,r,r,r,r,e,e,r,r,r,e,r,e,e,e,e,r,e,e,r,r,r,r,e,e,e,r]},__routerFilterDynamic:{numItems:e,errorRate:1e-4,numBits:20,numHashes:14,bitArray:[e,r,r,e,r,e,e,r,e,e,e,r,r,r,r,e,e,e,e,e]},"/_error":["static/chunks/pages/_error-9b7125ad1a1e68fa.js"],sortedPages:["/_app","/_error"]}}(1,0,14,0),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
|