刀子是什么意思| 年金是什么| 什么是奇数什么是偶数| 大同古代叫什么| qq2g在线是什么意思| 大便潜血阳性意味着什么| 男士长脸适合什么发型| 坐地能吸土是什么意思| 什么帽不能戴| 降血脂有什么好办法| 反流性食管炎吃什么药最好| 脑梗什么东西不能吃| 物以类聚人以群分什么意思| mpa什么意思| 冰淇淋是什么做的| 等闲变却故人心却道故人心易变什么意思| 法医是干什么的| 支气管扩张是什么原因引起| 小孩生日送什么礼物| 2023是什么年| 上师是什么意思| 吃面是什么意思| 什么叫正盐| 胃食管反流病是什么原因造成的| 唯小人与女子难养也什么意思| 促排卵吃什么药| 低密度脂蛋白高的原因是什么| 霍山黄芽属于什么茶| 尿频尿多是什么原因| 氯雷他定不能和什么药一起吃| 羽字五行属什么| 中暑了喝什么| 牙胶是什么| 肠胃炎吃什么好| 白带是什么味道| 手指甲扁平是什么原因| sys是什么意思| 囚徒是什么意思| 基础病是什么意思| 肺纤维化是什么症状| 三杯鸡为什么叫三杯鸡| 有机可乘是什么意思| 高危病变是什么意思| 黄体酮有什么作用与功效| 牛肉炖什么好吃又营养| 什么是热感冒| 回盲肠在什么位置| lh是什么激素| 扬州有什么好吃的| 秋葵什么人不能吃| 合成革是什么材质| 头总是昏昏沉沉的是什么原因| 孕妇脚肿是什么原因引起的| 铁蛋白高吃什么食物好| 双侧下鼻甲肥大是什么意思| 无底洞是什么意思| 口腔挂什么科| 嘴唇干燥是什么原因引起的| 拖鞋买什么材质的好| 两个百字念什么| 蚯蚓喜欢吃什么| 什么是更年期| 宫颈柱状上皮异位是什么意思| 霍乱时期的爱情讲的是什么| 冻豆腐炖什么好吃| 世界上最长的单词是什么| 假酒喝了有什么症状| 外耳炎用什么药| 低血糖看什么科室| 零零年属什么| 什么节气开始凉快| acne是什么意思| 阳春三月是什么生肖| 犯困是什么原因| 1126是什么星座| 男人壮阳吃什么最快| 颈部淋巴结肿大吃什么药| 腹腔淋巴结是什么意思| 感冒反复发烧是什么原因引起的| 扑热息痛又叫什么名| 猫有什么品种| 路痴是什么原因造成的| 文气是什么意思| 什么解酒最快| 云南小黄姜有什么功效| 在什么后面| 腰酸背痛挂什么科| 四面八方是什么意思| 凌晨1点是什么时辰| 咳嗽有绿痰是什么原因| 为什么嘴唇会发紫| 牙龈出血吃什么药| 黄埔军校现在叫什么| 肿瘤是什么病严重吗| 手背有痣代表什么| 得瑟是什么意思| 下颌关节紊乱挂什么科| 痿是什么意思| 一什么事情| 万金油什么意思| 肌肉萎缩是什么症状| 小孩发烧呕吐是什么原因| 吃什么食物对心脏有好处| 83年是什么年| 颈椎病最怕干什么活| 疣长什么样| 婴儿不睡觉是什么原因| 稽留流产是什么原因| 磨豆腐是什么意思| 2010属什么| 筒骨炖什么好吃| 三十周年结婚是什么婚| 中东是什么意思| 水果什么时间段吃最好| bulova是什么牌子的手表| 男性结扎是什么意思| 阴囊瘙痒用什么药| 腿上无缘无故出现淤青是什么原因| 卯时属什么生肖| 胃烧心是什么感觉| 63年属什么生肖| 大雄宝殿是什么意思| 奶油小生什么意思| 菜花炒什么好吃| 黄体酮有什么作用与功效| 枯木逢春什么意思| 紫色加绿色是什么颜色| 火车动车高铁有什么区别| 朝鲜和韩国是什么关系| 生吃胡萝卜有什么好处和坏处| 阿莫西林有什么副作用| 1977年是什么命| hscrp高是什么感染| 用进废退是什么意思| 圆是什么图形| 咽喉炎吃什么药能治好| 肠胃不好拉肚子吃什么药| 有情人终成眷属是什么意思| m代表什么意思| 巨细胞病毒抗体阳性是什么意思| 女生肾疼是什么原因| 血崩是什么意思| 新疆古代叫什么| hc是胎儿的什么意思| 什么人什么己| 梦见老虎是什么预兆| 藏青色配什么颜色好看| 飞是什么结构| 领导喜欢什么样的员工| 梦见自己家被盗有什么预兆| 做手术后吃什么对伤口恢复快| 扭捏是什么意思| 岁月匆匆像一阵风是什么歌| 喝茉莉花茶有什么好处| 皮肌炎是什么病| 阳痿吃什么中成药| 男生为什么要割包皮| 全身无力吃什么药| 糯米粉做什么好吃| 嘴唇白是什么原因| 贫血做什么检查能查出来| 曹植字什么| 周岁和虚岁是什么意思| 哺乳期发烧吃什么药| 女人骨质疏松吃什么最好| 苹果手机为什么那么贵| 老板喜欢什么样的员工| 惆怅是什么意思| 急性咽喉炎吃什么药好得快| 白羊座后面是什么星座| 为什么青蛙跳的比树高| 蚊子不咬什么体质的人| silk是什么意思| fda是什么| nt是什么币| 紫癜有什么危害| 冰醋酸是什么| 古代四大发明是什么| 发泡胶用什么能洗掉| 慢性咽喉炎吃什么药好| 女生喜欢男生什么行为| 横财是什么意思| 孕妇贫血有什么症状| 9月28是什么星座| 农历六月六是什么日子| 黄色加红色是什么颜色| pct是什么意思| 人见人爱是什么生肖| 长期做梦是什么原因| 全身性疾病是什么意思| 经常咳嗽是什么原因| 吃生姜对身体有什么好处| 牛仔蓝是什么颜色| 什么是丝状疣| 安逸是什么意思| 世界上最大的海洋是什么| 帆船像什么| 血用什么能洗掉| 舌头中间疼是什么原因| 老放屁是什么病的征兆| 经常中暑是什么原因| 猪生肠是什么部位| 为什么总想睡觉| 好人是什么意思| 做梦梦到捡钱是什么征兆| 龙虾和什么不能一起吃| 抗ro52抗体阳性是什么意思| 什么是子宫憩室| look是什么意思| 熊猫为什么会成为国宝| 盆腔少量积液什么意思| 小孩流鼻涕咳嗽吃什么药| 有冬瓜西瓜南瓜为什么没有北瓜| 补牙挂什么科| 孕吐严重是什么原因| 11月11号什么星座| 开车穿什么鞋子| 蝾螈是什么| 什么情况需要做肠镜| 血糖高是什么意思| 桥本甲状腺炎吃什么药| 沙中土是什么意思| 冰箱什么牌子的好| 舌头起泡是什么原因引起的| 唐玄宗为什么叫唐明皇| 为什么总是拉肚子| 讥讽的笑是什么笑| 秦时明月什么时候更新| 婴儿吃什么奶粉好吸收| 尿酸高不能吃什么水果| 牙龈充血是什么原因| 贫血的人适合喝什么茶| 用醋泡脚有什么好处| 局部是什么意思| 什么是元气| 一个夸一个瓜念什么| 什么药治尿酸高最有效| 失落是什么意思| modal是什么意思| 舌头起泡吃什么药好| 倪字五行属什么| 孕早期适合吃什么水果| 铅中毒有什么症状| 开方是什么意思| 屁眼火辣辣的疼是什么原因| 狗狗不吃饭是什么原因| 饭前饭后吃药有什么区别| 白癜风是什么病| 幽闭是什么意思| 单核细胞百分比偏高是什么意思| 崎字五行属什么| 女中指戴戒指什么意思| 怀孕初期吃什么食物好| 为什么小腹隐隐作痛| 什么叫物理| 德国是什么民族| 食邑万户是什么意思| 肠胃炎能吃什么| 活动性胃炎是什么意思| 骨龄偏小意味着什么| 技校算什么学历| denham是什么牌子| kaws是什么牌子| 大熊猫属于什么科| 百度
Skip to content

