wrangler-legacy icon indicating copy to clipboard operation
wrangler-legacy copied to clipboard

get kv metadata

Open ags799 opened this issue 4 years ago • 11 comments

💡 Feature request

We can put KV metadata with

wrangler kv:key put --namespace-id $id some-key some-value -m '"metadata"'

It makes sense to add functionality to get metadata, too. I'm thinking

wrangler kv:key get --metadata --namespace-id $id some-key

which would print metadata to STDOUT, instead of the value.

ags799 avatar Feb 03 '21 20:02 ags799

what about list with metadata?

koeninger avatar Feb 03 '21 21:02 koeninger

@koeninger separate issue?

ags799 avatar Feb 03 '21 22:02 ags799

would it be nice to get both the key and the metadata at the same time? could we output a JSON object with both?

xortive avatar Feb 04 '21 21:02 xortive

@xortive value isn't necessarily valid JSON, it would need to be base-64'd.

ags799 avatar Feb 04 '21 21:02 ags799

The API in a Worker forces you to get both the value and the metadata at the same time, right? I think I'd prefer keeping the API as similar as possible, which would mean adding metadata list and getWithMetadata, but not a get for metadata alone.

In a Worker today, does getWithMetadata do base 64 encoding?

greg-mckeon avatar Feb 12 '21 17:02 greg-mckeon

getWithMetadata in a worker has the same available return types for the value as get does, ie text. arraybuffer, etc.

It's a little different when we're dealing with standard out on a command line api.

On Fri, Feb 12, 2021 at 11:23 AM Greg McKeon [email protected] wrote:

The API in a Worker forces you to get both the value and the metadata at the same time, right? I think I'd prefer keeping the API as similar as possible, which would mean adding metadata list and getWithMetadata, but not a get for metadata alone.

In a Worker today, does getWithMetadata do base 64 encoding?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cloudflare/wrangler/issues/1751#issuecomment-778329006, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAYAB4NOHEIS2XNB52FBWDS6VPYJANCNFSM4XBPYXBA .

koeninger avatar Feb 12 '21 18:02 koeninger

We'll go with

wrangler kv:key get-metadata --namespace-id $id some-key

And in another issue, list should include metadata.

ags799 avatar Feb 12 '21 22:02 ags799

Hi, what's the status?

StarpTech avatar Aug 05 '21 15:08 StarpTech

This issue has been automatically marked as stale because it has not had recent activity in the last 180 days. It will be closed if no further activity occurs in the next week. Please feel free to comment if you'd like it to remain open, and thank you for your contributions.

stale[bot] avatar Mar 02 '22 09:03 stale[bot]

did this ever get fixed?

samuelcolvin avatar Jul 15 '22 12:07 samuelcolvin

probably better to re-open on https://github.com/cloudflare/wrangler2

koeninger avatar Jul 15 '22 13:07 koeninger

Thanks for suggesting this feature! Wrangler v1 is now deprecated and support is only being provided for critical updates or security concerns. As such, we are closing this issue.

New versions of Wrangler are maintained in the workers-sdk repo. If this is a feature you’d like to see in wrangler v2+, please feel free to report it in the workers-sdk repo. For more info about wrangler v1 deprecation, please check out our blog post.

penalosa avatar Feb 27 '23 16:02 penalosa