* `RelationDef` & `RelationBuilder` are `Send` & `Sync` * [issues] add tests Co-authored-by: Chris Tsang <chris.2y3@outlook.com>
20 lines
505 B
Rust
20 lines
505 B
Rust
use sea_orm::tests_cfg::{cake, cake_filling};
|
|
use sea_orm::{Database, DbErr, EntityTrait, JoinType, QuerySelect, RelationTrait};
|
|
|
|
#[tokio::main]
|
|
async fn main() -> Result<(), DbErr> {
|
|
let db = Database::connect("sqlite::memory:").await?;
|
|
|
|
tokio::spawn(async move {
|
|
let _cakes = cake::Entity::find()
|
|
.join_rev(JoinType::InnerJoin, cake_filling::Relation::Cake.def())
|
|
.all(&db)
|
|
.await
|
|
.unwrap();
|
|
})
|
|
.await
|
|
.unwrap();
|
|
|
|
Ok(())
|
|
}
|