elixlsx v0.0.5 Elixlsx.Compiler.DBUtil
Generic functions for the Compiler.*DB modules.
Summary
Functions
return 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
)
Types
gen_db_datatype :: %{optional(object_type) => non_neg_integer}
gen_db_type :: {gen_db_datatype, non_neg_integer}
object_type :: any
Functions
Specs
get_id(gen_db_datatype, object_type) :: non_neg_integer
return the ID for an object in the database
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
)