Skip to main content

sql_insight/
error.rs

1use sqlparser::parser::ParserError;
2
3/// Top-level error type for sql-insight.
4#[allow(clippy::enum_variant_names)]
5#[derive(Debug, Eq, thiserror::Error, PartialEq)]
6pub enum Error {
7    /// Invalid CLI argument (unknown dialect, malformed option).
8    /// Not emitted by the library.
9    #[error("{0}")]
10    ArgumentError(String),
11    /// SQL parse failure surfaced from sqlparser.
12    #[error("{0}")]
13    ParserError(#[from] ParserError),
14    /// Semantic analysis rejected the input (e.g. a qualified
15    /// name with more than three parts).
16    #[error("{0}")]
17    AnalysisError(String),
18    /// I/O failure. CLI only.
19    #[error("{0}")]
20    IOError(String),
21}