Skip to content

Allowed choosing the IN-list data structure type#132

Open
avalente wants to merge 1 commit intokrisajenkins:masterfrom
avalente:master
Open

Allowed choosing the IN-list data structure type#132
avalente wants to merge 1 commit intokrisajenkins:masterfrom
avalente:master

Conversation

@avalente
Copy link
Copy Markdown

Currently it is impossible to interact with PostgreSQL advanced data types such as arrays because vectors are intercepted for the IN clause expansion. The set data type seems more suitable (after all, semantically it is a set membership test), but I made it configurable. I didn't change the default, however: if you want to change the behaviour you have to pass an explicit option.

@dmitrig01
Copy link
Copy Markdown

I've dealt with this issue before, and an alternate solution that came to mind was naming the parameter such that it ended with "..." to indicate that it should be expanded into top-level items.

--- name: test
SELECT * FROM test WHERE x IN (:foo...) AND y = :bar

then query as (test ... {:foo... [1 2 3] :bar [2 3 4]})

Thoughts on that approach instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants