-
-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds dolt_merge_status
system table
#4277
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some questions about this specific design. Seems like a row per unmerged table might be a bit more ergonomic?
} | ||
|
||
func (s MergeStatusTable) Schema() sql.Schema { | ||
return []*sql.Column{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this actually dolt_unmerged_tables, with one row per unmerged table?
No rows if no unmerged tables?
Get rid of is_merging
and replace with a merge_active()
function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A flat design could work here as well, but determining which tables are unmerged isn't the primary use case. The main reason we want a merge status function is to know if we need to commit a merge or if we need to abort the active one.
The unmerged tables column was added for more similarity between dolt status
and this new procedure.
{Name: "is_merging", Type: sql.Boolean, Source: doltdb.MergeStatusTableName, PrimaryKey: false, Nullable: false}, | ||
{Name: "source", Type: sql.Text, Source: doltdb.MergeStatusTableName, PrimaryKey: false, Nullable: true}, | ||
{Name: "source_commit", Type: sql.Text, Source: doltdb.MergeStatusTableName, PrimaryKey: false, Nullable: true}, | ||
{Name: "target", Type: sql.Text, Source: doltdb.MergeStatusTableName, PrimaryKey: false, Nullable: true}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this just active_branch()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, target is just the active branch. Do you think we should name it differently than target
?
@@ -1328,6 +1328,10 @@ var MergeScripts = []queries.ScriptTest{ | |||
Query: "CALL DOLT_MERGE('feature-branch')", | |||
Expected: []sql.Row{{1, 0}}, | |||
}, | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need some tests with more than one table unmerged
Closes #3504
The
dolt_merge_status
system table tells a user if a merge is active. It has the following schema:For example, lets create a simple conflict:
Output of
SELECT * from dolt_merge_status;
: