use comunic_server::data::config::{conf, Config}; use comunic_server::helpers::database; use mysql::prelude::Queryable; #[derive(Debug, PartialEq, Eq)] struct User { id : i32, name : String, email: String, age: i32 } fn main() { // Load configuration Config::load("config.yaml").expect("Could not load configuration!"); // Connect to the database database::connect(&conf().database).expect("Could not connect to database!"); let mut conn = database::get_connection().unwrap(); let res = conn.query_map("SELECT id, name, email, age FROM user", |(id, name, email, age)| { User {id, name, email, age} }).unwrap(); println!("{:#?}", res); println!("Hello, world!"); }