skeg_client/kv

Key-value commands. Keys and values are bytes, sent and returned as is.

Values

pub fn delete(
  connection: connection.Connection,
  keys: List(BitArray),
) -> Result(Int, error.Error)

Deletes keys and returns how many existed.

pub fn get(
  connection: connection.Connection,
  key: BitArray,
) -> Result(option.Option(BitArray), error.Error)

The value stored under key, or None when there is none. An empty value is Some(<<>>).

pub fn incr(
  connection: connection.Connection,
  key: BitArray,
) -> Result(Int, error.Error)

Adds one to the integer stored under key and returns the new value.

pub fn incr_by(
  connection: connection.Connection,
  key: BitArray,
  delta: Int,
) -> Result(Int, error.Error)

Adds delta to the integer stored under key and returns the new value.

pub fn mget(
  connection: connection.Connection,
  keys: List(BitArray),
) -> Result(List(option.Option(BitArray)), error.Error)

The values of keys, in the same order, None where a key is missing.

pub fn set(
  connection: connection.Connection,
  key: BitArray,
  value: BitArray,
) -> Result(Nil, error.Error)

Stores value under key, replacing any previous value.

✨ Search Document