summaryrefslogtreecommitdiffstats
path: root/models/models.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-03-30 16:01:50 -0400
committerUnknown <joe2010xtmf@163.com>2014-03-30 16:01:50 -0400
commit2a0066420a9395e5fa5afcd9be4d094a48eee3fa (patch)
tree7529650f4c78f9113ac4d9f7f307a4d92255e6cf /models/models.go
parentd0e6a4c25acc3414f6d0f93cc50e6dcb41111c19 (diff)
downloadgitea-2a0066420a9395e5fa5afcd9be4d094a48eee3fa.tar.gz
gitea-2a0066420a9395e5fa5afcd9be4d094a48eee3fa.zip
Fix bug work with sqlite3
Diffstat (limited to 'models/models.go')
-rw-r--r--models/models.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/models/models.go b/models/models.go
index be176b5d39..a626b98f6e 100644
--- a/models/models.go
+++ b/models/models.go
@@ -12,6 +12,7 @@ import (
_ "github.com/go-sql-driver/mysql"
_ "github.com/lib/pq"
"github.com/lunny/xorm"
+ // _ "github.com/mattn/go-sqlite3"
"github.com/gogits/gogs/modules/base"
)
@@ -23,10 +24,15 @@ var (
DbCfg struct {
Type, Host, Name, User, Pwd, Path, SslMode string
}
+
+ UseSQLite3 bool
)
func LoadModelsConfig() {
DbCfg.Type = base.Cfg.MustValue("database", "DB_TYPE")
+ if DbCfg.Type == "sqlite3" {
+ UseSQLite3 = true
+ }
DbCfg.Host = base.Cfg.MustValue("database", "HOST")
DbCfg.Name = base.Cfg.MustValue("database", "NAME")
DbCfg.User = base.Cfg.MustValue("database", "USER")