diff --git a/db/db.go b/db/db.go index 466295c..e6efa67 100644 --- a/db/db.go +++ b/db/db.go @@ -178,7 +178,7 @@ type TableSize struct { func (db *Db) SizeTable(dbname string) []TableSize { rs := make([]TableSize, 1) db.onDbExec("information_schema", func(sqlDb *sql.DB) bool { - query := "SELECT table_name AS `table`, round(((data_length + index_length) / 1024 / 1024), 2) `size' FROM TABLES WHERE table_schema = ? ORDER BY (data_length + index_length) DESC GROUP BY table_schema;" + query := "SELECT table_name AS `table`, round(((data_length + index_length) / 1024 / 1024), 2) `size` FROM TABLES WHERE table_schema = ? ORDER BY (data_length + index_length) DESC GROUP BY table_schema;" rows, err := sqlDb.Query(query, dbname) if err != nil { fmt.Printf("cannot get table size of db %s : %v", dbname, err)