# `MailglassInbound.Repo`
[🔗](https://github.com/szTheory/mailglass/blob/v2.3.0/lib/mailglass_inbound/repo.ex#L1)

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`.

## Schema prefix injection (v2.0)

Every delegated read/write injects `prefix: MailglassInbound.Config.schema()` via
`Keyword.put_new`, routing all operations to the configured Postgres schema
(`"mailglass"` by default, `"public"` for pre-2.0 opt-out). An explicit
caller-supplied `:prefix` wins over the injected default (INB-01).

`transact/2` and `multi/2` do NOT inject prefix. The inner `insert/2`, `one/2`,
`all/2`, and `get/3` calls inside a transaction carry their own prefix via the
facade. Inbound has no Multi builders today (`multi_opts/1` is deferred); a future
raw caller that passes an inbound table to a non-facade path must qualify inline.

# `all`

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

# `get`

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

# `insert`

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

# `multi`

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

# `one`

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

# `transact`

```elixir
@spec transact((-&gt; {:ok, any()} | {:error, any()}), keyword()) ::
  {:ok, any()} | {:error, any()}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
