pub fn db_write_dir(set_path: &str, dir_key: &str, dir_val: &str) -> rusqlite::Result<()> {
    // Collect the directory values
    let mut dir = std::collections::HashMap::new();
    dir.insert(dir_key, dir_val);

    // Establish a connection to the database
    let conn = Connection::open(&set_path)?;

    // Insert the values into the table
    for (key, val) in &dir {
        conn.execute(
            "insert into directories
            (option, path) values (?1, ?2)",
            &[&key.to_string(), &val.to_string()],
        )?;
    }

    // return an Ok value
    Ok(())
}
/// Funtion to write the directory values to the directories table
Funtion to write the directory values to the directories table
Funtion to write the directory values to the directories table
pub fn db_write_dir(set_path: &str, dir_key: &str, dir_val: &str) -> rusqlite::Result<()> {
    // Collect the directory values
    let mut dir = std::collections::HashMap::new();
    dir.insert(dir_key, dir_val);
    // Establish a connection to the database
    let conn = Connection::open(&set_path)?;
    // Insert the values into the table
    for (key, val) in &dir {
        conn.execute(
            "insert into directories
            (option, path) values (?1, ?2)",
            &[&key.to_string(), &val.to_string()],
        )?;
    }
    // return an Ok value
    Ok(())
}
pub fn db_write_dir ( set_path : & str , dir_key : & str , dir_val : & str ) -> rusqlite :: Result < ( ) > { // Collect the directory values let mut dir = std :: collections :: HashMap :: new ( ) ; dir . insert ( dir_key , dir_val ) ; // Establish a connection to the database let conn = Connection :: open ( & set_path ) ? ; // Insert the values into the table for ( key , val ) in & dir { conn . execute ( " " , & [ & key . to_string ( ) , & val . to_string ( ) ] , ) ? ; } // return an Ok value Ok ( ( ) ) }
Funtion to write the directory values to the directories table
Funtion to write the directory values to the directories table
set_path
&str
dir_key
&str
dir_val
&str
set_path
&str
dir_key
&str
dir_val
&str