Wrapping Up
In this chapter, we learned how schemas allow us to create data structures that we can map to our database tables. This is how you’ll be using schemas most of the time, but schemas are actually very flexible and can be used in a number of different ways. We’ll be looking at some examples later on in the book.
At the end of the chapter, we saw how schemas make it easy for us to insert lots of records at once, even records with complex nested associations. There’s one issue that we glossed over, however: making sure that the data we’re inserting is valid, and catching any errors that might arise. This is a critical part of maintaining the integrity of our data, and the Changeset module is here to help, so we’ll look at that next.
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