pardom-zz/Ollie

Multiple Conditions?

StephenBlackWasAlreadyTaken opened this issue · 2 comments

I feel like I must be doing something wrong, but is there no way to chain multiple conditions in a single query

Select.from(SomeTable.class)
  .where("a > ?", something)
  .where("b > ?", something_else)
  .fetch()`

Correct, in the spirit of not straying from SQL syntax, each clause can only be called once unless otherwise specified: https://www.sqlite.org/syntax/select-stmt.html Expressions should be combined with the appropriate AND, OR, IN, etc.

Your example should be written like this:

Select.from(SomeTable.class)
  .where("a > ? AND b > ?", something, something_else)
  .fetch()

Thanks a ton, I knew I was missing something silly! Awesome library!!