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

feat(examples): Adding a complex filter example #123

Merged
merged 2 commits into from
Feb 17, 2025

Conversation

Jacobbrewer1
Copy link
Owner

Describe your changes

This pull request introduces a new example for creating complex filters using the Joiner and Wherer interfaces and makes several changes to the codebase to support this functionality. The most important changes include the addition of a new example, modifications to existing filter interfaces, and updates to the patcher package.

New Example Addition:

  • examples/complex_filter/README.md: Added a new README file that explains how to use the Joiner and Wherer interfaces to create a complex filter. This includes a database schema for the People and Contacts tables.
  • examples/complex_filter/main.go: Added a new Go file that demonstrates the creation of a complex filter using the patcher package. This includes defining Person and PersonFilter structs, implementing the Where and Join methods, and generating SQL queries.

Interface Modifications:

  • examples/joiner/main.go: Updated the NewPersonWhere and NewPersonContactJoiner functions to return patcher.Wherer and patcher.Joiner interfaces, respectively. Removed the ContactWhere struct and its associated methods. [1] [2]

Patcher Package Updates:

  • multifilter.go: Modified the MultiFilter interface to embed the new Filter interface, which combines the Joiner and Wherer interfaces.

@Jacobbrewer1 Jacobbrewer1 enabled auto-merge (squash) February 17, 2025 13:30
@Jacobbrewer1 Jacobbrewer1 merged commit 0cc9600 into main Feb 17, 2025
6 checks passed
@Jacobbrewer1 Jacobbrewer1 deleted the feat/complex-example branch February 17, 2025 13:31
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.

1 participant