Skip to content

Add and and or functions #799

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 18, 2021
Merged

Add and and or functions #799

merged 3 commits into from
Aug 18, 2021

Conversation

davedelong
Copy link
Contributor

When you're programmatically building a query to execute, you have times where you build a variable number of clauses by which you filter a table. There isn't a great way to turn an Array<Expression<Bool>> into an Expression<Bool>, short of making a large (a AND (b AND (c AND (d AND e)))) expression.

and and or fix this by allowing you to turn an Array<Expression<Bool>> directly into a lower-complexity clause: (a AND b AND c AND d AND e)

When you're programmatically building a query to execute, you have times where you build a variable number of clauses by which you filter a table. There isn't a great way to turn an `Array<Expression<Bool>>` into an `Expression<Bool>`, short of making a large `(a AND (b AND (c AND (d AND e))))` expression.

`and` and `or` fix this by allowing you to turn an `Array<Expression<Bool>>` directly into a lower-complexity clause: `(a AND b AND c AND d AND e)`
@davedelong
Copy link
Contributor Author

Hello?

@KyleLeneau
Copy link

Cool!

@stephanheilner
Copy link
Contributor

Would this replace the .filter?

@davedelong
Copy link
Contributor Author

A year and a half later, I find myself needing this again.

Is there anyone around who's interested in merging this?

sergeymild added a commit to sergeymild/SQLite.swift that referenced this pull request Jun 9, 2020
@nathanfallet nathanfallet merged commit 6cb4e06 into stephencelis:master Aug 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants