ash_postgres/test/support/test_repo.ex
Zach Daniel 10cf60cdc1 fix: remove Agent "convenience" for determining min pg version
We need to require that users provide this function. To that end we're
adding a warning in a minor release branch telling users to define this.
The agent was acting as a bottleneck that all queries must go through,
causing nontrivial performance issues at scale.
2024-08-13 09:58:25 -04:00

26 lines
616 B
Elixir

defmodule AshPostgres.TestRepo do
@moduledoc false
use AshPostgres.Repo,
otp_app: :ash_postgres
def on_transaction_begin(data) do
send(self(), data)
end
def installed_extensions do
["ash-functions", "uuid-ossp", "pg_trgm", "citext", AshPostgres.TestCustomExtension] --
Application.get_env(:ash_postgres, :no_extensions, [])
end
def min_pg_version do
%Version{major: 16, minor: 0, patch: 0}
end
def all_tenants do
Code.ensure_compiled(AshPostgres.MultitenancyTest.Org)
AshPostgres.MultitenancyTest.Org
|> Ash.read!()
|> Enum.map(&"org_#{&1.id}")
end
end