MCPcopy Index your code
hub / github.com/dnote/dnote / Update

Method Update

pkg/cli/database/models.go:130–139  ·  view source on GitHub ↗

Update updates the book with the given data

(db *DB)

Source from the content-addressed store, hash-verified

128
129// Update updates the book with the given data
130func (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
142func (b *Book) UpdateUUID(db *DB, newUUID string) error {

Callers 2

TestBookUpdateFunction · 0.95
sendBooksFunction · 0.95

Calls 1

ExecMethod · 0.65

Tested by 1

TestBookUpdateFunction · 0.76