Execute raw sql queries conveniently
Repo.query
is a convenience function that wraps the more verbose
Ecto.Adapters.SQL.query
. Repo
in this case is not Ecto.Repo
but your application's Repo, so its more correct to say that YourApp.Repo.query
is a convenience function that wraps Ecto.Adapters.SQL.query
.
{:ok, result} = YourApp.Repo.query("select * from users order random()")
Tweet