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

Function UpdateNoteContent

pkg/cli/database/queries.go:194–205  ·  view source on GitHub ↗

UpdateNoteContent updates the note content and marks the note as dirty

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

Source from the content-addressed store, hash-verified

192
193// UpdateNoteContent updates the note content and marks the note as dirty
194func UpdateNoteContent(db *DB, c clock.Clock, rowID int, content string) error {
195 ts := c.Now().UnixNano()
196
197 _, err := db.Exec(`UPDATE notes
198 SET body = ?, edited_on = ?, dirty = ?
199 WHERE rowid = ?`, content, ts, true, rowID)
200 if err != nil {
201 return errors.Wrap(err, "updating the note")
202 }
203
204 return nil
205}
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 {

Callers 2

changeContentFunction · 0.92
TestUpdateNoteContentFunction · 0.85

Calls 2

NowMethod · 0.65
ExecMethod · 0.65

Tested by 1

TestUpdateNoteContentFunction · 0.68