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

Allow id to be an int in doc upsert #393

Merged
merged 1 commit into from
Sep 4, 2024
Merged

Allow id to be an int in doc upsert #393

merged 1 commit into from
Sep 4, 2024

Conversation

Westwooo
Copy link
Contributor

No description provided.

@@ -164,7 +165,18 @@ pub(crate) fn run_kv_store_ops(
let mut content = None;
for (k, v) in val.iter() {
if k.clone() == id_column {
id = v.as_str().ok();
id = match v {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need applying to get too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, get, remove and subdoc_get all use ids_from_input which works with ints.
Replace, upsert and insert all use this so are fine but import does need changing.

@chvck
Copy link
Contributor

chvck commented Aug 20, 2024

The commit message is a bit misleading as i think this applies to all kv store commnands?

@ldoguin
Copy link
Contributor

ldoguin commented Aug 27, 2024

Found it a bit confusing to have run_kv_store_ops in the Upsert CLI. Would it be better to have a KV_Doc commons with all these operations ?

@Westwooo
Copy link
Contributor Author

Westwooo commented Sep 4, 2024

Found it a bit confusing to have run_kv_store_ops in the Upsert CLI. Would it be better to have a KV_Doc commons with all these operations ?

It could be, will raise an issue to look into refactoring this

@Westwooo Westwooo merged commit 52c8228 into main Sep 4, 2024
11 checks passed
@Westwooo Westwooo deleted the doc_upsert_int_ids branch September 4, 2024 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants