Fix Statement.getAsObject cursor handling
This commit is contained in:
parent
fa68916d3e
commit
f2d246f63a
1 changed files with 2 additions and 1 deletions
|
@ -654,10 +654,11 @@
|
||||||
getAsObject() {
|
getAsObject() {
|
||||||
try {
|
try {
|
||||||
if (!this._columnNames) this._columnNames = this._stmt.getColumnNames();
|
if (!this._columnNames) this._columnNames = this._stmt.getColumnNames();
|
||||||
|
const values = this._stmt.get();
|
||||||
const row = Object.create(null);
|
const row = Object.create(null);
|
||||||
const count = this._columnNames.length;
|
const count = this._columnNames.length;
|
||||||
for (let i = 0; i < count; i += 1) {
|
for (let i = 0; i < count; i += 1) {
|
||||||
row[this._columnNames[i]] = this._stmt.get(i);
|
row[this._columnNames[i]] = values ? values[i] : undefined;
|
||||||
}
|
}
|
||||||
return row;
|
return row;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue