try {
sequelize = new Sequelize('test', 'postgres', 'root', {
host: 'localhost',
dialect: 'postgres',
logging:false,
pool: {
max: 12,
min: 0,
}
});
await sequelize.authenticate();
console.log('Connection has been established successfully.');
} catch (error) {
console.error('Unable to connect to the database:', error);
}
}
here i try to understand the connection pool concept in sequelize with node js . here i define my database connection and define pool 12. i read docs and so many other recourses but picture is not clear in mind.
here max = 12 what exactly define ? number of connection which we made by Sequelize instances ? or some recourses say sequelize is create a new connection per query !! what exactly happen ?
and in every resource only theory explained . not showing single case when we got connection error due to busy all pool connections
thanks for answer in advance