sled v0.1.0-alpha.1 Sled View Source

An Elixir binding for sled, the champagne of beta embedded databases.

A basic example:

iex> db = Sled.open("my_db")
iex> Sled.insert(db, "hello", "world")
iex> Sled.get(db, "hello")
"world"

Link to this section Summary

Types

t()

A handle to a sled db.

Functions

Retrieve the value for key from db.

Insert value into db for key.

Open the db with options, by default creating it if it doesn't exist.

Link to this section Types

Specs

t()

A handle to a sled db.

Link to this section Functions

Specs

get(t(), binary()) :: binary() | nil | no_return()

Retrieve the value for key from db.

Returns nil if there is no value associated with the key.

Specs

insert(t(), binary(), binary()) :: binary() | nil | no_return()

Insert value into db for key.

Returns nil if there was no previous value associated with the key.

Specs

open(Path.t() | keyword() | Sled.Config.Options.t()) :: t() | no_return()

Open the db with options, by default creating it if it doesn't exist.

If options is a path, opens the db at the path with default options, creating it if it doesn't exist:

iex> Sled.open("my_db")

If options is a keyword or Sled.Config.Options struct, then this function is the same as calling Sled.Config.new/1 and passing the result to Sled.Config.open/1.