pub fn import_table(sql: String, table_name: String, config: Config) -> () {
    let mut conn =
        get_connection(config.clone()).expect("Error while trying to connect to mysql database!");
    let params = Params::from(());

    conn.query(format!("DELETE FROM `{}`;", table_name))
        .expect("Could not delete all rows of table!")
        .to_value();

    let prepped_sql = conn
        .prep(sql)
        .expect("Could not convert file to valid stmt!");

    conn.exec(prepped_sql, params)
        .expect("Error while running select query!")
        .to_value();
}
// Import table given as sql string
Import table given as sql string
Import table given as sql string
pub fn import_table(sql: String, table_name: String, config: Config) -> () {
    let mut conn =
        get_connection(config.clone()).expect("Error while trying to connect to mysql database!");
    let params = Params::from(());
    conn.query(format!("DELETE FROM `{}`;", table_name))
        .expect("Could not delete all rows of table!")
        .to_value();
    let prepped_sql = conn
        .prep(sql)
        .expect("Could not convert file to valid stmt!");
    conn.exec(prepped_sql, params)
        .expect("Error while running select query!")
        .to_value();
}
pub fn import_table ( sql : String , table_name : String , config : Config ) -> ( ) { let mut conn = get_connection ( config . clone ( ) ) . expect ( " " ) ; let params = Params :: from ( ( ) ) ; conn . query ( format ! ( " " table_name ) ) . expect ( " " ) . to_value ( ) ; let prepped_sql = conn . prep ( sql ) . expect ( " " ) ; conn . exec ( prepped_sql , params ) . expect ( " " ) . to_value ( ) ; }
Import table given as sql string
Import table given as sql string
sql
String
table_name
String
config
Config
sql
String
table_name
String
config
Config