I am trying the following:
const { Client } = require('pg');
console.log(Client);
const client = new Client({
user: 'Username censored',
host: 'Host censored',
database: 'gisuebung',
password: 'Passworded censored',
port: 5432,
});
client.connect();
When I run this however, I get the following Error: Error in v-on handler: "TypeError: Client is not a constructor"
I wrote this after a snippet I found online and it seems everywhere I look people did the exact same thing. Can anyone tell me what I am doing wrong?
clientto something likepgClientto check if is not an issue with the destructuring