Closed anshap1719 closed 4 months ago
@tyt2y3 @billy1624 Can I ask for your opinions for these:
Hi @tyt2y3 @billy1624, sorry to ping you about this! Did you get a chance to look at it yet?
@billy1624 This is ready for your review in my opinion.
Thanks @billy1624
@tyt2y3 Please review.
@tyt2y3 @billy1624 Thanks for all your help as well.
Thank you everyone for the contribution! This feature is now available in the latest release. Now is a good time to upgrade! Your participation is what makes us unique; your adoption is what drives us forward. You can support SeaQL 🌊 by starring our repos, sharing our libraries and becoming a sponsor ⭐.
@anshap1719 Just wanted to inform you that this no longer works:
#[derive(EnumIter, DeriveActiveEnum)]
#[sea_orm(
rs_type = "String",
db_type = "String(Some(1))",
rename_all = "camelCase"
)]
pub enum Category {
BigTask,
SmallWork,
}
String(None)
does not work as well.
Using sea-orm 1.0.0-rc.5
.
EDIT: Nvm found the correct way:
#[derive(EnumIter, DeriveActiveEnum)]
#[sea_orm(rs_type = "String", db_type = "String(StringLen::None)", rename_all = "camelCase")]
pub enum TestEnum {
DefaultVariant, // defaultVariant
#[sea_orm(rename = "kebab-case")]
VariantKebabCase, // variant-kebab-case
#[sea_orm(rename = "snake_case")]
VariantSnakeCase, // variant_snake_case
#[sea_orm(string_value = "CuStOmStRiNgVaLuE")]
CustomStringValue, // CuStOmStRiNgVaLuE
}
Thank you everyone for the contribution! This feature is now available in the latest release. Now is a good time to upgrade! Your participation is what makes us unique; your adoption is what drives us forward. You can support SeaQL 🌊 by starring our repos, sharing our libraries and becoming a sponsor ⭐.
PR Info
New Features
column_name_case
attribute inDeriveEntityModel
for automatically generating column names for all fields based on case style provided.column_name_case
attribute in fields within a model that derivesDeriveEntityModel
for automatically generating column name based on case style provided.rename_all
attribute inDeriveActiveEnum
for automatically generating string values for all variants of the enum based on case style provided.rename
attribute for variants of anActiveEnum
that derivesDeriveActiveEnum
for automatically generating string value for it based on case style provided.Dependents