Introducing Ecto

Ecto for Beginners : part 1 of 22 published on Nov 09, 2015

Hi! In this guide we are going to work our way through learning Ecto, a database library for Elixir (https://github.com/elixir-lang/ecto).

Ecto is written by the excellent Elixir team so no surprise it is truly awesome to work with. Big shout out thanks to Jose Valim, Eric Meadows, and the other 100+ contributors to Ecto. Great job!

My time with Ecto has been awesome. Ecto is fast, composable, and flexible.

The official documentation can be found at: http://hexdocs.pm/ecto

Why write this guide?

The official documentation does a great job demonstrating the API but sometimes it is hard to know where to look right? This guide is not a replacement for the level of detail provided by the official documentation.

If you are coming from Rails, there can be a few bumps on your road to productivity. Ecto is not Active Record. In many ways it is better!

This guide is all about reducing if not eliminating those bumps!

I want help you to get started shipping code and not spending hours reading documentation searching for answers to simple questions.

What to expect from this guide

We will use Ecto inside a Phoenix application to learn all the common database actions. We will demonstrate the code in working tests that you can run and verify things work as expected. We also will cover some best practices for getting the most out of Ecto.

I structured of the guide so it will be an example reference to come back to as you begin working with Ecto.

Let’s get started!

Next: Creating our Phoenix app