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

Method Update

pkg/cli/database/models.go:72–81  ·  view source on GitHub ↗

Update updates the note with the given data

(db *DB)

Source from the content-addressed store, hash-verified

70
71// Update updates the note with the given data
72func (n Note) Update(db *DB) error {
73 _, err := db.Exec("UPDATE notes SET book_uuid = ?, body = ?, added_on = ?, edited_on = ?, usn = ?, deleted = ?, dirty = ? WHERE uuid = ?",
74 n.BookUUID, n.Body, n.AddedOn, n.EditedOn, n.USN, n.Deleted, n.Dirty, n.UUID)
75
76 if err != nil {
77 return errors.Wrapf(err, "updating the note with uuid %s", n.UUID)
78 }
79
80 return nil
81}
82
83// UpdateUUID updates the uuid of a book
84func (n *Note) UpdateUUID(db *DB, newUUID string) error {

Callers 15

TestNoteUpdateFunction · 0.95
TestNoteFTSFunction · 0.95
sendNotesFunction · 0.95
PasswordResetMethod · 0.45
TestCreateNoteFunction · 0.45
TestDeleteNoteFunction · 0.45
TestUpdateNoteFunction · 0.45
TestCreateBookFunction · 0.45
TestUpdateBookFunction · 0.45
TestDeleteBookFunction · 0.45
TestResetPasswordFunction · 0.45
incrementUserUSNFunction · 0.45

Calls 1

ExecMethod · 0.65

Tested by 15

TestNoteUpdateFunction · 0.76
TestNoteFTSFunction · 0.76
TestCreateNoteFunction · 0.36
TestDeleteNoteFunction · 0.36
TestUpdateNoteFunction · 0.36
TestCreateBookFunction · 0.36
TestUpdateBookFunction · 0.36
TestDeleteBookFunction · 0.36
TestResetPasswordFunction · 0.36
TestIncremenetUserUSNFunction · 0.36
TestCreateNoteFunction · 0.36
TestUpdateNoteFunction · 0.36