← All series

Series contents

Log in to track your progress

  1. 1. Ecto Overview: The Repo Episode
  2. 2. Configuring a new project with Ecto Episode
  3. 3. Creating Ecto Migrations Episode
  4. 4. Schema-less Ecto Queries Episode
  5. 5. Our first Ecto schemas Episode
  6. 6. Some useful Ecto functions Episode
  7. 7. Configuring IEx for working with Ecto Episode
  8. 8. Ecto belongs_to and has_many Episode
  9. 9. Ecto many_to_many and joining through Episode
  10. 10. Naming things in an Ecto project Episode
  11. 11. Ecto changesets: change vs cast Episode
  12. 12. Ecto changesets, validations and constraints Episode
  13. 13. Ecto build_assoc and put_assoc Episode

Ecto Overview: The Repo

Ecto is the overwhelmingly dominant database library for Elixir.

The most important thing to understand about Ecto is that it uses a repository pattern. It's a fundamentally different way of working with a database than Active Record which you may be used to from Rails, Laravel or other frameworks. There are both advantages and disadvantages.

In essence the repo acts like a border agent between you and your database. Anytime you want to read or write through the database, you go through the repo. It never dissolves into the background the way Active Record and some other ORMs do.

This can feel a little bit tedious at the beginning, but you will be very aware of when and how you're querying your database and will have a much easier time understanding your system as it grows.

To see this full series on YouTube, use this playlist.

Open standalone page ↗

No Comments