Skip to content

Commit

Permalink
update sqlx to 0.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jgraef committed Jul 23, 2024
1 parent 7beb4e7 commit 2030a11
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 67 deletions.
2 changes: 1 addition & 1 deletion skunk-api-protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ uuid = { version = "1.9.1", features = ["serde"] }
chrono = { version = "0.4.38", features = ["serde"] }
indexmap = { version = "2.2.6", features = ["serde"] }
serde_json = { version = "1.0.120", features = ["raw_value"] }
sqlx = { version = "0.7.4", default-features = false, features = ["chrono", "json", "macros", "uuid"], optional = true }
sqlx = { version = "0.8.0", default-features = false, features = ["chrono", "json", "macros", "uuid"], optional = true }
6 changes: 3 additions & 3 deletions skunk-api-protocol/src/sqlx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ where
{
fn encode_by_ref(
&self,
buf: &mut <DB as sqlx::database::HasArguments<'q>>::ArgumentBuffer,
) -> sqlx::encode::IsNull {
buf: &mut <DB as sqlx::Database>::ArgumentBuffer<'q>,
) -> Result<sqlx::encode::IsNull, Box<dyn std::error::Error + Send + Sync>> {
sqlx::Encode::<'q, DB>::encode(self.as_db_value(), buf)
}
}
Expand All @@ -31,7 +31,7 @@ where
i8: sqlx::Decode<'r, DB>,
{
fn decode(
value: <DB as sqlx::database::HasValueRef<'r>>::ValueRef,
value: <DB as sqlx::Database>::ValueRef<'r>,
) -> Result<Self, sqlx::error::BoxDynError> {
Ok(Self::from_db_value(<i8 as sqlx::Decode<'r, DB>>::decode(
value,
Expand Down
6 changes: 3 additions & 3 deletions skunk-api-protocol/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ macro_rules! sqlx_json_type {
{
fn encode_by_ref(
&self,
buf: &mut <DB as sqlx::database::HasArguments<'q>>::ArgumentBuffer,
) -> sqlx::encode::IsNull {
buf: &mut <DB as sqlx::Database>::ArgumentBuffer<'q>,
) -> Result<sqlx::encode::IsNull, Box<dyn std::error::Error + Send + Sync>> {
sqlx::Encode::<'q, DB>::encode_by_ref(&sqlx::types::Json(self), buf)
}
}
Expand All @@ -85,7 +85,7 @@ macro_rules! sqlx_json_type {
sqlx::types::Json<$ty>: sqlx::Decode<'r, DB>,
{
fn decode(
value: <DB as sqlx::database::HasValueRef<'r>>::ValueRef,
value: <DB as sqlx::Database>::ValueRef<'r>,
) -> Result<Self, sqlx::error::BoxDynError> {
Ok(<sqlx::types::Json<$ty> as sqlx::Decode<'r, DB>>::decode(value)?.0)
}
Expand Down
4 changes: 2 additions & 2 deletions skunk-flow-store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ semver = { version = "1.0.23", features = ["serde"] }
semver-macro = "0.1.0"
serde = { version = "1.0.204", features = ["derive"] }
serde_json = "1.0.120"
sqlx = { version = "0.7.4", features = ["chrono", "json", "macros", "migrate", "runtime-tokio", "sqlite", "uuid"] }
sqlx = { version = "0.8.0", features = ["chrono", "json", "macros", "migrate", "runtime-tokio", "sqlite", "uuid"] }
thiserror = "1.0.61"
uuid = "1.9.1"

[build-dependencies]
sqlx = { version = "0.7.4", features = ["migrate", "runtime-tokio", "sqlite"] }
sqlx = { version = "0.8.0", features = ["migrate", "runtime-tokio", "sqlite"] }
tokio = { version = "1.37.0", features = ["macros", "rt"] }
6 changes: 1 addition & 5 deletions skunk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ categories = [
default = ["full"]

# All features
full = ["socks", "http", "tls", "store", "graph-vis", "pcap"]
full = ["socks", "http", "tls", "graph-vis", "pcap"]

# Socks protocol
socks = []
Expand All @@ -31,9 +31,6 @@ http = ["dep:hyper", "dep:hyper-util", "dep:http-body-util"]
# TLS
tls = ["dep:rustls", "dep:tokio-rustls", "dep:rcgen", "dep:rustls-pemfile"]

# Storing flows
store = ["dep:sqlx"]

# Filter graph visualization
graph-vis = []

Expand Down Expand Up @@ -80,7 +77,6 @@ rustls-pemfile = { version = "2.1.2", optional = true }
serde = { version = "1.0.202", features = ["derive"] }
serde_yml = "0.0.11"
smallvec = "1.13.2"
sqlx = { version = "0.7.4", features = ["runtime-tokio", "sqlite"], optional = true }
strum = { version = "0.26.2", features = ["derive"] }
tempfile = "3.10.1"
thiserror = "1.0.60"
Expand Down
6 changes: 0 additions & 6 deletions skunk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ pub mod connect;
pub mod protocol;
pub mod proxy;
pub mod rule;
#[cfg(feature = "store")]
pub mod store;
pub mod util;

// hack to get the proc-macro working from this crate
Expand All @@ -37,8 +35,4 @@ pub enum Error {
#[cfg(feature = "http")]
#[error("http error")]
Http(#[from] self::protocol::http::Error),

#[cfg(feature = "store")]
#[error("store error")]
Store(#[from] self::store::Error),
}
47 changes: 0 additions & 47 deletions skunk/src/store.rs

This file was deleted.

0 comments on commit 2030a11

Please sign in to comment.