fn add_filedata_sql(filedata: &FileData, transaction: &Transaction) {
    log::info!("Adding {}'s results to results database", filedata.path);
    for comment in filedata.comments.as_slice() {
        transaction
            .execute(
                "INSERT INTO comments (id, comment, filehash) VALUES (:hash, :comment, :filehash)",
                to_params_named(&comment).unwrap().to_slice().as_slice(),
            )
            .unwrap();
    }
    transaction
        .execute(
            "INSERT INTO files (id, filename) VALUES (?1, ?2)",
            params![filedata.hash, filedata.path],
        )
        .unwrap();
}
/*
    Adds a given filedata struct to the sqlite 3 database
*/
Adds a given filedata struct to the sqlite 3 database
Adds a given filedata struct to the sqlite 3 database
fn add_filedata_sql(filedata: &FileData, transaction: &Transaction) {
    log::info!("Adding {}'s results to results database", filedata.path);
    for comment in filedata.comments.as_slice() {
        transaction
            .execute(
                "INSERT INTO comments (id, comment, filehash) VALUES (:hash, :comment, :filehash)",
                to_params_named(&comment).unwrap().to_slice().as_slice(),
            )
            .unwrap();
    }
    transaction
        .execute(
            "INSERT INTO files (id, filename) VALUES (?1, ?2)",
            params![filedata.hash, filedata.path],
        )
        .unwrap();
}
fn add_filedata_sql ( filedata : & FileData , transaction : & Transaction ) { log :: info ! ( " " filedata path ) ; for comment in filedata . comments . as_slice ( ) { transaction . execute ( " " , to_params_named ( & comment ) . unwrap ( ) . to_slice ( ) . as_slice ( ) , ) . unwrap ( ) ; } transaction . execute ( " " , params ! [ filedata hash filedata path ] , ) . unwrap ( ) ; }
Adds a given filedata struct to the sqlite 3 database
Adds a given filedata struct to the sqlite 3 database
filedata
&FileData
transaction
&Transaction
filedata
&FileData
transaction
&Transaction