Grzegorz Gajewski
08/01/2023, 7:23 AMOR
between two subqueries? I have a big query with subqueries build like this:
var query = query<Model>("id == $0", id)
if (otherModelId != null) {
query = query.query("otherModel.id == $0", otherModelId)
}
if (markedOnly) {
query = query("flagged == $0", true)
}
And now I need to add OR to the top level query.chrmelchior
08/01/2023, 8:18 AMquery.description()
to create a new one, something like:
var query = query<Model>("id == $0", id)
if (otherModelId != null) {
query = query.query("otherModel.id == $0 OR ${query.description()}", otherModelId)
}
if (markedOnly) {
query = query("flagged == $0 OR ${query.description()}", true)
}
(Not sure if that was the queries you wanted to OR, but hopefully you get the the idea)Grzegorz Gajewski
08/01/2023, 8:53 AM