This library is a work in progress. This means a feature you might need is not implemented yet or could be handled better.
Pull requests are always welcome. See Contributing and Code of Conduct. For a list of past changes, see CHANGELOG.md.
Currently Supported Features
- Reading and Writing to InfluxDB
- Optional Serde Support for Deserialization
- Running multiple queries in one request (e.g.
SELECT * FROM weather_berlin; SELECT * FROM weather_london
) - Writing single or multiple measurements in one request (e.g.
WriteQuery
orVec<WriteQuery>
argument) - Authenticated and Unauthenticated Connections
async
/await
support#[derive(InfluxDbWriteable)]
Derive Macro for Writing / Reading into StructsGROUP BY
support- Tokio and async-std support (see example below) or available backends
- Swappable HTTP backends (see below)
Quickstart
Add the following to your Cargo.toml
= { = "0.7.2", = ["derive"] }
For an example with using Serde deserialization, please refer to serde_integration
use ;
use ;
// or #[async_std::main] if you prefer
async
For further examples, check out the Integration Tests in tests/integration_tests.rs
in the repository.
Choice of HTTP backend
To communicate with InfluxDB, you can choose the HTTP backend to be used configuring the appropriate feature. We recommend sticking with the default reqwest-based client, unless you really need async-std compatibility.
-
hyper (through reqwest, used by default), with rustls
= { = "0.7.2", = ["derive"] }
-
hyper (through reqwest), with native TLS (OpenSSL)
= { = "0.7.2", = false, = ["derive", "use-serde", "reqwest-client"] }
-
hyper (through surf), use this if you need tokio 0.2 compatibility
= { = "0.7.2", = false, = ["derive", "use-serde", "hyper-client"] }
-
= { = "0.7.2", = false, = ["derive", "use-serde", "curl-client"] }
-
async-h1 with native TLS (OpenSSL)
= { = "0.7.2", = false, = ["derive", "use-serde", "h1-client"] }
-
= { = "0.7.2", = false, = ["derive", "use-serde", "h1-client-rustls"] }
-
WebAssembly’s
window.fetch
, viaweb-sys
and wasm-bindgen= { = "0.7.2", = false, = ["derive", "use-serde", "wasm-client"] }
License
@ 2020 Gero Gerke and contributors.