1
0
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:
slene
2013-09-16 09:48:04 +08:00
parent 198d6320dd
commit a616087cde
5 changed files with 106 additions and 35 deletions

View File

@ -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() {