aboutsummaryrefslogtreecommitdiff
path: root/src/db
diff options
context:
space:
mode:
authorTom Harley2018-02-13 19:15:20 +0000
committerTom Harley2018-02-13 19:15:20 +0000
commitb828d90527eeb86e7f0937117543736c57b43f04 (patch)
tree44c17c498c748c8c89a4f39b438eb710cc801238 /src/db
parentMerge branch 'trh/docs' into 'master' (diff)
parentadded gitlab-ci job for linter (diff)
downloadmedicine-b828d90527eeb86e7f0937117543736c57b43f04.tar.gz
medicine-b828d90527eeb86e7f0937117543736c57b43f04.zip

Merge branch ‘trh/linter’

Diffstat (limited to 'src/db')
-rw-r--r--src/db/initPostgresDB.ts26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/db/initPostgresDB.ts b/src/db/initPostgresDB.ts
index 307d9b6..eb979f4 100644
--- a/src/db/initPostgresDB.ts
+++ b/src/db/initPostgresDB.ts
@@ -1,13 +1,15 @@
-var Sequelize = require('sequelize');
-const Op = Sequelize.Op;
-const gres = new Sequelize('postgres://admin:eprprJacR0hBpmWvs5IDJZTnjRAY2gM3tSm0b1af@localhost:5432/be4',
- {operatorsAliases : false});
+import * as Sequelize from 'sequelize';
+const gres: Sequelize.Sequelize = new Sequelize(
+ 'postgres://admin:eprprJacR0hBpmWvs5IDJZTnjRAY2gM3tSm0b1af@localhost:5432/be4',
+ {
+ operatorsAliases : false
+ }
+);
-gres
- .authenticate()
- .then(() => {
- console.log('Connection has been established successfully.');
- })
- .catch(err => {
- console.error('Unable to connect to the database:', err);
- });
+gres.authenticate()
+ .then(() => {
+ // Connection has been established successfully.
+ })
+ .catch((err: Error) => {
+ // Unable to connect to the database.
+ });