We can't find the internet
Attempting to reconnect
Something went wrong!
Attempting to reconnect
Ecto: From Zero to Advanced
About this course
A complete Ecto course — from your first query to advanced techniques. Ecto is not an ORM but a tandem of a data mapper and a query language: explicit, composable, without magic. Knowledge of Elixir is assumed (pattern matching, pipe, structs). Ecto is used in Phoenix, but it’s a standalone library and works without it — the course accounts for that. Examples are on PostgreSQL (the ecosystem’s main database), but most applies to MySQL/SQLite.
The course covers Ecto’s four pillars — Repo (database access), Schema (table mapping), Changeset (data validation and transformation), Query (a composable query DSL) — and moves from basics to advanced: associations and the fight against N+1, complex queries (joins, subqueries, window functions, CTEs, dynamic queries), transactions via Ecto.Multi, embedded and schemaless changesets, upserts and bulk operations, multi-tenancy via prefixes, custom types, plus testing, performance, and safe migrations in production.
For a developer from Rails, parallels are drawn: Ecto ≈ ActiveRecord, but without magic and with explicit changesets; Repo ≈ what’s spread across models in AR; migrations are similar, but fully reversible. The key difference from AR — Ecto separates data (schema), its modification (changeset), and access (Repo), rather than mixing everything into an “active record.”
Pace 1–2 hours a day. Each lesson contains theory, code examples, a checklist of tasks, and a quiz. The main principle: Ecto makes database work explicit — you always see what SQL will run, which fields are accepted from input, and when a database access happens.