Understanding Ecto
If you’ve used persistence frameworks like LINQ in .NET or Active Record in Rails, you’ll see some common threads in Ecto but also some significant differences. Ecto is a wrapper that’s primarily intended for relational databases, allowing developers to read and persist data to underlying storage such as PostgreSQL. It has an encapsulated query language that you can use to build layered queries that can then be composed into more-sophisticated ones.
Ecto also has a feature called changesets that holds all changes you want to perform on the database. It encapsulates the whole process of receiving external data, casting and validating it before writing it to the database.
In this chapter, we’ll start with a basic database-backed ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access