Skip to content

Enumeration String no longer supports certain characters #1851

Closed
@byeblack

Description

@byeblack

Description

Create an enumeration, an error proc-macro derive panicked message: "" occurs when inputting most non-English languages as its value.

Steps to Reproduce

  1. Add SeaORM version 0.12.0 or above to the project.
  2. Use the command sea-orm-cli generate entity -u sqlite://any.sqlite to create any entity.
  3. Add an enumeration to the created table and use a non-English language as its value.

Expected Behavior

The enumeration should be able to handle all supported characters without any errors.

Actual Behavior

An error occurs when most non-English languages are used as the enumeration value: proc-macro derive panicked message: "".

Reproduces How Often

The issue is consistently reproducible.

Workarounds

No workaround has been identified yet.

Reproducible Example

Please refer to this example link: Reproducible Example

#[derive(Clone, Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum)]
#[sea_orm(rs_type = "String", db_type = "String(None)", enum_name = "status")]
pub enum Status {
    // #[sea_orm(string_value = "Open")]
    // #[sea_orm(string_value = "열려 있는")]

    // The following situations
    // proc-macro derive panicked message: `""` is not a valid identifier
    #[sea_orm(string_value = "打开")]
    // #[sea_orm(string_value = "開ける")]
    // #[sea_orm(string_value = "Нээлттэй")]
    // #[sea_orm(string_value = "Открыть")]
    // #[sea_orm(string_value = "يفتح")]
    Open,
    #[sea_orm(string_value = "Close")]
    Close,
}

Versions

SeaORM version: 0.12.0 and above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions