This repository has been archived by the owner on Aug 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 334
Add key listing functionality for workers kv subcommands #462
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gabbifish
requested review from
ashleymichal,
ashleygwilliams and
steveklabnik
August 21, 2019 17:46
gabbifish
added
status - needs review
feature
Feature requests and suggestions
regression
Something is broken, but works in previous releases
labels
Aug 21, 2019
gabbifish
force-pushed
the
gabbi/list-all-keys
branch
from
August 21, 2019 18:35
0747df0
to
edfe690
Compare
ashleymichal
approved these changes
Aug 21, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
feature
Feature requests and suggestions
regression
Something is broken, but works in previous releases
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR closes #345. A clarification: this does not list all KV pairs in a Workers KV instance, but instead, lists all keys and (if present) their expiration timestamps.
Usage without prefix filter:
With prefix filter:
I made sure that the logic handles pagination correctly for KV namespaces with >1000 keys :)
There are
todo
comments in my code about particular pieces of logic I'd like to write more elegantly, if possible. I'd love if you could toss ideas there if you have any.Right now, I print out the results of every page as wrangler gets them (instead of storing them in memory and outputting them all at once). What do the reviewers think about this? I figured this was the best option because it wouldn't eat memory, but I'm curious what other folks think.
This PR will fail CI until cloudflare/cloudflare-rs#30 is merged.