Caravela.Types (Caravela v0.6.0)

Copy Markdown View Source

Type mapping between the Caravela DSL, Ecto, and Postgres.

The DSL uses plain atoms like :string, :integer, :decimal, :text. Those are translated into Ecto field types (for schema generation) and Postgres column types (for migration generation).

Summary

Functions

Ecto type for a DSL atom. Raises if unknown.

Is the atom a known DSL type?

All DSL types recognised by Caravela.

True for numeric DSL types.

Postgres column type for a DSL atom. Raises if unknown.

True for string-ish DSL types.

Functions

ecto_type(type)

Ecto type for a DSL atom. Raises if unknown.

known?(type)

Is the atom a known DSL type?

known_types()

All DSL types recognised by Caravela.

numeric?(type)

True for numeric DSL types.

postgres_type(type)

Postgres column type for a DSL atom. Raises if unknown.

string_like?(type)

True for string-ish DSL types.