@@ -40,6 +40,7 @@ Pull requests are always welcome. See [Contributing](https://github.com/influxdb
4040- Reading and Writing to InfluxDB
4141- Optional Serde Support for Deserialization
4242- 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)
4344- Authenticated and Unauthenticated Connections
4445- ` async ` /` await ` support
4546- ` #[derive(InfluxDbWriteable)] ` Derive Macro for Writing / Reading into Structs
@@ -76,14 +77,21 @@ async fn main() {
7677 }
7778
7879 // 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+ );
8492
8593 let write_result = client
86- . query (weather_reading . into_query ( " weather " ) )
94+ . query (weather_readings )
8795 . await ;
8896 assert! (write_result . is_ok (), " Write result was not okay" );
8997
0 commit comments