blob: 0ec2724f0f0f41c697a04a74083fa504160a8aff (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
use rusqlite;
use yaml_rust::yaml;
fn main() {
println!("Hello, world!");
// Get column names from SQLite
let mut dbconn = rusqlite::Connection::open("./test.db").unwrap();
let text_data = std::fs::read_to_string("test2.yml").unwrap();
let mut yaml_data = yaml::YamlLoader::load_from_str(&text_data).unwrap();
yaqlite::insert(&mut dbconn, "people", &mut yaml_data).unwrap();
dbg!(yaml_data);
dbconn.close().unwrap();
}
|