EctoCooler (ecto_cooler v1.0.0)
This module provides a DSL to easily generate the basic functions for a schema. This allows the context to focus on interesting, atypical implementations rather than the redundent, drifting CRUD functions.
Link to this section Summary
Functions
Macro to import EctoCooler.using_repo/2
Macro to define CRUD methods for the given Ecto.Repo in the using module.
Macro to define schema access within a given Ecto.Repo
Link to this section Functions
Macro to import EctoCooler.using_repo/2
examples
Examples
use EctoCooler
Macro to define CRUD methods for the given Ecto.Repo in the using module.
examples
Examples
using(Repo) do
resource(Schema)
end
using(Repo) do
resource(Schema, suffix: false)
end
using(Repo) do
resource(Schema, only: [:get])
end
using(Repo) do
resource(Schema, except: [:delete])
end
using(Repo) do
resource(Schema, :read)
end
using(Repo) do
resource(Schema, :write)
end
using(Repo) do
resource(Schema, :delete)
end
Macro to define schema access within a given Ecto.Repo
examples
Examples
using_repo(Repo) do
resource(Schema)
end