More consistent return types for dolt procedures

This commit is contained in:
Taylor Bantle
2024-08-26 16:22:32 -07:00
parent 1e96895aee
commit 3c6dbb38ce
5 changed files with 6 additions and 6 deletions
@@ -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
@@ -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.
@@ -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.
@@ -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.
@@ -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;
},
},
];