-
Notifications
You must be signed in to change notification settings - Fork 0
/
delete.go
33 lines (30 loc) · 941 Bytes
/
delete.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package sqlitestorage
import (
"fmt"
)
// DeleteQuotesPluginQuote deletes a QuotesPluginQuote.
func (b *SQLiteStorage) DeleteQuotesPluginQuote(botID, pluginID, identifier string) error {
deleteSQL := fmt.Sprintf(`DELETE FROM %s WHERE bot_id=? AND plugin_id=? AND identifier=?`, tableQuotesPluginQuote)
statement, err := b.db.Prepare(deleteSQL)
if err != nil {
return err
}
_, err = statement.Exec(botID, pluginID, identifier)
if err != nil {
return err
}
return nil
}
// DeleteRssPluginSubscription deletes a RssPluginSubscription.
func (b *SQLiteStorage) DeleteRssPluginSubscription(botID, pluginID, identifier string) error {
deleteSQL := fmt.Sprintf(`DELETE FROM %s WHERE bot_id=? AND plugin_id=? AND identifier=?`, tableRssPluginSubscription)
statement, err := b.db.Prepare(deleteSQL)
if err != nil {
return err
}
_, err = statement.Exec(botID, pluginID, identifier)
if err != nil {
return err
}
return nil
}