1- use crate :: cql_to_rust:: FromCqlVal ;
1+ use crate :: transport:: session:: Session ;
2+ use scylla_cql:: types:: deserialize:: value:: DeserializeValue ;
3+
4+ use crate :: frame:: response:: result:: CqlValue ;
25use crate :: test_utils:: { create_new_session_builder, setup_tracing} ;
36use crate :: utils:: test_utils:: unique_keyspace_name;
4- use crate :: { frame:: response:: result:: CqlValue , LegacySession } ;
57use scylla_cql:: types:: serialize:: value:: SerializeValue ;
68use std:: collections:: { BTreeMap , BTreeSet , HashMap , HashSet } ;
79
8- async fn connect ( ) -> LegacySession {
9- let session = create_new_session_builder ( ) . build_legacy ( ) . await . unwrap ( ) ;
10+ async fn connect ( ) -> Session {
11+ let session = create_new_session_builder ( ) . build ( ) . await . unwrap ( ) ;
1012 let ks = unique_keyspace_name ( ) ;
1113 session. query_unpaged ( format ! ( "CREATE KEYSPACE IF NOT EXISTS {} WITH REPLICATION = {{'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1}}" , ks) , & [ ] ) . await . unwrap ( ) ;
1214 session. use_keyspace ( ks, false ) . await . unwrap ( ) ;
1315
1416 session
1517}
1618
17- async fn create_table ( session : & LegacySession , table_name : & str , value_type : & str ) {
19+ async fn create_table ( session : & Session , table_name : & str , value_type : & str ) {
1820 session
1921 . query_unpaged (
2022 format ! (
@@ -28,13 +30,13 @@ async fn create_table(session: &LegacySession, table_name: &str, value_type: &st
2830}
2931
3032async fn insert_and_select < InsertT , SelectT > (
31- session : & LegacySession ,
33+ session : & Session ,
3234 table_name : & str ,
3335 to_insert : & InsertT ,
3436 expected : & SelectT ,
3537) where
3638 InsertT : SerializeValue ,
37- SelectT : FromCqlVal < Option < CqlValue > > + PartialEq + std:: fmt:: Debug ,
39+ SelectT : for < ' r > DeserializeValue < ' r , ' r > + PartialEq + std:: fmt:: Debug ,
3840{
3941 session
4042 . query_unpaged (
@@ -48,7 +50,10 @@ async fn insert_and_select<InsertT, SelectT>(
4850 . query_unpaged ( format ! ( "SELECT val FROM {} WHERE p = 0" , table_name) , ( ) )
4951 . await
5052 . unwrap ( )
51- . single_row_typed :: < ( SelectT , ) > ( )
53+ . into_rows_result ( )
54+ . unwrap ( )
55+ . unwrap ( )
56+ . single_row :: < ( SelectT , ) > ( )
5257 . unwrap ( )
5358 . 0 ;
5459
@@ -58,7 +63,7 @@ async fn insert_and_select<InsertT, SelectT>(
5863#[ tokio:: test]
5964async fn test_cql_list ( ) {
6065 setup_tracing ( ) ;
61- let session: LegacySession = connect ( ) . await ;
66+ let session: Session = connect ( ) . await ;
6267
6368 let table_name: & str = "test_cql_list_tab" ;
6469 create_table ( & session, table_name, "list<int>" ) . await ;
@@ -91,7 +96,7 @@ async fn test_cql_list() {
9196#[ tokio:: test]
9297async fn test_cql_set ( ) {
9398 setup_tracing ( ) ;
94- let session: LegacySession = connect ( ) . await ;
99+ let session: Session = connect ( ) . await ;
95100
96101 let table_name: & str = "test_cql_set_tab" ;
97102 create_table ( & session, table_name, "set<int>" ) . await ;
@@ -155,7 +160,7 @@ async fn test_cql_set() {
155160#[ tokio:: test]
156161async fn test_cql_map ( ) {
157162 setup_tracing ( ) ;
158- let session: LegacySession = connect ( ) . await ;
163+ let session: Session = connect ( ) . await ;
159164
160165 let table_name: & str = "test_cql_map_tab" ;
161166 create_table ( & session, table_name, "map<int, int>" ) . await ;
@@ -206,7 +211,7 @@ async fn test_cql_map() {
206211#[ tokio:: test]
207212async fn test_cql_tuple ( ) {
208213 setup_tracing ( ) ;
209- let session: LegacySession = connect ( ) . await ;
214+ let session: Session = connect ( ) . await ;
210215
211216 let table_name: & str = "test_cql_tuple_tab" ;
212217 create_table ( & session, table_name, "tuple<int, int, text>" ) . await ;
0 commit comments