SQL Cells should cast count(*) as numeric
nachocab opened this issue · comments
For context, the reason is that PostgreSQL returns BIGINT which node-postgres casts to string for several reasons, one of them being that JS's BigInt type isn't JSON-serializable (see issue).
Luckily it's easy to cast to int yourself: select count(*)::int
We should return it as bigint instead of string, though. I think initially bigint wasn’t widely supported so we used string, but now it is widely supported.
And frankly it’s so rare that you need bigint we should also just consider using int and losing precision if needed.