Wrapping Up
Ecto’s schemas require a little manual setup when mapping them to database tables. But in exchange for that effort, you get data structures that are flexible and able to work with the specific needs of your app.
With Ecto, it’s possible to break out of the gravitational pull of having your data structures locked to your database tables. You can design your structs around the needs of your application code rather than your database, and still not lose any of the conveniences that changesets provide.
In this chapter, we looked at one use case for table-less schemas, but others exist. In Using Changesets Without Schemas, we used the validations from the Changeset module to help validate a search form that we weren’t persisting to a ...
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