refactor(router): move db models into separate crate and refactoring around it (#125)

This commit is contained in:
ItsMeShashank
2022-12-13 12:00:27 +05:30
committed by GitHub
parent fc670ea0da
commit eb4fe6f46b
106 changed files with 4013 additions and 3387 deletions

View File

@ -0,0 +1,16 @@
#[derive(Debug, thiserror::Error)]
pub enum DatabaseError {
#[error("An error occurred when obtaining database connection")]
DatabaseConnectionError,
#[error("The requested resource was not found in the database")]
NotFound,
#[error("A unique constraint violation occurred")]
UniqueViolation,
#[error("No fields were provided to be updated")]
NoFieldsToUpdate,
#[error("An error occurred when generating raw SQL query")]
QueryGenerationFailed,
// InsertFailed,
#[error("An unknown error occurred")]
Others,
}