[−][src]Trait influxdb::query::InfluxDbQuery
Required methods
fn build(&self) -> Result<ValidQuery, InfluxDbError>
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::{InfluxDbQuery, Timestamp}; let invalid_query = InfluxDbQuery::write_query(Timestamp::NOW, "measurement").build(); assert!(invalid_query.is_err()); let valid_query = InfluxDbQuery::write_query(Timestamp::NOW, "measurement").add_field("myfield1", 11).build(); assert!(valid_query.is_ok());
fn get_type(&self) -> QueryType
Methods
impl dyn InfluxDbQuery
[src]
pub fn write_query<S>(
timestamp: Timestamp,
measurement: S
) -> InfluxDbWriteQuery where
S: ToString,
[src]
timestamp: Timestamp,
measurement: S
) -> InfluxDbWriteQuery where
S: ToString,
Returns a InfluxDbWriteQuery
builder.
Examples
use influxdb::query::{InfluxDbQuery, Timestamp}; InfluxDbQuery::write_query(Timestamp::NOW, "measurement"); // Is of type [`InfluxDbWriteQuery`](crate::query::write_query::InfluxDbWriteQuery)
pub fn raw_read_query<S>(read_query: S) -> InfluxDbReadQuery where
S: ToString,
[src]
S: ToString,
Returns a InfluxDbReadQuery
builder.
Examples
use influxdb::query::InfluxDbQuery; InfluxDbQuery::raw_read_query("SELECT * FROM weather"); // Is of type [`InfluxDbReadQuery`](crate::query::read_query::InfluxDbReadQuery)