Current section
Files
Jump to
Current section
Files
src/amnesiac@table.erl
-module(amnesiac@table).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([table_name/1, name_from_string/1, create_table/2, del_table_copy/2, del_table_index/2, delete_table/1]).
-export_type([table/0, access_mode/0, table_type/0, create_option/0]).
-type table() :: any().
-type access_mode() :: read_write | read_only.
-type table_type() :: set | ordered_set | bag.
-type create_option() :: {access_mode, access_mode()} |
{attributes, list(gleam@erlang@atom:atom_())} |
{disc_copies, list(gleam@erlang@node:node_())} |
{disc_only_copies, list(gleam@erlang@node:node_())} |
{ram_copies, list(gleam@erlang@node:node_())} |
{index, list(gleam@erlang@atom:atom_())} |
{load_order, integer()} |
{majority, boolean()} |
{record_name, gleam@erlang@atom:atom_()} |
{type, table_type()} |
{local_content, boolean()}.
-spec table_name(gleam@erlang@atom:atom_()) -> table().
table_name(Name) ->
table_ffi:table_name(Name).
-spec name_from_string(binary()) -> table().
name_from_string(Name) ->
_pipe = erlang:binary_to_atom(Name),
table_ffi:table_name(_pipe).
-spec create_table(table(), list(create_option())) -> {ok, nil} |
{error, gleam@dynamic:dynamic_()}.
create_table(Name, Create_option) ->
table_ffi:create_table(Name, Create_option).
-spec del_table_copy(table(), gleam@erlang@node:node_()) -> {ok, nil} |
{error, gleam@dynamic:dynamic_()}.
del_table_copy(Table, Node) ->
table_ffi:del_table_copy(Table, Node).
-spec del_table_index(table(), gleam@erlang@atom:atom_()) -> {ok, nil} |
{error, gleam@dynamic:dynamic_()}.
del_table_index(Table, Attribute) ->
table_ffi:del_table_index(Table, Attribute).
-spec delete_table(table()) -> {ok, nil} | {error, gleam@dynamic:dynamic_()}.
delete_table(Table) ->
table_ffi:delete_table(Table).