};
use futures::TryStreamExt;
-use sqlx::{Connection, SqliteConnection, Row, Column};
+use sqlx::{database::HasStatement, sqlite::SqliteStatement, Column, Connection, Execute, Executor, Row, SqliteConnection, Statement};
use std::str::FromStr;
#[derive(Debug, Deserialize)]
s.push_str(format!("col {} title {}<br/>\n", i, v.title()).as_str());
}
+ let mut conn = SqliteConnection::connect("examples/grid.db").await.unwrap();
+
+ let p = conn.prepare("SELECT * FROM clients WHERE FALSE").await.unwrap();
+
+ //let q: sqlx::query::Query<'_, sqlx::Sqlite, _> = sqlx::query("SELECT * FROM clients WHERE FALSE");
+ //let p = q.statement().unwrap();
+
+ s.push_str(&format!("<br/>Sql columns: {:?}<br/>", p.columns()));
+
s.push_str("<br/><br/>\n");
s.push_str("<table style='border: 1px solid;'>\n");
let header = grid.header();
s.push_str(header.as_str());
- let mut conn = SqliteConnection::connect("examples/grid.db").await.unwrap();
-
let mut rows = sqlx::query("SELECT * FROM clients").fetch(&mut conn);
while let Some(row) = rows.try_next().await.unwrap() {
let cols = row.columns();