pub struct BigQueryInsertObjBuilder<'a, D, I>where
D: BigQueryWriteSupport,{ /* private fields */ }Expand description
An insert of rows. The default writes through the table’s default stream, at least once.
Implementations§
Source§impl<'a, D, I> BigQueryInsertObjBuilder<'a, D, I>
impl<'a, D, I> BigQueryInsertObjBuilder<'a, D, I>
Sourcepub fn exactly_once(self) -> Self
pub fn exactly_once(self) -> Self
Writes through a committed stream with offsets: each row exactly once, even when a request is sent again.
Sourcepub fn atomic(self) -> Self
pub fn atomic(self) -> Self
Writes through a pending stream: every row becomes visible at one commit, or none does.
Sourcepub fn buffered(self) -> Self
pub fn buffered(self) -> Self
Writes through a buffered stream with offsets: each row exactly once, readable from the
flush at the end of the insert. Unlike atomic, a failed batch does not
hold back the rows of the others.
Sourcepub fn upsert(self) -> Self
pub fn upsert(self) -> Self
Writes the rows as CDC upserts by primary key. Only the default stream takes CDC, so
together with exactly_once, atomic or
buffered the insert fails.
BigQueryExprBuilder::update does the same and can
add a sequence number.
Sourcepub fn options(self, options: BigQueryStreamingWriteOptions) -> Self
pub fn options(self, options: BigQueryStreamingWriteOptions) -> Self
Replaces the writer options, the mode included; call it before
exactly_once, atomic or
buffered to keep those.
Sourcepub async fn execute(self) -> BigQueryResult<BigQueryWriteSummary>
pub async fn execute(self) -> BigQueryResult<BigQueryWriteSummary>
Opens a writer, writes every row and finishes it.
Each call pays one GetWriteStream or CreateWriteStream round trip, about 300 ms,
so many small inserts should share a
BigQueryStreamingWriter.
§Errors
The first failed batch’s error; in pending mode nothing is committed then. A row that
does not serialize stops the insert with
BigQueryError::SerializeError; on the default and committed streams the batches
before it may be written. BigQueryError::InvalidParametersError for the field
mode for upsert with another mode than the default.
Trait Implementations§
Auto Trait Implementations§
impl<'a, D, I> Forget for BigQueryInsertObjBuilder<'a, D, I>
impl<'a, D, I> Freeze for BigQueryInsertObjBuilder<'a, D, I>
impl<'a, D, I> Move for BigQueryInsertObjBuilder<'a, D, I>
impl<'a, D, I> RefUnwindSafe for BigQueryInsertObjBuilder<'a, D, I>
impl<'a, D, I> Send for BigQueryInsertObjBuilder<'a, D, I>
impl<'a, D, I> Sync for BigQueryInsertObjBuilder<'a, D, I>
impl<'a, D, I> Unpin for BigQueryInsertObjBuilder<'a, D, I>
impl<'a, D, I> UnsafeUnpin for BigQueryInsertObjBuilder<'a, D, I>
impl<'a, D, I> UnwindSafe for BigQueryInsertObjBuilder<'a, D, I>
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request