fix query performance from Studio - use command() instead of execute() to run SQL queries from HTTP/REST
@@ -166,6 +166,15 @@ public class OServerCommandPostCommand extends OServerCommandAuthenticatedDbAbst
protected OResultSet executeStatement(String language, String text, Object params, ODatabaseDocument db) {
OResultSet result;
+ if ("sql".equalsIgnoreCase(language)) {
+ if (params instanceof Map) {
+ result = db.command(text, (Map) params);
+ } else if (params instanceof Object[]) {
+ result = db.command(text, (Object[]) params);
+ } else {
+ result = db.command(text, params);
+ }
+ } else {
if (params instanceof Map) {
result = db.execute(language, text, (Map) params);
} else if (params instanceof Object[]) {
@@ -173,6 +182,7 @@ public class OServerCommandPostCommand extends OServerCommandAuthenticatedDbAbst
} else {
result = db.execute(language, text, params);
}
+ }
return result;
}
