Today I Learned

hashrocket A Hashrocket project

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()")
See More #elixir TILs
Looking for help? At Hashrocket, we 💜 Elixir! From our many Elixir client projects, to sponsoring the Chicago Elixir Meetup, to the source code for this application, we are invested in this community. Contact us today to talk about your Elixir project.