proof_of_sql/sql/postprocessing/
error.rs1use alloc::string::String;
2use snafu::Snafu;
3use sqlparser::ast::Ident;
4
5#[derive(Snafu, Debug, PartialEq, Eq)]
7pub enum PostprocessingError {
8 #[snafu(display("Error in slicing due to slice index beyond usize {index}"))]
10 InvalidSliceIndex {
11 index: i128,
13 },
14 #[snafu(display("Column not found: {column}"))]
16 ColumnNotFound {
17 column: String,
19 },
20 #[snafu(display("Index out of bounds: {index}"))]
22 IndexOutOfBounds {
23 index: usize,
25 },
26 #[snafu(transparent)]
28 ExpressionEvaluationError {
29 source: crate::base::database::ExpressionEvaluationError,
31 },
32 #[snafu(transparent)]
34 OwnedTableError {
35 source: crate::base::database::OwnedTableError,
37 },
38 #[snafu(display("Invalid group by: column '{column}' must not appear outside aggregate functions or `GROUP BY` clause."))]
40 IdentNotInAggregationOperatorOrGroupByClause {
41 column: Ident,
43 },
44 #[snafu(display("Failed to convert `Ident` to `Identifier`: {error}"))]
46 IdentifierConversionError {
47 error: String,
49 },
50 #[snafu(transparent)]
52 AggregateColumnsError {
53 source: crate::base::database::group_by_util::AggregateColumnsError,
55 },
56 #[snafu(transparent)]
58 OwnedColumnError {
59 source: crate::base::database::OwnedColumnError,
61 },
62 #[snafu(display("Nested aggregation in `GROUP BY` clause: {error}"))]
64 NestedAggregationInGroupByClause {
65 error: String,
67 },
68}
69
70pub type PostprocessingResult<T> = core::result::Result<T, PostprocessingError>;