Skip to content

Identity::Many#1326

Closed
billy1624 wants to merge 7 commits into0.12.xfrom
identity-many
Closed

Identity::Many#1326
billy1624 wants to merge 7 commits into0.12.xfrom
identity-many

Conversation

@billy1624
Copy link
Copy Markdown
Member

@billy1624 billy1624 commented Dec 21, 2022

PR Info

New Features

  • Implemented IntoIdentity for Identity
  • Identity supports up to identity tuple of DynIden with length up to 12
  • Implemented IntoIdentity for tuple of IdenStatic with length up to 12
  • Implemented IdentityOf for tuple of ColumnTrait with length up to 12
  • Implemented TryGetableMany for tuple of TryGetable with length up to 12
  • Implemented TryFromU64 for tuple of TryFromU64 with length up to 12
  • Supports entity with composite primary key of length 12
use sea_orm::entity::prelude::*;

#[derive(Clone, Debug, PartialEq, DeriveEntityModel)]
#[sea_orm(table_name = "primary_key_of_12")]
pub struct Model {
    #[sea_orm(primary_key, auto_increment = false)]
    pub id_1: String,
    #[sea_orm(primary_key, auto_increment = false)]
    pub id_2: i8,
    #[sea_orm(primary_key, auto_increment = false)]
    pub id_3: u8,
    #[sea_orm(primary_key, auto_increment = false)]
    pub id_4: i16,
    #[sea_orm(primary_key, auto_increment = false)]
    pub id_5: u16,
    #[sea_orm(primary_key, auto_increment = false)]
    pub id_6: i32,
    #[sea_orm(primary_key, auto_increment = false)]
    pub id_7: u32,
    #[sea_orm(primary_key, auto_increment = false)]
    pub id_8: i64,
    #[sea_orm(primary_key, auto_increment = false)]
    pub id_9: u64,
    #[sea_orm(primary_key, auto_increment = false)]
    pub id_10: f32,
    #[sea_orm(primary_key, auto_increment = false)]
    pub id_11: f64,
    #[sea_orm(primary_key, auto_increment = false)]
    pub id_12: bool,
    pub owner: String,
    pub name: String,
    pub description: String,
}

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

impl ActiveModelBehavior for ActiveModel {}

Breaking Changes

  • Added Identity::Many

@billy1624 billy1624 self-assigned this Dec 21, 2022
@billy1624 billy1624 mentioned this pull request Dec 21, 2022
2 tasks
@billy1624 billy1624 requested a review from tyt2y3 December 21, 2022 09:31
@billy1624 billy1624 marked this pull request as ready for review December 21, 2022 09:31
@billy1624 billy1624 marked this pull request as draft December 23, 2022 10:41
@billy1624
Copy link
Copy Markdown
Member Author

Waiting SeaQL/sea-query#564 to be published on a new sea-query version

@billy1624 billy1624 changed the base branch from master to 0.12.x February 24, 2023 09:15
@billy1624 billy1624 marked this pull request as ready for review February 24, 2023 09:34
@billy1624
Copy link
Copy Markdown
Member Author

Hey @tyt2y3, please review :P

@billy1624
Copy link
Copy Markdown
Member Author

This will be merged into 0.12.x branch. I want the master branch point to the next 0.11.x release as of now.

@tyt2y3 tyt2y3 deleted the branch 0.12.x February 24, 2023 14:59
@tyt2y3 tyt2y3 closed this Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

large composite key table

2 participants