[][src]Trait influxdb::Query

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

Required methods

fn build(&self) -> Result<ValidQuery, Error>

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());

fn get_type(&self) -> QueryType

Loading content...

Implementations

impl dyn Query[src]

pub fn raw_read_query<S>(read_query: S) -> ReadQuery where
    S: Into<String>, 
[src]

Returns a ReadQuery builder.

Examples

use influxdb::Query;

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

Implementors

impl Query for ReadQuery[src]

impl Query for WriteQuery[src]

Loading content...