pub fn update_record(record: models::Annotation, config: &models::Config) {
    let conn =  rusqlite::Connection::open(config.database.file.as_path()).unwrap();
    match conn.execute(&config.database.update_record,
        rusqlite::params![record.title, record.description, record.publisher,
                            record.read, record.id]) {
                                Ok(added) => println!("{} row updated", added),
                                Err(err) => println!("Update failed {}", err),
                            };
}
// Update the database with the contents of the record
Update the database with the contents of the record
Update the database with the contents of the record
pub fn update_record(record: models::Annotation, config: &models::Config) {
    let conn =  rusqlite::Connection::open(config.database.file.as_path()).unwrap();
    match conn.execute(&config.database.update_record,
        rusqlite::params![record.title, record.description, record.publisher,
                            record.read, record.id]) {
                                Ok(added) => println!("{} row updated", added),
                                Err(err) => println!("Update failed {}", err),
                            };
}
pub fn update_record ( record : models :: Annotation , config : & models :: Config ) { let conn = rusqlite :: Connection :: open ( config . database . file . as_path ( ) ) . unwrap ( ) ; match conn . execute ( & config . database . update_record , rusqlite :: params ! [ record title record description record publisher record read record id ] ) { Ok ( added ) => println ! ( " " added ) , Err ( err ) => println ! ( " " err ) , } ; }
Update the database with the contents of the record
Update the database with the contents of the record
record
models::Annotation
config
&models::Config
record
models::Annotation
config
&models::Config