# How do I load ecto structs from a postgresql function?

**URL:** <https://forum.elixirforum.com/t/how-do-i-load-ecto-structs-from-a-postgresql-function/36112>\
**Category:** Questions\
**Tags:** postgresql, ecto-query, function\
**Created:** [December 10, 2020, 2:55am UTC](https://forum.elixirforum.com/t/how-do-i-load-ecto-structs-from-a-postgresql-function/36112 "2020-12-10T02:55:18Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![thousandsofthem](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/thousandsofthem/32/1030_2.png) [@thousandsofthem](https://forum.elixirforum.com/u/thousandsofthem)\
**Post date:** [December 12, 2020, 6:22am UTC](https://forum.elixirforum.com/t/how-do-i-load-ecto-structs-from-a-postgresql-function/36112/4 "2020-12-12T06:22:57Z")

</div>

Some (partially outdated) info:

> <https://stackoverflow.com/questions/27751216/how-to-use-raw-sql-with-ecto-repo>

> UPDATE: for Ecto 3 you can use  
> ` __MODULE__.load(model, fields)`

---

_[View the full topic](https://forum.elixirforum.com/t/how-do-i-load-ecto-structs-from-a-postgresql-function/36112)._
