From 49ec5a7edd10a634ed96a71357098f3b234194d5 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 23 Nov 2019 18:08:43 +0100 Subject: [PATCH] Can get instance of database connection from anywhere in the application --- src/helpers/DatabaseHelper.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/helpers/DatabaseHelper.ts b/src/helpers/DatabaseHelper.ts index a9567e9..2610d10 100644 --- a/src/helpers/DatabaseHelper.ts +++ b/src/helpers/DatabaseHelper.ts @@ -45,6 +45,13 @@ export class DatabaseHelper { }) } + /** + * Get an instance of the connection to the database + */ + static getConnection() : Connection { + return this.connection; + } + /** * Query the database (SELECT) *