amnesia v0.2.2 Amnesia.Metadata

Summary

Functions

Get the counter value for the given table and field

See Amnesia.Metadata.counter!/4

Get the counter value for the given table and field, with a dirty read

Create the metadata table

Create the metadata table, raising in case of error

Destroy the metadata table

Destroy the metadata table, raising in case of error

Get the metadata for the given database

Get a value from the metadata table

Get a value from the metadata table using a dirty read

Set a value in the metadata table

Set a value in the metadata table using a dirty write

Types

t

Functions

counter(self, table, field)

Specs

counter(t, module, atom) :: non_neg_integer

Get the counter value for the given table and field.

counter(self, table, field, value)

Specs

counter(t, module, atom, integer) :: non_neg_integer

See Amnesia.Metadata.counter!/4.

counter!(self, table, field)

Specs

counter!(t, module, atom) :: non_neg_integer

Get the counter value for the given table and field, with a dirty read.

create(metadata, options)

Specs

create(t, Keyword.t) :: :ok | {:error, term}

Create the metadata table.

create!(metadata, options)

Specs

create!(t, Keyword.t) :: :ok | no_return

Create the metadata table, raising in case of error.

destroy(metadata)

Specs

destroy(t) :: :ok | {:error, term}

Destroy the metadata table.

destroy!(metadata)

Specs

destroy!(t) :: :ok | no_return

Destroy the metadata table, raising in case of error.

for(database)

Specs

for(atom) :: t

Get the metadata for the given database.

get(metadata, key)

Specs

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

Get a value from the metadata table.

get!(metadata, key)

Specs

get!(t, term) :: term | nil | no_return

Get a value from the metadata table using a dirty read.

set(metadata, key, value)

Specs

set(t, term, term) :: :ok | no_return

Set a value in the metadata table.

set!(metadata, key, value)

Specs

set!(t, term, term) :: :ok | no_return

Set a value in the metadata table using a dirty write.