You can tell Ecto to load data from any view or table like this:
from c in "special_comments(1)"
If you want to load this into a specific module, you can do:
from c in {"special_comments(1)", MyApp.Comment}
And you should be good to go!
source
to share