Skip to content

Commit

Permalink
Select from Statement (SeaQL/sea-orm#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
billy1624 committed Sep 17, 2021
1 parent 3804d91 commit a384fb5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions SeaORM/docs/04-basic-crud/07-raw-sql.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ pub struct UniqueCake {
name: String,
}

let unique: Vec<UniqueCake> = cake::Entity::find()
.from_raw_sql(Statement::from_sql_and_values(
let unique: Vec<UniqueCake> = 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?;
```
Expand Down

0 comments on commit a384fb5

Please sign in to comment.