mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-14 07:33:28 +01:00
Correct way to combine where clauses? #324
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @zachwaugh on GitHub (Mar 26, 2020).
I'm wondering the best way to build a query with conditionals. It looks something like this where we optional want to limit the query based on some state.
That will do an
OR, but I want it to be anAND. The closest I've found is doing this:That seems to work, but feels like maybe I'm missing a simpler way? Also, this is a contrived example, but I'd like to be able to pass in an existing
FetchChainBuilder<Post>from elsewhere and appendWhereclauses usingANDas well. Ideally, we'd have an API like:Thanks!
@JohnEstropia commented on GitHub (Mar 27, 2020):
You can use an array of
Whereclauses:@zachwaugh commented on GitHub (Mar 27, 2020):
Wow, that’s exactly what I was looking for, not sure I how I missed it. Thank you!