1
0
mirror of https://github.com/beego/bee.git synced 2025-07-05 18:20:18 +00:00

help/error message correction and import lib/pq

This commit is contained in:
ZhengYang
2014-08-21 10:19:44 +08:00
parent 6d56c04147
commit 9bf23ea88a
2 changed files with 3 additions and 2 deletions

View File

@ -25,6 +25,7 @@ import (
"strings"
_ "github.com/go-sql-driver/mysql"
_ "github.com/lib/pq"
)
const (
@ -223,7 +224,7 @@ func generateAppcode(driver, connStr, level, tables, currpath string) {
func gen(dbms, connStr string, mode byte, selectedTableNames map[string]bool, currpath string) {
db, err := sql.Open(dbms, connStr)
if err != nil {
ColorLog("[ERRO] Could not connect to %s: %s\n", dbms, connStr)
ColorLog("[ERRO] Could not connect to %s database: %s %s\n", dbms, connStr, err)
os.Exit(2)
}
defer db.Close()