finds.dev← search

// the find

elixir-ecto/ecto

★ 6,499 · Elixir · Apache-2.0 · updated Sep 2026

A toolkit for data mapping and language integrated query.

Ecto is Elixir's data mapping and query toolkit — not an ORM in the ActiveRecord sense, more a composable query builder plus an explicit changeset system for casting and validating data. It targets Elixir/Phoenix developers who want database access without magic method injection or implicit callbacks.

Changesets separate validation/casting from the schema definition, so you can have multiple validation paths for the same struct instead of one model class owning all the rules. Queries are plain data structures built with a pipe-friendly DSL, so you can compose, extend, and inspect them before they ever hit `Repo.all/one` — useful for building dynamic filters without string concatenation. Ecto.Multi models multi-step transactions as a value you build up and inspect, not a callback nested inside a `transaction do` block, which makes the steps independently testable. The adapter boundary (Postgres, MyXQL, Tds, SQLite3, ClickHouse) keeps core query planning separate from DB execution, and that's let the community add adapters like ecto_ch without touching Ecto itself.

SQL-specific functionality — migrations, raw SQL, the Postgres/MySQL adapters — lives in the separate ecto_sql repo, so 'using Ecto' in practice means pulling two dependencies and jumping between two docs sites for what feels like one tool. Associations via cast_assoc vs put_assoc have genuinely confusing semantics (one deletes-and-recreates children, the other diffs) and it's a near-universal early gotcha. Preloading is entirely manual — nothing warns you about N+1s at compile time or in dev logs by default, so you find out in production. Read-replica/dynamic-repo support is a documented howto pattern bolted on top, not a first-class config option, so sharding or replica routing takes real wiring.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →