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

Function GetBookUUID

pkg/cli/database/queries.go:134–144  ·  view source on GitHub ↗

GetBookUUID returns a uuid of a book given a label

(db *DB, label string)

Source from the content-addressed store, hash-verified

132
133// GetBookUUID returns a uuid of a book given a label
134func GetBookUUID(db *DB, label string) (string, error) {
135 var ret string
136 err := db.QueryRow("SELECT uuid FROM books WHERE label = ?", label).Scan(&ret)
137 if err == sql.ErrNoRows {
138 return ret, errors.Errorf("book '%s' not found", label)
139 } else if err != nil {
140 return ret, errors.Wrap(err, "querying the book")
141 }
142
143 return ret, nil
144}
145
146// UpdateBookName updates a book name
147func UpdateBookName(db *DB, uuid string, name string) error {

Callers 3

runBookFunction · 0.92
runBookFunction · 0.92
moveBookFunction · 0.92

Calls 1

QueryRowMethod · 0.65

Tested by

no test coverage detected