Exclude parts of a query in Ecto
Ecto.Query has a function called exclude you can call it to remove previous parts of a query that have already been defined
query = from(u in User,
  where: u.email == "jack@example.com",
  select: u.email
query
|> exclude(:where)
#=> will return the %Ecto.Query{} expression without the where clause