I can't not find any button to export database data,so I try to connect to it (even enable public domain) via local terminal but failed.
I can't get any useful help from docs,so I ask for help here.Belows are my code:
const { Client } = require('pg');
// Connection string copy from overview-Connection Details
const connectionString = `postgresql://<user>:<psw>@xxx`
// Create a new client instance
const client = new Client({
connectionString: connectionString,
});
// Connect to the database
client.connect()
.then(() => console.log('Connected successfully'))
.catch(e => console.log(e))
.finally(() => client.end());
I got the error message in terminal: Error: Connection terminated unexpectedly
.
I've replaced the connect string with other progresql database and connected successfully(so my test code are correct).