Anoma.Tables (Anoma v0.34.0)
Summary
Types
A table is typed by a tuple where the first element is the table name, and the second one is a list of keys (i.e., columns).
a list of table specs
Functions
I clear out the given table.
I duplicate a given table's content to a new table. If the new table does not exist, it is created.
I initialize the mnesia storage for this entire vm.
I initialize the tables for the client. There is only one client in the virtual machine. I do this by creating all tables in the mnesia storage.
I initialize the tables for a given node id. I do this by creating all tables in the mnesia storage.
Given an atom as table name, I create a node-specific name based on that.
I reset the tables for the client. Resetting means creating them if they dont exist, and clearing them if they do.
I return the table name for the given node its blocks.
I return the name of the client's id table.
I return the name of the client's update table.
I return the name of the client's values table.
I return the table name for the given node its event table.
Check if the given table name exists.
I return the table name for the intents table.
I return the table name for the given node its updates.
I return the table name for the given node its values.
Check if a given list of tables exists.
Types
A table is typed by a tuple where the first element is the table name, and the second one is a list of keys (i.e., columns).
@type table_specs() :: [table_spec()]
a list of table specs
Functions
@spec clear_table(atom()) :: :ok | {:error, :failed_to_clear_table}
I clear out the given table.
@spec create_local_schema() :: :ok | {:error, :failed_to_create_schema, any()}
I duplicate a given table's content to a new table. If the new table does not exist, it is created.
@spec has_data?(String.t()) :: {:ok, :exists} | {:error, :partial_exist | :none_exist | :failed_to_check_tables}
@spec initialize_storage() ::
:ok
| {:error, :failed_to_initialize_storage}
| {:error, :failed_to_create_tables}
I initialize the mnesia storage for this entire vm.
@spec initialize_tables_for_client() ::
{:ok, :existing | :created} | {:error, :failed_to_initialize_tables}
I initialize the tables for the client. There is only one client in the virtual machine. I do this by creating all tables in the mnesia storage.
I return information whether these tables did not exist, were created, or when I failed to create them.
@spec initialize_tables_for_node(String.t()) :: {:ok, :existing | :created} | {:error, :failed_to_initialize_tables}
I initialize the tables for a given node id. I do this by creating all tables in the mnesia storage.
I return information whether these tables did not exist, were created, or when I failed to create them.
Given an atom as table name, I create a node-specific name based on that.
@spec reset_tables_for_client() :: :ok
I reset the tables for the client. Resetting means creating them if they dont exist, and clearing them if they do.
I return the table name for the given node its blocks.
@spec table_client_ids() :: atom()
I return the name of the client's id table.
@spec table_client_updates() :: atom()
I return the name of the client's update table.
@spec table_client_values() :: atom()
I return the name of the client's values table.
I return the table name for the given node its event table.
Check if the given table name exists.
Run inside transaction.
I return the table name for the intents table.
I return the table name for the given node its updates.
I return the table name for the given node its values.
@spec tables_exist?([atom()]) :: {:ok, :exists} | {:error, :partial_exist | :none_exist | :failed_to_check_tables}
Check if a given list of tables exists.
This function takes a list of tables to avoid waiting for tables multiple times.