drizzle-team / drizzle-team/drizzle-orm
Drizzle kit for D1 does not work when Wrangler is installed locally
- 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
Assessment
This issue has not been assessed yet.