proof_of_sql/base/database/
owned_column_error.rs1use crate::base::database::ColumnType;
2use alloc::string::String;
3use snafu::Snafu;
4
5#[derive(Snafu, Debug, PartialEq, Eq)]
7pub enum OwnedColumnError {
8 #[snafu(display("Can not perform type casting from {from_type:?} to {to_type:?}"))]
10 TypeCastError {
11 from_type: ColumnType,
13 to_type: ColumnType,
15 },
16 #[snafu(display("Error in converting scalars to a given column type: {error}"))]
18 ScalarConversionError {
19 error: String,
21 },
22 #[snafu(display("Unsupported operation: {error}"))]
24 Unsupported {
25 error: String,
27 },
28}
29
30#[derive(Snafu, Debug, PartialEq, Eq)]
32pub(crate) enum ColumnCoercionError {
33 #[snafu(display("Overflow when coercing a column"))]
35 Overflow,
36 #[snafu(display("Invalid type coercion"))]
38 InvalidTypeCoercion,
39}
40
41pub type OwnedColumnResult<T> = core::result::Result<T, OwnedColumnError>;