rox v1.3.0 Rox.Batch

Module for performing atomic write operations on a database.

Link to this section Summary

Types

t()

A reference to a batch operation

Functions

Schedules a delete operation in the batch

Schedules a delete operation in the batch for key in column_family

Merges a list of Batch.t into a single Batch.t

Creates a new Batch operation

Returns a new Batch with a put operation scheduled

Returns a new Batch with a put operation scheduled for the column_family

Atomically commits the operations in the batch to the db

Link to this section Types

Link to this type t()
t() :: %Rox.Batch{operations: [op]}

A reference to a batch operation

Link to this section Functions

Link to this function delete(batch, key)
delete(t, Rox.key) :: t

Schedules a delete operation in the batch.

Link to this function delete(batch, column_family, key)
delete(t, Rox.ColumnFamily.t, Rox.key) :: t

Schedules a delete operation in the batch for key in column_family.

Link to this function merge(batches)
merge([t]) :: t

Merges a list of Batch.t into a single Batch.t.

Link to this function new()
new() :: t

Creates a new Batch operation

Link to this function put(batch, key, value)
put(t, Rox.key, Rox.value) :: t

Returns a new Batch with a put operation scheduled.

Link to this function put(batch, column_family, key, value)

Returns a new Batch with a put operation scheduled for the column_family.

Link to this function write(batch, db)
write(t, Rox.DB.t) :: :ok | {:error, reason :: any}

Atomically commits the operations in the batch to the db.