Docs.rs | Crates.io Version | Crates.io Downloads | CodeCov |
---|---|---|---|
English | 简体中文
- 1. Introduction
- 2. Getting the Driver
- 3. Documentation
- 4. Prerequisites
- 5. Build
- 6. Testing
- 7. Submitting Issues
- 8. Submitting PRs
- 9. References
- 10. License
taos
is the official Rust language connector of TDengine, through which Rust developers can develop applications that access TDengine databases. It supports data writing, data query, data subscription, schemaless writing, parameter binding and other functions.
taos
provides two ways to establish a connection:
- Native connection: Establish a connection directly with the server program taosd through the client driver taosc. When using this connection method, you need to ensure that the client driver taosc and the server taosd version are consistent.
- WebSocket connection: Establish a connection with taosd through the WebSocket API provided by the taosAdapter component. This method does not rely on the TDengine client driver, supports cross-platform use, is more convenient and flexible, and has performance similar to native connection.
It is recommended to use the WebSocket connection method. For detailed description, please refer to Connection Methods.
Supports Rust 1.70 and above.
- The platforms supported by the native connection are consistent with those supported by the TDengine client driver.
- WebSocket connection supports all platforms that can run Rust.
Add the following to your Cargo.toml
:
[dependencies]
taos = "0.12.3"
- For development examples, please visit the Developer Guide, which includes examples of data writing, data querying, data subscription, schemaless writing, and parameter binding.
- For more information, please visit the Reference Manual, which includes version history, data type mapping, sample program summary, API reference, and FAQ.
- Rust 1.70 or above has been installed.
- TDengine has been deployed locally. For specific steps, please refer to Deploy TDengine, and taosd and taosAdapter have been started.
Run the following command in the project directory to build the project:
cargo build
Before running the test, please add the following configuration to the taos.cfg
file:
supportVnodes 256
After completing the configuration, execute the following command in the project directory to run the test:
cargo test
Add test cases in the #[cfg(test)]
module of the corresponding .rs
file. For synchronous code, use the #[test]
macro; for asynchronous code, use the #[tokio::test]
macro.
Performance testing is under development.
We welcome the submission of GitHub Issue. When submitting, please provide the following information:
- Description of the problem, whether it must occur, preferably with detailed call stack.
- Rust connector version.
- Connection parameters (no username or password required).
- TDengine server version.
We welcome developers to contribute to this project. When submitting PRs, please follow these steps:
- Fork this project, refer to (how to fork a repo).
- Create a new branch from the main branch with a meaningful branch name (
git checkout -b my_branch
). Do not modify the main branch directly. - Modify the code, ensure all unit tests pass, and add new unit tests to verify the changes.
- Push the changes to the remote branch (
git push origin my_branch
). - Create a Pull Request on GitHub (how to create a pull request).
- After submitting the PR, if CI passes, you can find your PR on the codecov page to check the test coverage.