pub fn db_write_wl(set_path: &str, wl_key: &str, wl_val: &str) -> rusqlite::Result<()> {
    // Collect the watchlist values
    let mut wl = std::collections::HashMap::new();
    wl.insert(wl_key, wl_val);

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

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

    // return an Ok value
    Ok(())
}
/// Function to write the watchlist values to the watchlist table
Function to write the watchlist values to the watchlist table
Function to write the watchlist values to the watchlist table
pub fn db_write_wl(set_path: &str, wl_key: &str, wl_val: &str) -> rusqlite::Result<()> {
    // Collect the watchlist values
    let mut wl = std::collections::HashMap::new();
    wl.insert(wl_key, wl_val);
    // Establish a connection to the database
    let conn = Connection::open(&set_path)?;
    // Insert the values into the table
    for (key, val) in &wl {
        conn.execute(
            "insert into watchlist
            (name, option) values (?1, ?2)",
            &[&key.to_string(), &val.to_string()],
        )?;
    }
    // return an Ok value
    Ok(())
}
pub fn db_write_wl ( set_path : & str , wl_key : & str , wl_val : & str ) -> rusqlite :: Result < ( ) > { // Collect the watchlist values let mut wl = std :: collections :: HashMap :: new ( ) ; wl . insert ( wl_key , wl_val ) ; // Establish a connection to the database let conn = Connection :: open ( & set_path ) ? ; // Insert the values into the table for ( key , val ) in & wl { conn . execute ( " " , & [ & key . to_string ( ) , & val . to_string ( ) ] , ) ? ; } // return an Ok value Ok ( ( ) ) }
Function to write the watchlist values to the watchlist table
Function to write the watchlist values to the watchlist table
set_path
&str
wl_key
&str
wl_val
&str
set_path
&str
wl_key
&str
wl_val
&str