(to: SetVariableTo)
| 66 | } |
| 67 | |
| 68 | pub 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 | |
| 86 | pub fn describe_reset_variable( |
| 87 | _: &StatementContext, |
no test coverage detected