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

Function UpdateNoteBook

pkg/cli/database/queries.go:208–219  ·  view source on GitHub ↗

UpdateNoteBook moves the note to a different book and marks the note as dirty

(db *DB, c clock.Clock, rowID int, bookUUID string)

Source from the content-addressed store, hash-verified

206
207// UpdateNoteBook moves the note to a different book and marks the note as dirty
208func UpdateNoteBook(db *DB, c clock.Clock, rowID int, bookUUID string) error {
209 ts := c.Now().UnixNano()
210
211 _, err := db.Exec(`UPDATE notes
212 SET book_uuid = ?, edited_on = ?, dirty = ?
213 WHERE rowid = ?`, bookUUID, ts, true, rowID)
214 if err != nil {
215 return errors.Wrap(err, "updating the note")
216 }
217
218 return nil
219}

Callers 2

moveBookFunction · 0.92
TestUpdateNoteBookFunction · 0.85

Calls 2

NowMethod · 0.65
ExecMethod · 0.65

Tested by 1

TestUpdateNoteBookFunction · 0.68