Rheo.Backend.Ecto runs the same Rheo API on a host-owned Ecto.Repo (PostgreSQL or SQLite). Rheo does not own your Repo supervision or migrations layout — you do.

Dependencies

Rheo already depends on ecto / ecto_sql. Add the adapter your app uses:

{:postgrex, "~> 0.19"}      # PostgreSQL
# or
{:ecto_sqlite3, "~> 0.17"}  # SQLite

Supervise Repo then Rheo

children = [
  MyApp.Repo,
  {Rheo, name: MyRheo, backend: {Rheo.Backend.Ecto, repo: MyApp.Repo}},
  {MyApp.RiskConsumer, rheo: MyRheo}
]
:ok = Rheo.ensure_indexes(rheo: MyRheo)

Generate migrations with:

mix rheo.ecto.gen_migration

PostgreSQL vs SQLite

PostgreSQLSQLite
distributedtrue (FOR UPDATE SKIP LOCKED)false
Multi-node claimsYesNo — single writer
JSONjsonbJSON text
Typical useProduction SQLEmbedded / local durable
Rheo.Backend.Ecto.capabilities(:postgres).guarantees.distributed # => true
Rheo.Backend.Ecto.capabilities(:sqlite).guarantees.distributed   # => false

Same consumer code

Switching backends does not change Rheo.Consumer, fetch/ack, query, or lag APIs — only the supervised {Rheo, backend: …} child.

Not Mongo-via-Ecto

Mongo stays on Rheo.Backend.Mongo. The Ecto backend is SQL only (ADR 017).

Tutorial: One consumer API, PostgreSQL and SQLite.