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

Function plan_set_variable_to

src/sql/src/plan/statement/scl.rs:68–84  ·  view source on GitHub ↗
(to: SetVariableTo)

Source from the content-addressed store, hash-verified

66}
67
68pub fn plan_set_variable_to(to: SetVariableTo) -> Result<VariableValue, PlanError> {
69 match to {
70 SetVariableTo::Default => Ok(VariableValue::Default),
71 SetVariableTo::Values(values) => {
72 // Per PostgreSQL, string literals and identifiers are treated
73 // equivalently during `SET`. We retain only the underlying string
74 // value of each element in the list. It's our caller's
75 // responsibility to figure out how to set the variable to the
76 // provided list of values using variable-specific logic.
77 let values = values
78 .into_iter()
79 .map(|v| v.into_unquoted_value())
80 .collect();
81 Ok(VariableValue::Values(values))
82 }
83 }
84}
85
86pub fn describe_reset_variable(
87 _: &StatementContext,

Callers 3

plan_set_variableFunction · 0.85
plan_role_variableFunction · 0.85
plan_alter_system_setFunction · 0.85

Calls 5

into_unquoted_valueMethod · 0.80
ValuesClass · 0.50
collectMethod · 0.45
mapMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected