Skip to content

Commit

Permalink
Update uses of MutableJSON::Set and MutableJSON::Replace to use context.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicktobey authored and fulghum committed Jul 3, 2024
1 parent def23a2 commit 237bc14
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion go/libraries/doltcore/merge/merge_prolly_rows.go
Original file line number Diff line number Diff line change
Expand Up @@ -2053,7 +2053,7 @@ func mergeJSON(ctx context.Context, base types.JSONDocument, left types.JSONDocu

switch threeWayDiff.Op {
case tree.DiffOpRightAdd, tree.DiffOpConvergentAdd, tree.DiffOpRightModify, tree.DiffOpConvergentModify:
_, _, err := merged.Set(threeWayDiff.Key, threeWayDiff.Right)
_, _, err := merged.Set(ctx, threeWayDiff.Key, threeWayDiff.Right)
if err != nil {
return types.JSONDocument{}, true, err
}
Expand Down
8 changes: 4 additions & 4 deletions go/store/prolly/tree/json_indexed_document.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,21 +323,21 @@ func (i IndexedJsonDocument) Remove(ctx context.Context, path string) (types.Mut
}

// Set is not yet implemented, so we call it on a types.JSONDocument instead.
func (i IndexedJsonDocument) Set(path string, val sql.JSONWrapper) (types.MutableJSON, bool, error) {
func (i IndexedJsonDocument) Set(ctx context.Context, path string, val sql.JSONWrapper) (types.MutableJSON, bool, error) {
v, err := i.ToInterface()
if err != nil {
return nil, false, err
}
return types.JSONDocument{Val: v}.Set(path, val)
return types.JSONDocument{Val: v}.Set(ctx, path, val)
}

// Replace is not yet implemented, so we call it on a types.JSONDocument instead.
func (i IndexedJsonDocument) Replace(path string, val sql.JSONWrapper) (types.MutableJSON, bool, error) {
func (i IndexedJsonDocument) Replace(ctx context.Context, path string, val sql.JSONWrapper) (types.MutableJSON, bool, error) {
v, err := i.ToInterface()
if err != nil {
return nil, false, err
}
return types.JSONDocument{Val: v}.Replace(path, val)
return types.JSONDocument{Val: v}.Replace(ctx, path, val)
}

// ArrayInsert is not yet implemented, so we call it on a types.JSONDocument instead.
Expand Down

0 comments on commit 237bc14

Please sign in to comment.