# Ecto Postgres select ARRAY constructor

**URL:** <https://forum.elixirforum.com/t/ecto-postgres-select-array-constructor/69777>\
**Category:** Questions\
**Tags:** ecto, postgres, postgresql\
**Created:** [March 5, 2025, 7:23pm UTC](https://forum.elixirforum.com/t/ecto-postgres-select-array-constructor/69777 "2025-03-05T19:23:33Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![D4no0](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/d4no0/32/33624_2.png) [@D4no0](https://forum.elixirforum.com/u/D4no0)\
**Post date:** [March 5, 2025, 7:38pm UTC](https://forum.elixirforum.com/t/ecto-postgres-select-array-constructor/69777/2 "2025-03-05T19:38:25Z")

</div>

You could move the fragment to a macro to make the query cleaner, here is an example on how that looks like:

```elixir
defmacro st_transform(wkt, srid) do
  quote do: fragment("ST_Transform(?, ?)", unquote(wkt), unquote(srid))
end

```

---

_[View the full topic](https://forum.elixirforum.com/t/ecto-postgres-select-array-constructor/69777)._
