what is the correct syntax for squeryl to write or and?

95 views Asked by At

What is the correct syntax to write sql like this squeryl:

select * 
    from table
      where 
        (colA = 'value1' or colA = 'value2' )
         and colB = 'value3'

???

1

There are 1 answers

0
SergGr On BEST ANSWER

The example under the Nesting Sub Queries suggests that you should use simple and and or. Have you tried this? I mean something straightforward like:

table.where(t =>
    ((t.colA === "value1") or (t.colA === "value2"))
     and (t.colB === "value3"))

Code like this seems to work fine for me.