|
|
|
@ -780,6 +780,8 @@ func FetchAll(rows *sql.Rows) (error, map[int]map[string]string) {
|
|
|
|
|
record := make(map[string]string)
|
|
|
|
|
for i, col := range values {
|
|
|
|
|
switch vtype := col.(type) {
|
|
|
|
|
case float64:
|
|
|
|
|
record[columns[i]] = strconv.FormatFloat(vtype, 'f', -1, 64)
|
|
|
|
|
case int64:
|
|
|
|
|
record[columns[i]] = strconv.FormatInt(vtype, 10)
|
|
|
|
|
case string:
|
|
|
|
@ -826,6 +828,7 @@ func Query(args ...interface{}) (error, map[int]map[string]string) {
|
|
|
|
|
}
|
|
|
|
|
sql := args[0]
|
|
|
|
|
stmt, err := DBRes.Prepare(sql.(string))
|
|
|
|
|
defer stmt.Close()
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err, records
|
|
|
|
|
}
|
|
|
|
@ -862,6 +865,7 @@ func DBExec(args ...interface{}) error {
|
|
|
|
|
}
|
|
|
|
|
sql := args[0]
|
|
|
|
|
stmt, err := DBRes.Prepare(sql.(string))
|
|
|
|
|
defer stmt.Close()
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|