From 34a3f2f132791ad33e6a6b59371bb6f029436ab4 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sat, 18 Jul 2020 16:51:55 +0200 Subject: Tests and abc fix using Lars' branch --- src/db/DBController.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/db/DBController.ts') diff --git a/src/db/DBController.ts b/src/db/DBController.ts index 2cfd1f2..c01d7b4 100644 --- a/src/db/DBController.ts +++ b/src/db/DBController.ts @@ -34,10 +34,10 @@ export default class DBController { } } - async execute(query: string) { + async execute(query: string, params?: string[]) { if (this.client) { try { - return await this.client.execute(query); + return await this.client.execute(query, params); } catch (e) { throw e; } @@ -45,11 +45,15 @@ export default class DBController { } async execute_multiple(queries: string[]) { - await this.client!.transaction(async (conn) => { - queries.forEach(async (query) => { - await conn.execute(query); + try { + return await this.client!.transaction(async (conn) => { + queries.forEach(async (query) => { + await conn.execute(query); + }); }); - }); + } catch (e) { + throw e; + } } async close() { -- cgit v1.2.3