pub struct InsertBuilder<T> { /* private fields */ }Expand description
Builder for INSERT queries. Implements Modifiable (for count).
Call .select() to add RETURNING clause.
Implementations§
Source§impl<T> InsertBuilder<T>
impl<T> InsertBuilder<T>
Sourcepub fn schema(self, schema: &str) -> InsertBuilder<T>
pub fn schema(self, schema: &str) -> InsertBuilder<T>
Override the schema for this query.
Generates "schema"."table" instead of the default schema.
Sourcepub fn select(self) -> InsertBuilder<T>
pub fn select(self) -> InsertBuilder<T>
Add RETURNING clause to get inserted rows back.
Sourcepub fn select_columns(self, columns: &str) -> InsertBuilder<T>
pub fn select_columns(self, columns: &str) -> InsertBuilder<T>
Add RETURNING clause with specific columns.
Source§impl<T> InsertBuilder<T>where
T: DeserializeOwned + Send,
impl<T> InsertBuilder<T>where
T: DeserializeOwned + Send,
Sourcepub async fn execute(self) -> SupabaseResponse<T>
pub async fn execute(self) -> SupabaseResponse<T>
Execute the INSERT query.
Trait Implementations§
Source§impl<T> Modifiable for InsertBuilder<T>
impl<T> Modifiable for InsertBuilder<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 InsertBuilder<T>
impl<T> !RefUnwindSafe for InsertBuilder<T>
impl<T> Send for InsertBuilder<T>where
T: Send,
impl<T> Sync for InsertBuilder<T>where
T: Sync,
impl<T> Unpin for InsertBuilder<T>where
T: Unpin,
impl<T> !UnwindSafe for InsertBuilder<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