MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / end_transaction

Method end_transaction

src/sql/src/session/vars.rs:317–330  ·  view source on GitHub ↗
(&self, action: EndTransactionAction)

Source from the content-addressed store, hash-verified

315 /// Returns a possibly new SessionVar if this needs to mutate at transaction end.
316 #[must_use]
317 pub fn end_transaction(&self, action: EndTransactionAction) -> Option<Self> {
318 if !self.is_mutating() {
319 return None;
320 }
321 let mut next: Self = self.clone();
322 next.local_value = None;
323 match action {
324 EndTransactionAction::Commit if next.staged_value.is_some() => {
325 next.session_value = next.staged_value.take()
326 }
327 _ => next.staged_value = None,
328 }
329 Some(next)
330 }
331
332 /// Whether this Var needs to mutate at the end of a transaction.
333 pub fn is_mutating(&self) -> bool {

Callers

nothing calls this directly

Calls 11

is_mutatingMethod · 0.80
is_someMethod · 0.80
expectMethod · 0.80
cloneMethod · 0.45
takeMethod · 0.45
iterMethod · 0.45
valueMethod · 0.45
pushMethod · 0.45
insertMethod · 0.45
nameMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected