Elixlsx.Compiler.DBUtil (elixlsx v0.6.0) View Source
Generic functions for the Compiler.*DB modules.
Link to this section Summary
Functions
Returns the ID for an object in the database.
If the value does not exist in the database, return
the tuple {dict, nextid}
unmodified. Otherwise,
returns a tuple {dict', nextid+1}
, where dict'
is the dictionary with the new element inserted
(with id nextid
)
Link to this section Types
Specs
gen_db_datatype() :: %{required(object_type()) => non_neg_integer()}
Specs
gen_db_type() :: {gen_db_datatype(), non_neg_integer()}
Specs
object_type() :: any()
Link to this section Functions
Specs
get_id(gen_db_datatype(), object_type()) :: non_neg_integer()
Returns the ID for an object in the database.
Specs
id_sorted_values(gen_db_datatype()) :: [object_type()]
Specs
register(gen_db_type(), object_type()) :: gen_db_type()
If the value does not exist in the database, return
the tuple {dict, nextid}
unmodified. Otherwise,
returns a tuple {dict', nextid+1}
, where dict'
is the dictionary with the new element inserted
(with id nextid
)