Log in Sign up
Courses / Ecto: From Zero to Advanced

Ecto: From Zero to Advanced

Intermediate
ecto elixir database postgresql sql

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.

Lessons (12)

1

Introduction, Repo, Migrations

Enroll to unlock lessons
2

Schemas and Types

Enroll to unlock lessons
3

Changeset: Validation Basics

Enroll to unlock lessons
4

Changeset: Advanced

Enroll to unlock lessons
5

Queries: Basics

Enroll to unlock lessons
6

Associations

Enroll to unlock lessons
7

Queries: Advanced

Enroll to unlock lessons
8

Transactions and Ecto.Multi

Enroll to unlock lessons
9

Embedded and Schemaless Changesets

Enroll to unlock lessons
10

Upserts, Bulk Operations, Prefixes, Custom Types

Enroll to unlock lessons
11

Testing, Performance, Operations

Enroll to unlock lessons
12

Next Steps and Reference

Enroll to unlock lessons
No ratings yet

Comments (0)

Log in to leave a comment.

No comments yet. Be the first to comment!

Share this course

Invite someone else to start learning.