aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index e064baa..0c445fe 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -52,6 +52,26 @@ fn yaml_extract(
}
}
+ let mut stmt = tx.prepare(
+ &format!(
+ r#"
+ INSERT INTO "people"
+ ({})
+ VALUES
+ ({});
+ "#,
+ // Wrap column names in quotes.
+ hash.keys()
+ .map(|k| format!(r#""{}""#, k.as_str().unwrap()))
+ .collect::<Vec<String>>()
+ .join(", "),
+ // TODO: get len "?"s
+ format!("{}?", "?, ".repeat(hash.len() - 1)),
+ )
+ ).unwrap();
+
+ // stmt.insert(rusqlite::params_from_iter(hash.values())).unwrap();
+
// tx.execute(
// r#"
// INSERT INTO "people"