From ac2700a5a3250be20d6a95f0edd5d962667a8206 Mon Sep 17 00:00:00 2001 From: Hanen Alrwasheda <alrwasheda@mi.fu-berlin.de> Date: Mon, 6 Dec 2021 03:56:38 +0100 Subject: [PATCH] Fix for `Parameter 'res' implicitly has an 'any' type.` using QueryResult. Quick (temporary) Fix for missing "pg"-module. --- server/src/db/seqConnection.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/src/db/seqConnection.ts b/server/src/db/seqConnection.ts index 925f743..5d04ec3 100644 --- a/server/src/db/seqConnection.ts +++ b/server/src/db/seqConnection.ts @@ -1,6 +1,7 @@ import { Sequelize } from "sequelize"; import envVars from "./config"; -import { Client } from "pg"; +const pg = require("pg") +const { Client, QueryResult } = pg; let sequelizeConnection = new Sequelize( envVars.dbName, @@ -25,7 +26,7 @@ export const checkDB = async () => { //search for db in pg-catalog. if not found, create a one await client .query(`SELECT * FROM pg_database WHERE datname = '${envVars.dbName}'`) - .then((res) => { + .then((res: typeof QueryResult) => { //------------------------------------------------then if (res.rows.length === 0) { //given db not found -- GitLab