Cont. added reexports for sqlx errors (#1434)

* added reexports for sqlx errors (#1181)

Co-authored-by: erhodes <erik@space-nav.com>

* Re-export SQLx error types

* Apply suggestions from code review

---------

Co-authored-by: e-rhodes <33500135+e-rhodes@users.noreply.github.com>
Co-authored-by: erhodes <erik@space-nav.com>
Co-authored-by: Chris Tsang <chris.2y3@outlook.com>
This commit is contained in:
Billy Chan 2023-01-31 13:03:57 +08:00 committed by GitHub
parent 67aa35e3c1
commit e2721e094a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,15 @@
#[cfg(feature = "sqlx-dep")]
use sqlx::error::Error as SqlxError;
#[cfg(all(feature = "sea-orm-internal", feature = "sqlx-dep"))]
pub use sqlx::error::Error as SqlxError;
#[cfg(all(feature = "sea-orm-internal", feature = "sqlx-mysql"))]
pub use sqlx::mysql::MySqlDatabaseError as SqlxMySqlError;
#[cfg(all(feature = "sea-orm-internal", feature = "sqlx-postgres"))]
pub use sqlx::postgres::PgDatabaseError as SqlxPostgresError;
#[cfg(all(feature = "sea-orm-internal", feature = "sqlx-sqlite"))]
pub use sqlx::sqlite::SqliteError as SqlxSqliteError;
use thiserror::Error;
/// An error from unsuccessful database operations
@ -71,7 +81,7 @@ pub enum RuntimeErr {
/// SQLx Error
#[cfg(feature = "sqlx-dep")]
#[error("{0}")]
SqlxError(SqlxError),
SqlxError(sqlx::error::Error),
/// Error generated from within SeaORM
#[error("{0}")]
Internal(String),