feat: Implement merge changes method (#38)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Marcelo Soares <marcelo.me.soares@gmail.com>
This commit is contained in:
Copilot 2026-05-07 00:42:23 -03:00 • committed by GitHub
commit d04a56520c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 1752 additions and 105 deletions

View file

@ -0,0 +1,13 @@
### A remote CRDT change to merge.
class: CrdtMergeChange
sealed: true
extends: BaseHlc
fields:
### The table receiving the change.
tableName: String
### The domain row identifier receiving the change.
uuidRowId: UuidValue
### The remote node that produced the change.
uuidNodeId: UuidValue

View file

@ -0,0 +1,6 @@
### A remote tombstone update to merge.
class: CrdtMergeDelete
extends: CrdtMergeChange
fields:
### Whether the row is deleted or restored.
isDeleted: bool

View file

@ -0,0 +1,6 @@
### A remote row insertion to merge.
class: CrdtMergeInsert
extends: CrdtMergeChange
fields:
### The serialized domain row payload for the insert.
data: dynamic

View file

@ -0,0 +1,11 @@
### A set of remote CRDT changes to merge into the local database.
class: CrdtMergeSet
fields:
### Remote row insertions.
inserts: List<CrdtMergeInsert>
### Remote field updates.
updates: List<CrdtMergeUpdate>
### Remote tombstone updates.
deletes: List<CrdtMergeDelete>

View file

@ -0,0 +1,9 @@
### A remote field update to merge.
class: CrdtMergeUpdate
extends: CrdtMergeChange
fields:
### The updated database column name.
columnName: String
### The serialized new value for the column.
value: dynamic