Skip to content

Commit 3cb3372

Browse files
committed
improvement: support latest ash version & operator overrides
1 parent c0c9621 commit 3cb3372

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

lib/types/types.ex

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ defmodule AshPostgres.Types do
7878
def determine_types(mod, values) do
7979
Code.ensure_compiled(mod)
8080

81+
name =
82+
if function_exported?(mod, :name, 0) do
83+
mod.name
84+
end
85+
8186
cond do
8287
:erlang.function_exported(mod, :types, 0) ->
8388
mod.types()
@@ -88,6 +93,7 @@ defmodule AshPostgres.Types do
8893
true ->
8994
[:any]
9095
end
96+
|> Enum.concat(Ash.Query.Operator.operator_overloads(name))
9197
|> Enum.map(fn types ->
9298
case types do
9399
:same ->

mix.exs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,7 @@ defmodule AshPostgres.MixProject do
204204
{:ecto, "~> 3.9"},
205205
{:jason, "~> 1.0"},
206206
{:postgrex, ">= 0.0.0"},
207-
{:ash,
208-
ash_version(github: "ash-project/ash", ref: "fe2156a9ac9e49cae44132552ce6e52aee14104c")},
207+
{:ash, ash_version("~> 2.17 and >= 2.17.20")},
209208
{:benchee, "~> 1.1", only: [:dev, :test]},
210209
{:git_ops, "~> 2.5", only: [:dev, :test]},
211210
{:ex_doc, github: "elixir-lang/ex_doc", only: [:dev, :test], runtime: false},

mix.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
%{
2-
"ash": {:git, "https://github.com/ash-project/ash.git", "fe2156a9ac9e49cae44132552ce6e52aee14104c", [ref: "fe2156a9ac9e49cae44132552ce6e52aee14104c"]},
2+
"ash": {:hex, :ash, "2.17.20", "8b201335fac2f9ec8eb89c71c7c9007d11a09089dd82aa070ed4214c7ae02400", [:mix], [{:comparable, "~> 1.0", [hex: :comparable, repo: "hexpm", optional: false]}, {:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:earmark, "~> 1.4", [hex: :earmark, repo: "hexpm", optional: false]}, {:ecto, "~> 3.7", [hex: :ecto, repo: "hexpm", optional: false]}, {:ets, "~> 0.8", [hex: :ets, repo: "hexpm", optional: false]}, {:jason, ">= 1.0.0", [hex: :jason, repo: "hexpm", optional: false]}, {:picosat_elixir, "~> 0.2", [hex: :picosat_elixir, repo: "hexpm", optional: false]}, {:plug, ">= 0.0.0", [hex: :plug, repo: "hexpm", optional: true]}, {:spark, ">= 1.1.50 and < 2.0.0-0", [hex: :spark, repo: "hexpm", optional: false]}, {:stream_data, "~> 0.6", [hex: :stream_data, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.1", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c89da37cf7464803b09cdd6f20c0b944764ea124b782cdfc72eeb9ac43a11445"},
33
"benchee": {:hex, :benchee, "1.1.0", "f3a43817209a92a1fade36ef36b86e1052627fd8934a8b937ac9ab3a76c43062", [:mix], [{:deep_merge, "~> 1.0", [hex: :deep_merge, repo: "hexpm", optional: false]}, {:statistex, "~> 1.0", [hex: :statistex, repo: "hexpm", optional: false]}], "hexpm", "7da57d545003165a012b587077f6ba90b89210fd88074ce3c60ce239eb5e6d93"},
44
"bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm", "7af5c7e09fe1d40f76c8e4f9dd2be7cebd83909f31fee7cd0e9eadc567da8353"},
55
"certifi": {:hex, :certifi, "2.9.0", "6f2a475689dd47f19fb74334859d460a2dc4e3252a3324bd2111b8f0429e7e21", [:rebar3], [], "hexpm", "266da46bdb06d6c6d35fde799bcb28d36d985d424ad7c08b5bb48f5b5cdd4641"},

0 commit comments

Comments
 (0)