Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Slick support methods 'inSet' or 'in' for tuples?

I'm using Slick 2.1.0 and PostgreSQL 9.x.

How can I make this SQL (correct for postgresql) using Slick lifted query:

select * from someObjects 
            where (key, value) in (('k1', 'value1'), ('k2', 'value2'));

This code is not works (can't resolve symbol 'in'):

someObjects.filter { o => 
    (o.key, o.value) in (("k1", "value1"), ("k2", "value2")) 
}
like image 257
John Mullins Avatar asked Sep 29 '22 22:09

John Mullins


1 Answers

No. There is a mailing list discussion telling how to emulate it: https://groups.google.com/d/msgid/scalaquery/6bbc7e19-07d2-43fb-b378-7db82ca78664%40googlegroups.com

The feature request is here: https://github.com/slick/slick/issues/517

like image 174
cvogt Avatar answered Oct 08 '22 02:10

cvogt