aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
blob: 0ac5a2657f9e8438c414fdc0e5c0a9804a4b4ef3 (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);

    dbg!(yaml_data);

    dbconn.close().unwrap();
}