drizzle-team / drizzle-kit-mirror

Docs and issues repository for drizzle-kit
290 stars 17 forks source link

Drizzle kit for D1 does not work when Wrangler is installed locally #321

Open valtyr opened 7 months ago

valtyr commented 7 months ago

I ran into problems using Drizzle Studio for D1 that were caused by Wrangler being installed locally. It would likely be an improvement to default to the wrangler binary in node_modules if it is available, since this seems to be a common setup. It would probably also be useful if the error message thrown would fall back to stderr if no stdout is returned as this would make it easier to surface these sorts of problems:

    try {
      await $`NO_D1_WARNING=true wrangler d1 execute ${dbName} --config=${configPath} --command=${query}`;
    } catch (e1) {
-        throw new Error(e1.stdout);
+        throw new Error(e1.stdout || e1.stderr);
    }

Thank you!

valtyr commented 7 months ago

For reference: https://developers.cloudflare.com/workers/wrangler/install-and-update/#install-wrangler

Cloudflare recommends that wrangler is installed locally.

clibequilibrium commented 6 months ago

For reference: https://developers.cloudflare.com/workers/wrangler/install-and-update/#install-wrangler

Cloudflare recommends that wrangler is installed locally.

Hi, I am having issues on Windows. Even though the wrangler is installer globally I am simply not able to connect to remote db. Were you able to make it work on Windows ?