数据库可以手工清理

This commit is contained in:
刘祥超
2021-01-19 16:13:04 +08:00
parent 8bd22b06cf
commit 99073b98d6
5 changed files with 126 additions and 2 deletions

View File

@@ -0,0 +1,19 @@
package services
import (
"github.com/iwind/TeaGo/dbs"
"github.com/iwind/TeaGo/logs"
"testing"
)
func TestDBService_FindAllDBTables(t *testing.T) {
db, err := dbs.Default()
if err != nil {
t.Fatal(err)
}
ones, _, err := db.FindOnes("SELECT * FROM information_schema.`TABLES` WHERE TABLE_SCHEMA=?", db.Name())
if err != nil {
t.Fatal(err)
}
logs.PrintAsJSON(ones, t)
}