sql-psi icon indicating copy to clipboard operation
sql-psi copied to clipboard

WHERE IN many columns

Open PhilipDukhov opened this issue 3 years ago • 1 comments

Dialect: ALL

failing sql:

CREATE TABLE Test(field1 INTEGER NOT NULL, field2 INTEGER NOT NULL);

select1:
SELECT * FROM Test
WHERE (field1, field2) IN (VALUES(1,2));

select2:
SELECT * FROM Test
WHERE (field1, field2) IN ?;

',' after field1 is marked as error: (', ')', '.', <binary like operator real>, BETWEEN or IN expected, got ','

Also In second case I expect type safe class to be generated to I can use it something like this:

select2(
     listOf(
        Select2Values(field1 = 1, field2 = 2),
        Select2Values(field1 = 2, field2 = 1),
     )
)

PhilipDukhov avatar Jun 17 '21 07:06 PhilipDukhov

I think, the first case is implemented in #411. Now sqldelight needs use this to implement select2, so what about closing this issue here and create another one in sqldelight?

hfhbd avatar Aug 16 '22 15:08 hfhbd

Closed in favor of https://github.com/cashapp/sqldelight/issues/4205

hfhbd avatar May 29 '23 16:05 hfhbd