Skip to content

Commit

Permalink
Merge pull request #291 from taosdata/3.0
Browse files Browse the repository at this point in the history
chore: merge 3.0 to main
  • Loading branch information
AdamEECS authored Dec 1, 2023
2 parents 50d3458 + d25a29d commit fbed0c6
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions taos-ws/src/stmt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use taos_query::{block_in_place_or_global, IntoDsn, RawBlock};
use taos_query::prelude::tokio;
use tokio::sync::{oneshot, watch};

use tokio_tungstenite::connect_async;
use tokio_tungstenite::tungstenite::protocol::Message;

use crate::query::infra::ToMessage;
Expand Down Expand Up @@ -258,9 +257,7 @@ impl Drop for Stmt {
impl Stmt {
pub(crate) async fn from_wsinfo(info: &TaosBuilder) -> RawResult<Self> {

let (ws, _) = connect_async(info.to_stmt_url())
.await
.map_err(Error::from)?;
let ws = info.build_stream(info.to_stmt_url()).await?;

let req_id = 0;
let (mut sender, mut reader) = ws.split();
Expand Down Expand Up @@ -735,15 +732,19 @@ mod tests {
taos.exec("create table ws_stmt_sj2.stb (ts timestamp, v int) tags(tj json)")
.await?;

std::env::set_var("RUST_LOG", "debug");
std::env::set_var("RUST_LOG", "trace");
// pretty_env_logger::init();
let mut client = Stmt::from_dsn("taos+ws://localhost:6041/ws_stmt_sj2").await?;
let stmt = client
.s_stmt("insert into ? using stb tags(?) values(?, ?)")
.await?;

// let tag_fields = stmt.stmt_get_tag_fields().await;
// dbg!(tag_fields);
let tag_fields = stmt.stmt_get_tag_fields().await;
if let Err(err) = tag_fields {
log::error!("tag fields error: {:?}", err);
} else {
log::debug!("tag fields: {:?}", tag_fields);
}

stmt.stmt_set_tbname("tb1").await?;

Expand Down

0 comments on commit fbed0c6

Please sign in to comment.