Struct rbatis::rbatis::Rbatis[][src]

pub struct Rbatis {
    pub pool: OnceCell<DBPool>,
    pub page_plugin: Box<dyn PagePlugin>,
    pub sql_intercepts: Vec<Box<dyn SqlIntercept>>,
    pub log_plugin: Arc<Box<dyn LogPlugin>>,
    pub logic_plugin: Option<Box<dyn LogicDelete>>,
    pub encoder: fn(q: &mut DBQuery<'_>, arg: Bson) -> Result<()>,
}
Expand description

rbatis engine

Fields

pool: OnceCell<DBPool>page_plugin: Box<dyn PagePlugin>sql_intercepts: Vec<Box<dyn SqlIntercept>>log_plugin: Arc<Box<dyn LogPlugin>>logic_plugin: Option<Box<dyn LogicDelete>>encoder: fn(q: &mut DBQuery<'_>, arg: Bson) -> Result<()>

Implementations

create an Rbatis

new Rbatis from Option

try return an new wrapper,if not call the link() method,it will be panic!

try return an new wrapper and set table formats,if not call the link() method,it will be panic!

link pool

link pool by DBPoolOptions for example: let mut opt = PoolOptions::new(); opt.max_size = 20; rb.link_opt(“mysql://root:123456@localhost:3306/test”, opt).await.unwrap();

link pool by DBConnectOption and DBPoolOptions for example: let db_cfg=DBConnectOption::from(“mysql://root:123456@localhost:3306/test”)?; rb.link_cfg(&db_cfg,PoolOptions::new());

get conn pool

get driver type

get an DataBase Connection used for the next step

get an DataBase Connection,and call begin method,used for the next step

is debug mode

change ref to executor

Trait Implementations

update_by_wrapper skips: use &[Skip::Value(&bson::Bson::Null), Skip::Column(“id”), Skip::Column(column)] will skip id column and null value param

fetch page result(prepare sql)

save_batch_slice batch save each slice_len every time Read more

remove_by_column column_value,column’s value Read more

remove_batch_by_column column_values,column’s value Read more

update database record by id

remove batch database record by args

fetch database record by id

fetch database record by a wrapper

count database record

count database record by a wrapper

fetch page database record list by a wrapper

fetch database record list for all

fetch database record list by a id array

fetch database record list by a wrapper

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Performs the conversion.

bind arg into DBQuery

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.