ash_postgres/test/support/string_agg.ex
Zach Daniel 68c6d7aaf8 improvement: better error messages from mix tasks
fix: various broken behavior from new aggregate work
improvement: validate that references refer to relationships

closes #99
2022-12-10 15:59:50 -05:00

14 lines
333 B
Elixir

defmodule AshPostgres.Test.StringAgg do
@moduledoc false
use Ash.Resource.Aggregate.CustomAggregate
use AshPostgres.CustomAggregate
require Ecto.Query
def dynamic(opts, binding) do
Ecto.Query.dynamic(
[],
fragment("string_agg(?, ?)", field(as(^binding), ^opts[:field]), ^opts[:delimiter])
)
end
end