(
&self,
options: Vec<(String, Value)>,
allow_duplicates: bool,
)
| 1970 | } |
| 1971 | |
| 1972 | fn parse_options_map( |
| 1973 | &self, |
| 1974 | options: Vec<(String, Value)>, |
| 1975 | allow_duplicates: bool, |
| 1976 | ) -> Result<HashMap<String, String>> { |
| 1977 | let mut options_map = HashMap::new(); |
| 1978 | for (key, value) in options { |
| 1979 | if !allow_duplicates && options_map.contains_key(&key) { |
| 1980 | return plan_err!("Option {key} is specified multiple times"); |
| 1981 | } |
| 1982 | |
| 1983 | let Some(value_string) = crate::utils::value_to_string(&value) else { |
| 1984 | return plan_err!("Unsupported Value {}", value); |
| 1985 | }; |
| 1986 | |
| 1987 | if !(&key.contains('.')) { |
| 1988 | // If config does not belong to any namespace, assume it is |
| 1989 | // a format option and apply the format prefix for backwards |
| 1990 | // compatibility. |
| 1991 | let renamed_key = format!("format.{key}"); |
| 1992 | options_map.insert(renamed_key.to_lowercase(), value_string); |
| 1993 | } else { |
| 1994 | options_map.insert(key.to_lowercase(), value_string); |
| 1995 | } |
| 1996 | } |
| 1997 | |
| 1998 | Ok(options_map) |
| 1999 | } |
| 2000 | |
| 2001 | /// Generate a plan for EXPLAIN ... that will print out a plan |
| 2002 | /// |
no test coverage detected