fixed #13
from support: Different JSON result for non-query request http://support.cartodb.com/discussions/suggestions/50-sql-api-different-json-object-for-non-query-request
This commit is contained in:
parent
374583e655
commit
7e1847bca5
@ -152,11 +152,17 @@ function handleQuery(req, res){
|
|||||||
toCSV(result, res, this);
|
toCSV(result, res, this);
|
||||||
} else {
|
} else {
|
||||||
var end = new Date().getTime();
|
var end = new Date().getTime();
|
||||||
return {
|
|
||||||
'time' : ((end - start)/1000),
|
var json_result = {'time' : (end - start)/1000};
|
||||||
'total_rows': result.rows.length,
|
|
||||||
'rows' : result.rows
|
if (result.command === 'SELECT') {
|
||||||
};
|
json_result.total_rows = result.rows.length;
|
||||||
|
json_result.rows = result.rows;
|
||||||
|
} else {
|
||||||
|
json_result.total_rows = result.rowCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
return json_result;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
function sendResults(err, out){
|
function sendResults(err, out){
|
||||||
|
Loading…
Reference in New Issue
Block a user