amnesia v0.2.8 Amnesia.Metadata

Link to this section Summary

Functions

Get the counter value for the given table and field.

Update the counter for the given table and field by the given value.

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.

Link to this section Types

Link to this opaque

t()

(opaque)
t()

Link to this section Functions

Link to this function

counter(self, table, field)

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

Get the counter value for the given table and field.

Link to this function

counter(metadata, table, field, value)

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

Update the counter for the given table and field by the given value.

Link to this function

counter!(self, table, field)

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

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

Link to this function

counter!(self, table, field, value)

See Amnesia.Metadata.counter/4.

Link to this function

create(metadata, options)

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

Create the metadata table.

Link to this function

create!(metadata, options)

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

Create the metadata table, raising in case of error.

Link to this function

destroy(metadata)

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

Destroy the metadata table.

Link to this function

destroy!(metadata)

destroy!(t()) :: :ok | no_return()

Destroy the metadata table, raising in case of error.

Link to this function

for(database)

for(atom()) :: t()

Get the metadata for the given database.

Link to this function

get(metadata, key)

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

Get a value from the metadata table.

Link to this function

get!(metadata, key)

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

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

Link to this function

set(metadata, key, value)

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

Set a value in the metadata table.

Link to this function

set!(metadata, key, value)

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

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