Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tyt2y3 committed Oct 5, 2024
1 parent 47317bb commit 6265311
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/backend/postgres/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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),
Expand Down

0 comments on commit 6265311

Please sign in to comment.