Skip to content

Instantly share code, notes, and snippets.

@Norbert515
Created February 20, 2018 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Norbert515/08f4398c9184c3627d745f7f21d5cab8 to your computer and use it in GitHub Desktop.
Save Norbert515/08f4398c9184c3627d745f7f21d5cab8 to your computer and use it in GitHub Desktop.
updateBook
/// Inserts or replaces the book.
Future updateBook(Book book) async {
await db.inTransaction(() async {
await db.rawInsert(
'INSERT OR REPLACE INTO '
'$tableName(${Book.db_id}, ${Book.db_title}, ${Book.db_url}, ${Book.db_star}, ${Book.db_notes})'
' VALUES("${book.id}", "${book.title}", "${book.url}", ${book.starred? 1:0}, "${book.notes}")');
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment