Struct influxdb::WriteQuery
source · pub struct WriteQuery { /* private fields */ }
Expand description
Internal Representation of a Write query that has not yet been built
Implementations§
source§impl WriteQuery
impl WriteQuery
sourcepub fn new<S>(timestamp: Timestamp, measurement: S) -> Selfwhere
S: Into<String>,
pub fn new<S>(timestamp: Timestamp, measurement: S) -> Selfwhere
S: Into<String>,
Creates a new WriteQuery
sourcepub fn add_field<S, F>(self, field: S, value: F) -> Selfwhere
S: Into<String>,
F: WriteType,
pub fn add_field<S, F>(self, field: S, value: F) -> Selfwhere
S: Into<String>,
F: WriteType,
Adds a field to the WriteQuery
Examples
use influxdb::{Query, Timestamp};
use influxdb::InfluxDbWriteable;
Timestamp::Nanoseconds(0).into_query("measurement").add_field("field1", 5).build();
sourcepub fn add_tag<S, I>(self, tag: S, value: I) -> Selfwhere
S: Into<String>,
I: WriteType,
pub fn add_tag<S, I>(self, tag: S, value: I) -> Selfwhere
S: Into<String>,
I: WriteType,
Adds a tag to the WriteQuery
Please note that a WriteQuery
requires at least one field. Composing a query with
only tags will result in a failure building the query.
Examples
use influxdb::{Query, Timestamp};
use influxdb::InfluxDbWriteable;
Timestamp::Nanoseconds(0)
.into_query("measurement")
.add_tag("field1", 5); // calling `.build()` now would result in a `Err(Error::InvalidQueryError)`
pub fn get_precision(&self) -> String
Trait Implementations§
source§impl Clone for WriteQuery
impl Clone for WriteQuery
source§fn clone(&self) -> WriteQuery
fn clone(&self) -> WriteQuery
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more