pub struct SelectBuilder { /* private fields */ }Implementations§
Source§impl SelectBuilder
impl SelectBuilder
pub fn new() -> Self
pub fn set_flavor(&mut self, flavor: Flavor) -> Flavor
pub fn flavor(&self) -> Flavor
pub fn with(&mut self, cte: &CTEBuilder) -> &mut Self
Sourcepub fn where_clause(&self) -> Option<WhereClauseRef>
pub fn where_clause(&self) -> Option<WhereClauseRef>
返回当前 WhereClause(可用于跨 builder 共享)。
Sourcepub fn set_where_clause(&mut self, wc: Option<WhereClauseRef>) -> &mut Self
pub fn set_where_clause(&mut self, wc: Option<WhereClauseRef>) -> &mut Self
设置/共享 WhereClause(对齐 go-sqlbuilder 公开字段 WhereClause 的用法)。
None等价于清空 WHERE。Some(wc)会把该 WhereClause 绑定到当前 builder,并确保内部 placeholder 指向正确的 builder。
pub fn clear_where_clause(&mut self) -> &mut Self
Sourcepub fn add_where_expr(
&mut self,
args: ArgsRef,
exprs: impl IntoIterator<Item = impl Into<String>>,
) -> &mut Self
pub fn add_where_expr( &mut self, args: ArgsRef, exprs: impl IntoIterator<Item = impl Into<String>>, ) -> &mut Self
AddWhereExpr:允许显式指定 ArgsRef,把表达式追加到 WhereClause(对齐 go-sqlbuilder)。
pub fn clone_builder(&self) -> Self
pub fn select( &mut self, cols: impl IntoIterator<Item = impl Into<String>>, ) -> &mut Self
pub fn select_more( &mut self, cols: impl IntoIterator<Item = impl Into<String>>, ) -> &mut Self
pub fn distinct(&mut self) -> &mut Self
pub fn from( &mut self, tables: impl IntoIterator<Item = impl Into<String>>, ) -> &mut Self
pub fn join( &mut self, table: impl Into<String>, on_expr: impl IntoIterator<Item = impl Into<String>>, ) -> &mut Self
pub fn join_with_option( &mut self, option: Option<JoinOption>, table: impl Into<String>, on_expr: impl IntoIterator<Item = impl Into<String>>, ) -> &mut Self
pub fn where_( &mut self, and_expr: impl IntoIterator<Item = impl Into<String>>, ) -> &mut Self
pub fn add_where_clause(&mut self, other: &WhereClause) -> &mut Self
pub fn add_where_clause_ref(&mut self, other: &WhereClauseRef) -> &mut Self
pub fn having( &mut self, and_expr: impl IntoIterator<Item = impl Into<String>>, ) -> &mut Self
pub fn group_by( &mut self, cols: impl IntoIterator<Item = impl Into<String>>, ) -> &mut Self
pub fn order_by( &mut self, cols: impl IntoIterator<Item = impl Into<String>>, ) -> &mut Self
pub fn order_by_asc(&mut self, col: impl Into<String>) -> &mut Self
pub fn order_by_desc(&mut self, col: impl Into<String>) -> &mut Self
pub fn asc(&mut self) -> &mut Self
pub fn desc(&mut self) -> &mut Self
pub fn limit(&mut self, limit: i64) -> &mut Self
pub fn offset(&mut self, offset: i64) -> &mut Self
pub fn for_update(&mut self) -> &mut Self
pub fn as_(&self, name: &str, alias: &str) -> String
pub fn builder_as(&self, builder: impl Builder + 'static, alias: &str) -> String
pub fn sql(&mut self, sql: impl Into<String>) -> &mut Self
Methods from Deref<Target = Cond>§
pub fn equal(&self, field: &str, value: impl Into<Arg>) -> String
pub fn e(&self, field: &str, value: impl Into<Arg>) -> String
pub fn eq(&self, field: &str, value: impl Into<Arg>) -> String
pub fn not_equal(&self, field: &str, value: impl Into<Arg>) -> String
pub fn ne(&self, field: &str, value: impl Into<Arg>) -> String
pub fn neq(&self, field: &str, value: impl Into<Arg>) -> String
pub fn greater_than(&self, field: &str, value: impl Into<Arg>) -> String
pub fn g(&self, field: &str, value: impl Into<Arg>) -> String
pub fn gt(&self, field: &str, value: impl Into<Arg>) -> String
pub fn greater_equal_than(&self, field: &str, value: impl Into<Arg>) -> String
pub fn ge(&self, field: &str, value: impl Into<Arg>) -> String
pub fn gte(&self, field: &str, value: impl Into<Arg>) -> String
pub fn less_than(&self, field: &str, value: impl Into<Arg>) -> String
pub fn l(&self, field: &str, value: impl Into<Arg>) -> String
pub fn lt(&self, field: &str, value: impl Into<Arg>) -> String
pub fn less_equal_than(&self, field: &str, value: impl Into<Arg>) -> String
pub fn le(&self, field: &str, value: impl Into<Arg>) -> String
pub fn lte(&self, field: &str, value: impl Into<Arg>) -> String
pub fn like(&self, field: &str, value: impl Into<Arg>) -> String
pub fn ilike(&self, field: &str, value: impl Into<Arg>) -> String
pub fn not_like(&self, field: &str, value: impl Into<Arg>) -> String
pub fn not_ilike(&self, field: &str, value: impl Into<Arg>) -> String
pub fn is_null(&self, field: &str) -> String
pub fn is_not_null(&self, field: &str) -> String
pub fn between( &self, field: &str, lower: impl Into<Arg>, upper: impl Into<Arg>, ) -> String
pub fn not_between( &self, field: &str, lower: impl Into<Arg>, upper: impl Into<Arg>, ) -> String
pub fn in_( &self, field: &str, values: impl IntoIterator<Item = impl Into<Arg>>, ) -> String
pub fn not_in( &self, field: &str, values: impl IntoIterator<Item = impl Into<Arg>>, ) -> String
pub fn or(&self, exprs: impl IntoIterator<Item = impl Into<String>>) -> String
pub fn and(&self, exprs: impl IntoIterator<Item = impl Into<String>>) -> String
pub fn not(&self, expr: impl Into<String>) -> String
pub fn exists(&self, subquery: impl Into<Arg>) -> String
pub fn not_exists(&self, subquery: impl Into<Arg>) -> String
pub fn any( &self, field: &str, op: &str, values: impl IntoIterator<Item = impl Into<Arg>>, ) -> String
pub fn all( &self, field: &str, op: &str, values: impl IntoIterator<Item = impl Into<Arg>>, ) -> String
pub fn some( &self, field: &str, op: &str, values: impl IntoIterator<Item = impl Into<Arg>>, ) -> String
pub fn is_distinct_from(&self, field: &str, value: impl Into<Arg>) -> String
pub fn is_not_distinct_from(&self, field: &str, value: impl Into<Arg>) -> String
Trait Implementations§
Source§impl Builder for SelectBuilder
impl Builder for SelectBuilder
Source§impl Clone for SelectBuilder
impl Clone for SelectBuilder
Source§impl Debug for SelectBuilder
impl Debug for SelectBuilder
Source§impl Default for SelectBuilder
impl Default for SelectBuilder
Auto Trait Implementations§
impl Freeze for SelectBuilder
impl !RefUnwindSafe for SelectBuilder
impl !Send for SelectBuilder
impl !Sync for SelectBuilder
impl Unpin for SelectBuilder
impl !UnwindSafe for SelectBuilder
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