O'Reilly logo

Programming Phoenix by Jose Valim, Bruce Tate, Chris McCord

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required