taosdata/taos-connector-rust

Repository files navigation

TDengine Rust Connector

GitHub Actions Workflow Status codecov GitHub commit activity GitHub License Crates.io
Twitter Follow YouTube Channel Discord Community LinkedIn StackOverflow

English | 简体中文

Table of Contents

1. Introduction

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.

2. Documentation

  • To use Rust Connector, please check Developer Guide, which includes examples of data writing, data querying, data subscription, modeless writing, and parameter binding.
  • For other reference information, please refer to the Reference Manual, which includes version history, data type mapping, sample program summary, API reference, and FAQ.
  • This quick guide is mainly for developers who like to contribute/build/test the Rust connector by themselves. To learn about TDengine, you can visit the official documentation.

3. Prerequisites

  1. Rust 1.78 or above has been installed. The latest version is recommended.
  2. TDengine has been installed locally. For specific steps, please refer to Deploy TDengine.
  3. Modify the /etc/taos/taos.cfg configuration file and add the following configuration:
    supportVnodes 256
    
  4. Start taosd and taosAdapter.

4. Build

Run the following command in the project directory to build the project:

cargo build

5. Testing

5.1 Test Execution

Run the test by executing the following command in the project directory:

cargo test

The test case will connect to the local TDengine server and taosAdapter for testing. After the test is completed, you will see a result summary similar to the following. If all test cases pass, the failed item should be 0:

test result: ok. 101 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.21s

