Skip to content
Snippets Groups Projects
Commit ac2700a5 authored by alrwasheda's avatar alrwasheda :speech_balloon:
Browse files

Fix for `Parameter 'res' implicitly has an 'any' type.` using QueryResult. ...

Fix for `Parameter 'res' implicitly has an 'any' type.` using QueryResult.  Quick (temporary) Fix for missing "pg"-module.
parent 49010b2d
No related branches found
No related tags found
No related merge requests found
import { Sequelize } from "sequelize"; import { Sequelize } from "sequelize";
import envVars from "./config"; import envVars from "./config";
import { Client } from "pg"; const pg = require("pg")
const { Client, QueryResult } = pg;
let sequelizeConnection = new Sequelize( let sequelizeConnection = new Sequelize(
envVars.dbName, envVars.dbName,
...@@ -25,7 +26,7 @@ export const checkDB = async () => { ...@@ -25,7 +26,7 @@ export const checkDB = async () => {
//search for db in pg-catalog. if not found, create a one //search for db in pg-catalog. if not found, create a one
await client await client
.query(`SELECT * FROM pg_database WHERE datname = '${envVars.dbName}'`) .query(`SELECT * FROM pg_database WHERE datname = '${envVars.dbName}'`)
.then((res) => { .then((res: typeof QueryResult) => {
//------------------------------------------------then //------------------------------------------------then
if (res.rows.length === 0) { if (res.rows.length === 0) {
//given db not found //given db not found
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment