ExRocket (ex_rocket v0.5.0)

View Source

ExRocket — an Elixir NIF wrapper around RocksDB, powered by the maintained rust-rocksdb crate.

Summary

Functions

Types

batch_operation()

@type batch_operation() ::
  {:put, binary(), binary()}
  | {:delete, binary()}
  | {:merge, binary(), binary()}
  | {:put_cf, String.t(), binary(), binary()}
  | {:delete_cf, String.t(), binary()}
  | {:merge_cf, String.t(), binary(), binary()}

consistency_error()

@type consistency_error() ::
  :closed
  | :resource_busy
  | :invalid_write_options
  | :invalid_iterator_options
  | {:invalid_option, atom()}
  | {:unknown_option, atom()}

db()

@opaque db()

iterator()

@opaque iterator()

iterator_status()

@type iterator_status() :: :more | :end_of_iterator

iterator_take_options()

@type iterator_take_options() :: %{
  :max_entries => pos_integer(),
  optional(:max_bytes) => pos_integer()
}

snapshot()

@opaque snapshot()

write_options()

@type write_options() :: %{
  optional(:sync) => boolean(),
  optional(:disable_wal) => boolean()
}

Functions

close(db_ref)

@spec close(db()) :: :ok | {:error, :resource_busy | term()}

create_backup(db_ref, path)

create_cf(db_ref, cf_name, options \\ %{})

create_checkpoint(db_ref, path)

delete(db_ref, key)

delete_cf(db_ref, cf_name, key)

delete_range(db_ref, from, to)

delete_range_cf(db_ref, cf_name, from, to)

destroy(path, options \\ %{})

drop_cf(db_ref, cf_name)

flush_wal(db_ref, sync)

@spec flush_wal(db(), boolean()) :: :ok | {:error, term()}

get(db_ref, key)

get(db_ref, key, default)

get_backup_info(backup_path)

get_cf(db_ref, cf_name, key)

get_cf(db_ref, cf_name, key, default)

get_cfb(db_ref, cf_name, key)

get_db_path(db_ref)

getb(db_ref, key)

iterator(db_ref, mode)

iterator_cf(db_ref, cf_name, mode)

iterator_range(db_ref, mode, from, to, read_options \\ %{})

iterator_take(iterator_ref, options)

@spec iterator_take(iterator(), iterator_take_options()) ::
  {:ok, [{binary(), binary()}], iterator_status()} | {:error, term()}

key_may_exist(db_ref, key)

key_may_exist_cf(db_ref, cf_name, key)

latest_sequence_number(db_ref)

list_cf(path, options \\ %{})

lxcode()

merge(db_ref, key, operand)

merge_cf(db_ref, cf_name, key, operand)

merge_cfb(db_ref, cf_name, key, operand)

mergeb(db_ref, key, operand)

multi_get(db_ref, keys)

multi_get_cf(db_ref, keys)

next(iterator_ref)

open(path, options \\ %{})

open_cf(path, cf_names, options \\ %{})

open_cf_for_read_only(path, cf_names, options \\ %{})

open_for_read_only(path, options \\ %{})

prefix_iterator(db_ref, prefix)

prefix_iterator_cf(db_ref, cf_name, prefix)

purge_old_backups(backup_path, keep)

put(db_ref, key, value)

put_cf(db_ref, cf_name, key, value)

repair(path, options \\ %{})

restore_from_backup(backup_path, restore_path)

restore_from_backup(backup_path, restore_path, backup_id)

snapshot(db_ref)

snapshot_get(snapshot_ref, key)

snapshot_get(snapshot_ref, key, default)

snapshot_get_cf(snapshot_ref, cf_name, key)

snapshot_get_cf(snapshot_ref, cf_name, key, default)

snapshot_iterator(snapshot_ref, mode)

snapshot_iterator_cf(snapshot_ref, cf_name, mode)

snapshot_multi_get(snapshot_ref, keys)

snapshot_multi_get_cf(snapshot_ref, keys)

write_batch(db_ref, operations)

@spec write_batch(db(), [batch_operation()]) ::
  {:ok, non_neg_integer()} | {:error, term()}

write_batch(db_ref, operations, write_options)

@spec write_batch(db(), [batch_operation()], write_options()) ::
  {:ok, non_neg_integer()} | {:error, term()}