@@ -40,6 +40,7 @@ Pull requests are always welcome. See [Contributing](https://github.com/influxdb
40
40
- Reading and Writing to InfluxDB
41
41
- Optional Serde Support for Deserialization
42
42
- Running multiple queries in one request (e.g. ` SELECT * FROM weather_berlin; SELECT * FROM weather_london ` )
43
+ - Writing single or multiple measurements in one request (e.g. ` WriteQuery ` or ` Vec<WriteQuery> ` argument)
43
44
- Authenticated and Unauthenticated Connections
44
45
- ` async ` /` await ` support
45
46
- ` #[derive(InfluxDbWriteable)] ` Derive Macro for Writing / Reading into Structs
@@ -76,14 +77,21 @@ async fn main() {
76
77
}
77
78
78
79
// Let's write some data into a measurement called `weather`
79
- let weather_reading = WeatherReading {
80
- time : Timestamp :: Hours (1 ). into (),
81
- humidity : 30 ,
82
- wind_direction : String :: from (" north" ),
83
- };
80
+ let weather_readings = vec! (
81
+ WeatherReading {
82
+ time : Timestamp :: Hours (1 ). into (),
83
+ humidity : 30 ,
84
+ wind_direction : String :: from (" north" ),
85
+ }. into_query (" weather" ),
86
+ WeatherReading {
87
+ time : Timestamp :: Hours (2 ). into (),
88
+ humidity : 40 ,
89
+ wind_direction : String :: from (" west" ),
90
+ }. into_query (" weather" ),
91
+ );
84
92
85
93
let write_result = client
86
- . query (weather_reading . into_query ( " weather " ) )
94
+ . query (weather_readings )
87
95
. await ;
88
96
assert! (write_result . is_ok (), " Write result was not okay" );
89
97
0 commit comments