diff --git a/.dredd/hooks/helpers.go b/.dredd/hooks/helpers.go index eadd6987..d07497b8 100644 --- a/.dredd/hooks/helpers.go +++ b/.dredd/hooks/helpers.go @@ -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) diff --git a/db/sql/SqlDb.go b/db/sql/SqlDb.go index 2db4e0b8..c6822c27 100644 --- a/db/sql/SqlDb.go +++ b/db/sql/SqlDb.go @@ -400,7 +400,8 @@ func getSqlForTable(tableName string, p db.RetrieveQueryParams) (string, []inter } - - +func (d *SqlDb) Sql() *gorp.DbMap { + return d.sql +} diff --git a/go.mod b/go.mod index 21eb7803..609c2280 100644 --- a/go.mod +++ b/go.mod @@ -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