Chore: Disable cgo by default for local builds (#111807)
* disable cgo by default for local builds, also set cgo variable in either case * actually do not set the default value * disable cgo for darwin, display sqlite driver in logs * fix linter warning, although I do not fully agree with it
This commit is contained in:
@@ -16,6 +16,7 @@ import (
|
||||
_ "github.com/lib/pq"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
|
||||
"github.com/grafana/grafana/pkg/util/sqlite"
|
||||
"github.com/grafana/grafana/pkg/util/xorm"
|
||||
"github.com/grafana/grafana/pkg/util/xorm/core"
|
||||
|
||||
@@ -248,6 +249,9 @@ func (ss *SQLStore) initEngine(engine *xorm.Engine) error {
|
||||
}
|
||||
|
||||
ss.log.Info("Connecting to DB", "dbtype", ss.dbCfg.Type)
|
||||
if ss.dbCfg.Type == migrator.SQLite {
|
||||
ss.log.Info("Using SQLite driver", "driver", sqlite.DriverType())
|
||||
}
|
||||
if ss.dbCfg.Type == migrator.SQLite && strings.HasPrefix(ss.dbCfg.ConnectionString, "file:") &&
|
||||
!strings.HasPrefix(ss.dbCfg.ConnectionString, "file::memory:") {
|
||||
exists, err := fs.Exists(ss.dbCfg.Path)
|
||||
|
||||
Reference in New Issue
Block a user