Struct pgbatis::wrapper::Wrapper

source ·
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>

source

pub fn new() -> Self

source

pub fn eq<T>(self, column: &dyn ColumnExt, obj: &'a T) -> Self
where T: ToSql + Sync,

等于

source

pub fn not_eq<T>(self, column: &dyn ColumnExt, obj: &'a T) -> Self
where T: ToSql + Sync,

不等于

source

pub fn is_null<T>(self, column: &dyn ColumnExt) -> Self
where T: ToSql + Sync,

空值

source

pub fn is_not_null<T>(self, column: &dyn ColumnExt) -> Self
where T: ToSql + Sync,

非空值

source

pub fn between<T>(self, column: &dyn ColumnExt, min: &'a T, max: &'a T) -> Self
where T: ToSql + Sync,

在范围

source

pub fn not_between<T>( self, column: &dyn ColumnExt, min: &'a T, max: &'a T ) -> Self
where T: ToSql + Sync,

不在范围

source

pub fn like<T>(self, column: &dyn ColumnExt, obj: &'a T) -> Self
where T: ToSql + Sync,

like 向前匹配还是向后匹配由前端进行控制

source

pub fn set_in<T>(self, column: &dyn ColumnExt, obj: &'a T) -> Self
where T: ToSql + Sync,

in

source

pub fn gt<T>(self, column: &dyn ColumnExt, obj: &'a T) -> Self
where T: ToSql + Sync,

大于

source

pub fn ge<T>(self, column: &dyn ColumnExt, obj: &'a T) -> Self
where T: ToSql + Sync,

大于等于

source

pub fn lt<T>(self, column: &dyn ColumnExt, obj: &'a T) -> Self
where T: ToSql + Sync,

小于

source

pub fn le<T>(self, column: &dyn ColumnExt, obj: &'a T) -> Self
where T: ToSql + Sync,

小于等于

source

pub fn limit(self, limit: u64) -> Self

source

pub fn set_pages(self, page_no: u64, page_size: u64) -> Self

source

pub fn set_order_by( self, order_by: &'a str, desc: bool ) -> Result<Self, WrapperError>

设置排序

source

pub fn set_order_by_column_ext( self, order_by: &dyn ColumnExt, desc: bool ) -> Self

设置排序参数是ColumnExt 类型

source

pub fn get_order_by(self) -> Option<String>

source

pub fn get_page_info(self) -> (String, u64, u64, u64)

source

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 {*}

source

pub fn set_recoder_field(self, column: &dyn ColumnExt) -> Self

source

pub fn get_recoder_field<T>(self) -> String
where T: Parameters,

source

pub fn in_array_string(self, column: &dyn ColumnExt, obj: &Vec<String>) -> Self

Trait Implementations§

source§

impl<'a> Clone for Wrapper<'a>

source§

fn clone(&self) -> Wrapper<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more