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::Now.into_query("measurement").build();
assert!(invalid_query.is_err());

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

Implementations

Returns a ReadQuery builder.

Examples
use influxdb::Query;

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

Implementors