pub struct Savepoint {
pub name: String,
}Expand description
A named savepoint within a transaction.
Savepoints allow partial rollback within a transaction. They can be created and managed via server-side GQL commands.
§Example
ⓘ
conn.begin().await?;
conn.query("CREATE (n:Node {id: 1})").await?;
let sp = conn.savepoint("before_risky_op")?;
match conn.query("CREATE (n:Node {id: 2})").await {
Ok(_) => {},
Err(_) => conn.rollback_to(&sp).await?, // Undo only the second create
}
conn.commit().await?; // First node is savedFields§
§name: StringThe savepoint name
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Savepoint
impl RefUnwindSafe for Savepoint
impl Send for Savepoint
impl Sync for Savepoint
impl Unpin for Savepoint
impl UnwindSafe for Savepoint
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> 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>
Wrap the input message
T in a tonic::Request