mirror of
https://github.com/astaxie/beego.git
synced 2025-07-03 16:10:19 +00:00
orm now can specify engine for mysql. add api SetMaxIdleConns/SetMaxOpenConns(go 1.2)
This commit is contained in:
@ -26,6 +26,20 @@ func getTableName(val reflect.Value) string {
|
||||
return snakeString(ind.Type().Name())
|
||||
}
|
||||
|
||||
func getTableEngine(val reflect.Value) string {
|
||||
fun := val.MethodByName("TableEngine")
|
||||
if fun.IsValid() {
|
||||
vals := fun.Call([]reflect.Value{})
|
||||
if len(vals) > 0 {
|
||||
val := vals[0]
|
||||
if val.Kind() == reflect.String {
|
||||
return val.String()
|
||||
}
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func getTableIndex(val reflect.Value) [][]string {
|
||||
fun := val.MethodByName("TableIndex")
|
||||
if fun.IsValid() {
|
||||
|
Reference in New Issue
Block a user