Error since v4.26.0: (connection || this.sequelize).query(...).then is not a function
See original GitHub issueHey happy new year! π π
Iβm having this error with sequelize v4.26.0 and above but my code worked fine with the version just below (v4.25.2). What has changed that I missed? Thank you!
P.S: Using Postgres 9.6
Unhandled rejection TypeError: (connection || this.sequelize).query(...).then is not a function
at ConnectionManager._refreshDynamicOIDs (/Users/xdamman/github/opencollective/api/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:190:7)
at Promise.tap.tap.connection (/Users/xdamman/github/opencollective/api/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:161:21)
From previous event:
at ConnectionManager.connect (/Users/xdamman/github/opencollective/api/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:154:8)
at sequelize.runHooks.then (/Users/xdamman/github/opencollective/api/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:327:50)
at runCallback (timers.js:781:20)
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top Results From Across the Web
sequelize.query() is not a FUNCTION - node.js - Stack Overflow
I am trying to use row query, but I'm getting an error. Code: const sequelize = require('sequelize'); sequelize.query("SELECT *Β ...
Read more >Model Querying - Basics - Sequelize
Transactions are important to ensure data integrity and to provide other benefits. This guide will show how to make the standard CRUD queries....
Read more >How To Use Sequelize with Node.js and MySQL - DigitalOcean
Then, you will install Sequelize, configure the MySQL database, ... If not, it will return an error via the catch method and print...
Read more >Node.js Rest APIs example with Express, Sequelize & MySQL
Next, we add configuration for MySQL database, create Tutorial model with Sequelize, write the controller. Then we define routes forΒ ...
Read more >error: connectionmanager.getconnection was called after the ...
To avoid this issue you should NOT close the connection with sequelize, but instead set an extra option with mocha --exit which terminates...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
So it seems
pg@4doesnβt supportconnection.queryas promise, Can you try withpg@6and see if that resolves this issueMy bad, I had a look at my
package-lock.jsonand did anpm list pginstead, it returns4.5.6. sorry about thatAlso, reading from https://github.com/sequelize/sequelize/issues/8765 it seems the issue is not from
.query()but from the initial connection