mirror of
https://github.com/ash-project/ash_postgres.git
synced 2024-09-20 21:43:12 +12:00
10cf60cdc1
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.
26 lines
616 B
Elixir
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
|