pub struct Wrapper<'a> {
pub where_sql: Vec<String>,
pub args: Vec<&'a (dyn ToSql + Sync)>,
pub formats: HashMap<String, String>,
pub limit: Option<u64>,
pub page_size: u64,
pub page_no: u64,
pub order_by: &'a str,
pub recoder_field: Vec<&'a str>,
pub desc: bool,
}
Fields§
§where_sql: Vec<String>
§args: Vec<&'a (dyn ToSql + Sync)>
§formats: HashMap<String, String>
§limit: Option<u64>
§page_size: u64
§page_no: u64
§order_by: &'a str
§recoder_field: Vec<&'a str>
§desc: bool
Implementations§
source§impl<'a> Wrapper<'a>
impl<'a> Wrapper<'a>
pub fn new() -> Self
sourcepub fn is_not_null<T>(self, column: &dyn ColumnExt) -> Self
pub fn is_not_null<T>(self, column: &dyn ColumnExt) -> Self
非空值
sourcepub fn not_between<T>(
self,
column: &dyn ColumnExt,
min: &'a T,
max: &'a T
) -> Self
pub fn not_between<T>( self, column: &dyn ColumnExt, min: &'a T, max: &'a T ) -> Self
不在范围
pub fn limit(self, limit: u64) -> Self
pub fn set_pages(self, page_no: u64, page_size: u64) -> Self
sourcepub fn set_order_by(
self,
order_by: &'a str,
desc: bool
) -> Result<Self, WrapperError>
pub fn set_order_by( self, order_by: &'a str, desc: bool ) -> Result<Self, WrapperError>
设置排序
sourcepub fn set_order_by_column_ext(
self,
order_by: &dyn ColumnExt,
desc: bool
) -> Self
pub fn set_order_by_column_ext( self, order_by: &dyn ColumnExt, desc: bool ) -> Self
设置排序参数是ColumnExt 类型
pub fn get_order_by(self) -> Option<String>
pub fn get_page_info(self) -> (String, u64, u64, u64)
sourcepub fn build(
self,
args_number: u32
) -> Result<(String, Vec<&'a (dyn ToSql + Sync)>), String>
pub fn build( self, args_number: u32 ) -> Result<(String, Vec<&'a (dyn ToSql + Sync)>), String>
@description: @param {} self @param {u32} args_number 从1开始 @param {} Vec @return {*}
pub fn set_recoder_field(self, column: &dyn ColumnExt) -> Self
pub fn get_recoder_field<T>(self) -> Stringwhere
T: Parameters,
pub fn in_array_string(self, column: &dyn ColumnExt, obj: &Vec<String>) -> Self
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Wrapper<'a>
impl<'a> !RefUnwindSafe for Wrapper<'a>
impl<'a> Send for Wrapper<'a>
impl<'a> Sync for Wrapper<'a>
impl<'a> Unpin for Wrapper<'a>
impl<'a> !UnwindSafe for Wrapper<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more