nuxt-hub / core

Build full-stack applications with Nuxt on CloudFlare, with zero configuration.
https://hub.nuxt.com
Apache License 2.0
821 stars 37 forks source link

Nuxt Devtools Hub Database SQL Runner doesn't create indexes #94

Open ra-jeev opened 2 months ago

ra-jeev commented 2 months ago

Try creating a unique index using the Nuxt Devtools Hub Database SQL Runner.

E.g. the below query doesn't give any error, but doesn't create the index as well.

CREATE UNIQUE INDEX users_email_key ON users(email); 

Is there some way to run the wrangler commands to run D1 queries in the terminal in a NuxtHub project? To be specific, can I execute the below command for interacting with the local DB?

bunx wrangler d1 execute <db_name> --local --file=./schema.sql

If yes, then what should be the DB name? I tried default and ran the command from the root folder and got the below error:

✘ [ERROR] Couldn't find a D1 DB with the name or binding 'default' in wrangler.toml.

And running the command from .data/hub (with modified file path) folder creates a new local database (not visible to Nuxt Devtools).

Atinux commented 1 month ago

This is an issue related to Drizzle Studio, I contacted the team and should be fixed very soon. Will keep you updated when fixed.

Atinux commented 1 month ago

This should be fixed now @ra-jeev

Can you confirm?

ra-jeev commented 1 month ago

Just tested it, and it works fine now.

Thank you @Atinux 🙏

Also, is it possible to do this 👇 right now?

any way to run the wrangler commands to run D1 queries in the terminal in a NuxtHub project? If yes, how?