pub struct UpdateBuilder<T> { /* private fields */ }Expand description
Builder for UPDATE queries. Implements Filterable and Modifiable.
Call .select() to add RETURNING clause.
Implementations§
Source§impl<T> UpdateBuilder<T>
impl<T> UpdateBuilder<T>
Sourcepub fn schema(self, schema: &str) -> UpdateBuilder<T>
pub fn schema(self, schema: &str) -> UpdateBuilder<T>
Override the schema for this query.
Generates "schema"."table" instead of the default schema.
Sourcepub fn select(self) -> UpdateBuilder<T>
pub fn select(self) -> UpdateBuilder<T>
Add RETURNING * clause.
Sourcepub fn select_columns(self, columns: &str) -> UpdateBuilder<T>
pub fn select_columns(self, columns: &str) -> UpdateBuilder<T>
Add RETURNING with specific columns.
Source§impl<T> UpdateBuilder<T>where
T: DeserializeOwned + Send,
impl<T> UpdateBuilder<T>where
T: DeserializeOwned + Send,
Sourcepub async fn execute(self) -> SupabaseResponse<T>
pub async fn execute(self) -> SupabaseResponse<T>
Execute the UPDATE query.
Trait Implementations§
Source§impl<T> Filterable for UpdateBuilder<T>
impl<T> Filterable for UpdateBuilder<T>
Source§fn filters_mut(&mut self) -> &mut Vec<FilterCondition>
fn filters_mut(&mut self) -> &mut Vec<FilterCondition>
Get a mutable reference to the filter list.
Source§fn params_mut(&mut self) -> &mut ParamStore
fn params_mut(&mut self) -> &mut ParamStore
Get a mutable reference to the parameter store.
Source§fn eq(self, column: &str, value: impl IntoSqlParam) -> Self
fn eq(self, column: &str, value: impl IntoSqlParam) -> Self
Filter: column = value
Source§fn neq(self, column: &str, value: impl IntoSqlParam) -> Self
fn neq(self, column: &str, value: impl IntoSqlParam) -> Self
Filter: column != value
Source§fn gt(self, column: &str, value: impl IntoSqlParam) -> Self
fn gt(self, column: &str, value: impl IntoSqlParam) -> Self
Filter: column > value
Source§fn gte(self, column: &str, value: impl IntoSqlParam) -> Self
fn gte(self, column: &str, value: impl IntoSqlParam) -> Self
Filter: column >= value
Source§fn lt(self, column: &str, value: impl IntoSqlParam) -> Self
fn lt(self, column: &str, value: impl IntoSqlParam) -> Self
Filter: column < value
Source§fn lte(self, column: &str, value: impl IntoSqlParam) -> Self
fn lte(self, column: &str, value: impl IntoSqlParam) -> Self
Filter: column <= value
Source§fn like(self, column: &str, pattern: impl IntoSqlParam) -> Self
fn like(self, column: &str, pattern: impl IntoSqlParam) -> Self
Filter: column LIKE pattern
Source§fn ilike(self, column: &str, pattern: impl IntoSqlParam) -> Self
fn ilike(self, column: &str, pattern: impl IntoSqlParam) -> Self
Filter: column ILIKE pattern (case-insensitive)
Source§fn is(self, column: &str, value: IsValue) -> Self
fn is(self, column: &str, value: IsValue) -> Self
Filter: column IS NULL / IS NOT NULL / IS TRUE / IS FALSE
Source§fn in_<V>(self, column: &str, values: Vec<V>) -> Selfwhere
V: IntoSqlParam,
fn in_<V>(self, column: &str, values: Vec<V>) -> Selfwhere
V: IntoSqlParam,
Filter: column IN (val1, val2, …)
Source§fn contains(self, column: &str, value: impl IntoSqlParam) -> Self
fn contains(self, column: &str, value: impl IntoSqlParam) -> Self
Filter: column @> value (contains)
Source§fn contained_by(self, column: &str, value: impl IntoSqlParam) -> Self
fn contained_by(self, column: &str, value: impl IntoSqlParam) -> Self
Filter: column <@ value (contained by)
Source§fn overlaps(self, column: &str, value: impl IntoSqlParam) -> Self
fn overlaps(self, column: &str, value: impl IntoSqlParam) -> Self
Filter: column && value (overlaps)
Source§fn range_gt(self, column: &str, value: impl IntoSqlParam) -> Self
fn range_gt(self, column: &str, value: impl IntoSqlParam) -> Self
Filter: column >> value (range strictly greater than)
Source§fn range_gte(self, column: &str, value: impl IntoSqlParam) -> Self
fn range_gte(self, column: &str, value: impl IntoSqlParam) -> Self
Filter: column &> value (range greater than or equal)
Source§fn range_lt(self, column: &str, value: impl IntoSqlParam) -> Self
fn range_lt(self, column: &str, value: impl IntoSqlParam) -> Self
Filter: column << value (range strictly less than)
Source§fn range_lte(self, column: &str, value: impl IntoSqlParam) -> Self
fn range_lte(self, column: &str, value: impl IntoSqlParam) -> Self
Filter: column &< value (range less than or equal)
Source§fn range_adjacent(self, column: &str, value: impl IntoSqlParam) -> Self
fn range_adjacent(self, column: &str, value: impl IntoSqlParam) -> Self
Filter: column -|- value (range adjacent)
Source§fn text_search(
self,
column: &str,
query: impl IntoSqlParam,
search_type: TextSearchType,
config: Option<&str>,
) -> Self
fn text_search( self, column: &str, query: impl IntoSqlParam, search_type: TextSearchType, config: Option<&str>, ) -> Self
Full-text search filter.
Source§fn not(self, f: impl FnOnce(FilterCollector<'_>) -> FilterCollector<'_>) -> Self
fn not(self, f: impl FnOnce(FilterCollector<'_>) -> FilterCollector<'_>) -> Self
Negate a filter condition using a closure.
Source§fn or_filter(
self,
f: impl FnOnce(FilterCollector<'_>) -> FilterCollector<'_>,
) -> Self
fn or_filter( self, f: impl FnOnce(FilterCollector<'_>) -> FilterCollector<'_>, ) -> Self
OR filter: combine multiple conditions with OR.
Source§fn match_filter(self, pairs: Vec<(&str, impl IntoSqlParam + Clone)>) -> Self
fn match_filter(self, pairs: Vec<(&str, impl IntoSqlParam + Clone)>) -> Self
Match multiple column=value pairs (all must match).
Source§impl<T> Modifiable for UpdateBuilder<T>
impl<T> Modifiable for UpdateBuilder<T>
Source§fn order(self, column: &str, direction: OrderDirection) -> Self
fn order(self, column: &str, direction: OrderDirection) -> Self
Order by a column.
Source§fn order_with_nulls(
self,
column: &str,
direction: OrderDirection,
nulls: NullsPosition,
) -> Self
fn order_with_nulls( self, column: &str, direction: OrderDirection, nulls: NullsPosition, ) -> Self
Order by a column with explicit nulls positioning.
Source§fn range(self, from: i64, to: i64) -> Self
fn range(self, from: i64, to: i64) -> Self
Set the range of rows to return (offset..offset+limit).
Source§fn maybe_single(self) -> Self
fn maybe_single(self) -> Self
Expect zero or one row. Returns error if >1 rows.
Source§fn count_option(self, option: CountOption) -> Self
fn count_option(self, option: CountOption) -> Self
Request a row count with a specific counting strategy.
Auto Trait Implementations§
impl<T> Freeze for UpdateBuilder<T>
impl<T> !RefUnwindSafe for UpdateBuilder<T>
impl<T> Send for UpdateBuilder<T>where
T: Send,
impl<T> Sync for UpdateBuilder<T>where
T: Sync,
impl<T> Unpin for UpdateBuilder<T>where
T: Unpin,
impl<T> !UnwindSafe for UpdateBuilder<T>
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