mirror of
https://github.com/astaxie/beego.git
synced 2024-12-23 05:30:49 +00:00
Orm: Add tidb for query builder
This commit is contained in:
parent
c73e0395ed
commit
c841a77ad6
@ -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
|
||||
|
||||
`)
|
||||
|
@ -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()
|
||||
|
@ -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" {
|
||||
|
Loading…
Reference in New Issue
Block a user