Databend unified SQL client for RestAPI and FlightSQL
```rust use databend_driver::Client;
let dsn = "databend://root:@localhost:8000/default?sslmode=disable".tostring(); let client = Client::new(dsn); let conn = client.getconn().await.unwrap();
let sqlcreate = "CREATE TABLE books ( title VARCHAR, author VARCHAR, date Date );"; conn.exec(sqlcreate).await.unwrap(); let sqlinsert = "INSERT INTO books VALUES ('The Little Prince', 'Antoine de Saint-Exupéry', '1943-04-06');"; conn.exec(sqlinsert).await.unwrap(); ```
rust
let row = conn.query_row("SELECT * FROM books;").await.unwrap();
let (title,author,date): (String,String,i32) = row.unwrap().try_into().unwrap();
println!("{} {} {}", title, author, date);
rust
let mut rows = conn.query_iter("SELECT * FROM books;").await.unwrap();
while let Some(row) = rows.next().await {
let (title,author,date): (String,String,chrono::NaiveDate) = row.unwrap().try_into().unwrap();
println!("{} {} {}", title, author, date);
}