ecto_resource v1.1.1 EctoResource
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 EctoResource.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 EctoResource.using_repo/2
Examples
use EctoResource
Macro to define CRUD methods for the given Ecto.Repo
in the using module.
Examples
using(Repo) do
resource(Schema)
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
using_repo(Repo) do
resource(Schema)
end