diff --git a/src/query.ts b/src/query.ts index 00e581e..9571692 100644 --- a/src/query.ts +++ b/src/query.ts @@ -101,7 +101,7 @@ export class selectQuery { const builder = this.serialize(handler); const s = handler.builders.query(builder); let readResp = await db.query(s, printQuery); - return db.getHandler().responses.readResponse(readResp); + return handler.responses.readResponse(readResp); } } diff --git a/src/responses.ts b/src/responses.ts index 0f2ac4d..0261f44 100644 --- a/src/responses.ts +++ b/src/responses.ts @@ -15,7 +15,9 @@ export class singleResponse { export class readResponse extends Array{ constructor(rows: ({ [key: string]: primaryData })[]) { super(); - this.push(...rows.map(r => new singleResponse(r))); + for(let i = 0; i < rows.length; i++){ + this[i] = new singleResponse(rows[i]) + } } }