Skip to content

Commit

Permalink
Merge pull request #8299 from dolthub/taylor/procedure-return
Browse files Browse the repository at this point in the history
More consistent return types for dolt procedures
  • Loading branch information
tbantle22 authored Aug 26, 2024
2 parents 1e96895 + 3c6dbb3 commit 3259561
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion go/libraries/doltcore/sqle/dprocedures/dolt_cherry_pick.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func doltCherryPick(ctx *sql.Context, args ...string) (sql.RowIter, error) {
if err != nil {
return nil, err
}
return rowToIter(newCommitHash, dataConflicts, schemaConflicts, constraintViolations), nil
return rowToIter(newCommitHash, int64(dataConflicts), int64(schemaConflicts), int64(constraintViolations)), nil
}

// doDoltCherryPick attempts to perform a cherry-pick merge based on the arguments specified in |args| and returns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func doltConflictsResolve(ctx *sql.Context, args ...string) (sql.RowIter, error)
if err != nil {
return nil, err
}
return rowToIter(res), nil
return rowToIter(int64(res)), nil
}

// DoltConflictsCatFunc runs a `dolt commit` in the SQL context, committing staged changes to head.
Expand Down
2 changes: 1 addition & 1 deletion go/libraries/doltcore/sqle/dprocedures/dolt_remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func doltRemote(ctx *sql.Context, args ...string) (sql.RowIter, error) {
if err != nil {
return nil, err
}
return rowToIter(res), nil
return rowToIter(int64(res)), nil
}

// doDoltRemote is used as sql dolt_remote command for only creating or deleting remotes, not listing.
Expand Down
2 changes: 1 addition & 1 deletion go/libraries/doltcore/sqle/dprocedures/dolt_tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func doltTag(ctx *sql.Context, args ...string) (sql.RowIter, error) {
if err != nil {
return nil, err
}
return rowToIter(res), nil
return rowToIter(int64(res)), nil
}

// doDoltTag is used as sql dolt_tag command for only creating or deleting tags, not listing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ export const databaseTests = [
{
q: `SELECT dolt_version()`,
res: [{ "dolt_version()": "0.0.0" }],
matcher: (_, exp) => {
return exp[0]["dolt_version()"].length > 0;
matcher: (res) => {
return res[0]["dolt_version()"].length > 0;
},
},
];

0 comments on commit 3259561

Please sign in to comment.