View Source Crontab.CronExpression.Ecto.Type (crontab v1.1.13)
Provides a type for Ecto usage.
The underlying data type should be a map.
migration-example
Migration Example
create table(:my_table) do
add :schedule, :map
end
schema-example
Schema Example
schema "my_table" do
field :schedule, Crontab.CronExpression.Ecto.Type
end
Link to this section Summary
Functions
Callback implementation for Ecto.Type.cast/1
.
Callback implementation for Ecto.Type.dump/1
.
Callback implementation for Ecto.Type.embed_as/1
.
Callback implementation for Ecto.Type.equal?/2
.
Callback implementation for Ecto.Type.load/1
.
Callback implementation for Ecto.Type.type/0
.
Link to this section Types
@type map_expression() :: %{ extended: boolean(), reboot: boolean(), second: [Crontab.CronExpression.value(Calendar.second())], minute: [Crontab.CronExpression.value(Calendar.minute())], hour: [Crontab.CronExpression.value(Calendar.second())], day: [Crontab.CronExpression.value(Calendar.day())], month: [Crontab.CronExpression.value(Calendar.month())], weekday: [Crontab.CronExpression.value(Calendar.day_of_week())], year: [Crontab.CronExpression.value(Calendar.year())] }
Link to this section Functions
@spec cast(any()) :: {:ok, Crontab.CronExpression.t()} | :error
Callback implementation for Ecto.Type.cast/1
.
@spec dump(any()) :: {:ok, Crontab.CronExpression.t()} | :error
Callback implementation for Ecto.Type.dump/1
.
Callback implementation for Ecto.Type.embed_as/1
.
Callback implementation for Ecto.Type.equal?/2
.
@spec load(any()) :: {:ok, Crontab.CronExpression.t()} | :error
Callback implementation for Ecto.Type.load/1
.
@spec type() :: :map
Callback implementation for Ecto.Type.type/0
.