Merge remote-tracking branch 'jgallagher/master' into vtab

This commit is contained in:
gwenn
2016-05-16 18:58:56 +02:00
4 changed files with 102 additions and 0 deletions

View File

@@ -56,6 +56,13 @@ pub enum Error {
/// that column cannot be converted to the requested Rust type.
InvalidColumnType,
/// Error when a query that was expected to insert one row did not insert any or insert many.
StatementChangedRows(c_int),
/// Error when a query that was expected to insert a row did not change the connection's
/// last_insert_rowid().
StatementFailedToInsertRow,
/// Error returned by `functions::Context::get` when the function argument cannot be converted
/// to the requested type.
#[cfg(feature = "functions")]
@@ -108,6 +115,8 @@ impl fmt::Display for Error {
Error::InvalidColumnIndex(i) => write!(f, "Invalid column index: {}", i),
Error::InvalidColumnName(ref name) => write!(f, "Invalid column name: {}", name),
Error::InvalidColumnType => write!(f, "Invalid column type"),
Error::StatementChangedRows(i) => write!(f, "Query changed {} rows", i),
Error::StatementFailedToInsertRow => write!(f, "Statement failed to insert new row"),
#[cfg(feature = "functions")]
Error::InvalidFunctionParameterType => write!(f, "Invalid function parameter type"),
@@ -140,6 +149,8 @@ impl error::Error for Error {
Error::InvalidColumnIndex(_) => "invalid column index",
Error::InvalidColumnName(_) => "invalid column name",
Error::InvalidColumnType => "invalid column type",
Error::StatementChangedRows(_) => "query inserted zero or more than one row",
Error::StatementFailedToInsertRow => "statement failed to insert new row",
#[cfg(feature = "functions")]
Error::InvalidFunctionParameterType => "invalid function parameter type",
@@ -167,6 +178,8 @@ impl error::Error for Error {
Error::InvalidColumnName(_) |
Error::InvalidColumnType |
Error::InvalidPath(_) => None,
Error::StatementChangedRows(_) => None,
Error::StatementFailedToInsertRow => None,
#[cfg(feature = "functions")]
Error::InvalidFunctionParameterType => None,