Chapter 7. Being persistent with a database
This chapter covers
Your Auction application has a public interface where you can query for items, and you know how to bring external package dependencies into the application. In chapter 5, you readied the application for real database use by bringing in Ecto and postgrex (or a different database adapter based on your needs).
You originally set up your Auction application to use a “fake” repo so as not to introduce too much complexity while you built up a small public interface for querying items. It was relatively quick to set up, required no external dependencies, and was fast, but it only allowed you to read a static list of items. For a true data-driven web application, you need the ability to do complex queries as well as insert new items and update existing ones.
In this chapter, you’ll get rid of the fake database and move to a real database. To achieve this, a few prerequisites need to be taken care of: