feat: add support for PostgreSQL as a backend repository

This commit is contained in:
Kieran
2023-01-22 16:26:54 -06:00
committed by Greg Heartsfield
parent 744d467a28
commit 16f6e974c8
9 changed files with 1539 additions and 17 deletions
+10
View File
@@ -48,6 +48,10 @@ pub enum Error {
DatabaseDirError,
#[error("Database Connection Pool Error")]
DatabasePoolError(r2d2::Error),
#[error("SQL error")]
SqlxError(sqlx::Error),
#[error("Database Connection Pool Error")]
SqlxDatabasePoolError(sqlx::Error),
#[error("Custom Error : {0}")]
CustomError(String),
#[error("Task join error")]
@@ -100,6 +104,12 @@ impl From<rusqlite::Error> for Error {
}
}
impl From<sqlx::Error> for Error {
fn from(d: sqlx::Error) -> Self {
Error::SqlxDatabasePoolError(d)
}
}
impl From<serde_json::Error> for Error {
/// Wrap JSON error
fn from(r: serde_json::Error) -> Self {