Skip to content

Instantly share code, notes, and snippets.

@nwalker
Created February 13, 2025 16:50
Show Gist options
  • Save nwalker/d6367a5cea175cd3557ae98074dedac0 to your computer and use it in GitHub Desktop.
Save nwalker/d6367a5cea175cd3557ae98074dedac0 to your computer and use it in GitHub Desktop.
to_sql = fn (q) ->
q
|> (&Ecto.Adapter.Queryable.plan_query(:all, Ecto.Adapters.Postgres, &1)).() |> elem(0)
|> Ecto.Adapters.Postgres.Connection.all()
|> List.to_string |> IO.puts()
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment