use thiserror::Error;
#[derive(Debug, Clone, Error)]
pub enum SqlError {
#[error("SQL parse error: {0}")]
ParseError(String),
#[error("Unsupported SQL feature: {0}")]
UnsupportedFeature(String),
#[error("Invalid table '{0}': expected 'nodes' or 'edges'")]
InvalidTable(String),
#[error("Invalid column reference: {0}")]
InvalidColumn(String),
#[error("Invalid temporal clause: {0}")]
InvalidTemporalClause(String),
#[error("Invalid timestamp: {0}")]
InvalidTimestamp(String),
#[error("Missing required clause: {0}")]
MissingClause(String),
#[error("Type error: {0}")]
TypeError(String),
#[error("Parameter error: {0}")]
ParameterError(String),
}
impl From<sqlparser::parser::ParserError> for SqlError {
fn from(err: sqlparser::parser::ParserError) -> Self {
SqlError::ParseError(err.to_string())
}
}