Skip to content

🚀 Feature Request: Inconsistent naming when creating new KV, D1, R2 resources #6472

Closed
@jasongitmail

Description

@jasongitmail

Describe the solution

(Not a feature, not a bug, just DX that could be improved.)

Problem

Assume you have wrangler.toml containing a name of mysite. When creating D1, R2, & KV resources using wrangler you must specify the desired name differently in order to end up with the same name for the resource.

wrangler d1 create mysite-staging  # creates mysite-staging ✅
wrangler r2 bucket create mysite-staging # creates mysite-staging ✅
wrangler kv namespace create mysite-staging
 # creates mysite-mysite-staging ❌

D1 and R2 are consistent with each other and good.

However, KV's create command preprends <name>-, and should not in order for a predictable DX with the others.

Suggestion

wrangler kv namespace create <name> should 1.) not preprend the project name in order to be consistent with the other commands, and 2.) instead it can just throw an error if the resource already exists like the other methods do and which is likely already does too.

Version

wrangler 3.70.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions