Wrapping Up
Ecto is a library for data mapping and database queries. It takes a different design approach than Ruby’s ActiveRecord library, but somehow it ends up feeling familiar. Many of the concepts and terms are similar between the libraries, so you’ll be right at home as you learn to use it. Ecto is used to query the database, translate data into your application, and change data from your application.
Ecto schemas are modules that define your application’s data structure. Ecto uses a schema to know how to map data from the database into an Elixir struct. You can define associations in your Ecto schema, such as one-to-one, one-to-many, and many-to-many associations. These associations are standardized across database libraries, so they feel ...
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