add TotalTootCount database method
This commit is contained in:
parent
95bb0aa301
commit
8dbd92abbd
@ -14,6 +14,16 @@ func (m *Manager) TootCountForHostname(hostname string) (uint, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *Manager) TotalTootCount() (uint, error) {
|
||||||
|
var c uint
|
||||||
|
e := m.db.Model(&StoredToot{}).Count(&c)
|
||||||
|
if e.Error != nil {
|
||||||
|
return 0, e.Error
|
||||||
|
} else {
|
||||||
|
return c, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (m *Manager) GetAPInstanceFromUUID(uuid *uuid.UUID) (*APInstance, error) {
|
func (m *Manager) GetAPInstanceFromUUID(uuid *uuid.UUID) (*APInstance, error) {
|
||||||
var i APInstance
|
var i APInstance
|
||||||
e := m.db.Model(&APInstance{}).Where("uuid = ?", uuid).First(&i)
|
e := m.db.Model(&APInstance{}).Where("uuid = ?", uuid).First(&i)
|
||||||
|
Loading…
Reference in New Issue
Block a user