diff --git a/src/backend/postgres/query.rs b/src/backend/postgres/query.rs index cd2bc926..f0650110 100644 --- a/src/backend/postgres/query.rs +++ b/src/backend/postgres/query.rs @@ -41,9 +41,7 @@ impl QueryBuilder for PostgresQueryBuilder { fn prepare_simple_expr(&self, simple_expr: &SimpleExpr, sql: &mut dyn SqlWriter) { match simple_expr { SimpleExpr::AsEnum(type_name, expr) => { - let simple_expr = expr - .clone() - .cast_as_quoted(SeaRc::clone(type_name), self.quote()); + let simple_expr = expr.clone().cast_as(SeaRc::clone(type_name)); self.prepare_simple_expr_common(&simple_expr, sql); } _ => QueryBuilder::prepare_simple_expr_common(self, simple_expr, sql), diff --git a/src/expr.rs b/src/expr.rs index 32a869c0..42a53254 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -3147,7 +3147,7 @@ impl Expr { /// ); /// assert_eq!( /// query.to_string(PostgresQueryBuilder), - /// r#"SELECT CAST("font_size" AS "text") FROM "character""# + /// r#"SELECT CAST("font_size" AS text) FROM "character""# /// ); /// assert_eq!( /// query.to_string(SqliteQueryBuilder), @@ -3166,7 +3166,7 @@ impl Expr { /// ); /// assert_eq!( /// query.to_string(PostgresQueryBuilder), - /// r#"INSERT INTO "character" ("font_size") VALUES (CAST('large' AS "FontSizeEnum"))"# + /// r#"INSERT INTO "character" ("font_size") VALUES (CAST('large' AS FontSizeEnum))"# /// ); /// assert_eq!( /// query.to_string(SqliteQueryBuilder),