-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
key-value module for std-rfc #965
base: main
Are you sure you want to change the base?
Conversation
Before anyone asks, I wrote this as a set of space-separated-commands, rather than a
... was clobbering/shadowing the internal
Option 1 resulted in some "less readable" code and was also more "dangerous", since if someone imported the module with So I went with Option 2 ;-) |
I have no real problem with this but I wonder what our process should be for adding something to the stdlib. Seems like it should be more formal with voting or something. Not sure. |
Agreed - I was thinking the same thing while i was working on these. It's something we have to figure out if we hope to open up Possibilities:
|
I'll add tests for this one as well before bringing out of draft. Any thoughts on whether I should use |
You'd have to do some tests to see if it makes any difference because with msgpackz you have to pay for creating msgpack and brotli for compression/decompression. |
4755d73
to
3c3677f
Compare
3c3677f
to
167b164
Compare
Simple getters and setters for key-value pairs in a pipeline.
From the help:
kv module
Easily store and retrieve key-value pairs
in a pipeline.
A common request is to be able to assign a
pipeline result to a variable. While it's
not currently possible to use a "let" statement
within a pipeline, this module provides an
alternative. Think of each key as a variable
that can be set and retrieved.
kv set
Stores the pipeline value for later use
Usage:
Examples:
kv get
Retrieves a stored value by key
Counterpart of
kv set
.Returns
null
if the key is not found.Usage:
kv list
List the currently stored key-value pairs
Returns results as the Nushell value rather
than the stored nuon.
kv drop
Returns and removes a key-value pair