Change placeholders
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Peter Stuifzand 2019-03-19 07:16:10 +01:00
parent 877addb1fc
commit 4e7b11d35a

View File

@ -25,7 +25,7 @@ func (s *postgres) Close() error {
func (s *postgres) Subscribe(topic string, sub Subscriber) error { func (s *postgres) Subscribe(topic string, sub Subscriber) error {
_, err := s.db.Exec( _, err := s.db.Exec(
`INSERT INTO "subscribers" ("topic", "callback", "lease_seconds", "secret", "created") VALUES (?, ?, ?, ?, now())`, `INSERT INTO "subscribers" ("topic", "callback", "lease_seconds", "secret", "created") VALUES ($1, $2, $3, $4, now())`,
topic, topic,
sub.Callback, sub.Callback,
sub.LeaseSeconds, sub.LeaseSeconds,
@ -36,7 +36,7 @@ func (s *postgres) Subscribe(topic string, sub Subscriber) error {
func (s *postgres) Unsubscribe(topic, callback string) error { func (s *postgres) Unsubscribe(topic, callback string) error {
_, err := s.db.Exec( _, err := s.db.Exec(
`DELETE FROM "subscribers" WHERE "topic" = ? AND "callback" = ?`, `DELETE FROM "subscribers" WHERE "topic" = ? AND "callback" = $1`,
topic, topic,
callback, callback,
) )