use df_helper::files::file; use df_helper::orm::db::Db; use df_helper::tools::tools; fn main() { let root_path = tools::root_path(); let conf = file::file_content_get_json(format!("{}/tests/config/db.json", root_path.clone()).as_str()); let mut db = Db::connect(conf); let user_user = file::file_content_get_json(format!("{}/tests/sql/user_user.json", root_path.clone()).as_str()); let table = "user_user"; let is_table = db.query_table(table); if is_table { // db.delete_table(table, true); // db.create_table(table, user_user.clone()); let res = db.update_table(table, user_user); println!("{}", res); // let data = db.fieldsinfo(); // println!("{:#}", data); } else { let res = db.create_table(table, user_user); println!("{}", res); // let data = array![ // object! { // name:"我的", // code:112 // }, // object! { // name:"我的", // code:1123 // } // ]; // let res = db.table("user_user").add(data); // println!("{}", res); } }