This document provides an overview of composing queries with Ecto by:
1) Introducing Ecto models and basic queries.
2) Explaining that queries can be constructed separately from execution for flexibility.
3) Describing how queries can be composed by making one query the subject of another, allowing reusable query components to be defined and combined.
4) Framing queries as pipelines with sources, transformations, and sinks, noting pipelines can also be nested for more complex operations like pagination.
13. Intro - First Query Deconstructed
query = from p in MyApp.Post,
where: p.published == true
MyApp.Repo.all(query)
14. Intro - Fancy Query
query = from c in MyApp.Comment,
join: p in assoc(c, :post),
where: p.id == 1 and c.votes > 5
select: c
comments = MyApp.Repo.all(query)