sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
A series of operation performed atomically.
A transaction handle. A transaction may be read-only or read-write.
go ~rw db f
makes a transaction in db
with the permission rw
and using the function f
.
The function f
will receive the transaction handle. All the operations called using the Txn
module will be executed when f
returns. The transaction handle should not be leaked outside of f
.
Return None
if the transaction was aborted with abort
, and Some v
otherwise.
Here is an example incrementing a value atomically:
go ~rw:`Write db begin fun txn ->
let v = get k in
put k (v+1) ;
v
end
val abort : 'a txn -> 'b
abort txn
will abort the transaction.
val put : ?flags:PutFlags.t -> [> `Write ] txn -> key -> elt -> unit
put txn k v
associates the key k
to the value v
.
append txn k v
append k, v
at the end of the database without performing comparisons.
Should only be used to quickly add already-sorted data to the database.
remove txn k
removes k
from the database.
If the database accepts duplicates:
elt
is provided, only the specified binding is removed.elt
is not provided, all the bindings with k
are removed.val drop : ?delete:bool -> [< `Write ] txn -> unit