aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2022-03-18 19:57:47 +0100
committerTeddy Wing2022-03-18 19:57:47 +0100
commit065f2e630f366fe38920885c63cf97a7d3218c21 (patch)
tree9e8de1f9d7f132ad6dda2b357c38981d47505311
parentcc960575a321700b9b8981eb1d5b542fd2207fc2 (diff)
downloadyaqlite-065f2e630f366fe38920885c63cf97a7d3218c21.tar.bz2
select(): Debug the parameterized SQL query
Add the `modern_sqlite` feature in order to use the `expanded_sql()` method. This shows us the SQL query with parameters expanded.
-rw-r--r--Cargo.toml2
-rw-r--r--src/select.rs2
2 files changed, 3 insertions, 1 deletions
diff --git a/Cargo.toml b/Cargo.toml
index d6fc66e..b8dea01 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -4,7 +4,7 @@ version = "0.0.1"
edition = "2021"
[dependencies]
-rusqlite = "0.27.0"
+rusqlite = { version = "0.27.0", features = ["modern_sqlite"] }
thiserror = "1.0.30"
yaml-rust = "0.4.5"
diff --git a/src/select.rs b/src/select.rs
index 133cae7..4fcd41c 100644
--- a/src/select.rs
+++ b/src/select.rs
@@ -76,6 +76,8 @@ pub fn select(
// return row[0].0.into_owned();
}
+ dbg!(&stmt.expanded_sql());
+
// sqlite3 -header test.db '
// SELECT "name"
// FROM pragma_table_info("test")