MCPcopy Index your code
hub / github.com/writefreely/writefreely / GetCollectionAttribute

Method GetCollectionAttribute

database.go:2517–2528  ·  view source on GitHub ↗
(id int64, attr string)

Source from the content-addressed store, hash-verified

2515}
2516
2517func (db *datastore) GetCollectionAttribute(id int64, attr string) string {
2518 var v string
2519 err := db.QueryRow("SELECT value FROM collectionattributes WHERE collection_id = ? AND attribute = ?", id, attr).Scan(&v)
2520 switch {
2521 case err == sql.ErrNoRows:
2522 return ""
2523 case err != nil:
2524 log.Error("Couldn't SELECT value in getCollectionAttribute for attribute '%s': %v", attr, err)
2525 return ""
2526 }
2527 return v
2528}
2529
2530func (db *datastore) SetCollectionAttribute(id int64, attr, v string) error {
2531 _, err := db.Exec("INSERT INTO collectionattributes (collection_id, attribute, value) VALUES (?, ?, ?) "+db.upsert("collection_id", "attribute")+" value = ?", id, attr, v, v)

Callers 8

GetCollectionByMethod · 0.95
GetPublicCollectionsMethod · 0.95
viewEditCollectionFunction · 0.80
handleViewCollectionFunction · 0.80
handleViewCollectionTagFunction · 0.80
handleViewCollectionLangFunction · 0.80
emailPostFunction · 0.80
FetchPublicPostsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected