# DustEcto v0.1.1 - Table of Contents

> Ecto-shaped facade over Dust — Dust.Schema + Dust.Repo for Phoenix apps.

## Pages

- [DustEcto](readme.md)
- [Changelog](changelog.md)

## Modules

- [DustEcto](DustEcto.md): Ecto-shaped facade over Dust — `DustEcto.Schema` plus `DustEcto.Repo`,
designed to feel like the parts of `Ecto.Schema` and `Ecto.Repo` that
map cleanly onto Dust's flat KV model.
- [DustEcto.Error](DustEcto.Error.md): Single error struct returned from `DustEcto.Repo` when transport
failures or server errors occur. Validation errors return
`{:error, %Ecto.Changeset{}}` instead — that path is unchanged.
- [DustEcto.Phoenix](DustEcto.Phoenix.md): `Phoenix.PubSub` bridge for `DustEcto.Repo` subscriptions. Turns the
four-step "supervise Dust, configure facade, subscribe in mount,
don't block in the callback" recipe into a one-liner that's safe to
call from a LiveView.
- [DustEcto.Phoenix.Broadcaster](DustEcto.Phoenix.Broadcaster.md): One broadcaster process per `{schema, pubsub, topic}` triple. Holds
a single `DustEcto.Repo.subscribe/2` registration whose callback
broadcasts every event through Phoenix.PubSub on `topic`.
- [DustEcto.Repo](DustEcto.Repo.md): Ecto-shaped facade over the active `DustEcto.Transport`. Functions
mirror the parts of `Ecto.Repo` that map cleanly onto Dust's flat KV
model: `all/1`, `get/2` + `get!/2`, `stream/1`, `exists?/2`, plus
`insert/1`, `update/1`, `delete/1` + `delete/2`, and `delete_all/1`.
- [DustEcto.Schema](DustEcto.Schema.md): `use DustEcto.Schema, prefix: ["links"], required: [:slug, :title]`
pairs an `Ecto.Schema` (embedded) with a Dust prefix and the slug
field used as the per-record namespace key.
- [DustEcto.Transport](DustEcto.Transport.md): Behaviour every dustlayer_ecto transport adapter implements. Two
implementations ship: `DustEcto.Transport.SDK` (recommended, uses
Phoenix Channels via `:dustlayer`) and `DustEcto.Transport.HTTP`
(Req-based, stateless, no realtime).
- [DustEcto.Transport.HTTP](DustEcto.Transport.HTTP.md): Stateless HTTP transport — Req against the Dust REST API. Suitable
for one-shot scripts, release tasks, and contexts where the WS
supervisor isn't running. No realtime: `subscribe/3` returns
`{:error, :not_supported}`.
- [DustEcto.Transport.SDK](DustEcto.Transport.SDK.md): WebSocket-backed transport — delegates every call to the configured
Dust facade module (default `Dust`). Uses the SDK pre-work landed in
the same monorepo: sync write semantics on every op, subtree-aware
reads, and `:committed` subscription mode for exactly-once delivery.

