pub struct Wrapper {
pub param_name_seq: i32,
pub sql_set: Vec<String>,
pub fields_set: Vec<(String, Segment)>,
pub sql_select: Option<String>,
pub sql_comment: Option<String>,
pub sql_first: Option<String>,
pub last_sql: Option<String>,
pub expression: MergeSegments,
}
Fields
param_name_seq: i32
必要度量
sql_set: Vec<String>
SQL set字段
fields_set: Vec<(String, Segment)>
set 字段
sql_select: Option<String>
SQL查询字段
sql_comment: Option<String>
SQL注释
sql_first: Option<String>
SQL起始语句
last_sql: Option<String>
SQL结束语句
expression: MergeSegments
Implementations
sourceimpl Wrapper
impl Wrapper
pub fn new() -> Self
pub fn set<S: Into<String>, U: ToSegment>(self, column: S, val: U) -> Self
pub fn sets<S: Into<String>, U: ISegment>(self, column: S, val: U) -> Self
pub fn set_conditions<S: Into<String>, U: ISegment>(
self,
condition: bool,
column: S,
val: U
) -> Self
pub fn set_condition<S: Into<String>, U: ToSegment>(
self,
condition: bool,
column: S,
val: U
) -> Self
pub fn set_sql<S: Into<String>>(self, condition: bool, sql: S) -> Self
pub fn get_set_sql(&mut self) -> Option<String>
pub fn clear(self)
pub fn get_update_sql(
&mut self,
table_name: &'static str
) -> Result<String, &str>
pub fn get_query_sql(self, table_name: &'static str) -> Result<String, &str>
pub fn eq<S: Into<String>, U: ToSegment>(self, column: S, val: U) -> Self
pub fn ne<S: Into<String>, U: ToSegment>(self, column: S, val: U) -> Self
pub fn gt<S: Into<String>, U: ToSegment>(self, column: S, val: U) -> Self
pub fn ge<S: Into<String>, U: ToSegment>(self, column: S, val: U) -> Self
pub fn lt<S: Into<String>, U: ToSegment>(self, column: S, val: U) -> Self
pub fn le<S: Into<String>, U: ToSegment>(self, column: S, val: U) -> Self
pub fn eq_condition<S: Into<String>, U: ToSegment>(
self,
condition: bool,
column: S,
val: U
) -> Self
pub fn ne_condition<S: Into<String>, U: ToSegment>(
self,
condition: bool,
column: S,
val: U
) -> Self
pub fn gt_condition<S: Into<String>, U: ToSegment>(
self,
condition: bool,
column: S,
val: U
) -> Self
pub fn ge_condition<S: Into<String>, U: ToSegment>(
self,
condition: bool,
column: S,
val: U
) -> Self
pub fn lt_condition<S: Into<String>, U: ToSegment>(
self,
condition: bool,
column: S,
val: U
) -> Self
pub fn le_condition<S: Into<String>, U: ToSegment>(
self,
condition: bool,
column: S,
val: U
) -> Self
pub fn first<S: Into<String>>(self, sql: S) -> Self
pub fn last<S: Into<String>>(self, sql: S) -> Self
pub fn first_condition<S: Into<String>>(self, condition: bool, sql: S) -> Self
pub fn last_condition<S: Into<String>>(self, condition: bool, sql: S) -> Self
pub fn inside<S: Into<String>, U: ToSegment + Clone>(
self,
column: S,
vals: Vec<U>
) -> Self
pub fn not_in<S: Into<String>, U: ToSegment + Clone>(
self,
column: S,
vals: Vec<U>
) -> Self
pub fn not_in_condition<S: Into<String>, U: ToSegment + Clone>(
self,
condition: bool,
column: S,
vals: Vec<U>
) -> Self
pub fn in_condition<S: Into<String>, U: ToSegment + Clone>(
self,
condition: bool,
column: S,
vals: Vec<U>
) -> Self
pub fn append_sql_segments(&mut self, sql_segments: Vec<Segment>)
pub fn do_it(self, condition: bool, segments: Vec<Segment>) -> Self
pub fn comment<S: Into<String>>(self, comment: S) -> Self
pub fn comment_condition<S: Into<String>>(
self,
condition: bool,
comment: S
) -> Self
pub fn get_select_sql(&mut self) -> String
pub fn select(self, columns: Vec<String>) -> Self
pub fn like<S: Into<String>, U: ToSegment>(self, column: S, val: U) -> Self
pub fn like_condition<S: Into<String>, U: ToSegment>(
self,
condition: bool,
column: S,
val: U
) -> Self
pub fn not_like<S: Into<String>, U: ToSegment>(self, column: S, val: U) -> Self
pub fn not_like_condition<S: Into<String>, U: ToSegment>(
self,
condition: bool,
column: S,
val: U
) -> Self
pub fn like_left<S: Into<String>, U: ToSegment>(self, column: S, val: U) -> Self
pub fn like_left_condition<S: Into<String>, U: ToSegment>(
self,
condition: bool,
column: S,
val: U
) -> Self
pub fn like_right<S: Into<String>, U: ToSegment>(
self,
column: S,
val: U
) -> Self
pub fn like_right_condition<S: Into<String>, U: ToSegment>(
self,
condition: bool,
column: S,
val: U
) -> Self
pub fn in_expression(vals: Vec<Segment>) -> Segment
pub fn between<S: Into<String>, U: ToSegment>(
self,
column: S,
val1: U,
val2: U
) -> Self
pub fn between_condition<S: Into<String>, U: ToSegment>(
self,
condition: bool,
column: S,
val1: U,
val2: U
) -> Self
pub fn not_between<S: Into<String>, U: ToSegment>(
self,
column: S,
val1: U,
val2: U
) -> Self
pub fn not_between_condition<S: Into<String>, U: ToSegment>(
self,
condition: bool,
column: S,
val1: U,
val2: U
) -> Self
pub fn add_condition(
self,
condition: bool,
column: Segment,
sql_keword: SqlKeyword,
val: Segment
) -> Self
pub fn like_value(
self,
condition: bool,
column: Segment,
sql_like: SqlLike,
val: Segment
) -> Self
pub fn not(self) -> Self
pub fn and<F: FnOnce(Self) -> Self>(self, f: F) -> Self
pub fn or<F: FnOnce(Self) -> Self>(self, f: F) -> Self
pub fn not_condition(self, condition: bool) -> Self
pub fn and_condition(self, condition: bool) -> Self
pub fn and_direct(self) -> Self
pub fn or_condition(self, condition: bool) -> Self
pub fn or_direct(self) -> Self
pub fn apply<S: Into<String>>(self, apply_sql: S) -> Self
pub fn apply_condition<S: Into<String>>(
self,
condition: bool,
apply_sql: S
) -> Self
pub fn is_null<S: Into<String>>(self, column: S) -> Self
pub fn is_null_condition<S: Into<String>>(
self,
condition: bool,
column: S
) -> Self
pub fn is_not_null<S: Into<String>>(self, column: S) -> Self
pub fn is_not_null_condition<S: Into<String>>(
self,
condition: bool,
column: S
) -> Self
pub fn not_exists<S: Into<String>>(self, not_exists_sql: S) -> Self
pub fn not_exists_condition<S: Into<String>>(
self,
condition: bool,
not_exists_sql: S
) -> Self
pub fn exists<S: Into<String>>(self, exists_sql: S) -> Self
pub fn exists_condition<S: Into<String>>(
self,
condition: bool,
exists_sql: S
) -> Self
pub fn in_sql<S: Into<String>, U: Into<String>>(
self,
column: S,
in_val: U
) -> Self
pub fn in_sql_condition<S: Into<String>, U: Into<String>>(
self,
condition: bool,
column: S,
in_val: U
) -> Self
pub fn group_by<S: Into<String> + Clone>(self, columns: Vec<S>) -> Self
pub fn group_by_condition<S: Into<String> + Clone>(
self,
condition: bool,
columns: Vec<S>
) -> Self
pub fn having<S: Into<String>>(self, sql_having: S) -> Self
pub fn having_condition<S: Into<String>>(
self,
condition: bool,
sql_having: S
) -> Self
pub fn order_by<S: Into<String> + Clone>(
self,
is_asc: bool,
columns: Vec<S>
) -> Self
pub fn asc_by<S: Into<String> + Clone>(self, columns: Vec<S>) -> Self
pub fn desc_by<S: Into<String> + Clone>(self, columns: Vec<S>) -> Self
pub fn order_by_condition<S: Into<String> + Clone>(
self,
condition: bool,
is_asc: bool,
columns: Vec<S>
) -> Self
pub fn asc_by_condition<S: Into<String> + Clone>(
self,
condition: bool,
columns: Vec<S>
) -> Self
pub fn desc_by_condition<S: Into<String> + Clone>(
self,
condition: bool,
columns: Vec<S>
) -> Self
Trait Implementations
impl StructuralPartialEq for Wrapper
Auto Trait Implementations
impl RefUnwindSafe for Wrapper
impl Send for Wrapper
impl Sync for Wrapper
impl Unpin for Wrapper
impl UnwindSafe for Wrapper
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more