diff options
author | Marvin Borner | 2020-07-18 16:51:55 +0200 |
---|---|---|
committer | Marvin Borner | 2020-07-18 16:51:55 +0200 |
commit | 34a3f2f132791ad33e6a6b59371bb6f029436ab4 (patch) | |
tree | 463bf8c68ce9b36085b1cd83179e367f09d645fb /src/db/DBController.ts | |
parent | 47f66e980761ad1218f51c7f51e51dd550bf0b35 (diff) |
Tests and abc fix using Lars' branch
Diffstat (limited to 'src/db/DBController.ts')
-rw-r--r-- | src/db/DBController.ts | 16 |
1 files changed, 10 insertions, 6 deletions
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() { |