Create Your Repo Module
Explore how to create and configure an Ecto repository module in an Elixir application without Phoenix. Understand setting the adapter, OTP app, and database connection details to enable interaction with PostgreSQL or other databases using Ecto.
Next, we need to create our application’s repository module. We went through this process in detail before, but we’ll run through it again here.
Creating repo.ex file
Open a new file called lib/my_app/repo.ex and add the following:
Explanation
The use Ecto.Repo directive will make our module a bona fide Ecto repository—all of Ecto’s repository functions will be defined and made available on this module. For more details on how this works, see ...