File tree 2 files changed +9
-5
lines changed 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -163,11 +163,14 @@ impl Client {
163
163
/// ```rust
164
164
/// use influxdb::{Client, Query, Timestamp};
165
165
///
166
+ /// # #[tokio::main]
167
+ /// # async fn main() -> Result<(), Box<dyn std::error::Error>> {
166
168
/// let client = Client::new("http://localhost:8086", "test");
167
- /// let _future = client.query(
168
- /// &Query::write_query(Timestamp::Now, "weather")
169
- /// .add_field("temperature", 82)
170
- /// );
169
+ /// let query = Query::write_query(Timestamp::Now, "weather")
170
+ /// .add_field("temperature", 82);
171
+ /// let results = client.query(query).await?;
172
+ /// # Ok(())
173
+ /// #}
171
174
/// ```
172
175
/// # Errors
173
176
///
Original file line number Diff line number Diff line change 23
23
//! }
24
24
//!
25
25
//! # #[tokio::main]
26
- //! # async fn main() -> Box<dyn std::error::Error> {
26
+ //! # async fn main() -> Result<(), Box<dyn std::error::Error> > {
27
27
//! let client = Client::new("http://localhost:8086", "test");
28
28
//! let query = Query::raw_read_query(
29
29
//! "SELECT temperature FROM /weather_[a-z]*$/ WHERE time > now() - 1m ORDER BY DESC",
42
42
//! }
43
43
//! })
44
44
//! .collect::<Vec<Weather>>();
45
+ //! # Ok(())
45
46
//! # }
46
47
//! ```
47
48
You can’t perform that action at this time.
0 commit comments