最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Is there a way to see interpolated mysql query for debugging in Rust? - Stack Overflow

programmeradmin2浏览0评论

In rust, I'm using mysql crate to make query with exec_first() function like this :

let query = r"SELECT NAME from MY_TABLE where VALUE=:age";
let datas = params!{"age"=> 2};
let reqres = pdb.conn.exec_first(query, datas)
    .expect("query failed")
    .expect("Can't get age"); 

dbg!(&reqres);

I understand this is the safe way to do it.

It works but, if I want to test the request in mysql> console, is there a way to print the datas interpolated request ?

发布评论

评论列表(0)

  1. 暂无评论