Skip to content
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

Allow empty filter group in QueryBuilder #9

Closed
code28 opened this issue Mar 5, 2019 · 0 comments · Fixed by #195
Closed

Allow empty filter group in QueryBuilder #9

code28 opened this issue Mar 5, 2019 · 0 comments · Fixed by #195
Labels
bug Something isn't working

Comments

@code28
Copy link

code28 commented Mar 5, 2019

This issue is a reminder to allow empty filter groups in QueryBuilder, which was fixed for Vapor 3 in vapor/fluent#616.


When using the QueryBuilder and a filter group, the resulting SQL statement should be correct, even if no filters are provided.

The usage

User.query(on: req).group(.or) { query in
    // No filters here...
}.all()

Expected behavior

No filters, so no restrictions on the query, so the statement should be:
SELECT * FROM "User" WHERE [].

@tanner0101 tanner0101 added the enhancement New feature or request label Mar 5, 2019
@tanner0101 tanner0101 added bug Something isn't working and removed enhancement New feature or request labels Mar 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants