Skip to content

Commit

Permalink
feat: added a convenience method that will return an existing item du…
Browse files Browse the repository at this point in the history
…ring a check for insertion
  • Loading branch information
QuantumExplorer committed Sep 27, 2024
1 parent fa4834b commit 1020875
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions grovedb-version/src/version/grovedb_versions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ pub struct GroveDBOperationsInsertVersions {
pub add_element_on_transaction: FeatureVersion,
pub add_element_without_transaction: FeatureVersion,
pub insert_if_not_exists: FeatureVersion,
pub insert_if_not_exists_return_existing_element: FeatureVersion,
pub insert_if_changed_value: FeatureVersion,
}

Expand Down
1 change: 1 addition & 0 deletions grovedb-version/src/version/v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ pub const GROVE_V1: GroveVersion = GroveVersion {
add_element_on_transaction: 0,
add_element_without_transaction: 0,
insert_if_not_exists: 0,
insert_if_not_exists_return_existing_element: 0,
insert_if_changed_value: 0,
},
delete: GroveDBOperationsDeleteVersions {
Expand Down
2 changes: 1 addition & 1 deletion grovedb/src/operations/insert/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ impl GroveDb {
.grovedb_versions
.operations
.insert
.insert_if_not_exists
.insert_if_not_exists_return_existing_element
);

let mut cost = OperationCost::default();
Expand Down

0 comments on commit 1020875

Please sign in to comment.