From 552473e9e769076c2d4b9066051fa4ed0519cbbc Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Wed, 9 Mar 2022 23:28:52 +0100 Subject: yaml_extract(): Fix code from transaction argument idea --- src/main.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index 9ea03f4..2593122 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,7 +6,7 @@ fn main() { // Get column names from SQLite - let dbconn = rusqlite::Connection::open("./test.db").unwrap(); + let mut dbconn = rusqlite::Connection::open("./test.db").unwrap(); let table_columns = get_column_names(&dbconn); dbg!(&table_columns); @@ -36,7 +36,7 @@ fn yaml_extract( match doc { yaml::Yaml::Array(ref array) => { for yaml_value in array { - yaml_extract(yaml_value, table_columns); + yaml_extract(yaml_value, tx, table_columns); } } yaml::Yaml::Hash(ref hash) => { @@ -52,15 +52,15 @@ fn yaml_extract( } } - tx.execute( - r#" - INSERT INTO "people" - () - VALUES - (); - "#, - [] - ).unwrap(); + // tx.execute( + // r#" + // INSERT INTO "people" + // () + // VALUES + // (); + // "#, + // [] + // ).unwrap(); } _ => {} } -- cgit v1.2.3