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

test: rust example

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