Skip to content

Feat: enforce compile-time model-safe query predicates - #40

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

Feat: enforce compile-time model-safe query predicates#40
VoidClancy merged 1 commit into
masterfrom
codegen-READ

Conversation

@VoidClancy

@VoidClancy VoidClancy commented Jul 14, 2026

Copy link
Copy Markdown
Owner

1- Define PredicateOf[M] interface instead of Predicate, with a phantom(M) method to differentiate between models at compile-time

2- Define Predicate[M] and UniquePredicate[M] structs that house predicate data and implement PredicateOf[M]

3- Adapt Field[M, T], UniqueField[M, T], StringField[M], and StringUniqueField[M] to be parameterized by model type M, ensuring returned predicates are model-specific

4- Refactor logical operator helpers And[M], Or[M], and Not[M] to be generic over the model type parameter

5- Parameterize QueryParams[M] and update FindUniqueBuilder, FindFirstBuilder, and FindManyBuilder to accept model-scoped predicates

6- Update relation query generation helpers and loaders to work with the generic QueryParams[M] container

@VoidClancy VoidClancy self-assigned this Jul 14, 2026
@VoidClancy
VoidClancy merged commit 6327c3e into master Jul 14, 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