|
|
|
@ -780,6 +780,8 @@ func FetchAll(rows *sql.Rows) (error, map[int]map[string]string) {
|
|
|
|
|
switch vtype := col.(type) {
|
|
|
|
|
case int64:
|
|
|
|
|
record[columns[i]] = strconv.FormatInt(vtype, 10)
|
|
|
|
|
case string:
|
|
|
|
|
record[columns[i]] = vtype
|
|
|
|
|
default:
|
|
|
|
|
record[columns[i]] = string(vtype.([]byte))
|
|
|
|
|
}
|
|
|
|
@ -793,6 +795,10 @@ func FetchAll(rows *sql.Rows) (error, map[int]map[string]string) {
|
|
|
|
|
func OpenDB(Method, ConnStr string) error {
|
|
|
|
|
var err error
|
|
|
|
|
DBRes, err = sql.Open(Method, ConnStr)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
err = DBRes.Ping()
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
func CloseDB() {
|
|
|
|
|