Exemple #1
0
// 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()
}
Exemple #2
0
// 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()
}