Skip to content

Feat: make FindUnique variadic with at least 1 required unique field - #38

Merged
VoidClancy merged 1 commit into
masterfrom
codegen-READ
Jul 13, 2026
Merged

Feat: make FindUnique variadic with at least 1 required unique field#38
VoidClancy merged 1 commit into
masterfrom
codegen-READ

Conversation

@VoidClancy

Copy link
Copy Markdown
Owner

1- Add an additional []Predicate field on FindUniqueBuilder, update the query execution function signatures (execFunc) to accept additional []Predicate

2- Update delegate's FindUnique method signature to accept a variadic list of additional predicates: FindUnique(where UniquePredicate, additional ...Predicate)

3- Update execute{{Model}}FindUnique to validate and append the additional predicates, compiling them into the WHERE clause using an AND conjunction

4- Add TestFindUniqueExtended in integration/read_test.go to verify that passing a mix of unique and non-unique fields filters lookups correctly

@VoidClancy VoidClancy self-assigned this Jul 13, 2026
@VoidClancy
VoidClancy merged commit e1ba93c into master Jul 13, 2026
3 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.

1 participant