aboutsummaryrefslogtreecommitdiff
path: root/src/db
diff options
context:
space:
mode:
authorMarvin Borner2020-07-18 16:51:55 +0200
committerMarvin Borner2020-07-18 16:51:55 +0200
commit34a3f2f132791ad33e6a6b59371bb6f029436ab4 (patch)
tree463bf8c68ce9b36085b1cd83179e367f09d645fb /src/db
parent47f66e980761ad1218f51c7f51e51dd550bf0b35 (diff)
Tests and abc fix using Lars' branch
Diffstat (limited to 'src/db')
-rw-r--r--src/db/DBController.ts16
-rw-r--r--src/db/user.ts3
2 files changed, 12 insertions, 7 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() {
diff --git a/src/db/user.ts b/src/db/user.ts
index c245b5f..1e20564 100644
--- a/src/db/user.ts
+++ b/src/db/user.ts
@@ -1,6 +1,7 @@
import DBController from "./DBController.ts";
-class User extends DBController {
+class User {
+ createUser() {}
}
export default new User();