fn db_create(set_path: &str) -> rusqlite::Result<()> {
    let conn = Connection::open(&set_path)?;

    // Create the directories table
    conn.execute(
        "create table if not exists directories (
            option text primary key,
            path text not null unique)
            ",
        NO_PARAMS,
    )?;

    // Create the watchlist table
    conn.execute(
        "create table if not exists watchlist (
            id integer primary key,
            name text not null unique,
            option text not null)
            ",
        NO_PARAMS,
    )?;
    // Create the item_tracker table
    conn.execute(
        "create table if not exists item_tracker (
            id integer primary key,
            item blob not null unique,
            latest blob not null unique)
            ",
        NO_PARAMS,
    )?;

    Ok(())
}
/// Function to create a database with the default tables
Function to create a database with the default tables
Function to create a database with the default tables
fn db_create(set_path: &str) -> rusqlite::Result<()> {
    let conn = Connection::open(&set_path)?;
    // Create the directories table
    conn.execute(
        "create table if not exists directories (
            option text primary key,
            path text not null unique)
            ",
        NO_PARAMS,
    )?;
    // Create the watchlist table
    conn.execute(
        "create table if not exists watchlist (
            id integer primary key,
            name text not null unique,
            option text not null)
            ",
        NO_PARAMS,
    )?;
    // Create the item_tracker table
    conn.execute(
        "create table if not exists item_tracker (
            id integer primary key,
            item blob not null unique,
            latest blob not null unique)
            ",
        NO_PARAMS,
    )?;
    Ok(())
}
fn db_create ( set_path : & str ) -> rusqlite :: Result < ( ) > { let conn = Connection :: open ( & set_path ) ? ; // Create the directories table conn . execute ( " " , NO_PARAMS , ) ? ; // Create the watchlist table conn . execute ( " " , NO_PARAMS , ) ? ; // Create the item_tracker table conn . execute ( " " , NO_PARAMS , ) ? ; Ok ( ( ) ) }
Function to create a database with the default tables
Function to create a database with the default tables
set_path
&str
set_path
&str