Enum rusqlite::Error[][src]

#[non_exhaustive]
pub enum Error {
Show 25 variants SqliteFailure(ErrorOption<String>), SqliteSingleThreadedMode, FromSqlConversionFailure(usizeTypeBox<dyn Error + Send + Sync + 'static>), IntegralValueOutOfRange(usizei64), Utf8Error(Utf8Error), NulError(NulError), InvalidParameterName(String), InvalidPath(PathBuf), ExecuteReturnedResults, QueryReturnedNoRows, InvalidColumnIndex(usize), InvalidColumnName(String), InvalidColumnType(usizeStringType), StatementChangedRows(usize), InvalidFunctionParameterType(usizeType), InvalidFilterParameterType(usizeType), UserFunctionError(Box<dyn Error + Send + Sync + 'static>), ToSqlConversionFailure(Box<dyn Error + Send + Sync + 'static>), InvalidQuery, ModuleError(String), UnwindingPanic, GetAuxWrongType, MultipleStatement, InvalidParameterCount(usizeusize), BlobSizeError,
}
Expand description

Enum listing possible errors from rusqlite.

Variants (Non-exhaustive)

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
SqliteFailure(ErrorOption<String>)

An error from an underlying SQLite call.

Tuple Fields of SqliteFailure

0: Error1: Option<String>
SqliteSingleThreadedMode

Error reported when attempting to open a connection when SQLite was configured to allow single-threaded use only.

FromSqlConversionFailure(usizeTypeBox<dyn Error + Send + Sync + 'static>)

Error when the value of a particular column is requested, but it cannot be converted to the requested Rust type.

Tuple Fields of FromSqlConversionFailure

0: usize1: Type2: Box<dyn Error + Send + Sync + 'static>
IntegralValueOutOfRange(usizei64)

Error when SQLite 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.

Tuple Fields of IntegralValueOutOfRange

0: usize1: i64
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
ExecuteReturnedResults

Error returned when an execute call returns rows.

QueryReturnedNoRows

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
InvalidColumnType(usizeStringType)

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.

Tuple Fields of InvalidColumnType

0: usize1: String2: 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
InvalidFunctionParameterType(usizeType)
This is supported on crate feature functions only.

Error returned by functions::Context::get when the function argument cannot be converted to the requested type.

Tuple Fields of InvalidFunctionParameterType

0: usize1: Type
InvalidFilterParameterType(usizeType)
This is supported on crate feature vtab only.

Error returned by vtab::Values::get when the filter argument cannot be converted to the requested type.

Tuple Fields of InvalidFilterParameterType

0: usize1: Type
UserFunctionError(Box<dyn Error + Send + Sync + 'static>)
This is supported on crate feature functions only.

An error case available for implementors of custom user functions (e.g., create_scalar_function).

Tuple Fields of UserFunctionError

0: Box<dyn Error + Send + Sync + 'static>
ToSqlConversionFailure(Box<dyn Error + Send + Sync + 'static>)

Error available for the implementors of the ToSql trait.

Tuple Fields of ToSqlConversionFailure

0: Box<dyn Error + Send + Sync + 'static>
InvalidQuery

Error when the SQL is not a SELECT, is not read-only.

ModuleError(String)
This is supported on crate feature vtab only.

An error case available for implementors of custom modules (e.g., create_module).

Tuple Fields of ModuleError

0: String
UnwindingPanic
This is supported on crate feature functions only.

An unwinding panic occurs in an UDF (user-defined function).

GetAuxWrongType
This is supported on crate feature functions only.

An error returned when Context::get_aux attempts to retrieve data of a different type than what had been stored using Context::set_aux.

MultipleStatement

Error when the SQL contains multiple statements.

InvalidParameterCount(usizeusize)

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.

Tuple Fields of InvalidParameterCount

0: usize1: usize
BlobSizeError
This is supported on crate feature blob only.

Returned from various functions in the Blob IO positional API. For example, Blob::raw_read_at_exact will return it if the blob has insufficient data.

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

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.

Performs the conversion.

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.