-
Notifications
You must be signed in to change notification settings - Fork 34
Merging branches
Use the stored SQL commands from the source branch and run them in the destination branch.
Problem: if a previous merge was already done (from previous or the same commit)
Solution 1: use the SQL commands starting at the last merge
This implies storing merge info/history.
- Easy to implement
- No conflict detection
- Merging can take a long time to be processed if the SQL commands are complex (because they are re-executed)
Compare all the rows from source and destination branches.
Detect duplicated and modified rows as conflicts that must be resolved in some way.
Rows that exist on source but not on the destination should be copied to the destination without question (not a conflict).
- Conflict detection
- Maybe faster at the merge stage
- Maybe slower at the scan stage
Use the Session / Changeset feature
- Conflict detection
- Does not deal with schema differences
- SQL based, so merging can be slow on complex SQL commands
Use a modified Session / Changeset feature with these changes:
-
Detect schema differences
-
Copy rows directly instead of generating SQL commands
- Conflict detection
- Deals with schema differences
- Maybe hard to implement
Just like option 4 but automatically choosing the best / faster merge approach (run SQL or copy rows directly)
- Conflict detection
- Deals with schema differences
- Maybe hard to implement
Either by:
-
Using our code in C
-
Using the SQLite VDBE
Notice that the SQL commands from option 1 come from the log / history and the others are generated by code. So the complexity and speed of execution may vary a lot.
(you can add your notes here bellow or participate in the discussion here)