From 065f2e630f366fe38920885c63cf97a7d3218c21 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Fri, 18 Mar 2022 19:57:47 +0100 Subject: 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. --- Cargo.toml | 2 +- src/select.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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") -- cgit v1.2.3