Join GitHub today
(Aliased) Count in raw query returns string instead of integer for the count column #2383
Sorry, I should have mentioned that in the OP. Using Postgres. Can you recommend a fix that doesn't involve having to iterate over the results and parse the value, or do you think that's the only solution?
You're right, it's not a Sequelize issue. :)
Solved by making a small change in the file lib/dialects/postgres/connector-manager.js
I commented out the line:
As mentioned in brianc/node-postgres#427
Yeah, it'd be great to have a setting in Sequelize for it as my modified files won't really work as we push our app to AWS EB, which installs fresh modules for us (so not including my changes).
I would have preferred that the PG guys keep it as int and then convert to string only when the value surpasses the postive value threshold for JS integers.