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

Method UpdateUUID

pkg/cli/database/models.go:84–94  ·  view source on GitHub ↗

UpdateUUID updates the uuid of a book

(db *DB, newUUID string)

Source from the content-addressed store, hash-verified

82
83// UpdateUUID updates the uuid of a book
84func (n *Note) UpdateUUID(db *DB, newUUID string) error {
85 _, err := db.Exec("UPDATE notes SET uuid = ? WHERE uuid = ?", newUUID, n.UUID)
86
87 if err != nil {
88 return errors.Wrapf(err, "updating note uuid from '%s' to '%s'", n.UUID, newUUID)
89 }
90
91 n.UUID = newUUID
92
93 return nil
94}
95
96// Expunge hard-deletes the note from the database
97func (n Note) Expunge(db *DB) error {

Callers 2

TestNoteUpdateUUIDFunction · 0.95
sendNotesFunction · 0.95

Calls 1

ExecMethod · 0.65

Tested by 1

TestNoteUpdateUUIDFunction · 0.76