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

fix multi filtering for gorm 1.25.6 #5

Merged
merged 1 commit into from
Jan 29, 2024

Conversation

bramca
Copy link

@bramca bramca commented Jan 29, 2024

gorm 1.25.6 update changed the way a where clause with multiple expressions is represented.
I the previous version it was stored as an array of multiple clause.Eq expressions.
In 1.25.6 it changed to be an array of clause.AndConditions expressions which in turn can contain an array clause.Eq expressions or other clause.AndConditions expressions.

This broke the test case regarding the "multi filter".

A recursive function was added to fix this issue, going recursively into the clause.AndConditions.

Copy link

@WilliamDeKeyzer WilliamDeKeyzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good solve!

Copy link
Owner

@survivorbat survivorbat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks for the contribution!

@survivorbat survivorbat merged commit 965e83d into survivorbat:master Jan 29, 2024
2 checks passed
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.

None yet

3 participants