Pure checks and corrections for a generated admin entity config (BOU-567).
The model is asked for the right types and relations and does not reliably give them, so what the project already knows — its migrations — decides the types, and what the description asked for is checked before anything is written.
Pure checks and corrections for a generated admin entity config (BOU-567). The model is asked for the right types and relations and does not reliably give them, so what the project already knows — its migrations — decides the types, and what the description asked for is checked before anything is written.
(apply-column-types config col-types)config with each field's :type taken from the table's col-types.
Returns {:config .. :corrections [{:field :from :to}]}.
`config` with each field's :type taken from the table's `col-types`.
Returns {:config .. :corrections [{:field :from :to}]}.(column-types columns)A table's columns as {:kebab-field admin-type}, skipping unknown SQL types.
A table's columns as {:kebab-field admin-type}, skipping unknown SQL types.
(infer-types config)For a table that does not exist yet: a date-named :instant becomes :date, and a quantity, count or amount in cents typed :decimal becomes :int.
For a table that does not exist yet: a date-named :instant becomes :date, and a quantity, count or amount in cents typed :decimal becomes :int.
(migration-columns sqls){table-name {column-name sql-type}} after applying sqls, the up migrations
in the order they run. Names are lower-case and unquoted, as in the SQL.
{table-name {column-name sql-type}} after applying `sqls`, the up migrations
in the order they run. Names are lower-case and unquoted, as in the SQL.(missing-keys entities requested)The keys in requested that no entity in entities carries.
The keys in `requested` that no entity in `entities` carries.
(prepare entities edn-text tables description)Check and correct a parsed answer: entities is the EDN value, edn-text
its text, tables what migration-columns read, description the request.
Returns {:entities [{:entity-name :text :type-source :corrections}]} with one file's text per entity, or {:error str}.
Check and correct a parsed answer: `entities` is the EDN value, `edn-text`
its text, `tables` what `migration-columns` read, `description` the request.
Returns {:entities [{:entity-name :text :type-source :corrections}]} with
one file's text per entity, or {:error str}.(render entities)entities as EDN text, one key per line, in the order people read them.
`entities` as EDN text, one key per line, in the order people read them.
(requested-keys description)The relation keys description asks for.
The relation keys `description` asks for.
(sql-type->field-type sql-type)The admin field type for a SQL column type, or nil when there is none.
The admin field type for a SQL column type, or nil when there is none.
(validation-errors entities)One "[path] problem" line per schema error in entities, or nil when
they are valid. An unknown key is named where it sits (BOU-572).
One "[path] problem" line per schema error in `entities`, or nil when they are valid. An unknown key is named where it sits (BOU-572).
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |