func (db *SQLDB) AddGHInstallation(installationID, accountID, senderID int) error {
	_, err := db.sqlx.Exec("INSERT IGNORE INTO gh_installations (installation_id, account_id, sender_id) VALUES (?, ?, ?)",
		installationID, accountID, senderID,
	)
	return err
}
AddGHInstallation implements the DB interface.
package db
import (
	"bytes"
	"context"
	"database/sql"
	"fmt"
	"strings"
	"time"
	"unicode"
	"github.com/bradleyfalzon/gopherci/internal/logger"
	"github.com/go-sql-driver/mysql"
	"github.com/jmoiron/sqlx"
)
type SQLDB struct {
	sqlx *sqlx.DB
}
var _ DB = (*SQLDB)(nil)
func NewSQLDB(sqlDB *sql.DB, driverName string) (*SQLDB, error) {
	db := &SQLDB{
		sqlx: sqlx.NewDb(sqlDB, driverName),
	}
	if err := db.sqlx.Ping(); err != nil {
		return nil, err
	}
	return db, nil
}
func (db *SQLDB) Cleanup(ctx context.Context, logger logger.Logger) {
	ticker := time.NewTicker(30 * time.Minute)
	defer ticker.Stop()
	for {
		select {
		case <-ctx.Done():
			return
		case <-ticker.C:
			_, err := db.sqlx.Exec(`DELETE o FROM outputs o JOIN analysis a ON(o.analysis_id = a.id) WHERE a.created_at < DATE_SUB(NOW(), INTERVAL 30 DAY);`)
			if err != nil {
				logger.With("error", err).Error("SQLDB cleanup outputs error")
			}
		}
	}
}