Markov.Database.Operation (markov v3.0.5)
Link to this section Summary
Functions
Require the needed modules to use the table effectively.
Add a copy of the table on the given node with the given mode.
Add the index in the table for the given attribute.
Read a record based on a slot, see mnesia:dirty_slot
.
The in order keyword list of attributes passed when the table was defined.
Check if the table is a bag.
Clear the content of the table.
Change the copying mode of the table on the given node, see
mnesia:change_table_copy_type
.
Get the number of records in the table.
Create the table with the given copying mode and inherent definition.
Return the database the table belongs to.
Delete the record or the given key from the table, see
mnesia:dirty_delete
and mnesia:dirty_delete_object
.
Delete the record or the given key from the table, see mnesia:delete
and mnesia:delete_object
.
Delete the record or the given key from the table with the given lock,
see mnesia:delete
and mnesia:delete_object
.
Delete a copy of the table from the given node.
Delete the index in the table for the given attribute.
Destroy the table, raising if an error occurs.
Destroy the table.
Return the first key or record in the table, see mnesia:dirty_first
.
Return the first key or record in the table, see mnesia:first
.
Fold the whole table from the left, see mnesia:foldl
.
Fold the whole table from the right, see mnesia:foldr
.
Force load the table.
Get the name of the id key.
Get information about the table, see mnesia:table_info
.
Return the key of the record.
Return all keys in the table, see mnesia:dirty_all_keys
.
Return all the keys in the table, see mnesia:all_keys
.
Return the last key or record in the table, see mnesia:dirty_last
.
Return the last key or record in the table, see mnesia:last
.
Lock the table with the given lock.
Change the table majority.
Set master nodes for the table, see mnesia:set_master_nodes
.
Select records in the table using simple don't care values, see
mnesia:dirty_match_object
.
Select records in the table using simple don't care values, see
mnesia:match_object
.
Check if the key is present in the table.
Change the access of the table, see mnesia:change_table_access_mode
.
Move a copy of the table from the given node to another given node.
Return the next key or record in the table, see mnesia:dirty_next
.
Return the next key or record in the table, see mnesia:next
.
The options passed when the table was defined.
Check if the table is an ordered set.
Return the previous key or record in the table, see mnesia:dirty_prev
.
Return the previous key or record in the table, see mnesia:prev
.
Change the table loading priority.
Return properties of the table.
Read records from the table, see mnesia:dirty_read
.
Read records from the table with the given key and given lock, see
mnesia:read
.
Read records from the table based on a secondary index given as position,
see mnesia:dirty_index_read
.
Read records from the table based on a secondary index given as position,
see mnesia:index_read
.
Select records in the table using a match_spec, see
mnesia:dirty_select
.
Select records in the table using a match_spec, see mnesia:select
.
Select records in the given table using a match_spec passing a limit or a
lock kind, see mnesia:select
.
Select records in the given table using a match_spec passing a limit and a
lock kind, see mnesia:select
.
Check if the table is a set.
Return an iterator to use with the Enum functions using dirty operations to retrieve information.
Return an iterator to use with Enum functions.
Return the type of the table.
Wait for the table optionally with a timeout.
Select records in the table using an Exquisite query, see
Exquisite.match/2
and mnesia:dirty_select
.
Select records in the table using an Exquisite query, see
Exquisite.match/2
and mnesia:select
.
Write the record to the table, see mnesia:dirty_write
.
Write the record to the table, see mnesia:write
.
Link to this section Types
autoincrement()
@type autoincrement() :: non_neg_integer()
@type t() :: %Markov.Database.Operation{ argument: term(), model: term(), ts: non_neg_integer(), type: Markov.log_entry_type() }
Link to this section Functions
Require the needed modules to use the table effectively.
add_copy(node, type \\ :disk)
@spec add_copy(node(), Amnesia.Table.cv()) :: Amnesia.Table.o()
Add a copy of the table on the given node with the given mode.
add_index(attribute)
@spec add_index(atom()) :: Amnesia.Table.o()
Add the index in the table for the given attribute.
at!(position)
Read a record based on a slot, see mnesia:dirty_slot
.
attributes()
@spec attributes() :: Keyword.t()
The in order keyword list of attributes passed when the table was defined.
bag?()
@spec bag?() :: boolean()
Check if the table is a bag.
clear()
@spec clear() :: Amnesia.Table.o()
Clear the content of the table.
copying(node, to)
@spec copying(node(), Amnesia.Table.cv()) :: Amnesia.Table.o()
Change the copying mode of the table on the given node, see
mnesia:change_table_copy_type
.
modes
Modes
:disk
sets:disc_copies
mode:disk!
sets:disc_only_copies
mode:memory
sets:ram_copies
mode
count()
@spec count() :: non_neg_integer()
Get the number of records in the table.
create!(copying \\ [])
@spec create!(Amnesia.Table.c()) :: :ok | no_return()
create(copying \\ [])
@spec create(Amnesia.Table.c()) :: Amnesia.o()
Create the table with the given copying mode and inherent definition.
database()
@spec database() :: module()
Return the database the table belongs to.
delete!(self)
Delete the record or the given key from the table, see
mnesia:dirty_delete
and mnesia:dirty_delete_object
.
delete(self)
Delete the record or the given key from the table, see mnesia:delete
and mnesia:delete_object
.
delete(self, lock)
Delete the record or the given key from the table with the given lock,
see mnesia:delete
and mnesia:delete_object
.
locks
Locks
:write
sets a:write
lock:write!
sets a:sticky_write
lock
delete_copy(node)
@spec delete_copy(node()) :: Amnesia.Table.o()
Delete a copy of the table from the given node.
delete_index(attribute)
@spec delete_index(atom()) :: Amnesia.Table.o()
Delete the index in the table for the given attribute.
destroy!()
@spec destroy!() :: :ok | no_return()
Destroy the table, raising if an error occurs.
destroy()
@spec destroy() :: Amnesia.Table.o()
Destroy the table.
first!(key \\ false)
Return the first key or record in the table, see mnesia:dirty_first
.
By default it returns the record, if you want only the key pass true as first parameter.
If the table is a bag, it will return a list of records.
first(key \\ false, lock \\ :read)
Return the first key or record in the table, see mnesia:first
.
By default it returns the record, if you want only the key pass true as first parameter.
If the table is a bag, it will return a list of records.
foldl(acc, fun)
Fold the whole table from the left, see mnesia:foldl
.
foldr(acc, fun)
Fold the whole table from the right, see mnesia:foldr
.
force()
@spec force() :: :yes | {:error, any()}
Force load the table.
hook_read!(_, _)
hook_read(_, _)
hook_write!(_)
hook_write(_)
@spec id() :: atom()
Get the name of the id key.
info(key)
Get information about the table, see mnesia:table_info
.
key(operation)
Return the key of the record.
keys!()
Return all keys in the table, see mnesia:dirty_all_keys
.
keys()
Return all the keys in the table, see mnesia:all_keys
.
last!(key \\ false)
Return the last key or record in the table, see mnesia:dirty_last
.
By default it returns the record, if you want only the key pass true as first parameter.
If the table is a bag, it will return a list of records.
last(key \\ false, lock \\ :read)
Return the last key or record in the table, see mnesia:last
.
By default it returns the record, if you want only the key pass true as first parameter.
If the table is a bag, it will return a list of records.
lock(mode)
Lock the table with the given lock.
locks
Locks
:write
sets a:write
lock:write!
sets a:sticky_write
lock:read
sets a:read
lock
majority(value)
@spec majority(boolean()) :: Amnesia.Table.o()
Change the table majority.
master_nodes(nodes)
Set master nodes for the table, see mnesia:set_master_nodes
.
match!(pattern)
Select records in the table using simple don't care values, see
mnesia:dirty_match_object
.
match(lock \\ :read, pattern)
Select records in the table using simple don't care values, see
mnesia:match_object
.
member?(key)
Check if the key is present in the table.
mode(value)
@spec mode(:both | :read!) :: Amnesia.Table.o()
Change the access of the table, see mnesia:change_table_access_mode
.
modes
Modes
:both
sets read and write mode, it's the default.:read!
sets read-only mode.
move_copy(from, to)
@spec move_copy(node(), node()) :: Amnesia.Table.o()
Move a copy of the table from the given node to another given node.
next!(self)
Return the next key or record in the table, see mnesia:dirty_next
.
If you're calling this function from an instance of the table (a record in it), it will get you the next record, if you're calling it directly on the module it will treat the argument as key to start from and return you the next key.
next(self)
Return the next key or record in the table, see mnesia:next
.
If you're calling this function from an instance of the table (a record in it), it will get you the next record, if you're calling it directly on the module it will treat the argument as key to start from and return you the next key.
options()
@spec options() :: Keyword.t()
The options passed when the table was defined.
ordered_set?()
@spec ordered_set?() :: boolean()
Check if the table is an ordered set.
prev!(self)
Return the previous key or record in the table, see mnesia:dirty_prev
.
If you're calling this function from an instance of the table (a record in it), it will get you the previous record, if you're calling it directly on the module it will treat the argument as key to start from and return you the previous key.
prev(self)
Return the previous key or record in the table, see mnesia:prev
.
If you're calling this function from an instance of the table (a record in it), it will get you the previous record, if you're calling it directly on the module it will treat the argument as key to start from and return you the previous key.
priority(value)
@spec priority(integer()) :: Amnesia.Table.o()
Change the table loading priority.
properties()
@spec properties() :: Keyword.t()
Return properties of the table.
read!(key)
Read records from the table, see mnesia:dirty_read
.
read(key, lock \\ :read)
Read records from the table with the given key and given lock, see
mnesia:read
.
locks
Locks
:write
sets a:write
lock:write!
sets a:sticky_write
lock:read
sets a:read
lock
read_at!(key, position)
Read records from the table based on a secondary index given as position,
see mnesia:dirty_index_read
.
read_at(key, position)
Read records from the table based on a secondary index given as position,
see mnesia:index_read
.
select!(spec)
Select records in the table using a match_spec, see
mnesia:dirty_select
.
select(spec)
Select records in the table using a match_spec, see mnesia:select
.
select(lock_or_limit, spec)
Select records in the given table using a match_spec passing a limit or a
lock kind, see mnesia:select
.
select(lock_or_limit, limit_or_lock, spec)
@spec select(integer() | :read | :write, integer() | :read | :write, integer()) :: Amnesia.Table.Selection.t() | nil | no_return()
Select records in the given table using a match_spec passing a limit and a
lock kind, see mnesia:select
.
set?()
@spec set?() :: boolean()
Check if the table is a set.
stream!()
@spec stream!() :: Amnesia.Table.Stream.t()
Return an iterator to use with the Enum functions using dirty operations to retrieve information.
stream(lock \\ :read)
@spec stream(:read | :write | :write!) :: Amnesia.Table.Stream.t()
Return an iterator to use with Enum functions.
type(self)
@spec type(t()) :: :set | :ordered_set | :bag
Return the type of the table.
wait(timeout \\ :infinity)
Wait for the table optionally with a timeout.
Select records in the table using an Exquisite query, see
Exquisite.match/2
and mnesia:dirty_select
.
options
Options
select
- Exquisite selector specqualified
- whether to set a name for the record or not
Select records in the table using an Exquisite query, see
Exquisite.match/2
and mnesia:select
.
options
Options
limit
- sets the count of elements to select in every continuationlock
- sets the kind of lock to useselect
- Exquisite selector specqualified
- whether to set a name for the record or not
write!(self)
Write the record to the table, see mnesia:dirty_write
.
Missing fields tagged as autoincrement will be incremented with the
counter if nil
.
write(self, lock \\ :write)
Write the record to the table, see mnesia:write
.
Missing fields tagged as autoincrement will be incremented with the
counter if nil
.