示例#1
0
文件: sql_table.go 项目: mabetle/mdb
// DropTables drops tables
func (s Sql) DropTables(tables ...string) error {
	errs := mcore.NewErrors()
	for _, v := range tables {
		e := s.DropTable(v)
		errs.Record(e)
	}
	return errs.Error()
}
示例#2
0
文件: sql_db.go 项目: mabetle/mdb
// DbTablesExec loop all tables in db, format include 1 string place holder.
func (s Sql) DbTablesExec(db string, format string) error {
	errs := mcore.NewErrors()
	ts := s.GetTables(db)
	for _, t := range ts {
		e := s.TableExec(t, format)
		errs.Record(e)
	}
	return errs.Error()
}