summaryrefslogtreecommitdiffstats
path: root/models/models.go
diff options
context:
space:
mode:
authorMichael Crosby <michael@crosbymichael.com>2014-04-12 11:48:12 -0700
committerMichael Crosby <michael@crosbymichael.com>2014-04-12 12:12:48 -0700
commit25fd495b2e790001e9c138205606ec4fa16bf129 (patch)
tree12cafa5b49502f423a3f6ab71810c75af0f09a1d /models/models.go
parent0650c3c9f609ba833c29fa120a34f15c0f064b54 (diff)
downloadgitea-25fd495b2e790001e9c138205606ec4fa16bf129.tar.gz
gitea-25fd495b2e790001e9c138205606ec4fa16bf129.zip
Add sqlite build tag
This adds a sqlite build tag so that you don't have to have the sqlite import commented out in code and users can run: go build -tags sqlite if they want to have sqlite support enabled. It is disabled by default so nothing changes with the default go get or build commands.
Diffstat (limited to 'models/models.go')
-rw-r--r--models/models.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/models/models.go b/models/models.go
index ee96207d10..3e3dbbf80c 100644
--- a/models/models.go
+++ b/models/models.go
@@ -12,7 +12,6 @@ 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"
)
@@ -56,9 +55,9 @@ func NewTestEngine(x *xorm.Engine) (err error) {
case "postgres":
x, err = xorm.NewEngine("postgres", fmt.Sprintf("user=%s password=%s dbname=%s sslmode=%s",
DbCfg.User, DbCfg.Pwd, DbCfg.Name, DbCfg.SslMode))
- // case "sqlite3":
- // os.MkdirAll(path.Dir(DbCfg.Path), os.ModePerm)
- // x, err = xorm.NewEngine("sqlite3", DbCfg.Path)
+ case "sqlite3":
+ os.MkdirAll(path.Dir(DbCfg.Path), os.ModePerm)
+ x, err = xorm.NewEngine("sqlite3", DbCfg.Path)
default:
return fmt.Errorf("Unknown database type: %s", DbCfg.Type)
}