Re-exports
pub extern crate rbatis_sql;
pub use rbatis_core as core;
pub use crate::rbatis::AsSqlTag;
pub use plugin::*;
Modules
Types and traits for decoding values from the database.
Errorand Result types.
Macros
Used to simulate enumerations to improve code maintainability.
this is return &str data
for example:
let name=field_name!(BizActivity.id);
rb.new_wrapper().eq(field_name!(BizActivity.id),“1”)
will create pub fn field_name()->&str method
for example:
#crud_table
#[derive(Clone, Debug)]
pub struct BizActivity {
pub id: Option,
pub name: Option,
pub delete_flag: Option,
}
impl_field_name_method!(BizActivity{id,name,delete_flag});
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
Structs
Rbatis Bool
for example:
let b = Bool::from(true);
let b = Bool::from(“true”);
let b = Bool::from(1);
Rbatis Bytes
Rust type Postgres type(s)
chrono::NaiveDate DATE
Rbatis DateTime
Rbatis DateTime Utc
Rbatis Decimal
Json
TimeLocal
Rust type Postgres type(s)
chrono::NaiveTime TIME
Rbatis Timestamp
Rust type Postgres type(s)
Rbatis Timestamp
Rust type Postgres type(s)
time::OffsetDateTime TIMESTAMPTZ
Uuid
Enums
A generic error that represents all the ways a method can fail inside of rbatis::core.
Constants
Traits
convert Value to Value
the stmt replace str convert
Functions
Type Definitions
A specialized
Result
type for rbatis::core.proxy rbson::Document struct,support Deserializer, Serializer
use Cow Optimize unnecessary clones
This structure has a certain amount of computing power
Attribute Macros
CRUD table,You can define functionality using the following properties
#crud_table
#[crud_table(table_name:“biz_activity”)]
#[crud_table(table_name:“biz_activity” | table_columns:“id,name,version,delete_flag” | formats_pg:“id:{}::uuid,name:{}::string”)]
pub struct BizActivity {
pub id: Option,
pub name: Option,
pub version: Option,
pub delete_flag: Option,
}
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
support py_sql fn convert
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 {}