gungnir.model
*column->field*
dynamic
*field->column*
dynamic
*model->table*
dynamic
*models*
dynamic
*table->model*
dynamic
after-read
multimethod
before-read
multimethod
before-save
multimethod
child
(child ?model k)
Get the child k
from ?model
. Returns nil
if not found.
find
(find key)
Find a model by key
. Returns nil
if not found.
format-error
multimethod
keys
(keys ?model)
Get all keys from model
as qualified-keywords.
primary-key
(primary-key ?model)
Get the primary-key of ?model
. ?model
can either be a keyword or a model.
properties
(properties ?model)
Get the properties of model ?model
.
register!
(register! model-map)
Adds the model-map
to the current available models for Gungnir. You can add multiple models at once, or add new ones over time.
The following format is accepted. Keys are the name of model, and the value should be a Malli :map
(gungnir.model/register!
{:user [:map ,,,]
:post [:map ,,,]
:comment [:map ,,,]})
table
(table ?model)
Get the table of ?model
. ?model
can either be a keyword or a model.