An embedded, single-file key-value store for OCaml, inspired by BoltDB and LMDB.
1(** Transaction operations with phantom types for mode safety *)
2
3type 'mode t = { mutable state : Types.txn_state }
4
5let root (_ : 'mode t) : ('mode Bucket.t, Error.t) result = Ok (Obj.magic ())
6
7let state txn = txn.state
8
9let commit txn =
10 txn.state <- Types.Committed;
11 Ok ()
12;;
13
14let rollback txn = txn.state <- Types.Rolled_back