config
This commit is contained in:
@@ -196,20 +196,11 @@ func ExtDatabaseExecSQL(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
vars := mux.Vars(r)
|
||||
tblName := vars["dataObject"]
|
||||
//vars := mux.Vars(r)
|
||||
//tblName := vars["dataObject"]
|
||||
sql = GetUriSQLArray(r)
|
||||
// select as must, todo ...
|
||||
|
||||
if sql == nil {
|
||||
wc := services.GetUriLocString(r)
|
||||
if wc == "" {
|
||||
sql = append(sql, fmt.Sprintf("select * from %s", tblName))
|
||||
} else {
|
||||
sql = append(sql, fmt.Sprintf("select * from %s where %s", tblName, wc))
|
||||
}
|
||||
}
|
||||
|
||||
ls := services.ExtGetUriPageLimitString(r)
|
||||
|
||||
// data := make([]map[string]interface{}, 0)
|
||||
@@ -219,7 +210,7 @@ func ExtDatabaseExecSQL(w http.ResponseWriter, r *http.Request) {
|
||||
for i, s := range sql {
|
||||
log.Tracef("SQL[%d]: %s", i, sql[i])
|
||||
|
||||
rows := make([]map[string]interface{}, 0)
|
||||
//rows := make([]map[string]interface{}, 0)
|
||||
mapRows := make(map[string]interface{})
|
||||
|
||||
if s != "" {
|
||||
@@ -234,7 +225,7 @@ func ExtDatabaseExecSQL(w http.ResponseWriter, r *http.Request) {
|
||||
querySQL = querySQL + " " + ls
|
||||
}
|
||||
log.Debug("querySQL:", querySQL)
|
||||
rows, err = DbClient.XEngine.QueryInterface(querySQL)
|
||||
rows, err := DbClient.XEngine.Exec(querySQL)
|
||||
if err != nil {
|
||||
log.Error("SQL failed:", err)
|
||||
services.ResponseInternalServerError500DatabaseOperationFailed(w)
|
||||
|
||||
Reference in New Issue
Block a user