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

Method GetUserPostsCount

database.go:2210–2222  ·  view source on GitHub ↗
(userID int64)

Source from the content-addressed store, hash-verified

2208}
2209
2210func (db *datastore) GetUserPostsCount(userID int64) int64 {
2211 var count int64
2212 err := db.QueryRow("SELECT COUNT(*) FROM posts WHERE owner_id = ?", userID).Scan(&count)
2213 switch {
2214 case err == sql.ErrNoRows:
2215 return 0
2216 case err != nil:
2217 log.Error("Failed selecting posts count for user %d: %v", userID, err)
2218 return 0
2219 }
2220
2221 return count
2222}
2223
2224// ChangeSettings takes a User and applies the changes in the given
2225// userSettings, MODIFYING THE USER with successful changes.

Callers 1

handleViewAdminUserFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected