Add Ecto to the Supervision Tree

Learn how to add Ecto to the supervision tree.

We’re almost there. We’ve added the dependencies, defined our repository, and configured it. The last step is to ensure the repository is started when the application starts. We need to add the repository to the application supervision tree to do this.

List child processes

As our project was generated with mix new --sup, we should have a file lib/my_app/application.ex with the following function.

Get hands-on with 1200+ tech skills courses.