Exit if selected database does not have any tables

This commit is contained in:
Dan Sosedoff 2014-10-11 22:32:10 -05:00
parent 5551626516
commit 8dcb66d58c

12
main.go
View File

@ -47,6 +47,18 @@ func initClient() {
os.Exit(1)
}
tables, err := client.Tables()
if err != nil {
fmt.Println("Error:", err)
os.Exit(1)
}
if len(tables) == 0 {
fmt.Println("Error: Database does not have any tables")
os.Exit(1)
}
dbClient = client
}