* chore: log examples with tracing-subscriber * chore: log [issues] with tracing-subscriber * chore: log [cli] with tracing-subscriber * feat: tracing will emit log if tracing-subscriber is not setup
19 lines
402 B
Rust
19 lines
402 B
Rust
mod cake;
|
|
use sea_orm::*;
|
|
|
|
#[tokio::main]
|
|
pub async fn main() {
|
|
tracing_subscriber::fmt()
|
|
.with_max_level(tracing::Level::DEBUG)
|
|
.with_test_writer()
|
|
.init();
|
|
|
|
let db = Database::connect("mysql://sea:sea@localhost/bakery")
|
|
.await
|
|
.unwrap();
|
|
|
|
tokio::spawn(async move {
|
|
cake::Entity::find().one(&db).await.unwrap();
|
|
})
|
|
.await.unwrap();
|
|
} |