|
|
@ -52,6 +52,7 @@ type Engine interface { |
|
|
|
|
|
|
|
|
|
|
|
var ( |
|
|
|
var ( |
|
|
|
x *xorm.Engine |
|
|
|
x *xorm.Engine |
|
|
|
|
|
|
|
supportedDatabases = []string{"mysql", "postgres", "mssql"} |
|
|
|
tables []interface{} |
|
|
|
tables []interface{} |
|
|
|
|
|
|
|
|
|
|
|
// HasEngine specifies if we have a xorm.Engine
|
|
|
|
// HasEngine specifies if we have a xorm.Engine
|
|
|
@ -350,7 +351,9 @@ func Ping() error { |
|
|
|
func DumpDatabase(filePath string, dbType string) error { |
|
|
|
func DumpDatabase(filePath string, dbType string) error { |
|
|
|
var tbs []*core.Table |
|
|
|
var tbs []*core.Table |
|
|
|
for _, t := range tables { |
|
|
|
for _, t := range tables { |
|
|
|
tbs = append(tbs, x.TableInfo(t).Table) |
|
|
|
t := x.TableInfo(t) |
|
|
|
|
|
|
|
t.Table.Name = t.Name |
|
|
|
|
|
|
|
tbs = append(tbs, t.Table) |
|
|
|
} |
|
|
|
} |
|
|
|
if len(dbType) > 0 { |
|
|
|
if len(dbType) > 0 { |
|
|
|
return x.DumpTablesToFile(tbs, filePath, core.DbType(dbType)) |
|
|
|
return x.DumpTablesToFile(tbs, filePath, core.DbType(dbType)) |
|
|
|