diff --git a/docs/en/05-develop/01-connect/04-rust.md b/docs/en/05-develop/01-connect/04-rust.md
index 32a6c30095012ed04c344d5c64d64b87b2c2e9a9..95ba4770506367fde9902181c8c3d3c0854c35b1 100644
--- a/docs/en/05-develop/01-connect/04-rust.md
+++ b/docs/en/05-develop/01-connect/04-rust.md
@@ -17,7 +17,10 @@ Add dependency to `Cargo.toml`.
```toml title="Cargo.toml"
[dependencies]
-libtaos = { version="*", feature=["rest"]}
+[dependencies]
+libtaos = { version="0.4.5-alpha.0", features=["rest"]}
+tokio = { version = "1", features = ["full"]}
+anyhow = "*"
```
## Config
@@ -28,24 +31,21 @@ Run this command in your terminal to save TDengine cloud token as variables:
```bash
-export TDENGINE_CLOUD_TOKEN=""
-export TDENGINE_CLOUD_URL=""
+export TDENGINE_CLOUD_DSN=""
```
```bash
-set TDENGINE_CLOUD_TOKEN=""
-set TDENGINE_CLOUD_URL=""
+set TDENGINE_CLOUD_DSN=""
```
```powershell
-$env:TDENGINE_CLOUD_TOKEN=""
-$env:TDENGINE_CLOUD_URL=""
+$env:TDENGINE_CLOUD_DSN=""
```
@@ -53,8 +53,7 @@ $env:TDENGINE_CLOUD_URL=""
:::note
-Replace and with cloud token and URL.
-To obtain the value of cloud token and URL, please log in [TDengine Cloud](https://cloud.tdengine.com) and click "Connector" and then select "Rust".
+Replace with real TDengine cloud DSN. To obtain the real value, please log in [TDengine Cloud](https://cloud.tdengine.com) and click "Connector" and then select "Rust".
:::
diff --git a/docs/examples/go/connectexample/main.go b/docs/examples/go/connectexample/main.go
index 22d171d875ee4874fb6d6ec978a9ebd38b1858de..3a32425be341adad1fc23ff0b01c6226cbad66f9 100644
--- a/docs/examples/go/connectexample/main.go
+++ b/docs/examples/go/connectexample/main.go
@@ -16,7 +16,7 @@ func main() {
return
}
defer taos.Close()
- rows, err := taos.Query("select server_version()")
+ rows, err := taos.Query("show databases")
if err != nil {
fmt.Println(err)
return
diff --git a/docs/examples/rust/cloud_example/Cargo.toml b/docs/examples/rust/cloud_example/Cargo.toml
index b4b2066b232b6f67ce9da5c56d415c8ffc443cd2..f9e1e54a6587ce43548fe5638d6c834cd65314fc 100644
--- a/docs/examples/rust/cloud_example/Cargo.toml
+++ b/docs/examples/rust/cloud_example/Cargo.toml
@@ -7,5 +7,6 @@ edition = "2021"
[dependencies]
-libtaos = { version="0.4.5-alpha.0", feature=["rest"]}
+libtaos = { version="0.4.5-alpha.0", features=["rest"]}
tokio = { version = "1", features = ["full"]}
+anyhow = "*"
diff --git a/docs/examples/rust/cloud_example/src/main.rs b/docs/examples/rust/cloud_example/src/main.rs
index faeedff9978275d55dd5b7e57fa1fefb477c296a..2019c389529ff2baa2a4f88d9fdc63debc448515 100644
--- a/docs/examples/rust/cloud_example/src/main.rs
+++ b/docs/examples/rust/cloud_example/src/main.rs
@@ -1,9 +1,12 @@
+use anyhow::Result;
use libtaos::*;
-fn main() {
- let token = std::env::var("TDENGINE_CLOUD_TOKEN").unwrap();
- let url = std::env::var("TDENGINE_CLOUD_URL").unwrap();
- let dsn = url + "?token=" + &token;
- let taos = TaosCfg::from_dsn(dsn)?;
- println!("connected");
+#[tokio::main]
+async fn main() -> Result<()> {
+ let dsn = std::env::var("TDENGINE_CLOUD_DSN").unwrap();
+ let cfg = TaosCfg::from_dsn(dsn)?;
+ let conn = cfg.connect()?;
+ let _ = conn.query("show databases").await?;
+ println!("Connected");
+ Ok(())
}
\ No newline at end of file