Normalizes an operator reference. Qualified operators outside of the pg_catalog schema are rejected.
(op: &Op)
| 89 | /// |
| 90 | /// Qualified operators outside of the pg_catalog schema are rejected. |
| 91 | pub fn op(op: &Op) -> Result<&str, PlanError> { |
| 92 | if let Some(namespace) = &op.namespace { |
| 93 | if namespace.len() != 0 |
| 94 | && (namespace.len() != 1 |
| 95 | || namespace[0].as_str() != mz_repr::namespaces::PG_CATALOG_SCHEMA) |
| 96 | { |
| 97 | sql_bail!( |
| 98 | "operator does not exist: {}.{}", |
| 99 | namespace.iter().map(|n| n.to_string()).join("."), |
| 100 | op.op, |
| 101 | ) |
| 102 | } |
| 103 | } |
| 104 | Ok(&op.op) |
| 105 | } |
| 106 | |
| 107 | #[derive(Debug, Clone)] |
| 108 | pub enum SqlValueOrSecret { |
no test coverage detected