MailglassInbound.Repo (MailglassInbound v0.1.0)

Copy Markdown View Source

Thin facade over the host-configured repo for mailglass_inbound.

The sibling package does not own a repo. Host applications configure one via config :mailglass_inbound, :repo, MyApp.Repo.

Summary

Functions

all(queryable, opts \\ [])

@spec all(
  Ecto.Queryable.t(),
  keyword()
) :: [struct()]

get(queryable, id, opts \\ [])

@spec get(Ecto.Queryable.t(), term(), keyword()) :: struct() | nil

insert(struct_or_changeset, opts \\ [])

@spec insert(
  Ecto.Changeset.t() | struct(),
  keyword()
) :: {:ok, struct()} | {:error, Ecto.Changeset.t()}

multi(multi, opts \\ [])

@spec multi(
  Ecto.Multi.t(),
  keyword()
) :: {:ok, map()} | {:error, atom(), any(), map()}

one(queryable, opts \\ [])

@spec one(
  Ecto.Queryable.t(),
  keyword()
) :: struct() | nil

transact(fun, opts \\ [])

@spec transact(
  (-> {:ok, any()} | {:error, any()}),
  keyword()
) :: {:ok, any()} | {:error, any()}