From a384fb530edee402eaf43c2d0643125c078a44e1 Mon Sep 17 00:00:00 2001 From: Billy Chan Date: Fri, 17 Sep 2021 17:13:21 +0800 Subject: [PATCH] Select from Statement (SeaQL/sea-orm#167) --- SeaORM/docs/04-basic-crud/07-raw-sql.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/SeaORM/docs/04-basic-crud/07-raw-sql.md b/SeaORM/docs/04-basic-crud/07-raw-sql.md index df9877184a1..9b3e7978561 100644 --- a/SeaORM/docs/04-basic-crud/07-raw-sql.md +++ b/SeaORM/docs/04-basic-crud/07-raw-sql.md @@ -23,13 +23,11 @@ pub struct UniqueCake { name: String, } -let unique: Vec = cake::Entity::find() - .from_raw_sql(Statement::from_sql_and_values( +let unique: Vec = UniqueCake::find_by_statement(Statement::from_sql_and_values( DbBackend::Postgres, r#"SELECT "cake"."name" FROM "cake" GROUP BY "cake"."name"#, vec![1.into()], )) - .into_model() .all(&db) .await?; ```