@@ -77,6 +77,7 @@ TDengine is a highly efficient platform to store, query, and analyze time-series
-[Node.js Connector](/connector#nodejs): driver for connecting to TDengine server from Node.js applications
-[C# Connector](/connector#csharp): driver for connecting to TDengine server from C# applications
-[Windows Client](https://www.taosdata.com/blog/2019/07/26/514.html): compile your own Windows client, which is required by various connectors on the Windows environment
-[Rust Connector](/connector/rust): A taosc/RESTful API based TDengine client for Rust
> Note that the rust connector is under active development and the APIs will changes a lot between versions. But we promise to ensure backward compatibility after version 1.0 .
Thanks [@songtianyi](https://github.com/songtianyi) for [libtdengine](https://github.com/songtianyi/tdengine-rust-bindings) - a rust bindings project for [TDengine]. It's an new design for [TDengine] rust client based on C interface or the REST API. It'll will provide Rust-like APIs and all rust things (like async/stream/iterators and others).
## Dependencies
-[Rust](https://www.rust-lang.org/learn/get-started) of course.
if you use the default features, it'll depend on:
- [TDengine] Client library and headers.
- clang because bindgen will requires the clang AST library.
## Fetures
In-design features:
- [x] API for both C interface
- [x] REST API support by feature `rest`.
- [x] [r2d2] Pool support by feature `r2d2`
- [ ] Iterators for fields fetching
- [ ] Stream support
- [ ] Subscribe support
## Build and test
```sh
cargo build
cargo test
```
`test` will use default TDengine user and password on localhost (TDengine default).
Set variables if it's not default:
-`TEST_TAOS_IP`
-`TEST_TAOS_PORT`
-`TEST_TAOS_USER`
-`TEST_TAOS_PASS`
-`TEST_TAOS_DB`
## Usage
For default C-based client API, set in Cargo.toml
```toml
[dependencies]
libtaos="v0.3.8"
```
For r2d2 support:
```toml
[dependencies]
libtaos={version="*",features=["r2d2"]}
```
For REST client:
```toml
[dependencies]
libtaos={version="*",features=["rest"]}
```
There's a [demo app]([examples/demo.rs](https://github.com/taosdata/libtaos-rs/blob/main/examples/demo.rs)) in examples directory, looks like this:
```rust
// ...
#[tokio::main]
asyncfnmain()->Result<(),Error>{
init();
lettaos=taos_connect()?;
assert_eq!(
taos.query("drop database if exists demo").await.is_ok(),
You can check out the experimental [bailongma-rs](https://github.com/taosdata/bailongma-rs) - a TDengine adapters for prometheus written with Rust - as a more productive code example.