提交 7706ebae 编写于 作者: D dingbo

test: rust example

上级 8d661358
...@@ -3,10 +3,7 @@ name = "cloud-example" ...@@ -3,10 +3,7 @@ name = "cloud-example"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
libtaos = { version="0.4.5-alpha.0", features=["rest"]} taos = { version = "*", default-features = false, features = ["ws"] }
tokio = { version = "1", features = ["full"]} tokio = { version = "1", features = ["full"]}
anyhow = "1.0.0" anyhow = "1.0.0"
...@@ -4,9 +4,8 @@ use libtaos::*; ...@@ -4,9 +4,8 @@ use libtaos::*;
#[tokio::main] #[tokio::main]
async fn main() -> Result<()> { async fn main() -> Result<()> {
let dsn = std::env::var("TDENGINE_CLOUD_DSN")?; let dsn = std::env::var("TDENGINE_CLOUD_DSN")?;
let cfg = TaosCfg::from_dsn(dsn)?; let taos = TaosBuilder::from_dsn(dsn)?.build()?;
let conn = cfg.connect()?; let _ = taos.query("show databases").await?;
let _ = conn.query("show databases").await?;
println!("Connected"); println!("Connected");
Ok(()) Ok(())
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册