@@ -7,7 +7,7 @@ use utilities::{
7
7
} ;
8
8
9
9
use influxdb:: InfluxDbWriteable ;
10
- use influxdb:: { Client , Error , Query , Timestamp } ;
10
+ use influxdb:: { Client , Error , ReadQuery , Timestamp } ;
11
11
12
12
/// INTEGRATION TEST
13
13
///
@@ -52,7 +52,7 @@ async fn test_connection_error() {
52
52
let test_name = "test_connection_error" ;
53
53
let client =
54
54
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" ) ;
56
56
let read_result = client. query ( & read_query) . await ;
57
57
assert_result_err ( & read_result) ;
58
58
match read_result {
@@ -78,7 +78,7 @@ async fn test_authed_write_and_read() {
78
78
Client :: new ( "http://127.0.0.1:9086" , TEST_NAME ) . with_auth ( "admin" , "password" ) ;
79
79
let query = format ! ( "CREATE DATABASE {}" , TEST_NAME ) ;
80
80
client
81
- . query ( & Query :: raw_read_query ( query) )
81
+ . query ( & ReadQuery :: new ( query) )
82
82
. await
83
83
. expect ( "could not setup db" ) ;
84
84
@@ -90,7 +90,7 @@ async fn test_authed_write_and_read() {
90
90
let write_result = client. query ( & write_query) . await ;
91
91
assert_result_ok ( & write_result) ;
92
92
93
- let read_query = Query :: raw_read_query ( "SELECT * FROM weather" ) ;
93
+ let read_query = ReadQuery :: new ( "SELECT * FROM weather" ) ;
94
94
let read_result = client. query ( & read_query) . await ;
95
95
assert_result_ok ( & read_result) ;
96
96
assert ! (
@@ -104,7 +104,7 @@ async fn test_authed_write_and_read() {
104
104
let query = format ! ( "DROP DATABASE {}" , TEST_NAME ) ;
105
105
106
106
client
107
- . query ( & Query :: raw_read_query ( query) )
107
+ . query ( & ReadQuery :: new ( query) )
108
108
. await
109
109
. expect ( "could not clean up db" ) ;
110
110
} ,
@@ -126,7 +126,7 @@ async fn test_wrong_authed_write_and_read() {
126
126
Client :: new ( "http://127.0.0.1:9086" , TEST_NAME ) . with_auth ( "admin" , "password" ) ;
127
127
let query = format ! ( "CREATE DATABASE {}" , TEST_NAME ) ;
128
128
client
129
- . query ( & Query :: raw_read_query ( query) )
129
+ . query ( & ReadQuery :: new ( query) )
130
130
. await
131
131
. expect ( "could not setup db" ) ;
132
132
@@ -145,7 +145,7 @@ async fn test_wrong_authed_write_and_read() {
145
145
) ,
146
146
}
147
147
148
- let read_query = Query :: raw_read_query ( "SELECT * FROM weather" ) ;
148
+ let read_query = ReadQuery :: new ( "SELECT * FROM weather" ) ;
149
149
let read_result = client. query ( & read_query) . await ;
150
150
assert_result_err ( & read_result) ;
151
151
match read_result {
@@ -158,7 +158,7 @@ async fn test_wrong_authed_write_and_read() {
158
158
159
159
let client = Client :: new ( "http://127.0.0.1:9086" , TEST_NAME )
160
160
. 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" ) ;
162
162
let read_result = client. query ( & read_query) . await ;
163
163
assert_result_err ( & read_result) ;
164
164
match read_result {
@@ -174,7 +174,7 @@ async fn test_wrong_authed_write_and_read() {
174
174
Client :: new ( "http://127.0.0.1:9086" , TEST_NAME ) . with_auth ( "admin" , "password" ) ;
175
175
let query = format ! ( "DROP DATABASE {}" , TEST_NAME ) ;
176
176
client
177
- . query ( & Query :: raw_read_query ( query) )
177
+ . query ( & ReadQuery :: new ( query) )
178
178
. await
179
179
. expect ( "could not clean up db" ) ;
180
180
} ,
@@ -196,7 +196,7 @@ async fn test_non_authed_write_and_read() {
196
196
Client :: new ( "http://127.0.0.1:9086" , TEST_NAME ) . with_auth ( "admin" , "password" ) ;
197
197
let query = format ! ( "CREATE DATABASE {}" , TEST_NAME ) ;
198
198
client
199
- . query ( & Query :: raw_read_query ( query) )
199
+ . query ( & ReadQuery :: new ( query) )
200
200
. await
201
201
. expect ( "could not setup db" ) ;
202
202
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() {
213
213
) ,
214
214
}
215
215
216
- let read_query = Query :: raw_read_query ( "SELECT * FROM weather" ) ;
216
+ let read_query = ReadQuery :: new ( "SELECT * FROM weather" ) ;
217
217
let read_result = non_authed_client. query ( & read_query) . await ;
218
218
assert_result_err ( & read_result) ;
219
219
match read_result {
@@ -229,7 +229,7 @@ async fn test_non_authed_write_and_read() {
229
229
Client :: new ( "http://127.0.0.1:9086" , TEST_NAME ) . with_auth ( "admin" , "password" ) ;
230
230
let query = format ! ( "DROP DATABASE {}" , TEST_NAME ) ;
231
231
client
232
- . query ( & Query :: raw_read_query ( query) )
232
+ . query ( & ReadQuery :: new ( query) )
233
233
. await
234
234
. expect ( "could not clean up db" ) ;
235
235
} ,
@@ -255,7 +255,7 @@ async fn test_write_and_read_field() {
255
255
let write_result = client. query ( & write_query) . await ;
256
256
assert_result_ok ( & write_result) ;
257
257
258
- let read_query = Query :: raw_read_query ( "SELECT * FROM weather" ) ;
258
+ let read_query = ReadQuery :: new ( "SELECT * FROM weather" ) ;
259
259
let read_result = client. query ( & read_query) . await ;
260
260
assert_result_ok ( & read_result) ;
261
261
assert ! (
@@ -304,8 +304,7 @@ async fn test_write_and_read_option() {
304
304
temperature : i32 ,
305
305
}
306
306
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" ) ;
309
308
let result = client
310
309
. json_query ( query)
311
310
. await
@@ -361,7 +360,7 @@ async fn test_json_query() {
361
360
temperature : i32 ,
362
361
}
363
362
364
- let query = Query :: raw_read_query ( "SELECT * FROM weather" ) ;
363
+ let query = ReadQuery :: new ( "SELECT * FROM weather" ) ;
365
364
let result = client
366
365
. json_query ( query)
367
366
. await
@@ -419,7 +418,7 @@ async fn test_json_query_tagged() {
419
418
temperature : i32 ,
420
419
}
421
420
422
- let query = Query :: raw_read_query ( "SELECT * FROM weather GROUP BY location" ) ;
421
+ let query = ReadQuery :: new ( "SELECT * FROM weather GROUP BY location" ) ;
423
422
let result = client. json_query ( query) . await . and_then ( |mut db_result| {
424
423
db_result. deserialize_next_tagged :: < WeatherMeta , Weather > ( )
425
424
} ) ;
@@ -487,7 +486,7 @@ async fn test_json_query_vec() {
487
486
temperature : i32 ,
488
487
}
489
488
490
- let query = Query :: raw_read_query ( "SELECT * FROM temperature_vec" ) ;
489
+ let query = ReadQuery :: new ( "SELECT * FROM temperature_vec" ) ;
491
490
let result = client
492
491
. json_query ( query)
493
492
. await
@@ -544,8 +543,7 @@ async fn test_serde_multi_query() {
544
543
545
544
let result = client
546
545
. 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" ) ,
549
547
)
550
548
. await
551
549
. and_then ( |mut db_result| {
@@ -588,7 +586,7 @@ async fn test_serde_multi_query() {
588
586
async fn test_wrong_query_errors ( ) {
589
587
let client = create_client ( "test_name" ) ;
590
588
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" ) )
592
590
. await ;
593
591
assert ! (
594
592
result. is_err( ) ,
0 commit comments