models: remove TiDB embedded driver support

Users should all start tidb-server process and connect to it as if
it is a MySQL server with MySQL drivers.
This commit is contained in:
Unknwon
2017-02-09 09:31:38 -05:00
parent afab38b0d7
commit 6622b7b49a
7 changed files with 11 additions and 47 deletions

View File

@@ -55,7 +55,6 @@ var (
}
EnableSQLite3 bool
EnableTiDB bool
)
func init() {
@@ -146,14 +145,6 @@ func getEngine() (*xorm.Engine, error) {
return nil, fmt.Errorf("Fail to create directories: %v", err)
}
connStr = "file:" + DbCfg.Path + "?cache=shared&mode=rwc"
case "tidb":
if !EnableTiDB {
return nil, errors.New("This binary version does not build support for TiDB.")
}
if err := os.MkdirAll(path.Dir(DbCfg.Path), os.ModePerm); err != nil {
return nil, fmt.Errorf("Fail to create directories: %v", err)
}
connStr = "goleveldb://" + DbCfg.Path
default:
return nil, fmt.Errorf("Unknown database type: %s", DbCfg.Type)
}

View File

@@ -1,18 +0,0 @@
// +build tidb go1.4.2
// Copyright 2015 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package models
import (
_ "github.com/go-xorm/tidb"
"github.com/ngaut/log"
_ "github.com/pingcap/tidb"
)
func init() {
EnableTiDB = true
log.SetLevelByString("error")
}