pub struct PartitionedDmlTransaction { /* private fields */ }Expand description
A Partitioned DML transaction.
Partitioned DML transactions are used to execute a single DML statement that may modify a large number of rows. The execution of the statement will automatically be partitioned into smaller transactions by Spanner, which may execute in parallel.
A Partitioned DML transaction cannot be committed or rolled back.
See also: https://docs.cloud.google.com/spanner/docs/dml-partitioned
Implementations§
Source§impl PartitionedDmlTransaction
impl PartitionedDmlTransaction
Sourcepub async fn execute_update<T: Into<Statement>>(
self,
statement: T,
) -> Result<i64>
pub async fn execute_update<T: Into<Statement>>( self, statement: T, ) -> Result<i64>
Executes a Partitioned DML statement.
§Example
let db_client = spanner.database_client("projects/p/instances/i/databases/d").build().await?;
let transaction = db_client.partitioned_dml_transaction().build().await?;
let statement = Statement::builder("UPDATE users SET active = true WHERE TRUE").build();
let modified_rows = transaction.execute_update(statement).await?;§Return
The number of rows that was at least modified by the statement. Note that the actual number of rows that was modified may be higher than this number if the statement was retried or split into multiple transactions by Spanner, and some of these (sub)transactions were executed multiple times.
See also: https://docs.cloud.google.com/spanner/docs/dml-partitioned
Auto Trait Implementations§
impl !RefUnwindSafe for PartitionedDmlTransaction
impl !UnwindSafe for PartitionedDmlTransaction
impl Freeze for PartitionedDmlTransaction
impl Send for PartitionedDmlTransaction
impl Sync for PartitionedDmlTransaction
impl Unpin for PartitionedDmlTransaction
impl UnsafeUnpin for PartitionedDmlTransaction
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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