proof_of_sql_parser/
error.rs

1use alloc::string::String;
2use snafu::Snafu;
3
4/// Errors encountered during the parsing process
5#[expect(clippy::module_name_repetitions)]
6#[derive(Debug, Snafu, Eq, PartialEq)]
7pub enum ParseError {
8    #[snafu(display("Unable to parse query"))]
9    /// Cannot parse the query
10    QueryParseError {
11        /// The underlying error
12        error: String,
13    },
14    #[snafu(display("Unable to parse identifier"))]
15    /// Cannot parse the identifier
16    IdentifierParseError {
17        /// The underlying error
18        error: String,
19    },
20    #[snafu(display("Unable to parse resource_id"))]
21    /// Cannot parse the `resource_id`
22    ResourceIdParseError {
23        /// The underlying error
24        error: String,
25    },
26}
27
28/// General parsing error that may occur, for example if the provided `schema`/`object_name` strings
29/// aren't valid postgres-style identifiers (excluding dollar signs).
30pub type ParseResult<T> = Result<T, ParseError>;