pub struct InsertBuilder { /* private fields */ }Implementations§
source§impl InsertBuilder
impl InsertBuilder
pub fn new(table_name: &str, record_batches: Vec<RecordBatch>) -> Self
sourcepub fn construct_insert_stmt<T: QueryBuilder + 'static>(
&self,
insert_stmt: &mut InsertStatement,
record_batch: &RecordBatch,
query_builder: &T,
) -> Result<()>
pub fn construct_insert_stmt<T: QueryBuilder + 'static>( &self, insert_stmt: &mut InsertStatement, record_batch: &RecordBatch, query_builder: &T, ) -> Result<()>
Create an Insert statement from a RecordBatch.
§Errors
Returns an error if a column’s data type is not supported, or its conversion failed.
sourcepub fn build_postgres(self, on_conflict: Option<OnConflict>) -> Result<String>
pub fn build_postgres(self, on_conflict: Option<OnConflict>) -> Result<String>
§Errors
Returns an error if any RecordBatch fails to convert into a valid postgres insert statement.
sourcepub fn build_sqlite(self, on_conflict: Option<OnConflict>) -> Result<String>
pub fn build_sqlite(self, on_conflict: Option<OnConflict>) -> Result<String>
§Errors
Returns an error if any RecordBatch fails to convert into a valid sqlite insert statement.
sourcepub fn build_mysql(self, on_conflict: Option<OnConflict>) -> Result<String>
pub fn build_mysql(self, on_conflict: Option<OnConflict>) -> Result<String>
§Errors
Returns an error if any RecordBatch fails to convert into a valid MySQL insert statement.
sourcepub fn build<T: GenericBuilder + 'static>(
&self,
query_builder: T,
on_conflict: Option<OnConflict>,
) -> Result<String>
pub fn build<T: GenericBuilder + 'static>( &self, query_builder: T, on_conflict: Option<OnConflict>, ) -> Result<String>
§Errors
Returns an error if any RecordBatch fails to convert into a valid insert statement. Upon
error, no further RecordBatch is processed.
Auto Trait Implementations§
impl Freeze for InsertBuilder
impl !RefUnwindSafe for InsertBuilder
impl Send for InsertBuilder
impl Sync for InsertBuilder
impl Unpin for InsertBuilder
impl !UnwindSafe for InsertBuilder
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