When I add operations to a select
’s where
, the prior existing value is grouped together with brackets:
>>> import sql, sql.operators
>>> table = sql.Table("Test")
>>> select = table.select(table.a)
>>> select.where = sql.operators.Equal(table.b, table.c)
>>> select.where |= sql.operators.Equal(table.d, table.e)
>>> select.where |= sql.operators.Equal(table.f, table.g)
>>> str(select)
'SELECT "a"."a" FROM "Test" AS "a" WHERE ((("a"."b" = "a"."c") OR ("a"."d" = "a"."e")) OR ("a"."f" = "a"."g"))'
is there a way to get something similar to:
'SELECT "a"."a" FROM "Test" AS "a" WHERE "a"."b" = "a"."c" OR "a"."d" = "a"."e" OR "a"."f" = "a"."g"'
instead? i.e. without the brackets (the ones that control operator precedence at least).
This is on SQLite.