sequelize.connectionManager.releaseConnection() returns since update #16156
-
Yesterday, I finally made the step to update sequelize from v6.19 to v6.32. We've been postponing this because it took a lot of tedious work due to the Since I've updated this, I've been getting errors when I'm trying to release a connection.
Cannot read properties of undefined (reading 'then'). Is this new normal behaviour that this doesn't return a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Releasing a connection only marks it as available to the pool, and is a fully synchronous operation (just flags it as available for use by the pool). It was accidentally marked as async for a long time
If you are trying to access connection objects manually, know that Sequelize 7 has a new api called |
Beta Was this translation helpful? Give feedback.
Releasing a connection only marks it as available to the pool, and is a fully synchronous operation (just flags it as available for use by the pool).
It was accidentally marked as async for a long time
destroyConnection
is still asynchronous, and kills the connection.If you are trying to access connection objects manually, know that Sequelize 7 has a new api called
sequelize.withConnection
that gives you a connection for the duration of the callback:sequelize/packages/core/src/sequelize-typescript.ts
Line 506 in 64a1b82