drizzle-team / drizzle-team/drizzle-orm

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

Open
#3,454 3 comments 1 reaction 0 assignees View on GitHub
bug driver/d1 drizzle/kit
Dominant language
TypeScript
Stars
35.8k
Forks
1.6k
Avg merge
2d 7h
Merged PRs (30d)
4

Description

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:

```diff
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!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.