Subscribe now

Elixir Weekly Drip #4 and Exercise: More Queries [04.20.2017]

This week we learned the basics of Ecto. There's a ton more to cover, so I'll point you to some valuable resources in the links. After the links, you can find a detailed plan for this week's exercise, where we'll focus on more detailed queries for our data model.

Here are some links to provide further exploration of Ecto:


For this week's exercise, we'll build on the existing data model. Write tests and then corresponding queries for the following:

  • Given a category, find the three threads with the most recent posts.
  • Given a user, find all of their posts.
  • Given a user, find all of the threads in which they have posted.
  • Given a thread, return the number of posts.
  • Find all posts whose body contains a particular string.

You can use the dailydrip/firestorm repo after the previous episode as a starting point. See you soon!