#[non_exhaustive]pub enum Operation {
Insert(Box<Write>),
Update(Box<Write>),
InsertOrUpdate(Box<Write>),
Replace(Box<Write>),
Delete(Box<Delete>),
Send(Box<Send>),
Ack(Box<Ack>),
}Expand description
Required. The operation to perform.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Insert(Box<Write>)
Insert new rows in a table. If any of the rows already exist,
the write or transaction fails with error ALREADY_EXISTS.
Update(Box<Write>)
Update existing rows in a table. If any of the rows does not
already exist, the transaction fails with error NOT_FOUND.
InsertOrUpdate(Box<Write>)
Like insert, except that if the row already exists, then its column values are overwritten with the ones provided. Any column values not explicitly written are preserved.
When using
insert_or_update, just as
when using insert, all NOT NULL
columns in the table must be given a value. This holds true even when the
row already exists and will therefore actually be updated.
Replace(Box<Write>)
Like insert, except that if the row
already exists, it is deleted, and the column values provided are
inserted instead. Unlike
insert_or_update, this
means any values not explicitly written become NULL.
In an interleaved table, if you create the child table with the
ON DELETE CASCADE annotation, then replacing a parent row
also deletes the child rows. Otherwise, you must delete the
child rows before you replace the parent row.
Delete(Box<Delete>)
Delete rows from a table. Succeeds whether or not the named rows were present.
Send(Box<Send>)
Send a message to a queue.
Ack(Box<Ack>)
Ack a message from a queue.
Implementations§
Source§impl Operation
impl Operation
Sourcepub fn from_insert(value: impl Into<Box<Write>>) -> Self
pub fn from_insert(value: impl Into<Box<Write>>) -> Self
Initializes the enum to the Insert branch.
Sourcepub fn from_update(value: impl Into<Box<Write>>) -> Self
pub fn from_update(value: impl Into<Box<Write>>) -> Self
Initializes the enum to the Update branch.
Sourcepub fn from_insert_or_update(value: impl Into<Box<Write>>) -> Self
pub fn from_insert_or_update(value: impl Into<Box<Write>>) -> Self
Initializes the enum to the InsertOrUpdate branch.
Sourcepub fn from_replace(value: impl Into<Box<Write>>) -> Self
pub fn from_replace(value: impl Into<Box<Write>>) -> Self
Initializes the enum to the Replace branch.
Trait Implementations§
impl StructuralPartialEq for Operation
Auto Trait Implementations§
impl Freeze for Operation
impl RefUnwindSafe for Operation
impl Send for Operation
impl Sync for Operation
impl Unpin for Operation
impl UnsafeUnpin for Operation
impl UnwindSafe for Operation
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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