Last active 1752987893

Adding a check of an elixir list compared to a PostgreSQL array

gaiety's Avatar gaiety revised this gist 1752987893. Go to revision

2 files changed, 6 insertions, 6 deletions

ecto-dynamic-list-within-list-query.ex(file created)

@@ -0,0 +1,6 @@
1 + def query(filters, dynamic) do
2 + dynamic(
3 + [features],
4 + ^dynamic and fragment("? && ?::varchar[]", ^features, item.features)
5 + )
6 + end

ecto-dynamic-list-within-list-query.sh (file deleted)

@@ -1,6 +0,0 @@
1 - def query(filters, dynamic) do
2 - dynamic(
3 - [keyboards],
4 - ^dynamic and fragment("? && ?::varchar[]", ^filters, keyboards.filters)
5 - )
6 - end

gaiety's Avatar gaiety revised this gist 1752987792. Go to revision

1 file changed, 6 insertions

ecto-dynamic-list-within-list-query.sh(file created)

@@ -0,0 +1,6 @@
1 + def query(filters, dynamic) do
2 + dynamic(
3 + [keyboards],
4 + ^dynamic and fragment("? && ?::varchar[]", ^filters, keyboards.filters)
5 + )
6 + end
Newer Older