Struct rinfluxdb_influxql::QueryBuilder[][src]

pub struct QueryBuilder { /* fields omitted */ }
Expand description

A builder for InfluxQL queries

let query = QueryBuilder::from("indoor_environment")
    .field("temperature")
    .field("humidity")
    .start(Utc.ymd(2021, 3, 7).and_hms(21, 0, 0))
    .build();

assert_eq!(
    query.as_ref(),
    "SELECT temperature, humidity \
    FROM indoor_environment \
    WHERE time > '2021-03-07T21:00:00Z'",
);

Implementations

Create a query selecting from a measurement

This sets the measurement in the FROM clause.

Set the database

This sets the database in the FROM clause: database.retention_policy.measurement.

Set the retention policy

This sets the retention policy in the FROM clause: database.retention_policy.measurement.

Add a field to the query

Restrict query results to a start time

Restrict query results to a stop time

Group by a tag

Create the InfluxQL query

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more