pub trait Query {
    fn build(&self) -> Result<ValidQuery, Error>;
fn get_type(&self) -> QueryType; }

Required methods

Builds valid InfluxSQL which can be run against the Database. In case no fields have been specified, it will return an error, as that is invalid InfluxSQL syntax.

Examples
use influxdb::{Query, Timestamp};
use influxdb::InfluxDbWriteable;

let invalid_query = Timestamp::Nanoseconds(0).into_query("measurement").build();
assert!(invalid_query.is_err());

let valid_query = Timestamp::Nanoseconds(0).into_query("measurement").add_field("myfield1", 11).build();
assert!(valid_query.is_ok());

Implementations

👎 Deprecated since 0.5.0:

Use ReadQuery::new instead

Returns a ReadQuery builder.

Examples
use influxdb::Query;

Query::raw_read_query("SELECT * FROM weather"); // Is of type [`ReadQuery`](crate::ReadQuery)

Implementations on Foreign Types

Implementors