blob: 8b4e9afd47c8925771a340b61a810f78aab26d48 (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 | 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 table_columns = yaqlite::sqlite::get_column_names(&dbconn, "people");
    dbg!(&table_columns);
    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();
}
 |