denodb
denodb copied to clipboard
Model.count() should return a number (integer)
Right now the method returns a string while querying a Postgres Db.
Can confirm. This is probably the same underlying issue as denodrivers/postgres#91, if Postgres returns the result of a COUNT
-query as a BIG_INTEGER
. I've worked around the issue for my specific use case by using parseInt()
, as I can ensure, that I will never cross the maximum of a Javascript number
type.
I guess it's more difficult to create a generic solution, although there seems to be a proposal in denodrivers/postgres#177, that hasn't gone anywhere yet.