-
-
Notifications
You must be signed in to change notification settings - Fork 692
enums are always lowercased in queries despire enum_name leading to type does not exist #2087
Copy link
Copy link
Closed
SeaQL/sea-query
#860Description
Description
After running the CLI to generate the types from my existing db, I got
#[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum)]
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "ModuleType")]
pub enum ModuleType {
#[sea_orm(string_value = "Sink")]
Sink,
#[sea_orm(string_value = "Source")]
Source,
#[sea_orm(string_value = "Transformation")]
Transformation,
}A simple query with it always results in a lowercase moduletype not existing - which is correct. The generator correctly extracted the type name with capitals.
Query(SqlxError(Database(PgDatabaseError { severity: Error, code: "42704", message: "type \"moduletype\" does not exist", detail: None, hint: None, position: Some(Original(65)), where: None, schema: None, table: None, column: None, data_type: None, constraint: None, file: Some("parse_type.c"), line: Some(270), routine: Some("typenameType") })))
Steps to Reproduce
- Have a
enumwith capitals in it sea-orm-cli generate entity- run any insert
Expected Behavior
inserts work
Actual Behavior
Query(SqlxError(Database(PgDatabaseError { severity: Error, code: "42704", message: "type \"moduletype\" does not exist", detail: None, hint: None, position: Some(Original(65)), where: None, schema: None, table: None, column: None, data_type: None, constraint: None, file: Some("parse_type.c"), line: Some(270), routine: Some("typenameType") })))
Reproduces How Often
always
Workarounds
Reproducible Example
Versions
sea-orm v0.12.12
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels