How to build WHERE IN array clause with Ecto? August 19, 2023 by Tarik The following should work: posts = Post |> where([p], p.id in [1, 2]) |> Repo.all