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

Method reset

src/sql/src/session/vars.rs:301–313  ·  view source on GitHub ↗

Reset the stored value to the default.

(&mut self, local: bool)

Source from the content-addressed store, hash-verified

299
300 /// Reset the stored value to the default.
301 pub fn reset(&mut self, local: bool) {
302 let value = self
303 .default_value
304 .as_ref()
305 .map(|v| v.as_ref())
306 .unwrap_or_else(|| self.definition.value.value());
307 if local {
308 self.local_value = Some(value.box_clone());
309 } else {
310 self.local_value = None;
311 self.staged_value = Some(value.box_clone());
312 }
313 }
314
315 /// Returns a possibly new SessionVar if this needs to mutate at transaction end.
316 #[must_use]

Callers 1

reset_allMethod · 0.45

Calls 11

compat_translate_nameFunction · 0.85
check_read_onlyMethod · 0.80
is_someMethod · 0.80
notify_callbacksMethod · 0.80
mapMethod · 0.45
as_refMethod · 0.45
valueMethod · 0.45
box_cloneMethod · 0.45
get_mutMethod · 0.45
visibleMethod · 0.45
to_stringMethod · 0.45

Tested by

no test coverage detected