HyriseSQLParser/frontend-hyrise/hyrise-sql-connector.js

30 lines
564 B
JavaScript
Raw Normal View History

2014-12-15 13:19:12 +01:00
var HyriseSQLConnector = function(endpointUrl) {
this._endpointUrl = endpointUrl;
}
2014-12-15 13:19:12 +01:00
HyriseSQLConnector.prototype.executeSQLQuery = function(query, callback, error_callback) {
var url = encodeURI(this._endpointUrl);
jQuery.ajax({
type: "POST",
url: url,
dataType: 'json',
data: {
performance: true,
sql: query
},
success: function(result) {
2014-11-13 02:40:43 +01:00
if (typeof result.real_size === "undefined") {
result.real_size = 0;
result.rows = [];
result.header = [];
}
callback(result);
2014-11-05 16:09:56 +01:00
},
error: error_callback
});
return this;
};