Skip to content

Commit

Permalink
chore(deps): update scylla driver (#6799)
Browse files Browse the repository at this point in the history
  • Loading branch information
dracarys18 authored Dec 16, 2024
1 parent 4b989fe commit 71574a8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 26 deletions.
17 changes: 8 additions & 9 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion crates/masking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ subtle = "2.5.0"
time = { version = "0.3.35", optional = true, features = ["serde-human-readable"] }
url = { version = "2.5.0", features = ["serde"] }
zeroize = { version = "1.7", default-features = false }
scylla = { version = "0.14.0", optional = true}
scylla = { git = "https://github.com/juspay/scylla-rust-driver.git",rev = "5700aa2847b25437cdd4fcf34d707aa90dca8b89", optional = true}

[dev-dependencies]
serde_json = "1.0.115"
Expand Down
22 changes: 6 additions & 16 deletions crates/masking/src/cassandra.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use scylla::{
cql_to_rust::FromCqlVal,
deserialize::DeserializeValue,
frame::response::result::{ColumnType, CqlValue},
frame::response::result::ColumnType,
serialize::{
value::SerializeValue,
writers::{CellWriter, WrittenCellProof},
Expand All @@ -17,34 +16,25 @@ where
{
fn serialize<'b>(
&self,
typ: &ColumnType,
typ: &ColumnType<'_>,
writer: CellWriter<'b>,
) -> Result<WrittenCellProof<'b>, SerializationError> {
self.peek().serialize(typ, writer)
}
}

impl<'frame, T> DeserializeValue<'frame> for StrongSecret<T>
impl<'frame, 'metadata, T> DeserializeValue<'frame, 'metadata> for StrongSecret<T>
where
T: DeserializeValue<'frame> + zeroize::Zeroize + Clone,
T: DeserializeValue<'frame, 'metadata> + zeroize::Zeroize + Clone,
{
fn type_check(typ: &ColumnType) -> Result<(), scylla::deserialize::TypeCheckError> {
fn type_check(typ: &ColumnType<'_>) -> Result<(), scylla::deserialize::TypeCheckError> {
T::type_check(typ)
}

fn deserialize(
typ: &'frame ColumnType,
typ: &'metadata ColumnType<'metadata>,
v: Option<scylla::deserialize::FrameSlice<'frame>>,
) -> Result<Self, scylla::deserialize::DeserializationError> {
Ok(Self::new(T::deserialize(typ, v)?))
}
}

impl<T> FromCqlVal<CqlValue> for StrongSecret<T>
where
T: FromCqlVal<CqlValue> + zeroize::Zeroize + Clone,
{
fn from_cql(cql_val: CqlValue) -> Result<Self, scylla::cql_to_rust::FromCqlValError> {
Ok(Self::new(T::from_cql(cql_val)?))
}
}

0 comments on commit 71574a8

Please sign in to comment.