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

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.