Table lifecycle helpers (create / wait / clear / keys).
Summary
Functions
Replicates table (or :schema) to node with the given storage type. Delegates to
:mnesia.add_table_copy/3. Returns {:atomic, :ok} or {:aborted, reason}.
Returns every key in table. Delegates to :mnesia.all_keys/1 and must run inside an activity.
Changes the storage type of table (or :schema) on node. Delegates to
:mnesia.change_table_copy_type/3. Returns {:atomic, :ok} or {:aborted, reason}.
Removes all records from table. Delegates to :mnesia.clear_table/1.
Creates table from a keyword list of options (:attributes, :index, :disc_copies, ...).
Delegates to :mnesia.create_table/2.
Blocks until tables are loaded, up to timeout (ms or :infinity).
Delegates to :mnesia.wait_for_tables/2.
Functions
@spec add_table_copy(atom(), node(), :ram_copies | :disc_copies | :disc_only_copies) :: {:atomic, :ok} | {:aborted, term()}
Replicates table (or :schema) to node with the given storage type. Delegates to
:mnesia.add_table_copy/3. Returns {:atomic, :ok} or {:aborted, reason}.
Returns every key in table. Delegates to :mnesia.all_keys/1 and must run inside an activity.
@spec change_table_copy_type( atom(), node(), :ram_copies | :disc_copies | :disc_only_copies ) :: {:atomic, :ok} | {:aborted, term()}
Changes the storage type of table (or :schema) on node. Delegates to
:mnesia.change_table_copy_type/3. Returns {:atomic, :ok} or {:aborted, reason}.
Removes all records from table. Delegates to :mnesia.clear_table/1.
Creates table from a keyword list of options (:attributes, :index, :disc_copies, ...).
Delegates to :mnesia.create_table/2.
Returns {:atomic, :ok} or {:aborted, reason}.
Blocks until tables are loaded, up to timeout (ms or :infinity).
Delegates to :mnesia.wait_for_tables/2.