Enum proof_of_sql::sql::parse::ConversionError
source · pub enum ConversionError {
Show 14 variants
MissingColumn(Box<Identifier>, Box<ResourceId>),
MissingColumnWithoutTable(Box<Identifier>),
InvalidDataType {
expected: ColumnType,
actual: ColumnType,
},
DataTypeMismatch(String, String),
DifferentColumnLength(usize, usize),
DuplicateResultAlias(String),
NonbooleanWhereClause(ColumnType),
InvalidOrderBy(String),
InvalidGroupByColumnRef(String),
InvalidExpression(String),
ParseError(String),
DecimalConversionError(DecimalError),
TimestampConversionError(PoSQLTimestampError),
Unprovable(String),
}
Expand description
Errors from converting an intermediate AST into a provable AST.
Variants§
MissingColumn(Box<Identifier>, Box<ResourceId>)
The column is missing in the table
MissingColumnWithoutTable(Box<Identifier>)
The column is missing (without table information)
InvalidDataType
Invalid data type received
DataTypeMismatch(String, String)
Data types do not match
DifferentColumnLength(usize, usize)
Two columns do not have the same length
DuplicateResultAlias(String)
Duplicate alias in result columns
NonbooleanWhereClause(ColumnType)
WHERE clause is not boolean
InvalidOrderBy(String)
ORDER BY clause references a non-existent alias
InvalidGroupByColumnRef(String)
GROUP BY clause references a non-existent column
InvalidExpression(String)
General error for invalid expressions
ParseError(String)
General parsing error
DecimalConversionError(DecimalError)
Errors related to decimal operations
TimestampConversionError(PoSQLTimestampError)
Errors related to timestamp parsing
Unprovable(String)
Query requires unprovable feature
Implementations§
source§impl ConversionError
impl ConversionError
sourcepub fn non_numeric_expr_in_agg<S: Into<String>>(dtype: S, func: S) -> Self
pub fn non_numeric_expr_in_agg<S: Into<String>>(dtype: S, func: S) -> Self
Returns a ConversionError::InvalidExpression
for non-numeric types used in numeric aggregation functions.
Trait Implementations§
source§impl Debug for ConversionError
impl Debug for ConversionError
source§impl Display for ConversionError
impl Display for ConversionError
source§impl Error for ConversionError
impl Error for ConversionError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl From<ConversionError> for String
impl From<ConversionError> for String
source§fn from(error: ConversionError) -> Self
fn from(error: ConversionError) -> Self
Converts to this type from the input type.
source§impl From<DecimalError> for ConversionError
impl From<DecimalError> for ConversionError
source§fn from(source: DecimalError) -> Self
fn from(source: DecimalError) -> Self
Converts to this type from the input type.
source§impl From<IntermediateDecimalError> for ConversionError
impl From<IntermediateDecimalError> for ConversionError
source§fn from(err: IntermediateDecimalError) -> ConversionError
fn from(err: IntermediateDecimalError) -> ConversionError
Converts to this type from the input type.
source§impl From<PoSQLTimestampError> for ConversionError
impl From<PoSQLTimestampError> for ConversionError
source§fn from(source: PoSQLTimestampError) -> Self
fn from(source: PoSQLTimestampError) -> Self
Converts to this type from the input type.
source§impl From<String> for ConversionError
impl From<String> for ConversionError
source§impl PartialEq for ConversionError
impl PartialEq for ConversionError
impl Eq for ConversionError
impl StructuralPartialEq for ConversionError
Auto Trait Implementations§
impl Freeze for ConversionError
impl RefUnwindSafe for ConversionError
impl Send for ConversionError
impl Sync for ConversionError
impl Unpin for ConversionError
impl UnwindSafe for ConversionError
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more