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

WhereClause: A new dedicated builder for WHERE #147

Merged
merged 4 commits into from
Apr 15, 2024
Merged

Conversation

huandu
Copy link
Owner

@huandu huandu commented Apr 13, 2024

Due to the importance of the WHERE statement in SQL, we often need to continuously append conditions and even share some common WHERE conditions among different builders. Therefore, we abstract the WHERE statement into a WhereClause struct, which can be used to create reusable WHERE conditions.

SelectBuilder, UpdateBuilder and DeleteBuilder have a new anonymous field WhereClause now to expose necessary APIs. Read the samples in the file whereclause_test.go as HOW-TO documents for WhereClause in all kinds of scenarios.

@coveralls
Copy link

coveralls commented Apr 13, 2024

Coverage Status

coverage: 96.32% (+0.02%) from 96.304%
when pulling 3771160 on feature-where-clause
into c35040f on master.

@huandu huandu merged commit 306be21 into master Apr 15, 2024
2 checks passed
@huandu huandu deleted the feature-where-clause branch April 15, 2024 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants