Crates.io | rbatis-core |
lib.rs | rbatis-core |
version | 3.1.11 |
source | src |
created_at | 2020-06-25 05:58:01.340887 |
updated_at | 2022-07-07 15:00:03.687466 |
description | Core of rbatis, the rust SQL toolkit. Not intended to be used directly. |
homepage | https://rbatis.github.io/rbatis.io/#/en/ |
repository | https://github.com/rbatis/rbatis |
max_upload_size | |
id | 257776 |
size | 180,116 |
use rbatis_core::db::{DBPool};
fn main() -> Result<(), rbatis_core::Error>{
async_std::task::block_on(
async move {
//Automatic judgment of database type
let pool = DBPool::new("mysql://root:123456@localhost:3306/test").await?;
let mut conn = pool.acquire().await?;
let count: u64 = conn.exec("SELECT count(1) FROM biz_activity;").await?.rows_affected;
println!("count: {}",count);
return Ok(());
}
)
}