ash_postgres/test/support/test_no_sandbox_repo.ex
Alessio Montagnani 4a02d8c6ad
improvement: custom-extension implementation (#162)
* improvement: custom-extension implementation

* improvement: allow adding custom-extension by module's reference and fixes formatting

* ci: fixes formatter
2023-08-08 10:20:26 -07:00

22 lines
579 B
Elixir

defmodule AshPostgres.TestNoSandboxRepo 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 all_tenants do
Code.ensure_compiled(AshPostgres.MultitenancyTest.Org)
AshPostgres.MultitenancyTest.Org
|> AshPostgres.MultitenancyTest.Api.read!()
|> Enum.map(&"org_#{&1.id}")
end
end