Update xorm and dependencies vendor for feature to dump to other database (#565)

* update xorm and dependencies vendor for feature to dump to other database

* fix golint
This commit is contained in:
Lunny Xiao 2017-01-03 16:20:28 +08:00 committed by GitHub
parent 70900bd167
commit 980dd0bf51
54 changed files with 3135 additions and 2619 deletions

View file

@ -1,5 +1,7 @@
Core is a lightweight wrapper of sql.DB.
[![CircleCI](https://circleci.com/gh/go-xorm/core/tree/master.svg?style=svg)](https://circleci.com/gh/go-xorm/core/tree/master)
# Open
```Go
db, _ := core.Open(db, connstr)

14
vendor/github.com/go-xorm/core/circle.yml generated vendored Normal file
View file

@ -0,0 +1,14 @@
dependencies:
override:
# './...' is a relative pattern which means all subdirectories
- go get -t -d -v ./...
- go build -v
database:
override:
- mysql -u root -e "CREATE DATABASE core_test DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci"
test:
override:
# './...' is a relative pattern which means all subdirectories
- go test -v -race

View file

@ -287,16 +287,21 @@ func (b *Base) LogSQL(sql string, args []interface{}) {
}
var (
dialects = map[DbType]func() Dialect{}
dialects = map[string]func() Dialect{}
)
// RegisterDialect register database dialect
func RegisterDialect(dbName DbType, dialectFunc func() Dialect) {
if dialectFunc == nil {
panic("core: Register dialect is nil")
}
dialects[dbName] = dialectFunc // !nashtsai! allow override dialect
dialects[strings.ToLower(string(dbName))] = dialectFunc // !nashtsai! allow override dialect
}
// QueryDialect query if registed database dialect
func QueryDialect(dbName DbType) Dialect {
return dialects[dbName]()
if d, ok := dialects[strings.ToLower(string(dbName))]; ok {
return d()
}
return nil
}

View file

@ -54,7 +54,7 @@ func (s *SQLType) IsNumeric() bool {
}
func (s *SQLType) IsJson() bool {
return s.Name == Json
return s.Name == Json || s.Name == Jsonb
}
var (