# Ecto

## Getting started

* Get motivated: [Leveling Up With Ecto](https://www.youtube.com/watch?v=QE7bpqpDoKo)
* Start with "Programming Phoenix". Part 1 contains chapters specifically related to Ecto which will provide a foundation.
* Read the API documentation. Focus on these areas:
  * [Ecto Overview](https://hexdocs.pm/ecto/2.0.0-beta.2/Ecto.html)
  * [Repo](https://hexdocs.pm/ecto/2.0.0-beta.2/Ecto.Repo.html)
  * [Schema](https://hexdocs.pm/ecto/2.0.0-beta.2/Ecto.Schema.html)
  * [Changesets](https://hexdocs.pm/ecto/2.0.0-beta.2/Ecto.Changeset.html)
  * [Query](https://hexdocs.pm/ecto/2.0.0-beta.2/Ecto.Query.html) and [Query.API](https://hexdocs.pm/ecto/2.0.0-beta.2/Ecto.Query.API.html)
* [What's new in Ecto 2.0](http://pages.plataformatec.com.br/ebook-whats-new-in-ecto-2-0)

## Additional References to help out round your understanding:

* [Composable Queries with Ecto](https://blog.drewolson.org/composable-queries-ecto/)
* [Working with Ecto associations and embeds](http://blog.plataformatec.com.br/2015/08/working-with-ecto-associations-and-embeds/)
* [The Ecto Query Library - Lew Parker](http://www.glydergun.com/the-ecto-query-library/) ([GitHub Repo](https://github.com/parkerl/ecto_query_librar:/github.com/parkerl/ecto_query_library))
* [Nicholas' Bookmarks](https://pinboard.in/u:nicholasjhenry/t:ecto/)

## Talks

* [Composable Queries with Ecto](http://confreaks.tv/videos/elixirconf2015-composable-queries-with-ecto)
* [Ecto](http://confreaks.tv/videos/elixirconfeu2015-ecto)

## "Patterns"

Ecto, as a database wrapper, is significantly different to ORM such as Rails' ActiveRecord. Dealing with certain data structures are not quite "out-of-the box". Here's a few patterns to deal with these:

* [Many to many and upserts](http://blog.plataformatec.com.br/2016/12/many-to-many-and-upserts/)
* TODO: Add another Many to many
* [Modeling Polymorphic Associations in a Relational Database](https://hashrocket.com/blog/posts/modeling-polymorphic-associations-in-a-relational-database)
* [Ecto Docs Polymorphic Associations](https://hexdocs.pm/ecto/Ecto.Schema.html#belongs_to/3-polymorphic-associations)

## Asking for help

* [Google Groups](https://groups.google.com/forum/#!forum/elixir-ecto)
