Revert unintended code changes.

This reverts commit ef861294e2987c5c2cc1fc2b909c72aaf2132ca5.
This commit is contained in:
Chris Tsang 2023-08-04 20:39:38 +01:00
parent ef861294e2
commit 727390b8d2
2 changed files with 43 additions and 1 deletions

View File

@ -23,7 +23,7 @@ use select::*;
#[async_std::main]
async fn main() {
let db = Database::connect("mysql://sea:sea@localhost/test")
let db = Database::connect("sql://sea:sea@localhost/bakery")
.await
.unwrap();
@ -32,4 +32,8 @@ async fn main() {
println!("===== =====\n");
all_about_select(&db).await.unwrap();
println!("===== =====\n");
all_about_operation(&db).await.unwrap();
}

View File

@ -2,8 +2,46 @@ use super::*;
use sea_orm::{entity::*, error::*, query::*, DbConn, FromQueryResult};
pub async fn all_about_select(db: &DbConn) -> Result<(), DbErr> {
find_all(db).await?;
println!("===== =====\n");
find_one(db).await?;
println!("===== =====\n");
find_one_to_one(db).await?;
println!("===== =====\n");
find_one_to_many(db).await?;
println!("===== =====\n");
count_fruits_by_cake(db).await?;
println!("===== =====\n");
find_many_to_many(db).await?;
if false {
println!("===== =====\n");
all_about_select_json(db).await?;
}
println!("===== =====\n");
find_all_stream(db).await.unwrap();
println!("===== =====\n");
find_first_page(db).await.unwrap();
println!("===== =====\n");
find_num_pages(db).await.unwrap();
Ok(())
}