Skip to content

Commit

Permalink
fix: handle atomic array operations
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdaniel committed Sep 29, 2024
1 parent 085a9f7 commit a119ba2
Show file tree
Hide file tree
Showing 8 changed files with 734 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/sql_implementation.ex
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ defmodule AshPostgres.SqlImplementation do
do: nil

def parameterized_type(type, constraints, no_maps?) do
if type == :array do
raise "WHAT"
end

if Ash.Type.ash_type?(type) do
cast_in_query? =
if function_exported?(Ash.Type, :cast_in_query?, 2) do
Expand Down Expand Up @@ -284,6 +288,7 @@ defmodule AshPostgres.SqlImplementation do
new_returns =
case new_returns do
{:parameterized, _} = parameterized -> parameterized
{:array, _} = type -> parameterized_type(type, [])
{type, constraints} -> parameterized_type(type, constraints)
other -> other
end
Expand All @@ -292,6 +297,9 @@ defmodule AshPostgres.SqlImplementation do
{:parameterized, _} = parameterized ->
parameterized

{:array, _} = type ->
parameterized_type(type, [])

{type, constraints} ->
parameterized_type(type, constraints)

Expand Down
Loading

0 comments on commit a119ba2

Please sign in to comment.