chore: bump sqlite system deps (#4262)

* chore: bump sqlite system deps

* chore: bump open ssl

* chore: fix clippy

* chore: remove unused deps

* chore: fix test
This commit is contained in:
Nathan.fooo
2023-12-31 10:23:43 +08:00
committed by GitHub
parent 5facb61e23
commit 2521611d6a
15 changed files with 99 additions and 484 deletions

View File

@ -10,18 +10,17 @@ diesel.workspace = true
diesel_derives = { version = "2.1.0", features = ["sqlite", "r2d2"] }
diesel_migrations = { version = "2.1.0", features = ["sqlite"] }
tracing.workspace = true
lazy_static = "1.4.0"
serde.workspace = true
serde_json.workspace = true
anyhow.workspace = true
parking_lot.workspace = true
r2d2 = ">= 0.8.2, < 0.9.0"
libsqlite3-sys = { version = ">=0.17.2, <0.28.0", features = ["bundled"] }
r2d2 = "0.8.10"
libsqlite3-sys = { version = "0.27.0", features = ["bundled"] }
scheduled-thread-pool = "0.2.6"
error-chain = "=0.12.0"
openssl = { version = "0.10.45", optional = true, features = ["vendored"] }
openssl-sys = { version = "0.9.80", optional = true, features = ["vendored"] }
openssl = { version = "0.10.62", optional = true, features = ["vendored"] }
openssl-sys = { version = "0.9.98", optional = true, features = ["vendored"] }
thiserror = "1.0"
[dev-dependencies]
tempfile = "3.5.0"

View File

@ -1,19 +1,15 @@
use error_chain::{
error_chain, error_chain_processing, impl_error_chain_kind, impl_error_chain_processed,
impl_extract_backtrace,
};
error_chain! {
errors {
UnknownMigrationExists(v: String) {
display("unknown migration version: '{}'", v),
}
}
foreign_links {
R2D2(::r2d2::Error);
Migrations(::diesel_migrations::MigrationError);
Diesel(::diesel::result::Error);
Connection(::diesel::ConnectionError);
Io(::std::io::Error);
}
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("Migration error: {0}")]
Migration(#[from] diesel_migrations::MigrationError),
#[error("r2d2 error: {0}")]
R2D2(#[from] r2d2::Error),
#[error("diesel error: {0}")]
Diesel(#[from] diesel::result::Error),
#[error("diesel connect error: {0}")]
Connect(#[from] diesel::ConnectionError),
#[error("internal error: {0}")]
Internal(#[from] anyhow::Error),
}
pub type Result<T> = std::result::Result<T, Error>;

View File

@ -1,5 +1,6 @@
#![allow(clippy::upper_case_acronyms)]
use anyhow::anyhow;
use std::{
convert::{TryFrom, TryInto},
fmt,
@ -139,7 +140,7 @@ impl FromStr for SQLiteJournalMode {
"MEMORY" => Ok(Self::MEMORY),
"WAL" => Ok(Self::WAL),
"OFF" => Ok(Self::OFF),
_ => Err(format!("Unknown value {} for JournalMode", s).into()),
_ => Err(anyhow!("Unknown value {} for JournalMode", s).into()),
}
}
}
@ -176,7 +177,7 @@ impl TryFrom<i32> for SQLiteSynchronous {
1 => Ok(Self::NORMAL),
2 => Ok(Self::FULL),
3 => Ok(Self::EXTRA),
_ => Err(format!("Unknown value {} for Synchronous", v).into()),
_ => Err(anyhow!("Unknown value {} for Synchronous", v).into()),
}
}
}
@ -190,7 +191,7 @@ impl FromStr for SQLiteSynchronous {
"1" | "NORMAL" => Ok(Self::NORMAL),
"2" | "FULL" => Ok(Self::FULL),
"3" | "EXTRA" => Ok(Self::EXTRA),
_ => Err(format!("Unknown value {} for Synchronous", s).into()),
_ => Err(anyhow!("Unknown value {} for Synchronous", s).into()),
}
}
}