rox v1.2.0 Rox.Batch

Module for performing atomic write operations on a database.

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

Types

t()
t() :: %Rox.Batch{operations: [op]}

A reference to a batch operation

Functions

delete(batch, key)
delete(t, Rox.key) :: t

Schedules a delete operation in the batch.

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.

merge(batches)
merge([t]) :: t

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

new()
new() :: t

Creates a new Batch operation

put(batch, key, value)
put(t, Rox.key, Rox.value) :: t

Returns a new Batch with a put operation scheduled.

put(batch, column_family, key, value)

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

write(batch, d_b)
write(t, Rox.DB.t) :: :ok | {:error, reason :: any}

Atomically commits the operations in the batch to the db.