1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-26 02:51:28 +00:00

Orm: Add tidb for query builder

This commit is contained in:
ngaut 2015-09-11 11:24:58 +08:00
parent c73e0395ed
commit c841a77ad6
3 changed files with 7 additions and 4 deletions

View File

@ -397,7 +397,7 @@ go test -v github.com/astaxie/beego/orm
#### TiDB
export ORM_DRIVER=tidb
export ORM_SOURCE='memory://test'
export ORM_SOURCE='memory://test/test'
go test -v github.com/astaxie/beego/orm
`)

View File

@ -26,6 +26,8 @@ import (
"strings"
"testing"
"time"
"github.com/juju/errors"
)
var _ = os.PathSeparator
@ -133,6 +135,7 @@ func throwFail(t *testing.T, err error, args ...interface{}) {
}
con += " " + strings.Join(parts, ", ")
}
t.Error(errors.ErrorStack(err))
t.Error(con)
t.Fail()
}
@ -172,7 +175,7 @@ func TestSyncDb(t *testing.T) {
RegisterModel(new(UserBig))
RegisterModel(new(PostTags))
err := RunSyncdb("default", true, false)
err := RunSyncdb("default", true, true)
throwFail(t, err)
modelCache.clean()

View File

@ -48,8 +48,8 @@ type QueryBuilder interface {
func NewQueryBuilder(driver string) (qb QueryBuilder, err error) {
if driver == "mysql" {
qb = new(MySQLQueryBuilder)
} else if driver == "mysql" {
qb = new(MySQLQueryBuilder)
} else if driver == "tidb" {
qb = new(TiDBQueryBuilder)
} else if driver == "postgres" {
err = errors.New("postgres query builder is not supported yet")
} else if driver == "sqlite" {