cloudflare / cloudflare/workers-sdk

🐛 BUG: D1 - deleting and re-creating a DB conflicts

Open
#3,438 1 comment 1 reaction 0 assignees View on GitHub
package:wrangler product:d1
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.