Search code examples
scalaormsqueryl

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


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

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

???


Solution

  • 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.