You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now dynamic_where() only supports adding conditions in a AND relationship. E.g. according to the example
auto s = dynamic_select(db, all_of(foo)).from(foo).dynamic_where();
s.where.add(foo.id == 1);
s.where.add(foo.name == "txt");
will produce the where-clause of WHERE (foo.id = 1) AND (foo.name = 'txt') without the possibility to use for example the OR operator or group sub-expressions.
A more flexible where-clause builder capability is needed so that more complex logical expressions could be dynamically built.
If all conditions are met, the above should yield: WHERE ((foo.id = 1) AND (foo.pos = 133)) OR (foo.name = 'yay').
My real-life need is that I have to select from a table rows where I have a match on label AND a position but the number of these label-position pairs is dynamically changing, In some cases I have just one pair, in some cases I have several and I need to return all matching rows. With the current dynamic_where it is not possible as I need an OR between all my (label = "labelX" AND pos = Y) sub-expressions.
The text was updated successfully, but these errors were encountered:
Right now
dynamic_where()
only supports adding conditions in aAND
relationship. E.g. according to the examplewill produce the where-clause of
WHERE (foo.id = 1) AND (foo.name = 'txt')
without the possibility to use for example theOR
operator or group sub-expressions.A more flexible where-clause builder capability is needed so that more complex logical expressions could be dynamically built.
E.g.:
If all conditions are met, the above should yield:
WHERE ((foo.id = 1) AND (foo.pos = 133)) OR (foo.name = 'yay')
.My real-life need is that I have to select from a table rows where I have a match on label AND a position but the number of these label-position pairs is dynamically changing, In some cases I have just one pair, in some cases I have several and I need to return all matching rows. With the current
dynamic_where
it is not possible as I need anOR
between all my(label = "labelX" AND pos = Y)
sub-expressions.The text was updated successfully, but these errors were encountered: