Skip to content

Aligning IdenStatic with its counterpart in SeaQuery - #1267

Merged
billy1624 merged 2 commits into
replace-columntype-n-idenstaticfrom
align-sea-query-iden-static
Jan 12, 2023
Merged

billy1624 merged 2 commits into
replace-columntype-n-idenstaticfrom
align-sea-query-iden-static

Conversation

@billy1624

Copy link
Copy Markdown
Member

PR Info

Breaking Changes

  • IdenStatic no longer with Debug bound

@billy1624 billy1624 self-assigned this Nov 30, 2022
Comment thread src/entity/base_entity.rs
pub trait IdenStatic: Iden + Copy + 'static {
/// Method to call to get the static string identity
fn as_str(&self) -> &str;
fn as_str(&self) -> &'static str;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

If we make this returns static reference, it'd be a massive breaking change 3cca57f

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Only if someone is using an ArrayString inside a custom Entity definition.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

User with compact entity won't be affected as well

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Only if someone is using an ArrayString inside a custom Entity definition.

Which I don't think someone had actually done that. So I am okay to this breaking change.

impl sea_orm::IdenStatic for #ident {
fn as_str(&self) -> &str {
fn as_str(&self) -> &'static str {
<Self as sea_orm::EntityName>::table_name(self)

@billy1624 billy1624 Nov 30, 2022 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Return type of table_name was being changed because of this @tyt2y3

@billy1624
billy1624 marked this pull request as ready for review January 12, 2023 05:15
@billy1624
billy1624 changed the base branch from master to replace-columntype-n-idenstatic January 12, 2023 05:15
@billy1624
billy1624 merged commit eb5f2b0 into replace-columntype-n-idenstatic Jan 12, 2023
@billy1624
billy1624 deleted the align-sea-query-iden-static branch January 12, 2023 05:15
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.

Replace SeaORM's ColumnType and IdenStatic with its SeaQuery's counterparts

2 participants