cdbc-0.1.1 has been yanked.
cdbc
Coroutine Database driver Connectivity.based on may
- High concurrency,based on coroutine
- No
Future<'q,Output=*>,Noasync fn, No.await, no Poll* func,NoPin - Optimize the trait system so that it has intelligent hints of the base method
- NativeTls and TCP connections are supported
- Low coupling,The database driver and the abstraction layer are designed separately
- Lightweight, no over-design, macro with intelligent tips
- Inspired by golang, may, sqlx
Database Support:
cdbcThe driver abstraction lib.cdbc-mysqlCDBC mysql driver librarycdbc-pgCDBC postgres driver librarycdbc-sqliteCDBC sqlite driver library
Supported functions
- execute: Execute the query and return the total number of rows affected.
- execute_many: Execute multiple queries and return the rows affected from each query, in a stream.
- fetch: Execute the query and return the generated results as a stream.
- fetch_many: Execute multiple queries and return the generated results as a stream,from each query, in a stream.
- fetch_all: Execute the query and return all the generated results, collected into a [
Vec]. - fetch_one: Execute the query and returns exactly one row.
- fetch_optional: Execute the query and returns at most one row.
- prepare: Prepare the SQL query to inspect the type information of its parameters and results
- prepare_with: Prepare the SQL query, with parameter type information, to inspect the type information about its parameters and results.
//prepare
let mut q = query;
q = q.bind;
Supported transaction
- Pool: begin(),commit(),rollback()
- Connection: begin(),commit(),rollback()
use example:
cargo.toml
#must dep
= { = "*"}
#optional dep
= { = "*"}
= { = "*"}
= { = "*"}
- row_scan macro
use File;
use Executor;
use SqlitePool;
- Processing read streams
main.rs
use BTreeMap;
use ;
use ;
use ;
use cratemake_sqlite;