@@ -7,7 +7,7 @@ use utilities::{
77} ;
88
99use influxdb:: InfluxDbWriteable ;
10- use influxdb:: { Client , Error , Query , Timestamp } ;
10+ use influxdb:: { Client , Error , ReadQuery , Timestamp } ;
1111
1212/// INTEGRATION TEST
1313///
@@ -52,7 +52,7 @@ async fn test_connection_error() {
5252 let test_name = "test_connection_error" ;
5353 let client =
5454 Client :: new ( "http://127.0.0.1:10086" , test_name) . with_auth ( "nopriv_user" , "password" ) ;
55- let read_query = Query :: raw_read_query ( "SELECT * FROM weather" ) ;
55+ let read_query = ReadQuery :: new ( "SELECT * FROM weather" ) ;
5656 let read_result = client. query ( & read_query) . await ;
5757 assert_result_err ( & read_result) ;
5858 match read_result {
@@ -78,7 +78,7 @@ async fn test_authed_write_and_read() {
7878 Client :: new ( "http://127.0.0.1:9086" , TEST_NAME ) . with_auth ( "admin" , "password" ) ;
7979 let query = format ! ( "CREATE DATABASE {}" , TEST_NAME ) ;
8080 client
81- . query ( & Query :: raw_read_query ( query) )
81+ . query ( & ReadQuery :: new ( query) )
8282 . await
8383 . expect ( "could not setup db" ) ;
8484
@@ -90,7 +90,7 @@ async fn test_authed_write_and_read() {
9090 let write_result = client. query ( & write_query) . await ;
9191 assert_result_ok ( & write_result) ;
9292
93- let read_query = Query :: raw_read_query ( "SELECT * FROM weather" ) ;
93+ let read_query = ReadQuery :: new ( "SELECT * FROM weather" ) ;
9494 let read_result = client. query ( & read_query) . await ;
9595 assert_result_ok ( & read_result) ;
9696 assert ! (
@@ -104,7 +104,7 @@ async fn test_authed_write_and_read() {
104104 let query = format ! ( "DROP DATABASE {}" , TEST_NAME ) ;
105105
106106 client
107- . query ( & Query :: raw_read_query ( query) )
107+ . query ( & ReadQuery :: new ( query) )
108108 . await
109109 . expect ( "could not clean up db" ) ;
110110 } ,
@@ -126,7 +126,7 @@ async fn test_wrong_authed_write_and_read() {
126126 Client :: new ( "http://127.0.0.1:9086" , TEST_NAME ) . with_auth ( "admin" , "password" ) ;
127127 let query = format ! ( "CREATE DATABASE {}" , TEST_NAME ) ;
128128 client
129- . query ( & Query :: raw_read_query ( query) )
129+ . query ( & ReadQuery :: new ( query) )
130130 . await
131131 . expect ( "could not setup db" ) ;
132132
@@ -145,7 +145,7 @@ async fn test_wrong_authed_write_and_read() {
145145 ) ,
146146 }
147147
148- let read_query = Query :: raw_read_query ( "SELECT * FROM weather" ) ;
148+ let read_query = ReadQuery :: new ( "SELECT * FROM weather" ) ;
149149 let read_result = client. query ( & read_query) . await ;
150150 assert_result_err ( & read_result) ;
151151 match read_result {
@@ -158,7 +158,7 @@ async fn test_wrong_authed_write_and_read() {
158158
159159 let client = Client :: new ( "http://127.0.0.1:9086" , TEST_NAME )
160160 . with_auth ( "nopriv_user" , "password" ) ;
161- let read_query = Query :: raw_read_query ( "SELECT * FROM weather" ) ;
161+ let read_query = ReadQuery :: new ( "SELECT * FROM weather" ) ;
162162 let read_result = client. query ( & read_query) . await ;
163163 assert_result_err ( & read_result) ;
164164 match read_result {
@@ -174,7 +174,7 @@ async fn test_wrong_authed_write_and_read() {
174174 Client :: new ( "http://127.0.0.1:9086" , TEST_NAME ) . with_auth ( "admin" , "password" ) ;
175175 let query = format ! ( "DROP DATABASE {}" , TEST_NAME ) ;
176176 client
177- . query ( & Query :: raw_read_query ( query) )
177+ . query ( & ReadQuery :: new ( query) )
178178 . await
179179 . expect ( "could not clean up db" ) ;
180180 } ,
@@ -196,7 +196,7 @@ async fn test_non_authed_write_and_read() {
196196 Client :: new ( "http://127.0.0.1:9086" , TEST_NAME ) . with_auth ( "admin" , "password" ) ;
197197 let query = format ! ( "CREATE DATABASE {}" , TEST_NAME ) ;
198198 client
199- . query ( & Query :: raw_read_query ( query) )
199+ . query ( & ReadQuery :: new ( query) )
200200 . await
201201 . expect ( "could not setup db" ) ;
202202 let non_authed_client = Client :: new ( "http://127.0.0.1:9086" , TEST_NAME ) ;
@@ -213,7 +213,7 @@ async fn test_non_authed_write_and_read() {
213213 ) ,
214214 }
215215
216- let read_query = Query :: raw_read_query ( "SELECT * FROM weather" ) ;
216+ let read_query = ReadQuery :: new ( "SELECT * FROM weather" ) ;
217217 let read_result = non_authed_client. query ( & read_query) . await ;
218218 assert_result_err ( & read_result) ;
219219 match read_result {
@@ -229,7 +229,7 @@ async fn test_non_authed_write_and_read() {
229229 Client :: new ( "http://127.0.0.1:9086" , TEST_NAME ) . with_auth ( "admin" , "password" ) ;
230230 let query = format ! ( "DROP DATABASE {}" , TEST_NAME ) ;
231231 client
232- . query ( & Query :: raw_read_query ( query) )
232+ . query ( & ReadQuery :: new ( query) )
233233 . await
234234 . expect ( "could not clean up db" ) ;
235235 } ,
@@ -255,7 +255,7 @@ async fn test_write_and_read_field() {
255255 let write_result = client. query ( & write_query) . await ;
256256 assert_result_ok ( & write_result) ;
257257
258- let read_query = Query :: raw_read_query ( "SELECT * FROM weather" ) ;
258+ let read_query = ReadQuery :: new ( "SELECT * FROM weather" ) ;
259259 let read_result = client. query ( & read_query) . await ;
260260 assert_result_ok ( & read_result) ;
261261 assert ! (
@@ -304,8 +304,7 @@ async fn test_write_and_read_option() {
304304 temperature : i32 ,
305305 }
306306
307- let query =
308- Query :: raw_read_query ( "SELECT time, temperature, wind_strength FROM weather" ) ;
307+ let query = ReadQuery :: new ( "SELECT time, temperature, wind_strength FROM weather" ) ;
309308 let result = client
310309 . json_query ( query)
311310 . await
@@ -361,7 +360,7 @@ async fn test_json_query() {
361360 temperature : i32 ,
362361 }
363362
364- let query = Query :: raw_read_query ( "SELECT * FROM weather" ) ;
363+ let query = ReadQuery :: new ( "SELECT * FROM weather" ) ;
365364 let result = client
366365 . json_query ( query)
367366 . await
@@ -419,7 +418,7 @@ async fn test_json_query_tagged() {
419418 temperature : i32 ,
420419 }
421420
422- let query = Query :: raw_read_query ( "SELECT * FROM weather GROUP BY location" ) ;
421+ let query = ReadQuery :: new ( "SELECT * FROM weather GROUP BY location" ) ;
423422 let result = client. json_query ( query) . await . and_then ( |mut db_result| {
424423 db_result. deserialize_next_tagged :: < WeatherMeta , Weather > ( )
425424 } ) ;
@@ -487,7 +486,7 @@ async fn test_json_query_vec() {
487486 temperature : i32 ,
488487 }
489488
490- let query = Query :: raw_read_query ( "SELECT * FROM temperature_vec" ) ;
489+ let query = ReadQuery :: new ( "SELECT * FROM temperature_vec" ) ;
491490 let result = client
492491 . json_query ( query)
493492 . await
@@ -544,8 +543,7 @@ async fn test_serde_multi_query() {
544543
545544 let result = client
546545 . json_query (
547- Query :: raw_read_query ( "SELECT * FROM temperature" )
548- . add_query ( "SELECT * FROM humidity" ) ,
546+ ReadQuery :: new ( "SELECT * FROM temperature" ) . add_query ( "SELECT * FROM humidity" ) ,
549547 )
550548 . await
551549 . and_then ( |mut db_result| {
@@ -588,7 +586,7 @@ async fn test_serde_multi_query() {
588586async fn test_wrong_query_errors ( ) {
589587 let client = create_client ( "test_name" ) ;
590588 let result = client
591- . json_query ( Query :: raw_read_query ( "CREATE DATABASE this_should_fail" ) )
589+ . json_query ( ReadQuery :: new ( "CREATE DATABASE this_should_fail" ) )
592590 . await ;
593591 assert ! (
594592 result. is_err( ) ,
0 commit comments