From f084d5b740dfaccfe4e5b3ee69443465ee06859c Mon Sep 17 00:00:00 2001 From: mahdi Date: Sat, 2 Dec 2023 13:42:56 +0100 Subject: [PATCH] db - amend SizeTable method --- db/db.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/db.go b/db/db.go index 39c18fb..466295c 100644 --- a/db/db.go +++ b/db/db.go @@ -175,7 +175,7 @@ type TableSize struct { Size float32 } -func (db *Db) SizeTable(dbname string, table string) []TableSize { +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;"