InfluxDBClient-rs
A easy-use client to influxdb
Overview
This is an InfluxDB driver for Rust.
Status
This project has been able to run properly, PR is welcome.
Usage
Use
[dependencies]
influx_db_client = "^0.7.0"
tokio = { version = "1", features = ["rt-multi-thread"] }
http
use ;
Client defaults to reqwest::Client when the default reqwest feature is enabled,
but it is generic over the HTTP implementation.
If you need a custom transport, implement the transport traits for the APIs you want to support,
then create it with Client::new_with_client(...).
Borrowing APIs such as ping_borrow, get_version_borrow, query_borrow,
query_chunked_borrow, write_point_borrow, write_points_borrow, and the corresponding
query-backed *_borrow management APIs require BorrowHttpClient and BorrowHttpResponse.
Borrowed chunked queries also require BorrowChunkedHttpResponse. Spawn-safe APIs such as ping,
get_version, query, query_chunked, write_point, write_points, and the query-backed
management commands require HttpClient and HttpResponse. Spawn-safe chunked queries also
require ChunkedHttpResponse. You can implement borrowed-only, spawn-safe-only, or both modes on the same
transport type.
Borrowing APIs use borrowed HttpRequest data, while spawnable query/write APIs receive owned
HttpRequest<'static> values. Chunked responses now expose an async byte stream rather than a
blocking reader.
query_chunked is an incompatible API change in this release: it now returns an async stream
instead of a synchronous iterator. Add futures = "0.3" if you want to consume it with
StreamExt::next:
use StreamExt;
use ;
#
To avoid compiling reqwest, disable default features and provide your own HTTP client:
[]
= { = "^0.7.0", = false }
The crate's default reqwest/default-tls path currently resolves to a rustls-based backend.
This is an incompatible feature-name update: the previous rustls-tls* feature names were removed.
To build the default reqwest transport with the native-tls backend, disable default features
and enable one of the native-tls* features explicitly. On Linux that typically means OpenSSL;
on macOS and Windows it uses the platform TLS stack:
[]
= { = "^0.7.0", = false, = ["native-tls"] }
udp
use ;
Compatibility
This is the API Document, it may apply to version 1.0 or higher.
I have tested it in version 1.0.2/1.3.5/1.5.
Thanks
Because influent seems to have no longer updated, and only support to the 0.9 version. I read influent.rs and influxdb-python source, and then try to write a library for 1.0+ version for support for my own use.