Files
EdgeAPI/internal/rpc/services/service_db_test.go

21 lines
393 B
Go
Raw Normal View History

2021-01-19 16:13:04 +08:00
package services
import (
2024-07-27 14:15:25 +08:00
"testing"
2021-01-19 16:13:04 +08:00
"github.com/iwind/TeaGo/dbs"
"github.com/iwind/TeaGo/logs"
)
func TestDBService_FindAllDBTables(t *testing.T) {
db, err := dbs.Default()
if err != nil {
t.Fatal(err)
}
2022-04-08 14:57:20 +08:00
ones, _, err := db.FindPreparedOnes("SELECT * FROM information_schema.`TABLES` WHERE TABLE_SCHEMA=?", db.Name())
2021-01-19 16:13:04 +08:00
if err != nil {
t.Fatal(err)
}
logs.PrintAsJSON(ones, t)
}