Skip to content

Feat: support nested relation subqueries with sorting, pagination, and projection (the too much lines changes are caused from the generated client not me) - #37

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

Conversation

@VoidClancy

Copy link
Copy Markdown
Owner

1- Define OrderDirection (Asc, Desc) and OrderBy structs in runtime, registering them under QueryParams

2- Implement Asc() and Desc() methods on Field[T], UniqueField[T], StringField, and StringUniqueField to return OrderBy structs

3- Introduce model-specific SelectQuery interfaces exposing GetRelationParams() returning (Select, Omit, QueryParams)

4- Implement GetRelationParams() on both raw Select structs and QueryBuilders, allowing mixing of simple nested struct projection and subqueries

5- Remove redundant relationship fields from generated Omit structs, since relationships are never fetched unless explicitly requested

6- Refactor loadRelation[P any, C any] into modular, separate responsibility functions (compileRelationSQL, compilePartitionedRelationSQL, and compileSimpleRelationSQL helpers)

7- Add TestRelationSubqueries test suite to test complex subqueries

@VoidClancy VoidClancy self-assigned this Jul 12, 2026
@VoidClancy VoidClancy changed the title Feat: support nested relation subqueries with sorting, pagination, and projection Feat: support nested relation subqueries with sorting, pagination, and projection (the too much lines changes are caused from the generated client not me) Jul 12, 2026
@VoidClancy
VoidClancy merged commit 75db26d into master Jul 12, 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