fix: return Sql() method to SqlDb type for dredd tests

This commit is contained in:
Denis Gukov 2021-05-06 18:12:21 +05:00
parent dafd619134
commit c16406c924
3 changed files with 7 additions and 6 deletions

View File

@ -4,7 +4,7 @@ import (
"encoding/json"
"fmt"
"github.com/ansible-semaphore/semaphore/db"
"github.com/ansible-semaphore/semaphore/db/factory"
"github.com/ansible-semaphore/semaphore/db/sql"
"github.com/ansible-semaphore/semaphore/util"
"github.com/snikch/goodman/transaction"
"math/rand"
@ -209,10 +209,10 @@ func loadConfig() {
}
}
var store db.Store
var store sql.SqlDb
func dbConnect() {
store = factory.CreateStore()
store = sql.SqlDb{}
if err := store.Connect(); err != nil {
panic(err)

View File

@ -400,7 +400,8 @@ func getSqlForTable(tableName string, p db.RetrieveQueryParams) (string, []inter
}
func (d *SqlDb) Sql() *gorp.DbMap {
return d.sql
}

2
go.mod
View File

@ -39,7 +39,7 @@ require (
github.com/radovskyb/watcher v1.0.7 // indirect
github.com/russross/blackfriday v1.5.2
github.com/sirupsen/logrus v1.4.2 // indirect
github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa // indirect
github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa
github.com/spf13/cobra v0.0.5 // indirect
github.com/ziutek/mymysql v1.5.4 // indirect
go.etcd.io/bbolt v1.3.2