Chapter 2Querying Your Database
For the next stop on our tour, we’ll look at writing queries. Queries are an essential operation for writing database-backed applications, but, as we saw in the last chapter, writing queries with raw SQL was a little cumbersome. The Query module makes writing queries much easier, and it can handle just about anything you’d want to throw at it, from the very simple to the very complex.
In this chapter, we’ll look at the Query module in detail. We’ll start by examining Ecto’s query syntax, and try our hand at writing some simple queries. From there, we’ll look at writing more advanced queries using where and join. We’ll then see how Ecto allows us to break up larger queries into smaller, reusable pieces with its ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access