Skip to main content

DeleteWrapper

Struct DeleteWrapper 

Source
pub struct DeleteWrapper {
    pub wrapper: Wrapper,
    /* private fields */
}
Expand description

SQL builder for DELETE statements

Fields§

§wrapper: Wrapper

WHERE conditions wrapper (public for direct manipulation)

Implementations§

Source§

impl DeleteWrapper

Source

pub fn new() -> Self

Create a new DeleteWrapper builder

Source

pub fn table(self, table: &str) -> Self

Set the table name

Source

pub fn try_into_sql(self) -> Result<(String, Vec<Value>), SswError>

Convert DeleteWrapper into final DELETE SQL and parameters

Source

pub async fn try_delete(self, rb: &RBatis) -> Result<ExecResult, SswError>

Execute DELETE statement asynchronously

Trait Implementations§

Source§

impl Debug for DeleteWrapper

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DeleteWrapper

Source§

fn default() -> DeleteWrapper

Returns the “default value” for a type. Read more
Source§

impl WrapperTrait for DeleteWrapper

Source§

fn build_eq<V: Into<Value>>(column: &str, value: V) -> Self

column = ?
Source§

fn build_ne<V: Into<Value>>(column: &str, value: V) -> Self

column != ?
Source§

fn build_gt<V: Into<Value>>(column: &str, value: V) -> Self

column > ?
Source§

fn build_ge<V: Into<Value>>(column: &str, value: V) -> Self

column >= ?
Source§

fn build_lt<V: Into<Value>>(column: &str, value: V) -> Self

column < ?
Source§

fn build_le<V: Into<Value>>(column: &str, value: V) -> Self

column <= ?
Source§

fn build_like<D: Display>(column: &str, value: D) -> Self

column LIKE '%value%'
Source§

fn build_like_left<D: Display>(column: &str, value: D) -> Self

column LIKE '%value'
Source§

fn build_like_right<D: Display>(column: &str, value: D) -> Self

column LIKE 'value%'
Source§

fn build_is_null(column: &str) -> Self

column IS NULL
Source§

fn build_is_not_null(column: &str) -> Self

column IS NOT NULL
Source§

fn build_is_true(column: &str) -> Self

column IS TRUE
Source§

fn build_is_false(column: &str) -> Self

column IS FALSE
Source§

fn build_in<V: Into<Value>>(column: &str, values: Vec<V>) -> Self

column IN (?, ?, ?)
Source§

fn build_not_in<V: Into<Value>>(column: &str, values: Vec<V>) -> Self

column NOT IN (?, ?, ?)
Source§

fn build_eq_or_in<V: Into<Value>>(column: &str, values: Vec<V>) -> Self

Auto-detect EQ or IN (1 value → =, >1 values → IN)
Source§

fn build_ne_or_not_in<V: Into<Value>>(column: &str, values: Vec<V>) -> Self

Auto-detect NE or NOT IN (1 value → !=, >1 values → NOT IN)
Source§

fn build_between<V: Into<Value>>(column: &str, start: V, end: V) -> Self

column BETWEEN ? AND ?
Source§

fn build_not_between<V: Into<Value>>(column: &str, start: V, end: V) -> Self

column NOT BETWEEN ? AND ?
Source§

fn or(self) -> Self

Switch to OR mode for next condition Read more
Source§

fn eq<V: Into<Value>>(self, column: &str, value: V) -> Self

column = ?
Source§

fn ne<V: Into<Value>>(self, column: &str, value: V) -> Self

column != ?
Source§

fn like<D: Display>(self, column: &str, value: D) -> Self

column LIKE '%value%'
Source§

fn like_left<D: Display>(self, column: &str, value: D) -> Self

column LIKE '%value'
Source§

fn like_right<D: Display>(self, column: &str, value: D) -> Self

column LIKE 'value%'
Source§

fn gt<V: Into<Value>>(self, column: &str, value: V) -> Self

column > ?
Source§

fn ge<V: Into<Value>>(self, column: &str, value: V) -> Self

column >= ?
Source§

fn lt<V: Into<Value>>(self, column: &str, value: V) -> Self

column < ?
Source§

fn le<V: Into<Value>>(self, column: &str, value: V) -> Self

column <= ?
Source§

fn in<V: Into<Value>>(self, column: &str, values: Vec<V>) -> Self

column IN (?, ?, ?)
Source§

fn not_in<V: Into<Value>>(self, column: &str, values: Vec<V>) -> Self

column NOT IN (?, ?, ?)
Source§

fn eq_or_in<V: Into<Value>>(self, column: &str, values: Vec<V>) -> Self

Auto-detect EQ or IN (1 value → =, >1 values → IN)
Source§

fn ne_or_not_in<V: Into<Value>>(self, column: &str, values: Vec<V>) -> Self

Auto-detect NE or NOT IN (1 value → !=, >1 values → NOT IN)
Source§

fn between<V: Into<Value>>(self, column: &str, start: V, end: V) -> Self

column BETWEEN ? AND ?
Source§

fn not_between<V: Into<Value>>(self, column: &str, start: V, end: V) -> Self

column NOT BETWEEN ? AND ?
Source§

fn column_is_null(self, column: &str) -> Self

column IS NULL
Source§

fn column_is_not_null(self, column: &str) -> Self

column IS NOT NULL
Source§

fn column_is_true(self, column: &str) -> Self

column IS TRUE
Source§

fn column_is_false(self, column: &str) -> Self

column IS FALSE
Source§

fn and_wrapper(self, other: Wrapper) -> Self

Combine with another Wrapper using AND (adds parentheses) Read more
Source§

fn or_wrapper(self, other: Wrapper) -> Self

Combine with another Wrapper using OR (adds parentheses) Read more
Source§

fn len(&self) -> usize

Get number of conditions
Source§

fn is_empty(&self) -> bool

Check if there are any conditions

Auto Trait Implementations§

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, 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.