Thin delegating wrapper around the host-configured DripDrop repo.
Library code calls this module so applications can provide their own Ecto
repo through config :dripdrop, :repo.
Summary
Functions
Runs a query and returns all rows.
Fetches one schema row by primary key, returning nil when it is missing.
Fetches one schema row by primary key, raising when it is missing.
Inserts a changeset through the configured repo.
Runs a query expected to return zero or one row.
Executes raw SQL through the configured repo.
Returns the host-configured Ecto repo or raises when DripDrop is not configured.
Runs an Ecto.Multi transaction through the configured repo.
Updates a changeset through the configured repo.
Runs an update_all through the configured repo.
Functions
@spec all( Ecto.Queryable.t(), keyword() ) :: [Ecto.Schema.t()]
Runs a query and returns all rows.
@spec get(module(), term(), keyword()) :: Ecto.Schema.t() | nil
Fetches one schema row by primary key, returning nil when it is missing.
@spec get!(module(), term(), keyword()) :: Ecto.Schema.t()
Fetches one schema row by primary key, raising when it is missing.
@spec insert( Ecto.Changeset.t(), keyword() ) :: {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}
Inserts a changeset through the configured repo.
@spec one( Ecto.Queryable.t(), keyword() ) :: Ecto.Schema.t() | nil
Runs a query expected to return zero or one row.
@spec query(String.t(), list(), keyword()) :: {:ok, Postgrex.Result.t()} | {:error, term()}
Executes raw SQL through the configured repo.
@spec repo!() :: module()
Returns the host-configured Ecto repo or raises when DripDrop is not configured.
Runs an Ecto.Multi transaction through the configured repo.
@spec update( Ecto.Changeset.t(), keyword() ) :: {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}
Updates a changeset through the configured repo.
@spec update_all(Ecto.Queryable.t(), keyword(), keyword()) :: {non_neg_integer(), nil | [term()]}
Runs an update_all through the configured repo.