5.2 Test Case Addition

  1. Create a test module: In the .rs file that needs to be tested, add a module with the #[cfg(test)] attribute. This attribute ensures that the test code is only compiled when the test is executed.

    #[cfg(test)]
    mod tests {
        // Write your test cases here
    }
  2. Import the contents of the module under test: In the test module, use use super::*; to import all the contents of the external module into the scope of the test module so that you can access the functions and structures that need to be tested.

    #[cfg(test)]
    mod tests {
        use super::*;
    
        // Write your test cases here
    }
  3. Write test functions: In the test module, define functions with the #[test] attribute. Each test function should contain the following steps:

    • Setup: Prepare the data or state required for the test.
    • Execution: Call the function or method that needs to be tested.
    • Assertions: Use assertion macros to verify that the results are as expected.
    #[cfg(test)]
    mod tests {
        use super::*;
    
        #[test]
        fn test_add() {
            let result = add(2, 3);
            assert_eq!(result, 5);
        }
    }

    In the above example, the assert_eq! macro is used to check if result is equal to the expected value 5. If not, the test will fail and panic.

  4. Asynchronous function testing: For asynchronous functions, you can use the #[tokio::test] attribute macro to mark the test function and provide it with the Tokio asynchronous runtime.

    #[cfg(test)]
    mod tests {
        use super::*;
        use tokio;
    
        #[tokio::test]
        async fn test_async_function() {
            let result = async_function().await;
            assert_eq!(result, expected_value);
        }
    }

    To enable asynchronous testing support, make sure to include the Tokio dependency in your Cargo.toml. You can choose the appropriate asynchronous runtime and corresponding test property macros based on your project needs.

  5. Test panic cases: For functions that are expected to panic, you can use the #[should_panic] attribute. This attribute optionally accepts an expected parameter to specify the expected panic message.

    #[cfg(test)]
    mod tests {
        use super::*;
    
        #[test]
        #[should_panic(expected = "Divide by zero error")]
        fn test_divide_by_zero() {
            divide(1, 0);
        }
    }

    In this example, the divide function should panic when the denominator is zero, and the message should be "Divide by zero error".

  6. Ignore specific tests: For tests that take a long time or are not run often, you can use the #[ignore] attribute to mark them. By default, these tests will not be run unless explicitly run with the cargo test -- --ignored command.

    #[cfg(test)]
    mod tests {
        use super::*;
    
        #[test]
        #[ignore]
        fn test_long_running() {
            // Long-running test code
        }
    }

5.3 Performance Testing

Performance testing is under development.

6. CI/CD

7. Submitting Issues

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.

8. Submitting PRs

We welcome developers to contribute to this project. When submitting PRs, please follow these steps:

  1. Fork this project, refer to (how to fork a repo).
  2. 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.
  3. Modify the code, ensure all unit tests pass, and add new unit tests to verify the changes.
  4. Push the changes to the remote branch (git push origin my_branch).
  5. Create a Pull Request on GitHub (how to create a pull request).
  6. After submitting the PR, you can find your PR through the Pull Request. Click on the corresponding link to see if the CI for your PR has passed. If it has passed, it will display "All checks have passed". Regardless of whether the CI passes or not, you can click "Show all checks" -> "Details" to view the detailed test case logs.
  7. After submitting the PR, if CI passes, you can find your PR on the codecov page to check the test coverage.

9. References

10. License

MIT License

About

TDengine connector for Rust

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors 17

Languages

虎年是什么年 乙肝五项15阳性是什么意思 梦见很多苍蝇是什么意思 高同型半胱氨酸血症是什么病 防晒衣什么颜色最防晒
吃螃蟹不能喝什么饮料 ph阳性是什么意思 女司机为什么开不好车 sjb什么意思 心结是什么意思
泌尿内科主要看什么病 什么床品牌最好 冲太岁是什么意思 嘴唇周围长痘痘是什么原因导致 fob什么意思
老年人口干是什么原因 空心是什么意思 干巴爹什么意思 孩子张嘴睡觉是什么原因 牙套什么年龄戴合适
眼睛近视缺什么维生素hcv8jop1ns4r.cn 什么是记忆棉hcv8jop0ns2r.cn 沙茶是什么hcv8jop7ns4r.cn 军绿色裤子配什么上衣hcv7jop5ns6r.cn 牛仔外套搭配什么裤子好看hcv9jop2ns3r.cn
戏是什么意思bjhyzcsm.com 助产学出来是干什么的hcv8jop6ns0r.cn 多发息肉是什么意思beikeqingting.com 心外科是看什么病的hcv8jop1ns4r.cn 香蕉可以做什么美食hcv7jop6ns6r.cn
巩加虫念什么hcv9jop2ns7r.cn 什么是生化流产hcv8jop3ns8r.cn hpv什么病hcv9jop1ns4r.cn 烫伤擦什么药hcv7jop9ns2r.cn 聪明如你什么意思hcv7jop7ns4r.cn
什么是杀猪菜hcv9jop3ns8r.cn 裸贷是什么意思hcv9jop0ns8r.cn 淋巴结节吃什么药最好hcv8jop1ns7r.cn 富甲一方什么意思hcv7jop6ns4r.cn bbw女孩是什么意思bfb118.com
百度