Skip to content

Commit 5222eb2

Browse files
committed
prepared_statement: adjust col spec getters
They now return `ColumnSpecs`. These methods are finally consistent with `QueryRowsResult` and `QueryPager` APIs.
1 parent 3e2a94d commit 5222eb2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

scylla/src/statement/prepared_statement.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use crate::frame::response::result::PreparedMetadata;
1919
use crate::frame::types::{Consistency, SerialConsistency};
2020
use crate::observability::history::HistoryListener;
2121
use crate::policies::retry::RetryPolicy;
22+
use crate::response::query_result::ColumnSpecs;
2223
use crate::routing::partitioner::{Partitioner, PartitionerHasher, PartitionerName};
2324
use crate::routing::Token;
2425

@@ -398,8 +399,8 @@ impl PreparedStatement {
398399
}
399400

400401
/// Access column specifications of the bind variables of this statement
401-
pub fn get_variable_col_specs(&self) -> &[ColumnSpec<'static>] {
402-
&self.shared.metadata.col_specs
402+
pub fn get_variable_col_specs(&self) -> ColumnSpecs<'_, 'static> {
403+
ColumnSpecs::new(&self.shared.metadata.col_specs)
403404
}
404405

405406
/// Access info about partition key indexes of the bind variables of this statement
@@ -413,8 +414,8 @@ impl PreparedStatement {
413414
}
414415

415416
/// Access column specifications of the result set returned after the execution of this statement
416-
pub fn get_result_set_col_specs(&self) -> &[ColumnSpec<'static>] {
417-
self.shared.result_metadata.col_specs()
417+
pub fn get_result_set_col_specs(&self) -> ColumnSpecs<'_, 'static> {
418+
ColumnSpecs::new(self.shared.result_metadata.col_specs())
418419
}
419420

420421
/// Get the name of the partitioner used for this statement.

0 commit comments

Comments
 (0)