Quick Recap
In this chapter, we learned how to set up and configure a database for our Rails app—something the vast majority of Rails apps typically need.
Let’s review what we covered:
-
We started up a Postgres server in a container using Compose.
-
We verified that the Postgres server was running by connecting with the Postgres client from a separate container.
-
We configured our Rails app to talk to Postgres by installing the Postgres gem, modifying our database.yml file, and running the Rake task to create the databases.
-
We put our new database through its paces by generating a scaffold, running migrations, and inserting, deleting, and updating records.
-
We discussed why it’s a good idea to decouple our database container from data we want to persist. ...
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