I have an Ecto.Query and a Repo, such that I can call Repo.all(query) and get results. However, the results are not what I expect.
Ecto.Query
Repo
Repo.all(query)
It's basically Gazlers answer, but modified to use in code:
Gazler
query = from p in Post {query, params} = Ecto.Adapters.SQL.to_sql(:all, Repo, query) IO.puts("#{query}, #{inspect(params)}")
You could use simple IO.inspect, but it'll output a query with backslashes.
IO.inspect