Enum duckdb::Error [−][src]
#[non_exhaustive]
pub enum Error {
Show 17 variants
DuckDBFailure(Error, Option<String>),
FromSqlConversionFailure(usize, Type, Box<dyn Error + Send + Sync + 'static>),
IntegralValueOutOfRange(usize, i128),
Utf8Error(Utf8Error),
NulError(NulError),
InvalidParameterName(String),
InvalidPath(PathBuf),
ExecuteReturnedResults,
QueryReturnedNoRows,
InvalidColumnIndex(usize),
InvalidColumnName(String),
InvalidColumnType(usize, String, Type),
StatementChangedRows(usize),
ToSqlConversionFailure(Box<dyn Error + Send + Sync + 'static>),
InvalidQuery,
MultipleStatement,
InvalidParameterCount(usize, usize),
}
Expand description
Enum listing possible errors from duckdb.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
An error from an underlying DuckDB call.
Error when the value of a particular column is requested, but it cannot be converted to the requested Rust type.
Error when DuckDB gives us an integral value outside the range of the
requested type (e.g., trying to get the value 1000 into a u8
).
The associated usize
is the column index,
and the associated i64
is the value returned by SQLite.
Utf8Error(Utf8Error)
Error converting a string to UTF-8.
Tuple Fields of Utf8Error
0: Utf8Error
NulError(NulError)
Error converting a string to a C-compatible string because it contained an embedded nul.
Tuple Fields of NulError
0: NulError
InvalidParameterName(String)
Error when using SQL named parameters and passing a parameter name not present in the SQL.
Tuple Fields of InvalidParameterName
0: String
InvalidPath(PathBuf)
Error converting a file path to a string.
Tuple Fields of InvalidPath
0: PathBuf
Error returned when an execute
call
returns rows.
Error when a query that was expected to return at least one row (e.g.,
for query_row
) did not return any.
InvalidColumnIndex(usize)
Error when the value of a particular column is requested, but the index is out of range for the statement.
Tuple Fields of InvalidColumnIndex
0: usize
InvalidColumnName(String)
Error when the value of a named column is requested, but no column matches the name for the statement.
Tuple Fields of InvalidColumnName
0: String
Error when the value of a particular column is requested, but the type of the result in that column cannot be converted to the requested Rust type.
StatementChangedRows(usize)
Error when a query that was expected to insert one row did not insert any or insert many.
Tuple Fields of StatementChangedRows
0: usize
Error available for the implementors of the
ToSql
trait.
Error when the SQL is not a SELECT
, is not read-only.
Error when the SQL contains multiple statements.
Error when the number of bound parameters does not match the number of
parameters in the query. The first usize
is how many parameters were
given, the 2nd is how many were expected.
Trait Implementations
The conversion isn’t precise, but it’s convenient to have it
to allow use of get_raw(…).as_…()?
in callbacks that take Error
.
Performs the conversion.