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

Slim query root #131

Merged
merged 20 commits into from
Jul 22, 2023
Merged

Slim query root #131

merged 20 commits into from
Jul 22, 2023

Conversation

karatakis
Copy link
Collaborator

PR Info

New Features

  • Slim down generated code in query_root.rs

Breaking Changes

  • Need to use the flag seaography when generating entities using sea-orm-cli

Changes

  • The way the query_root.rs file is generated

* Add `RelationBuilder` trait
* Use seaography flag on generation
* Use DeriveRelatedEntity macro
* Slim down parsing
* Slim down code generation
Copy link
Member

@billy1624 billy1624 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work!! The API looks really good!

Can we make register_entity!() take an array of entity module paths?

examples/sqlite/src/query_root.rs Outdated Show resolved Hide resolved
src/builder.rs Show resolved Hide resolved
Copy link
Member

@billy1624 billy1624 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @karatakis, I added a commit here f23b1af

To support the following commit in SeaQL/sea-orm#1599

  1. A demo for how to construct the async-graphql query root for entity with/without RelatedEntity c84294e

@tyt2y3
Copy link
Member

tyt2y3 commented May 18, 2023

I think we should keep register_entities as is, and only introduce a new macro may be called register_entities_without_relation?

@billy1624
Copy link
Member

Okay, keep the name of commonly used marco short :P

Copy link
Member

@billy1624 billy1624 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @karatakis, I just updated all three examples, please check :)

@tyt2y3
Copy link
Member

tyt2y3 commented May 18, 2023

Looks very good

@billy1624 billy1624 marked this pull request as ready for review May 19, 2023 15:39
Copy link
Member

@billy1624 billy1624 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @tyt2y3 @karatakis, please review

@tyt2y3 tyt2y3 self-requested a review May 20, 2023 14:26
@karatakis karatakis merged commit d9f5e2f into main Jul 22, 2023
@karatakis karatakis deleted the slim-query-root branch July 22, 2023 13:37
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.

Reduce the generated code in file query_root.rs
3 participants