Skip to content
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

Add get_or_create_key_value #1313

Open
Callum-A opened this issue Sep 11, 2024 · 3 comments · May be fixed by #1316
Open

Add get_or_create_key_value #1313

Callum-A opened this issue Sep 11, 2024 · 3 comments · May be fixed by #1316
Labels
proposal Enhancement idea or proposal

Comments

@Callum-A
Copy link

Proposed change

Add a helper method to the jetstream::Context struct to allow getting or creating a KV store in one call. This allows both Jetstreams and KVs to be created in code.

Use case

As a user I would like to ensure a KV exists and if not is created in one call before populating it.

Contribution

I have my changes ready in a branch : https://github.com/Callum-A/nats.rs/tree/feat/get-or-create-kv

@Callum-A Callum-A added the proposal Enhancement idea or proposal label Sep 11, 2024
@Jarema
Copy link
Member

Jarema commented Sep 13, 2024

Hey!

Sure, we can add it for consistency.

If you have it ready, feel free to issues a PR.
However, seeing your code, it would be good to add a test.

@Callum-A
Copy link
Author

I'll open up a PR, is there any guidance on setting up a test env?

@Callum-A Callum-A linked a pull request Sep 13, 2024 that will close this issue
@Callum-A
Copy link
Author

Opened : #1316

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Enhancement idea or proposal
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants