pub struct InsertSqlBuilder<'a> { /* private fields */ }
Implementations§
Source§impl<'a> InsertSqlBuilder<'a>
impl<'a> InsertSqlBuilder<'a>
pub fn table(self, table: &str) -> Self
pub fn data(self, fields: Vec<Field<'a>>) -> Self
pub fn returning(self, names: &[&str]) -> Self
pub async fn exec<'q, DB>(&'a self, db_pool: DB) -> Result<u64, Error>
pub async fn fetch_one<'e, DB, D>(&'a self, db_pool: DB) -> Result<D, Error>
pub async fn fetch_optional<'e, DB, D>( &'a self, db_pool: DB, ) -> Result<Option<D>, Error>
pub async fn fetch_all<'e, DB, D>( &'a self, db_pool: DB, ) -> Result<Vec<D>, Error>
Trait Implementations§
Source§impl<'a> SqlBuilder<'a> for InsertSqlBuilder<'a>
impl<'a> SqlBuilder<'a> for InsertSqlBuilder<'a>
fn sql(&self) -> String
fn vals( &'a self, ) -> Box<dyn Iterator<Item = &Box<dyn SqlxBindable + Send + Sync + 'a>> + Send + 'a>
fn exec<'q, 'async_trait, DB>( &'a self, db_pool: DB, ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>
fn fetch_one<'e, 'async_trait, DB, D>( &'a self, db_pool: DB, ) -> Pin<Box<dyn Future<Output = Result<D, Error>> + Send + 'async_trait>>
fn fetch_optional<'e, 'async_trait, DB, D>( &'a self, db_pool: DB, ) -> Pin<Box<dyn Future<Output = Result<Option<D>, Error>> + Send + 'async_trait>>
fn fetch_all<'e, 'async_trait, DB, D>( &'a self, db_pool: DB, ) -> Pin<Box<dyn Future<Output = Result<Vec<D>, Error>> + Send + 'async_trait>>
Auto Trait Implementations§
impl<'a> Freeze for InsertSqlBuilder<'a>
impl<'a> !RefUnwindSafe for InsertSqlBuilder<'a>
impl<'a> Send for InsertSqlBuilder<'a>
impl<'a> Sync for InsertSqlBuilder<'a>
impl<'a> Unpin for InsertSqlBuilder<'a>
impl<'a> !UnwindSafe for InsertSqlBuilder<'a>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more