defmodule Query do use Yesql, driver: Postgrex, conn: MyApp.ConnectionPool Yesql.defquery("some/where/select_users_by_country.sql") end Query.users_by_country(country_code: "gbr") # => {:ok, [%{name: "Louis", country_code: "gbr"}]}
Postgrex
Ecto
conn