Prefix-safe access to the host application's Ecto Repo.
Summary
Types
The result transaction/2 returns for an Ecto.Multi.
Functions
Runs a prefix-normalized all query through the context Repo.
Deletes a prefixed copy of a schema through the context Repo.
Inserts a prefixed copy of a changeset through the context Repo.
Runs a prefix-normalized one query through the context Repo.
Preloads associations using the context prefix.
Returns a copy of a schema or changeset with context-prefixed metadata.
Applies the context prefix to a prefix-neutral queryable.
Runs an Ecto Multi or zero-arity callback in a Repo transaction.
Reduces an Ecto.Multi transaction result to a two-tuple.
Updates a prefixed copy of a changeset through the context Repo.
Types
The result transaction/2 returns for an Ecto.Multi.
Functions
@spec all(BlogEngine.Context.t(), term()) :: [term()]
Runs a prefix-normalized all query through the context Repo.
@spec delete(BlogEngine.Context.t(), Ecto.Schema.t(), keyword()) :: {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}
Deletes a prefixed copy of a schema through the context Repo.
@spec insert(BlogEngine.Context.t(), Ecto.Changeset.t(), keyword()) :: {:ok, term()} | {:error, Ecto.Changeset.t()}
Inserts a prefixed copy of a changeset through the context Repo.
@spec one(BlogEngine.Context.t(), term()) :: term() | nil
Runs a prefix-normalized one query through the context Repo.
@spec preload(BlogEngine.Context.t(), term(), term()) :: term()
Preloads associations using the context prefix.
@spec put_prefix(BlogEngine.Context.t(), Ecto.Schema.t() | Ecto.Changeset.t()) :: Ecto.Schema.t() | Ecto.Changeset.t()
Returns a copy of a schema or changeset with context-prefixed metadata.
@spec query(BlogEngine.Context.t(), term()) :: Ecto.Query.t()
Applies the context prefix to a prefix-neutral queryable.
@spec transaction(BlogEngine.Context.t(), Ecto.Multi.t() | (-> term())) :: {:ok, term()} | {:error, term()} | {:error, term(), term(), map()}
Runs an Ecto Multi or zero-arity callback in a Repo transaction.
Inspectable changeset and query operations in a Multi must already resolve to
the context prefix. Nested subqueries, CTEs, and combinations fail closed until
recursive validation is supported. Opaque run and dynamic operations are a
trusted internal boundary because Ecto.Multi.to_list/1 does not expose the
values they will build at runtime.
@spec unwrap(multi_result(), (map() -> success)) :: success | {:error, term()} when success: var
Reduces an Ecto.Multi transaction result to a two-tuple.
on_success receives the committed changes map and returns the caller's own
success value. A failed operation always becomes {:error, reason} carrying
the reason of the operation that failed, so callers never repeat the
four-element shape transaction/2 returns for a Multi.
@spec update(BlogEngine.Context.t(), Ecto.Changeset.t(), keyword()) :: {:ok, term()} | {:error, Ecto.Changeset.t()}
Updates a prefixed copy of a changeset through the context Repo.