Add example of debug log support
This commit is contained in:
parent
38a4d3a810
commit
c1e399ae18
@ -10,3 +10,5 @@ publish = false
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
sea-orm = { path = "../../", features = [ "sqlx-all", "runtime-tokio-native-tls" ] }
|
sea-orm = { path = "../../", features = [ "sqlx-all", "runtime-tokio-native-tls" ] }
|
||||||
tokio = { version = "1", features = ["full"] }
|
tokio = { version = "1", features = ["full"] }
|
||||||
|
env_logger = { version = "^0.9" }
|
||||||
|
log = { version = "^0.4" }
|
||||||
|
@ -3,7 +3,12 @@ use sea_orm::*;
|
|||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
pub async fn main() {
|
pub async fn main() {
|
||||||
let db = Database::connect("sql://sea:sea@localhost/bakery")
|
env_logger::builder()
|
||||||
|
.filter_level(log::LevelFilter::Debug)
|
||||||
|
.is_test(true)
|
||||||
|
.init();
|
||||||
|
|
||||||
|
let db = Database::connect("mysql://sea:sea@localhost/bakery")
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user