Skip to content

Commit

Permalink
add version for delta functions
Browse files Browse the repository at this point in the history
  • Loading branch information
fominok committed Dec 27, 2024
1 parent dd43d6f commit f7d4105
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 2 additions & 0 deletions grovedb-version/src/version/grovedb_versions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,10 @@ pub struct GroveDBElementMethodVersions {
pub insert_if_changed_value: FeatureVersion,
pub insert_if_changed_value_into_batch_operations: FeatureVersion,
pub insert_reference: FeatureVersion,
pub insert_reference_if_changed_value: FeatureVersion,
pub insert_reference_into_batch_operations: FeatureVersion,
pub insert_subtree: FeatureVersion,
pub insert_subtree_if_changed: FeatureVersion,
pub insert_subtree_into_batch_operations: FeatureVersion,
pub get_query: FeatureVersion,
pub get_query_values: FeatureVersion,
Expand Down
2 changes: 2 additions & 0 deletions grovedb-version/src/version/v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ pub const GROVE_V1: GroveVersion = GroveVersion {
insert_if_changed_value: 0,
insert_if_changed_value_into_batch_operations: 0,
insert_reference: 0,
insert_reference_if_changed_value: 0,
insert_reference_into_batch_operations: 0,
insert_subtree: 0,
insert_subtree_if_changed: 0,
insert_subtree_into_batch_operations: 0,
get_query: 0,
get_query_values: 0,
Expand Down
14 changes: 10 additions & 4 deletions grovedb/src/element/insert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,11 @@ impl Element {
grove_version: &GroveVersion,
) -> CostResult<Delta, Error> {
check_grovedb_v0_with_cost!(
"insert_reference",
grove_version.grovedb_versions.element.insert_reference
"insert_reference_if_changed_value",
grove_version
.grovedb_versions
.element
.insert_reference_if_changed_value
);

let serialized = match self.serialize(grove_version) {
Expand Down Expand Up @@ -492,8 +495,11 @@ impl Element {
grove_version: &GroveVersion,
) -> CostResult<Delta, Error> {
check_grovedb_v0_with_cost!(
"insert_subtree",
grove_version.grovedb_versions.element.insert_subtree
"insert_subtree_if_changed",
grove_version
.grovedb_versions
.element
.insert_subtree_if_changed
);

let serialized = match self.serialize(grove_version) {
Expand Down

0 comments on commit f7d4105

Please sign in to comment.