sqlc icon indicating copy to clipboard operation
sqlc copied to clipboard

Map slice elements into clauses

Open richardhuaaa opened this issue 6 months ago • 1 comments

What do you want to change?

Is there any support for passing a slice of variable length and mapping it into clauses of a postgres query, like in this pseudo-code?

SELECT
  ...
WHERE
   ...
   AND (originator_node_id NOT IN $1::int[]
     OR (originator_node_id = $1[0] AND originator_sequence_id > $2[0])
     OR (originator_node_id = $1[1] AND originator_sequence_id > $2[1])
     ...
     );

What database engines need to be changed?

PostgreSQL

What programming language backends need to be changed?

Go

richardhuaaa avatar Sep 04 '24 00:09 richardhuaaa