Re-exports
pub extern crate rbatis_codegen;
pub extern crate rbdc;
pub use crate::rbatis::Rbatis;
pub use crate::rbatis::RbatisOption;
pub use decode::decode;
pub use error::Error;
pub use error::Result;
pub use plugin::*;
pub use crud::*;
Modules
Macros
PySql: gen select*,update*,insert*,delete* … methods
Used to simulate enumerations to improve code maintainability.
this is return &str data
for example:
let name=field_key!(BizActivity::id);
Used to simulate enumerations to improve code maintainability.
this is return &str data
for example:
let name=field_name!(BizActivity.id);
impl html_sql select page.
PySql: gen sql = DELETE FROM table_name WHERE some_column=some_value;
will create pub fn field_name()->&str method
for example:
#[derive(Clone, Debug,serde::Serialize, serde::Deserialize)]
pub struct BizActivity {
pub id: Option,
pub name: Option,
pub delete_flag: Option,
}
impl_field_name_method!(BizActivity{id,name,delete_flag});
PySql: gen sql => INSERT INTO table_name (column1,column2,column3,…) VALUES (value1,value2,value3,…);
PySql: gen sql => SELECT (column1,column2,column3,…) FROM table_name (column1,column2,column3,…) *** WHERE ***
pysql impl_select_page
If the database does not support the statement
limit ${page_no},${page_size}
,You should include ${page_no} and ${page_size} in SQLPySql: gen sql = UPDATE table_name SET column1=value1,column2=value2,… WHERE some_column=some_value;
html_sql/py_sql impled
Simplifies table construction by relying on the Default trait
Gets the HashMap collection of member attributes of the target Vec
vec_ref: vec reference,field_name: the field name of the structure
Gets the HashMap collection of member attributes of the target Vec
vec_ref: vec reference,field_name: the field name of the structure
take the target Vec member attribute Vec collection
vec_ref: a reference to vec, field_name: the field name of the structure
Attribute Macros
html sql create macro,this macro use RB.py_fetch and RB.py_exec
for example:
py sql create macro,this macro use RB.py_fetch and RB.py_exec
auto create sql macro,this macro use RB.fetch_prepare and RB.exec_prepare
for example:
pub static RB:Lazy = Lazy::new(||Rbatis::new());
#[sql(RB, “select * from biz_activity where id = ?”)]
async fn select(name: &str) -> BizActivity {}