select count(*) returns a string not a number? mysql

When running SELECT count(*) it returns a string. Attached is an image of the query and the output. Can someone help me make sense of this.
No description
3 Replies
rphlmr ⚡
rphlmr ⚡16mo ago
Yes, you have to cast it at db level:
sql<number>`select cast(count(*) as integer) from ...`
sql<number>`select cast(count(*) as integer) from ...`
or
sql<number>`select count(*) from...`.mapWith(Number)
sql<number>`select count(*) from...`.mapWith(Number)
To let Drizzle do that.
codefork
codeforkOP16mo ago
Appears to still be returning a string.
No description
rphlmr ⚡
rphlmr ⚡16mo ago
What about using cast?
Want results from more Discord servers?
Add your server