Skip to content

Commit

Permalink
cargo: bump rust-driver to 0.15
Browse files Browse the repository at this point in the history
  • Loading branch information
muzarski committed Nov 21, 2024
1 parent 21292f9 commit 84c10b2
Show file tree
Hide file tree
Showing 6 changed files with 202 additions and 65 deletions.
78 changes: 71 additions & 7 deletions scylla-rust-wrapper/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions scylla-rust-wrapper/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ categories = ["database"]
license = "MIT OR Apache-2.0"

[dependencies]
scylla = { git = "https://github.com/scylladb/scylla-rust-driver.git", rev = "64b4afcd", features = [
scylla = { git = "https://github.com/scylladb/scylla-rust-driver.git", rev = "v0.15.0", features = [
"ssl",
] }
tokio = { version = "1.27.0", features = ["full"] }
Expand All @@ -33,7 +33,7 @@ bindgen = "0.65"
chrono = "0.4.20"

[dev-dependencies]
scylla-proxy = { git = "https://github.com/scylladb/scylla-rust-driver.git", rev = "64b4afcd" }
scylla-proxy = { git = "https://github.com/scylladb/scylla-rust-driver.git", rev = "v0.15.0" }

assert_matches = "1.5.0"
ntest = "0.9.3"
Expand Down
9 changes: 9 additions & 0 deletions scylla-rust-wrapper/src/cass_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ impl ToCassError for CassErrorResult {
fn to_cass_error(&self) -> CassError {
match self {
CassErrorResult::Query(query_error) => query_error.to_cass_error(),

// For now let's leave these as LIB_INVALID_DATA.
// I don't see any variants that would make more sense.
// TBH, I'm almost sure that we should introduce additional enum variants
// of CassError in the future ~ muzarski.
CassErrorResult::ResultMetadataLazyDeserialization(_) => {
CassError::CASS_ERROR_LIB_INVALID_DATA
}
CassErrorResult::Deserialization(_) => CassError::CASS_ERROR_LIB_INVALID_DATA,
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions scylla-rust-wrapper/src/query_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ use crate::cass_error::*;
use crate::cass_error_types::CassWriteType;
use crate::cass_types::CassConsistency;
use crate::types::*;
use scylla::deserialize::DeserializationError;
use scylla::frame::frame_errors::ResultMetadataAndRowsCountParseError;
use scylla::statement::Consistency;
use scylla::transport::errors::*;
use thiserror::Error;
Expand All @@ -11,6 +13,10 @@ use thiserror::Error;
pub enum CassErrorResult {
#[error(transparent)]
Query(#[from] QueryError),
#[error(transparent)]
ResultMetadataLazyDeserialization(#[from] ResultMetadataAndRowsCountParseError),
#[error("Failed to deserialize rows: {0}")]
Deserialization(#[from] DeserializationError),
}

impl From<Consistency> for CassConsistency {
Expand Down
Loading

0 comments on commit 84c10b2

Please sign in to comment.