Add transaction (a list of deltas) as a primitive for applying sets of changes
... and Fix idomaticness
This commit is contained in:
parent
41f1a2b9a9
commit
7934252fb5
4 changed files with 62 additions and 3 deletions
|
|
@ -106,3 +106,12 @@ func (s *Single) Close() error {
|
|||
// Nothing to clean up locally.
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *Single) ApplyTransaction(t *graph.Transaction) error {
|
||||
ts := time.Now()
|
||||
for i := 0; i < len(t.Deltas); i++ {
|
||||
t.Deltas[i].ID = s.currentID.Next()
|
||||
t.Deltas[i].Timestamp = ts
|
||||
}
|
||||
return s.qs.ApplyDeltas(t.Deltas, s.ignoreOpts)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue