cloudflare / cloudflare/workers-sdk
🐛 BUG: D1 - deleting and re-creating a DB conflicts
- Dominant language
- TypeScript
- Stars
- 4.5k
- Forks
- 1.5k
- Avg merge
- 3d 8h
- Merged PRs (30d)
- 187
Description
### Which Cloudflare product(s) does this pertain to?
D1
### What version of `Wrangler` are you using?
0.0.0-ccb446b1
### What operating system are you using?
macOS
### Describe the Bug
Deleting a D1 database and re-creating a DB with the same name, but not updating `wrangler.toml`, prevents you from deleting or operating on that DB until the binding in `wrangler.toml` is updated.
0. Have an existing DB binding in `wrangler.toml`
1. `d1 delete `
2. `d1 create `
3. `d1 info ` or `d1 delete ` both fail as wrangler is looking at wrangler.toml and not the server-side (API) name :: ID
Contributor guide
Research direction
Start by reproducing the delete, recreate, and info commands with the described wrangler.toml binding. Trace Wrangler’s D1 command handling for the configured binding versus the server-side name and ID. Done means the recreated database can be operated on without first changing wrangler.toml.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli, cloud, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100