Crontab.CronExpression.Ecto.Type (crontab v1.2.0)

View Source

Provides a type for Ecto usage.

The underlying data type should be a map.

Migration Example

create table(:my_table) do
  add :schedule, :map
end

Schema Example

schema "my_table" do
  field :schedule, Crontab.CronExpression.Ecto.Type
end

Casted Values

It is recommended to only pass Crontab.CronExpression structs to the field.

The type will automatically cast the string representation to a Crontab.CronExpression struct. This will however only work for normal (not extended) expressions since the string representation of extended expressions can't be disambiguated from normal expressions.