Filter on topic
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Peter Stuifzand 2019-03-19 07:18:24 +01:00
parent 4e7b11d35a
commit 6f05bd0f85

View File

@ -44,7 +44,7 @@ func (s *postgres) Unsubscribe(topic, callback string) error {
}
func (s *postgres) Subscribers(topic string) ([]Subscriber, error) {
rows, err := s.db.Query(`SELECT callback, lease_seconds, secret, created FROM "subscribers"`)
rows, err := s.db.Query(`SELECT callback, lease_seconds, secret, created FROM "subscribers" WHERE "topic" = $1`, topic)
if err != nil {
return nil, err
}