aboutsummaryrefslogtreecommitdiff
path: root/src/db/initPostgresDB.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/db/initPostgresDB.ts')
-rw-r--r--src/db/initPostgresDB.ts27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/db/initPostgresDB.ts b/src/db/initPostgresDB.ts
index 1bb1d77..eb979f4 100644
--- a/src/db/initPostgresDB.ts
+++ b/src/db/initPostgresDB.ts
@@ -1,14 +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.
+ });