mirror of
https://github.com/ash-project/ash_postgres.git
synced 2024-09-20 05:23:18 +12:00
improvement: add default implementation for pg_version, and rename to min_pg_version
This commit is contained in:
parent
c41b7f3fab
commit
3647fc42ee
10 changed files with 90 additions and 73 deletions
|
@ -118,7 +118,7 @@
|
||||||
{Credo.Check.Refactor.CondStatements, []},
|
{Credo.Check.Refactor.CondStatements, []},
|
||||||
{Credo.Check.Refactor.CyclomaticComplexity, false},
|
{Credo.Check.Refactor.CyclomaticComplexity, false},
|
||||||
{Credo.Check.Refactor.FunctionArity, [max_arity: 10]},
|
{Credo.Check.Refactor.FunctionArity, [max_arity: 10]},
|
||||||
{Credo.Check.Refactor.LongQuoteBlocks, []},
|
{Credo.Check.Refactor.LongQuoteBlocks, false},
|
||||||
{Credo.Check.Refactor.MapInto, []},
|
{Credo.Check.Refactor.MapInto, []},
|
||||||
{Credo.Check.Refactor.MatchInCondition, []},
|
{Credo.Check.Refactor.MatchInCondition, []},
|
||||||
{Credo.Check.Refactor.NegatedConditionsInUnless, []},
|
{Credo.Check.Refactor.NegatedConditionsInUnless, []},
|
||||||
|
|
|
@ -4,15 +4,9 @@ There are only three breaking changes in this release, one of them is very signi
|
||||||
|
|
||||||
# AshPostgres officially supports only postgresql version 14 or higher
|
# AshPostgres officially supports only postgresql version 14 or higher
|
||||||
|
|
||||||
You will need to configure your repo version in the `pg_version/0` callback in your repo. For example:
|
A new callback `min_pg_version/0` has been added to the repo, but a default implementation is set up that reads the version from postgres directly, the first time it is required. It is cached until the repo is reinitialized, at which point it is looked up again.
|
||||||
|
|
||||||
```elixir
|
While _most_ things will work with versions as low as 9, we are relying on features of newer postgres versions and intend to do so more in the future. We will not be testing against versions lower than 14, and we will not be supporting them. If you are using an older version of postgres, you will need to upgrade.
|
||||||
def pg_version do
|
|
||||||
Version.parse!("14.0.0")
|
|
||||||
end
|
|
||||||
```
|
|
||||||
|
|
||||||
While _most_ things will work with versions as low as 11, we are relying on features of newer postgres versions. We will not be testing against versions lower than 14, and we will not be supporting them. If you are using an older version of postgres, you will need to upgrade.
|
|
||||||
|
|
||||||
If you _must_ use an older version, the only thing that you'll need to change in the short term is to handle the fact that we now use `gen_random_uuid()` as the default for generated uuids (see below), which is only available after postgres _13_. Additionally, if you are on postgres 12 or earlier, you will need to replace `ANYCOMPATIBLE` with `ANYELEMENT` in the `ash-functions` extension migration.
|
If you _must_ use an older version, the only thing that you'll need to change in the short term is to handle the fact that we now use `gen_random_uuid()` as the default for generated uuids (see below), which is only available after postgres _13_. Additionally, if you are on postgres 12 or earlier, you will need to replace `ANYCOMPATIBLE` with `ANYELEMENT` in the `ash-functions` extension migration.
|
||||||
|
|
||||||
|
|
|
@ -385,7 +385,6 @@ defmodule AshPostgres.DataLayer do
|
||||||
use Spark.Dsl.Extension,
|
use Spark.Dsl.Extension,
|
||||||
sections: @sections,
|
sections: @sections,
|
||||||
verifiers: [
|
verifiers: [
|
||||||
AshPostgres.Verifiers.VerifyPostgresVersion,
|
|
||||||
AshPostgres.Verifiers.PreventMultidimensionalArrayAggregates,
|
AshPostgres.Verifiers.PreventMultidimensionalArrayAggregates,
|
||||||
AshPostgres.Verifiers.ValidateReferences,
|
AshPostgres.Verifiers.ValidateReferences,
|
||||||
AshPostgres.Verifiers.PreventAttributeMultitenancyAndNonFullMatchType,
|
AshPostgres.Verifiers.PreventAttributeMultitenancyAndNonFullMatchType,
|
||||||
|
|
|
@ -17,13 +17,13 @@ defmodule AshPostgres.DataLayer.Info do
|
||||||
@doc "Checks a version requirement against the resource's repo's postgres version"
|
@doc "Checks a version requirement against the resource's repo's postgres version"
|
||||||
def pg_version_matches?(resource, requirement) do
|
def pg_version_matches?(resource, requirement) do
|
||||||
resource
|
resource
|
||||||
|> pg_version()
|
|> min_pg_version()
|
||||||
|> Version.match?(requirement)
|
|> Version.match?(requirement)
|
||||||
end
|
end
|
||||||
|
|
||||||
@doc "Gets the resource's repo's postgres version"
|
@doc "Gets the resource's repo's postgres version"
|
||||||
def pg_version(resource) do
|
def min_pg_version(resource) do
|
||||||
case repo(resource, :read).pg_version() do
|
case repo(resource, :read).min_pg_version() do
|
||||||
%Version{} = version -> version
|
%Version{} = version -> version
|
||||||
string when is_binary(string) -> Version.parse!(string)
|
string when is_binary(string) -> Version.parse!(string)
|
||||||
end
|
end
|
||||||
|
|
87
lib/repo.ex
87
lib/repo.ex
|
@ -45,7 +45,7 @@ defmodule AshPostgres.Repo do
|
||||||
@callback installed_extensions() :: [String.t() | module()]
|
@callback installed_extensions() :: [String.t() | module()]
|
||||||
|
|
||||||
@doc "Configure the version of postgres that is being used."
|
@doc "Configure the version of postgres that is being used."
|
||||||
@callback pg_version() :: Version.t()
|
@callback min_pg_version() :: Version.t()
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
Use this to inform the data layer about the oldest potential postgres version it will be run on.
|
Use this to inform the data layer about the oldest potential postgres version it will be run on.
|
||||||
|
@ -86,6 +86,7 @@ defmodule AshPostgres.Repo do
|
||||||
otp_app: otp_app
|
otp_app: otp_app
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@agent __MODULE__.AshPgVersion
|
||||||
@behaviour AshPostgres.Repo
|
@behaviour AshPostgres.Repo
|
||||||
|
|
||||||
defoverridable insert: 2, insert: 1, insert!: 2, insert!: 1
|
defoverridable insert: 2, insert: 1, insert!: 2, insert!: 1
|
||||||
|
@ -98,7 +99,6 @@ defmodule AshPostgres.Repo do
|
||||||
def create?, do: true
|
def create?, do: true
|
||||||
def drop?, do: true
|
def drop?, do: true
|
||||||
|
|
||||||
|
|
||||||
def transaction!(fun) do
|
def transaction!(fun) do
|
||||||
case fun.() do
|
case fun.() do
|
||||||
{:ok, value} -> value
|
{:ok, value} -> value
|
||||||
|
@ -119,7 +119,19 @@ defmodule AshPostgres.Repo do
|
||||||
"""
|
"""
|
||||||
end
|
end
|
||||||
|
|
||||||
def init(_, config) do
|
def init(type, config) do
|
||||||
|
if type == :supervisor do
|
||||||
|
try do
|
||||||
|
Agent.stop(@agent)
|
||||||
|
rescue
|
||||||
|
_ ->
|
||||||
|
:ok
|
||||||
|
catch
|
||||||
|
_, _ ->
|
||||||
|
:ok
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
new_config =
|
new_config =
|
||||||
config
|
config
|
||||||
|> Keyword.put(:installed_extensions, installed_extensions())
|
|> Keyword.put(:installed_extensions, installed_extensions())
|
||||||
|
@ -193,6 +205,74 @@ defmodule AshPostgres.Repo do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def min_pg_version do
|
||||||
|
if version = cached_version() do
|
||||||
|
version
|
||||||
|
else
|
||||||
|
lookup_version()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
defp cached_version do
|
||||||
|
Agent.start_link(
|
||||||
|
fn ->
|
||||||
|
lookup_version()
|
||||||
|
end,
|
||||||
|
name: @agent
|
||||||
|
)
|
||||||
|
|
||||||
|
Agent.get(@agent, fn state -> state end)
|
||||||
|
end
|
||||||
|
|
||||||
|
defp lookup_version do
|
||||||
|
version_string =
|
||||||
|
try do
|
||||||
|
query!("SELECT version()").rows |> Enum.at(0) |> Enum.at(0)
|
||||||
|
rescue
|
||||||
|
error ->
|
||||||
|
reraise """
|
||||||
|
Got an error while trying to read postgres version
|
||||||
|
|
||||||
|
Error:
|
||||||
|
|
||||||
|
#{inspect(error)}
|
||||||
|
""",
|
||||||
|
__STACKTRACE__
|
||||||
|
end
|
||||||
|
|
||||||
|
try do
|
||||||
|
version_string
|
||||||
|
|> String.split(" ")
|
||||||
|
|> Enum.at(1)
|
||||||
|
|> String.split(".")
|
||||||
|
|> case do
|
||||||
|
[major] ->
|
||||||
|
"#{major}.0.0"
|
||||||
|
|
||||||
|
[major, minor] ->
|
||||||
|
"#{major}.#{minor}.0"
|
||||||
|
|
||||||
|
other ->
|
||||||
|
Enum.join(other, ".")
|
||||||
|
end
|
||||||
|
|> Version.parse!()
|
||||||
|
rescue
|
||||||
|
error ->
|
||||||
|
reraise(
|
||||||
|
"""
|
||||||
|
Could not parse postgres version from version string: "#{version_string}"
|
||||||
|
|
||||||
|
You may need to define the `min_version/0` callback yourself.
|
||||||
|
|
||||||
|
Error:
|
||||||
|
|
||||||
|
#{inspect(error)}
|
||||||
|
""",
|
||||||
|
__STACKTRACE__
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def from_ecto(other), do: other
|
def from_ecto(other), do: other
|
||||||
|
|
||||||
def to_ecto(nil), do: nil
|
def to_ecto(nil), do: nil
|
||||||
|
@ -230,6 +310,7 @@ defmodule AshPostgres.Repo do
|
||||||
defoverridable init: 2,
|
defoverridable init: 2,
|
||||||
on_transaction_begin: 1,
|
on_transaction_begin: 1,
|
||||||
installed_extensions: 0,
|
installed_extensions: 0,
|
||||||
|
min_pg_version: 0,
|
||||||
all_tenants: 0,
|
all_tenants: 0,
|
||||||
tenant_migrations_path: 0,
|
tenant_migrations_path: 0,
|
||||||
default_prefix: 0,
|
default_prefix: 0,
|
||||||
|
|
|
@ -1,37 +0,0 @@
|
||||||
defmodule AshPostgres.Verifiers.VerifyPostgresVersion do
|
|
||||||
@moduledoc false
|
|
||||||
use Spark.Dsl.Verifier
|
|
||||||
|
|
||||||
def verify(dsl) do
|
|
||||||
read_repo = AshPostgres.DataLayer.Info.repo(dsl, :read)
|
|
||||||
mutate_repo = AshPostgres.DataLayer.Info.repo(dsl, :mutate)
|
|
||||||
|
|
||||||
read_version =
|
|
||||||
read_repo.pg_version() |> parse!(read_repo)
|
|
||||||
|
|
||||||
mutation_version = mutate_repo.pg_version() |> parse!(mutate_repo)
|
|
||||||
|
|
||||||
if Version.match?(read_version, ">= 14.0.0") && Version.match?(mutation_version, ">= 14.0.0") do
|
|
||||||
:ok
|
|
||||||
else
|
|
||||||
{:error, "AshPostgres only supports postgres versions >= 14.0."}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
defp parse!(%Version{} = version, _repo) do
|
|
||||||
version
|
|
||||||
end
|
|
||||||
|
|
||||||
defp parse!(version, repo) do
|
|
||||||
Version.parse!(version)
|
|
||||||
rescue
|
|
||||||
e ->
|
|
||||||
reraise ArgumentError,
|
|
||||||
"""
|
|
||||||
Failed to parse version in `#{inspect(repo)}.pg_version()`: #{inspect(version)}
|
|
||||||
|
|
||||||
Error: #{Exception.message(e)}
|
|
||||||
""",
|
|
||||||
__STACKTRACE__
|
|
||||||
end
|
|
||||||
end
|
|
0
lib/version_agent.ex
Normal file
0
lib/version_agent.ex
Normal file
4
mix.lock
4
mix.lock
|
@ -8,11 +8,9 @@
|
||||||
"decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"},
|
"decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"},
|
||||||
"deep_merge": {:hex, :deep_merge, "1.0.0", "b4aa1a0d1acac393bdf38b2291af38cb1d4a52806cf7a4906f718e1feb5ee961", [:mix], [], "hexpm", "ce708e5f094b9cd4e8f2be4f00d2f4250c4095be93f8cd6d018c753894885430"},
|
"deep_merge": {:hex, :deep_merge, "1.0.0", "b4aa1a0d1acac393bdf38b2291af38cb1d4a52806cf7a4906f718e1feb5ee961", [:mix], [], "hexpm", "ce708e5f094b9cd4e8f2be4f00d2f4250c4095be93f8cd6d018c753894885430"},
|
||||||
"dialyxir": {:hex, :dialyxir, "1.4.3", "edd0124f358f0b9e95bfe53a9fcf806d615d8f838e2202a9f430d59566b6b53b", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "bf2cfb75cd5c5006bec30141b131663299c661a864ec7fbbc72dfa557487a986"},
|
"dialyxir": {:hex, :dialyxir, "1.4.3", "edd0124f358f0b9e95bfe53a9fcf806d615d8f838e2202a9f430d59566b6b53b", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "bf2cfb75cd5c5006bec30141b131663299c661a864ec7fbbc72dfa557487a986"},
|
||||||
"earmark": {:hex, :earmark, "1.4.46", "8c7287bd3137e99d26ae4643e5b7ef2129a260e3dcf41f251750cb4563c8fb81", [:mix], [], "hexpm", "798d86db3d79964e759ddc0c077d5eb254968ed426399fbf5a62de2b5ff8910a"},
|
|
||||||
"earmark_parser": {:hex, :earmark_parser, "1.4.39", "424642f8335b05bb9eb611aa1564c148a8ee35c9c8a8bba6e129d51a3e3c6769", [:mix], [], "hexpm", "06553a88d1f1846da9ef066b87b57c6f605552cfbe40d20bd8d59cc6bde41944"},
|
"earmark_parser": {:hex, :earmark_parser, "1.4.39", "424642f8335b05bb9eb611aa1564c148a8ee35c9c8a8bba6e129d51a3e3c6769", [:mix], [], "hexpm", "06553a88d1f1846da9ef066b87b57c6f605552cfbe40d20bd8d59cc6bde41944"},
|
||||||
"ecto": {:hex, :ecto, "3.11.2", "e1d26be989db350a633667c5cda9c3d115ae779b66da567c68c80cfb26a8c9ee", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "3c38bca2c6f8d8023f2145326cc8a80100c3ffe4dcbd9842ff867f7fc6156c65"},
|
"ecto": {:hex, :ecto, "3.11.2", "e1d26be989db350a633667c5cda9c3d115ae779b66da567c68c80cfb26a8c9ee", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "3c38bca2c6f8d8023f2145326cc8a80100c3ffe4dcbd9842ff867f7fc6156c65"},
|
||||||
"ecto_sql": {:hex, :ecto_sql, "3.11.1", "e9abf28ae27ef3916b43545f9578b4750956ccea444853606472089e7d169470", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.11.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.6.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.16.0 or ~> 0.17.0 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "ce14063ab3514424276e7e360108ad6c2308f6d88164a076aac8a387e1fea634"},
|
"ecto_sql": {:hex, :ecto_sql, "3.11.1", "e9abf28ae27ef3916b43545f9578b4750956ccea444853606472089e7d169470", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.11.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.6.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.16.0 or ~> 0.17.0 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "ce14063ab3514424276e7e360108ad6c2308f6d88164a076aac8a387e1fea634"},
|
||||||
"elixir_make": {:hex, :elixir_make, "0.8.3", "d38d7ee1578d722d89b4d452a3e36bcfdc644c618f0d063b874661876e708683", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:certifi, "~> 2.0", [hex: :certifi, repo: "hexpm", optional: true]}], "hexpm", "5c99a18571a756d4af7a4d89ca75c28ac899e6103af6f223982f09ce44942cc9"},
|
|
||||||
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
|
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
|
||||||
"ets": {:hex, :ets, "0.9.0", "79c6a6c205436780486f72d84230c6cba2f8a9920456750ddd1e47389107d5fd", [:mix], [], "hexpm", "2861fdfb04bcaeff370f1a5904eec864f0a56dcfebe5921ea9aadf2a481c822b"},
|
"ets": {:hex, :ets, "0.9.0", "79c6a6c205436780486f72d84230c6cba2f8a9920456750ddd1e47389107d5fd", [:mix], [], "hexpm", "2861fdfb04bcaeff370f1a5904eec864f0a56dcfebe5921ea9aadf2a481c822b"},
|
||||||
"ex_check": {:hex, :ex_check, "0.15.0", "074b94c02de11c37bba1ca82ae5cc4926e6ccee862e57a485b6ba60fca2d8dc1", [:mix], [], "hexpm", "33848031a0c7e4209c3b4369ce154019788b5219956220c35ca5474299fb6a0e"},
|
"ex_check": {:hex, :ex_check, "0.15.0", "074b94c02de11c37bba1ca82ae5cc4926e6ccee862e57a485b6ba60fca2d8dc1", [:mix], [], "hexpm", "33848031a0c7e4209c3b4369ce154019788b5219956220c35ca5474299fb6a0e"},
|
||||||
|
@ -26,9 +24,7 @@
|
||||||
"makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"},
|
"makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"},
|
||||||
"makeup_elixir": {:hex, :makeup_elixir, "0.16.1", "cc9e3ca312f1cfeccc572b37a09980287e243648108384b97ff2b76e505c3555", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "e127a341ad1b209bd80f7bd1620a15693a9908ed780c3b763bccf7d200c767c6"},
|
"makeup_elixir": {:hex, :makeup_elixir, "0.16.1", "cc9e3ca312f1cfeccc572b37a09980287e243648108384b97ff2b76e505c3555", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "e127a341ad1b209bd80f7bd1620a15693a9908ed780c3b763bccf7d200c767c6"},
|
||||||
"makeup_erlang": {:hex, :makeup_erlang, "0.1.2", "ad87296a092a46e03b7e9b0be7631ddcf64c790fa68a9ef5323b6cbb36affc72", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "f3f5a1ca93ce6e092d92b6d9c049bcda58a3b617a8d888f8e7231c85630e8108"},
|
"makeup_erlang": {:hex, :makeup_erlang, "0.1.2", "ad87296a092a46e03b7e9b0be7631ddcf64c790fa68a9ef5323b6cbb36affc72", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "f3f5a1ca93ce6e092d92b6d9c049bcda58a3b617a8d888f8e7231c85630e8108"},
|
||||||
"nimble_options": {:hex, :nimble_options, "1.1.0", "3b31a57ede9cb1502071fade751ab0c7b8dbe75a9a4c2b5bbb0943a690b63172", [:mix], [], "hexpm", "8bbbb3941af3ca9acc7835f5655ea062111c9c27bcac53e004460dfd19008a99"},
|
|
||||||
"nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"},
|
"nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"},
|
||||||
"picosat_elixir": {:hex, :picosat_elixir, "0.2.3", "bf326d0f179fbb3b706bb2c15fbc367dacfa2517157d090fdfc32edae004c597", [:make, :mix], [{:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "f76c9db2dec9d2561ffaa9be35f65403d53e984e8cd99c832383b7ab78c16c66"},
|
|
||||||
"postgrex": {:hex, :postgrex, "0.17.4", "5777781f80f53b7c431a001c8dad83ee167bcebcf3a793e3906efff680ab62b3", [:mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "6458f7d5b70652bc81c3ea759f91736c16a31be000f306d3c64bcdfe9a18b3cc"},
|
"postgrex": {:hex, :postgrex, "0.17.4", "5777781f80f53b7c431a001c8dad83ee167bcebcf3a793e3906efff680ab62b3", [:mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "6458f7d5b70652bc81c3ea759f91736c16a31be000f306d3c64bcdfe9a18b3cc"},
|
||||||
"reactor": {:hex, :reactor, "0.8.1", "1aec71d16083901277727c8162f6dd0f07e80f5ca98911b6ef4f2c95e6e62758", [:mix], [{:libgraph, "~> 0.16", [hex: :libgraph, repo: "hexpm", optional: false]}, {:spark, "~> 2.0", [hex: :spark, repo: "hexpm", optional: false]}, {:splode, "~> 0.2", [hex: :splode, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.2", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "ae3936d97a3e4a316744f70c77b85345b08b70da334024c26e6b5eb8ede1246b"},
|
"reactor": {:hex, :reactor, "0.8.1", "1aec71d16083901277727c8162f6dd0f07e80f5ca98911b6ef4f2c95e6e62758", [:mix], [{:libgraph, "~> 0.16", [hex: :libgraph, repo: "hexpm", optional: false]}, {:spark, "~> 2.0", [hex: :spark, repo: "hexpm", optional: false]}, {:splode, "~> 0.2", [hex: :splode, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.2", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "ae3936d97a3e4a316744f70c77b85345b08b70da334024c26e6b5eb8ede1246b"},
|
||||||
"simple_sat": {:hex, :simple_sat, "0.1.1", "68a5ebe6f6d5956bd806e4881c495692c14580a2f1a4420488985abd0fba2119", [:mix], [], "hexpm", "63571218f92ff029838df7645eb8f0c38df8ed60d2d14578412a8d142a94471e"},
|
"simple_sat": {:hex, :simple_sat, "0.1.1", "68a5ebe6f6d5956bd806e4881c495692c14580a2f1a4420488985abd0fba2119", [:mix], [], "hexpm", "63571218f92ff029838df7645eb8f0c38df8ed60d2d14578412a8d142a94471e"},
|
||||||
|
|
|
@ -7,18 +7,6 @@ defmodule AshPostgres.TestNoSandboxRepo do
|
||||||
send(self(), data)
|
send(self(), data)
|
||||||
end
|
end
|
||||||
|
|
||||||
def pg_version do
|
|
||||||
version =
|
|
||||||
case System.get_env("PG_VERSION") do
|
|
||||||
nil -> "16.0.0"
|
|
||||||
"14" -> "14.0.0"
|
|
||||||
"15" -> "15.0.0"
|
|
||||||
"16" -> "16.0.0"
|
|
||||||
end
|
|
||||||
|
|
||||||
Version.parse!(version)
|
|
||||||
end
|
|
||||||
|
|
||||||
def installed_extensions do
|
def installed_extensions do
|
||||||
["ash-functions", "uuid-ossp", "pg_trgm", "citext", AshPostgres.TestCustomExtension] --
|
["ash-functions", "uuid-ossp", "pg_trgm", "citext", AshPostgres.TestCustomExtension] --
|
||||||
Application.get_env(:ash_postgres, :no_extensions, [])
|
Application.get_env(:ash_postgres, :no_extensions, [])
|
||||||
|
|
|
@ -7,10 +7,6 @@ defmodule AshPostgres.TestRepo do
|
||||||
send(self(), data)
|
send(self(), data)
|
||||||
end
|
end
|
||||||
|
|
||||||
def pg_version do
|
|
||||||
Version.parse!(System.get_env("PG_VERSION") || "16.0.0")
|
|
||||||
end
|
|
||||||
|
|
||||||
def installed_extensions do
|
def installed_extensions do
|
||||||
["ash-functions", "uuid-ossp", "pg_trgm", "citext", AshPostgres.TestCustomExtension] --
|
["ash-functions", "uuid-ossp", "pg_trgm", "citext", AshPostgres.TestCustomExtension] --
|
||||||
Application.get_env(:ash_postgres, :no_extensions, [])
|
Application.get_env(:ash_postgres, :no_extensions, [])
|
||||||
|
|
Loading…
Reference in a new issue