Module Rocksdb.Batch
Batch processing RocksDB allows to batch operations through a dedicated batch object that must be fed to write
. A batch object Batch.batch
is a collection of operation to run on a database. (like Batch.put
or delete).
val create : unit -> batch
create
will create a batch job to be used to batch operation on the database.
val count : batch -> int
count
number of operations in the batch object
val clear : batch -> unit
clear operations from the batch object
val put : batch -> key:string -> value:string -> unit
put batch key value
will take abatch
job and stage the writing of thekey
key andvalue
value in the batch job.
val write : t -> Options.Write_options.t -> batch -> (unit, error) Stdlib.result
write db write_options batch
takes adb
handle, somewrite_options
and abatch
job and execute it on the database.
val simple_write_batch : t -> Options.Write_options.t -> (string * string) list -> (unit, error) Stdlib.result
A simple helper, will take a list of key_value and do a unique batch and write it to the database