Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connection: remove paging state parameter from unpaged raw API #1084

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 8 additions & 17 deletions scylla/src/transport/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@ impl Connection {
// This method is used only for driver internal queries, so no need to consult execution profile here.
let query: Query = query.into();

self.query_raw_unpaged(&query, PagingState::start())
self.query_raw_unpaged(&query)
.await
.map_err(Into::into)
.and_then(QueryResponse::into_query_result)
Expand All @@ -1034,7 +1034,6 @@ impl Connection {
pub(crate) async fn query_raw_unpaged(
&self,
query: &Query,
paging_state: PagingState,
) -> Result<QueryResponse, UserRequestError> {
// This method is used only for driver internal queries, so no need to consult execution profile here.
self.query_raw_with_consistency(
Expand All @@ -1044,7 +1043,7 @@ impl Connection {
.determine_consistency(self.config.default_consistency),
query.config.serial_consistency.flatten(),
None,
paging_state,
PagingState::start(),
)
.await
}
Expand Down Expand Up @@ -1084,7 +1083,7 @@ impl Connection {
values: SerializedValues,
) -> Result<QueryResult, QueryError> {
// This method is used only for driver internal queries, so no need to consult execution profile here.
self.execute_raw_unpaged(prepared, values, PagingState::start())
self.execute_raw_unpaged(prepared, values)
.await
.map_err(Into::into)
.and_then(QueryResponse::into_query_result)
Expand All @@ -1095,7 +1094,6 @@ impl Connection {
&self,
prepared: &PreparedStatement,
values: SerializedValues,
paging_state: PagingState,
) -> Result<QueryResponse, UserRequestError> {
// This method is used only for driver internal queries, so no need to consult execution profile here.
self.execute_raw_with_consistency(
Expand All @@ -1106,7 +1104,7 @@ impl Connection {
.determine_consistency(self.config.default_consistency),
prepared.config.serial_consistency.flatten(),
None,
paging_state,
PagingState::start(),
)
.await
}
Expand Down Expand Up @@ -1362,7 +1360,7 @@ impl Connection {
false => format!("USE {}", keyspace_name.as_str()).into(),
};

let query_response = self.query_raw_unpaged(&query, PagingState::start()).await?;
let query_response = self.query_raw_unpaged(&query).await?;
Self::verify_use_keyspace_result(keyspace_name, query_response)
}

Expand Down Expand Up @@ -2390,7 +2388,6 @@ mod tests {

use super::ConnectionConfig;
use crate::query::Query;
use crate::statement::PagingState;
use crate::test_utils::setup_tracing;
use crate::transport::connection::open_connection;
use crate::transport::node::ResolvedContactPoint;
Expand Down Expand Up @@ -2490,11 +2487,7 @@ mod tests {
let mut insert_futures = Vec::new();
for v in &values {
let values = prepared.serialize_values(&(*v,)).unwrap();
let fut = async {
connection
.execute_raw_unpaged(&prepared, values, PagingState::start())
.await
};
let fut = async { connection.execute_raw_unpaged(&prepared, values).await };
insert_futures.push(fut);
}

Expand Down Expand Up @@ -2596,10 +2589,8 @@ mod tests {
let values = prepared
.serialize_values(&(j, vec![j as u8; j as usize]))
.unwrap();
let response = conn
.execute_raw_unpaged(&prepared, values, PagingState::start())
.await
.unwrap();
let response =
conn.execute_raw_unpaged(&prepared, values).await.unwrap();
// QueryResponse might contain an error - make sure that there were no errors
let _nonerror_response =
response.into_non_error_query_response().unwrap();
Expand Down
Loading