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).

type batch

An opaque batch request must be created through create and executed through write

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 a batch job and stage the writing of the key key and value value in the batch job.

val write : t -> Options.Write_options.t -> batch -> (unit, error) Stdlib.result

write db write_options batch takes a db handle, some write_options and a batch 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