Skip to content

Commit

Permalink
frame/value: deprecate SerializeValuesError
Browse files Browse the repository at this point in the history
This is part of the legacy serialization framework.
  • Loading branch information
wprzytula committed Dec 11, 2024
1 parent 04c6f31 commit 77d1846
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scylla-cql/src/frame/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ pub struct ValueTooBig;
pub struct ValueOverflow;

#[allow(deprecated)]
#[deprecated(
since = "0.15.1",
note = "Legacy serialization API is not type-safe and is going to be removed soon"
)]
#[derive(Debug, Error, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub enum SerializeValuesError {
#[error("Too many values to add, max 65,535 values can be sent in a request")]
Expand Down
7 changes: 7 additions & 0 deletions scylla/src/transport/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use std::{
sync::Arc,
};

#[allow(deprecated)]
use scylla_cql::{
frame::{
frame_errors::{
Expand Down Expand Up @@ -124,6 +125,7 @@ pub enum QueryError {
IntoLegacyQueryResultError(#[from] IntoLegacyQueryResultError),
}

#[allow(deprecated)]
impl From<SerializeValuesError> for QueryError {
fn from(serialized_err: SerializeValuesError) -> QueryError {
QueryError::BadQuery(BadQuery::SerializeValuesError(serialized_err))
Expand Down Expand Up @@ -573,7 +575,12 @@ pub enum ViewsMetadataError {
#[non_exhaustive]
pub enum BadQuery {
/// Failed to serialize values passed to a query - values too big
#[deprecated(
since = "0.15.1",
note = "Legacy serialization API is not type-safe and is going to be removed soon"
)]
#[error("Serializing values failed: {0} ")]
#[allow(deprecated)]
SerializeValuesError(#[from] SerializeValuesError),

#[error("Serializing values failed: {0} ")]
Expand Down

0 comments on commit 77d1846

Please # to comment.