split store and store_sqlite implementatio into multiple crates

This commit is contained in:
Lennart
2024-10-28 15:34:20 +01:00
parent 53d2ea10e6
commit c013ffa117
13 changed files with 213 additions and 107 deletions

View File

@@ -1,4 +1,5 @@
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("Not found")]
NotFound,
@@ -9,21 +10,9 @@ pub enum Error {
#[error("Invalid ics/vcf input: {0}")]
InvalidData(String),
#[error(transparent)]
SqlxError(sqlx::Error),
#[error(transparent)]
Other(#[from] anyhow::Error),
#[error(transparent)]
ParserError(#[from] ical::parser::ParserError),
}
impl From<sqlx::Error> for Error {
fn from(value: sqlx::Error) -> Self {
match value {
sqlx::Error::RowNotFound => Error::NotFound,
err => Error::SqlxError(err),
}
}
}