Speed up large SELECT operations a bit
This commit is contained in:
parent
03023e6265
commit
e59bb3078f
1 changed files with 11 additions and 5 deletions
|
@ -111,12 +111,18 @@ Zotero.DBConnection.prototype.query = function (sql,params) {
|
|||
|
||||
var statement = this.getStatement(sql, params, true);
|
||||
|
||||
var dataset = new Array();
|
||||
// Get column names
|
||||
var columns = [];
|
||||
var numCols = statement.columnCount;
|
||||
for (var i=0; i<numCols; i++) {
|
||||
columns.push(statement.getColumnName(i));
|
||||
}
|
||||
|
||||
var dataset = [];
|
||||
while (statement.executeStep()) {
|
||||
var row = new Array();
|
||||
|
||||
for(var i=0, len=statement.columnCount; i<len; i++) {
|
||||
row[statement.getColumnName(i)] = this._getTypedValue(statement, i);
|
||||
var row = [];
|
||||
for(var i=0; i<numCols; i++) {
|
||||
row[columns[i]] = this._getTypedValue(statement, i);
|
||||
}
|
||||
dataset.push(row);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue