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

Method UpdateUUID

pkg/cli/database/models.go:142–152  ·  view source on GitHub ↗

UpdateUUID updates the uuid of a book

(db *DB, newUUID string)

Source from the content-addressed store, hash-verified

140
141// UpdateUUID updates the uuid of a book
142func (b *Book) UpdateUUID(db *DB, newUUID string) error {
143 _, err := db.Exec("UPDATE books SET uuid = ? WHERE uuid = ?", newUUID, b.UUID)
144
145 if err != nil {
146 return errors.Wrapf(err, "updating book uuid from '%s' to '%s'", b.UUID, newUUID)
147 }
148
149 b.UUID = newUUID
150
151 return nil
152}
153
154// Expunge hard-deletes the book from the database
155func (b Book) Expunge(db *DB) error {

Callers 2

TestBookUpdateUUIDFunction · 0.95
sendBooksFunction · 0.95

Calls 1

ExecMethod · 0.65

Tested by 1

TestBookUpdateUUIDFunction · 0.76