cargo fmt
This commit is contained in:
parent
9e5900e25b
commit
a6646cdd2d
@ -15,29 +15,3 @@ pub use paginator::*;
|
||||
pub use query::*;
|
||||
pub use select::*;
|
||||
pub use update::*;
|
||||
|
||||
use sea_orm::{
|
||||
entity::*,
|
||||
query::*,
|
||||
tests_cfg::cake::{self, Entity as Cake},
|
||||
DbBackend, DerivePartialModel, FromQueryResult,
|
||||
};
|
||||
use sea_query::{Expr, Func, SimpleExpr};
|
||||
///
|
||||
#[derive(DerivePartialModel, FromQueryResult)]
|
||||
#[sea_orm(entity = "Cake")]
|
||||
struct PartialCake {
|
||||
name: String,
|
||||
#[sea_orm(
|
||||
from_expr = r#"SimpleExpr::FunctionCall(Func::upper(Expr::col((Cake, cake::Column::Name))))"#
|
||||
)]
|
||||
name_upper: String,
|
||||
}
|
||||
///
|
||||
assert_eq!(
|
||||
cake::Entity::find()
|
||||
.into_partial_model::<PartialCake>()
|
||||
.into_statement(DbBackend::Sqlite)
|
||||
.to_string(),
|
||||
r#"SELECT "cake"."name", UPPER("cake"."name") AS "name_upper" FROM "cake""#
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user