Struct influx_client::blocking::Client
source · pub struct Client<'a> { /* private fields */ }
Expand description
Use a Client to connect to your influx database and execute queries.
Implementations§
source§impl<'a> Client<'a>
impl<'a> Client<'a>
sourcepub fn new(url: &'a str, token: &'a str) -> Self
pub fn new(url: &'a str, token: &'a str) -> Self
Create a client with a given database URL and token.
sourcepub fn from_env(url: &'a str) -> Result<Self, InfluxError>
pub fn from_env(url: &'a str) -> Result<Self, InfluxError>
Create a client that reads its token from the
INFLUXDB_TOKEN
environment variable
sourcepub fn insert<T: Display>(
&self,
bucket: &'a str,
org: &'a str,
precision: Precision,
query: WriteQuery<'_, T>
) -> Result<(), InfluxError>
pub fn insert<T: Display>(
&self,
bucket: &'a str,
org: &'a str,
precision: Precision,
query: WriteQuery<'_, T>
) -> Result<(), InfluxError>
Insert a new value into a bucket.
Note that not all attributes on WriteQuery
are supported yet.
sourcepub fn get(
&self,
org: &'a str,
query: ReadQuery<'_>
) -> Result<String, InfluxError>
pub fn get(
&self,
org: &'a str,
query: ReadQuery<'_>
) -> Result<String, InfluxError>
Retrieve a value from a bucket based on certain filters.