Commit graph

19 commits

Author SHA1 Message Date
Orion Henry
b5742315ef move op observer into transaction 2022-09-29 15:59:08 -05:00
Alex Good
3a3df45b85
Access change fields through field accessors
The representation of changes in storage-v2 is different to the existing
representation so add accessor methods to the fields of `Change` and
make all accesses go through them. This allows the change representation
in storage-v2 to be a drop-in.

Signed-off-by: Alex Good <alex@memoryandthought.me>
2022-08-22 21:16:42 +01:00
Andrew Jeffery
933bf5ee07 Return an error when getting clock for missing hash 2022-05-20 10:05:08 +01:00
Andrew Jeffery
d667552a98 Add increment observation for observer 2022-04-20 14:44:04 +01:00
Andrew Jeffery
76a19185b7 Add separate functions for with op_observer 2022-04-19 17:48:11 +01:00
Andrew Jeffery
702a0ec172 Add lifetimes to transact_with and fixup watch example 2022-04-19 17:30:06 +01:00
Andrew Jeffery
b6fd7ac26e Add op_observer to documents and transactions
This replaces the built-in patches with a more generic mechanism, and
includes a convenience observer which uses the old patches.
2022-04-19 17:30:05 +01:00
Andrew Jeffery
a88d49cf45 Fixup builds 2022-04-07 14:32:17 +01:00
Andrew Jeffery
bd2f252e0b Try and fix parent object query 2022-04-07 14:21:17 +01:00
Andrew Jeffery
aeadedd584 Add watch example 2022-04-07 14:20:57 +01:00
Andrew Jeffery
d331ceb6d4 Rename set to put and set_object to put_object 2022-04-01 13:40:58 +01:00
Andrew Jeffery
1a66dc7ab1 Use full names for delete and increment 2022-04-01 13:36:00 +01:00
Andrew Jeffery
d00cee1637 Misc API updates
- Commit now returns just a single hash rather than a vec. Since the
  change we create from committing has all of the heads as deps there
  can only be one hash/head after committing.
- Apply changes now takes a Vec rather than a slice. This avoids having
  to clone them inside.
- transact_with now passes the result of the closure to the commit
  options function
- Remove patch struct
- Change receive_sync_message to return a () instead of the
  `Option<Patch>`
- Change `Transaction*` structs to just `*` and use the transaction
  module
- Make CommitOptions fields public
2022-03-09 12:33:20 +00:00
Orion Henry
95f27f362c
Merge pull request #283 from jeffa5/experiment-make
Separate scalars and objects in transaction API
2022-03-04 16:53:17 -05:00
Andrew Jeffery
d71e87882e Make save infallible 2022-03-04 12:28:05 +00:00
Andrew Jeffery
79d493ddd2 Rename make to set_object 2022-03-04 09:50:48 +00:00
Andrew Jeffery
e42adaf84b Fixup automerge tests 2022-03-04 09:47:37 +00:00
Andrew Jeffery
682b8007b9 Borrow exid to avoid &ROOT everywhere 2022-03-03 09:05:08 +00:00
Andrew Jeffery
dfb21ea8d6
Add quickstart example using new transaction (#273)
* Add quickstart example

Also change ordering of transact_with arguments.
This makes it more natural read: transact_with these commit options,
doing this.
2022-02-28 11:49:36 +00:00