Today I Learned

A Hashrocket project

Ready to join Hashrocket? Find Openings here and apply today.

Ecto Query Ellipsis in Elixir

We can use ... in Ecto Query when using positional bindings queries so we don’t need to specify all the schema references in the query. Check this out:

Comment
|> join(:inner, [c], p in Post, on: p.id == c.post_id)
|> join(:inner, [..., p], u in User, on: u.id == p.user_id)
Looking for help? At Hashrocket, we 💜 Elixir! From our many Elixir client projects, to sponsoring the Chicago Elixir Meetup, to the source code for this application, we are invested in this community. Contact us today to talk about your Elixir project.