where_or¶
-
BaseQueryBuilder.
where_or
(col, val, compare='=', placeholder=None)[source]¶ For adding simple col=value clause with “OR” before it (if at least 1 other clause). val is escaped properly
example: where(‘x’,’test’).where_or(‘y’,’thing’) produces prepared sql “WHERE x = %s OR y = %s”
- Parameters
col – the column, function etc. to query
val – the value it should be equal to. most python objects will be converted and escaped properly
compare – instead of ‘=’, compare using this comparator, e.g. ‘>’, ‘<=’ etc.
placeholder – Set the value placeholder, e.g. placeholder=’HOST(%s)’
- Returns
QueryBuilder object (for chaining)