Update updates the book with the given data
(db *DB)
| 128 | |
| 129 | // Update updates the book with the given data |
| 130 | func (b Book) Update(db *DB) error { |
| 131 | _, err := db.Exec("UPDATE books SET label = ?, usn = ?, dirty = ?, deleted = ? WHERE uuid = ?", |
| 132 | b.Label, b.USN, b.Dirty, b.Deleted, b.UUID) |
| 133 | |
| 134 | if err != nil { |
| 135 | return errors.Wrapf(err, "updating the book with uuid %s", b.UUID) |
| 136 | } |
| 137 | |
| 138 | return nil |
| 139 | } |
| 140 | |
| 141 | // UpdateUUID updates the uuid of a book |
| 142 | func (b *Book) UpdateUUID(db *DB, newUUID string) error { |