From cbac881a4954841238c8b593b4f4b16f4d0a7e14 Mon Sep 17 00:00:00 2001 From: jusax23 Date: Mon, 27 Feb 2023 17:59:16 +0100 Subject: [PATCH] bug fix --- src/query.ts | 2 +- src/responses.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) 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]) + } } }