Typecasting Ecto.Adapters.SQL.query

I’m using some rather complex sql queries with postgres WITH queries.

Ecto.Adapters.SQL.query(MyRepo, my_complex_sql_query, [])

I’m getting raw Postgrex.Result struct back, is there some prebuilt way of maping this with a Ecto.Schema?

https://hexdocs.pm/ecto/2.2.6/Ecto.Repo.html#c:load/2

1 Like

Wow! Exactly the thing I was looking for!
<3