So I am currently using the following:
const { Client } = require('pg');
const db = new Client({
connectionString: process.env.DATABASE_URL,
ssl: {
rejectUnauthorized: false
}
});
I'd like to start using pools because it seems to handle multiple users accessing the database much more efficiently...how can I convert the above into a pool? I tried just changing the word 'Client' to 'Pool,' but based on the docs it seems like pools are initialized differently. Here (https://node-postgres.com/api/pool) it shows a config object is made, and I assume I have to make one of those but I'm not exactly sure what to put inside it as I'm deploying to Heroku....any help much appreciated!