Alembic v2.1.0 Alembic.ToEctoSchema behaviour
The Alembic.ToEctoSchema
behaviour converts a struct in the Alembic
namespace to
an Ecto.Schema.t
struct.
Summary
Types
nil
if an empty singletonstruct
- if a non-empty singleton[]
- if an empty collection[struct]
- if a non-empty collection
A module that defines __struct__/0
and __schema__(:fields)
as happens when use Ecto.Schema
is run in a module
Maps JSON API Alembic.Resource.type
to ecto_schema_module
for casting that
Alembic.Resource.type
Types
ecto_schema :: nil | struct | [] | [struct, ...]
nil
if an empty singletonstruct
- if a non-empty singleton[]
- if an empty collection[struct]
- if a non-empty collection
ecto_schema_module :: atom
A module that defines __struct__/0
and __schema__(:fields)
as happens when use Ecto.Schema
is run in a module.
ecto_schema_module_by_type :: %{Alembic.Resource.type => ecto_schema_module}
Maps JSON API Alembic.Resource.type
to ecto_schema_module
for casting that
Alembic.Resource.type
.
Functions
Specs
to_ecto_schema(Alembic.ToParams.params, ecto_schema_module) :: struct
Specs
to_ecto_schema(%{type: Alembic.Resource.type}, Alembic.ToParams.params, ecto_schema_module_by_type) :: struct
Callbacks
Specs
to_ecto_schema(struct, Alembic.ToParams.resource_by_id_by_type, ecto_schema_module_by_type) :: ecto_schema
Parameters
struct
- anAlembic.Document.t
hierarchy structattributes_by_id_by_type
- Maps a resource identifier’sAlembic.ResourceIdentifier.type
andAlembic.ResourceIdentifier.id
to itsAlembic.Resource.attributes
fromAlembic.Document.t
included
.ecto_schema_module_by_type
-
Returns
nil
if an empty singletonstruct
- if a non-empty singleton[]
- if an empty collection[struct]
- if a non-empty collection