pub struct SqlBuilder {
pub statement_base: SqlStatementBase,
pub table_name: String,
pub where_params: BTreeMap<TinySafeString, (ComparisonType, Arc<dyn ToSql + Sync>)>,
pub order: Option<(TinySafeString, OrderingDirection)>,
pub limit: Option<u32>,
pub pagination: Option<PaginationData>,
}
Fields§
§statement_base: SqlStatementBase
§table_name: String
§where_params: BTreeMap<TinySafeString, (ComparisonType, Arc<dyn ToSql + Sync>)>
§order: Option<(TinySafeString, OrderingDirection)>
§limit: Option<u32>
§pagination: Option<PaginationData>
Implementations§
Source§impl SqlBuilder
impl SqlBuilder
pub fn new( statement_base: SqlStatementBase, table_name: impl Into<String>, ) -> Self
pub fn where_eq( self, key: impl Into<TinySafeString>, value: impl ToSql + Sync + 'static, ) -> Self
pub fn where_lt( self, key: impl Into<TinySafeString>, value: impl ToSql + Sync + 'static, ) -> Self
pub fn where_gt( self, key: impl Into<TinySafeString>, value: impl ToSql + Sync + 'static, ) -> Self
pub fn where_lte( self, key: impl Into<TinySafeString>, value: impl ToSql + Sync + 'static, ) -> Self
pub fn where_gte( self, key: impl Into<TinySafeString>, value: impl ToSql + Sync + 'static, ) -> Self
pub fn where_like( self, key: impl Into<TinySafeString>, value: impl ToSql + Sync + 'static, ) -> Self
pub fn where_in( self, key: impl Into<TinySafeString>, value: impl ToSql + Sync + 'static, ) -> Self
pub fn where_null(self, key: impl Into<TinySafeString>) -> Self
pub fn where_custom( self, key: impl Into<TinySafeString>, comparison_type: ComparisonType, value: impl ToSql + Sync + 'static, ) -> Self
pub fn order_by( self, column: impl Into<TinySafeString>, direction: OrderingDirection, ) -> Self
pub fn limit(self, limit: u32) -> Self
pub fn with_pagination(self, pagination: PaginationData) -> Self
pub fn build(&self) -> (String, Vec<Arc<dyn ToSql + Sync>>)
Auto Trait Implementations§
impl Freeze for SqlBuilder
impl !RefUnwindSafe for SqlBuilder
impl !Send for SqlBuilder
impl !Sync for SqlBuilder
impl Unpin for SqlBuilder
impl !UnwindSafe for SqlBuilder
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