I'd like to use a specific Postgres schema for my Phoenix app.
I tried to achieve this with Ecto.Repo.after_connect/1 callback but it seems to recursively create new db connections about 10 times before timing out.
Here is my repo file :
defmodule MyApp.Repo do
use Ecto.Repo, otp_app: :my_app
use Scrivener, page_size: 20
def after_connect(_pid) do
IO.puts "after_connect"
Ecto.Adapters.SQL.query(MyApp.Repo, "SET search_path TO 'my_app';", [])
end
end
alter user set ...