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

Codegen for compact Entity format #138

Closed
3 tasks done
tyt2y3 opened this issue Sep 9, 2021 · 3 comments · Fixed by #143
Closed
3 tasks done

Codegen for compact Entity format #138

tyt2y3 opened this issue Sep 9, 2021 · 3 comments · Fixed by #143
Assignees

Comments

@tyt2y3
Copy link
Member

tyt2y3 commented Sep 9, 2021

I think it's better for us to preserve the functionality to generate the current long Entity format, and can be switched on with a command line arguemnt.

  • update codegen
  • update sea-orm-cli to generate short format by default
  • update docs
@billy1624 billy1624 added this to the 0.3.0 milestone Sep 9, 2021
@billy1624
Copy link
Member

So, at the end the codegen can produce codes of one of the formats? Let say, compact & expanded format.

@billy1624 billy1624 changed the title Codegen for short Entity format Codegen for compact Entity format Sep 10, 2021
@billy1624 billy1624 self-assigned this Sep 10, 2021
@tyt2y3 tyt2y3 reopened this Sep 15, 2021
@tyt2y3 tyt2y3 modified the milestones: 0.3.0, 0.2.0 Sep 15, 2021
@billy1624 billy1624 mentioned this issue Sep 16, 2021
11 tasks
billy1624 added a commit to SeaQL/seaql.github.io that referenced this issue Sep 17, 2021
@tyt2y3
Copy link
Member Author

tyt2y3 commented Sep 17, 2021

sea-orm-codegen 0.2.2 released

@tyt2y3 tyt2y3 closed this as completed Sep 17, 2021
@tyt2y3
Copy link
Member Author

tyt2y3 commented Sep 18, 2021

I discovered a slightly strange behavior, is when there no relation, it will not derive DeriveRelation for the Relation enum.

// Filling.rs

#[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {}

impl RelationTrait for Relation {
    fn def(&self) -> RelationDef {
        match self {
            _ => panic!("No RelationDef"),
        }
    }
}

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 a pull request may close this issue.

2 participants