Extracted from PostgreSQL 9.6. ```ignore SELECT typcategory, typname, typispreferred FROM pg_catalog.pg_type WHERE typispreferred = true ORDER BY typcategory; ```
(&self)
| 193 | /// ORDER BY typcategory; |
| 194 | /// ``` |
| 195 | pub fn preferred_type(&self) -> Option<SqlScalarType> { |
| 196 | match self { |
| 197 | Self::Array |
| 198 | | Self::BitString |
| 199 | | Self::Composite |
| 200 | | Self::Enum |
| 201 | | Self::Geometric |
| 202 | | Self::List |
| 203 | | Self::NetworkAddress |
| 204 | | Self::Pseudo |
| 205 | | Self::Range |
| 206 | | Self::Unknown |
| 207 | | Self::UserDefined => None, |
| 208 | Self::Boolean => Some(SqlScalarType::Bool), |
| 209 | Self::DateTime => Some(SqlScalarType::TimestampTz { precision: None }), |
| 210 | Self::Numeric => Some(SqlScalarType::Float64), |
| 211 | Self::String => Some(SqlScalarType::String), |
| 212 | Self::Timespan => Some(SqlScalarType::Interval), |
| 213 | } |
| 214 | } |
| 215 | } |
| 216 | |
| 217 | /// Builds an expression that evaluates a scalar function on the provided |
no outgoing calls
no test coverage detected