node.js - Share a database connection pool between sequelize and pg -
i have server i've written using express , node-postgres (pg). creates own db pool:
const dbpool = new pg.pool(dbconfig);
and runs sql queries directly using connection.
now i'm adding new table , corresponding rest api. i'd use sequelize , epilogue reduce boilerplate. unfortunately, sequelize wants create own database connection pool:
const sequelize = new sequelize(database, user, password, config);
is possible re-use existing connection pool or otherwise share between existing pg
code , new sequelize
code?
Comments
Post a Comment