pub enum SqlError {
Parse {
line: usize,
col: usize,
msg: String,
},
UnknownTable(String),
UnknownColumn {
table: String,
column: String,
},
AmbiguousColumn(String),
TypeMismatch {
column: String,
expected: CandidDataTypeKind,
got: String,
},
InvalidLiteral {
column: String,
expected: CandidDataTypeKind,
reason: String,
},
MissingWhereClause,
ParameterCountMismatch {
expected: usize,
got: usize,
},
TransactionAlreadyActive,
NoActiveTransaction,
Unsupported(String),
Runtime(DbmsError),
}sql only.Expand description
Errors returned while parsing, planning, or executing a SQL statement.
Variants§
Parse
The statement is not valid SQL for the supported grammar.
line and col are 1-based and point at the offending token.
UnknownTable(String)
The statement references a table, or a table qualifier, that does not exist.
UnknownColumn
The statement references a column that does not exist on table.
AmbiguousColumn(String)
An unqualified column name exists on more than one table of a join.
TypeMismatch
A literal or parameter has a type that cannot be used for column.
got is the kind of the offending literal (Integer, Float,
String, Boolean) or the type name of the bound parameter.
InvalidLiteral
A literal or parameter has the right kind but a value that column
cannot hold, such as an out-of-range integer or a malformed date.
MissingWhereClause
An UPDATE or DELETE statement has no WHERE clause.
ParameterCountMismatch
The number of bound parameters differs from the number of ? placeholders.
TransactionAlreadyActive
BEGIN was issued together with a transaction ID.
NoActiveTransaction
COMMIT or ROLLBACK was issued without a transaction ID.
Unsupported(String)
The statement is valid SQL but uses a combination the engine cannot execute.
Runtime(DbmsError)
The DBMS rejected the statement while executing it.
Trait Implementations§
Source§impl CandidType for SqlError
impl CandidType for SqlError
Source§impl<'de> Deserialize<'de> for SqlError
impl<'de> Deserialize<'de> for SqlError
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SqlError, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SqlError, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Error for SqlError
impl Error for SqlError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()