Raw SQL in select type to number
Hellow, I have the following sql expression in a select statement array:
but the return type of the column in the row is a string. How can I get the type to be a number?
Solution:Jump to solution
The
pg
driver returns numeric type as a string. Use the pg-types
package to configure the type.9 Replies
Unknown User•14mo ago
Message Not Public
Sign In & Join Server To View
Im using an expression that is repeatedly used across my query
Im still getting the data backa s string
Unknown User•14mo ago
Message Not Public
Sign In & Join Server To View
postgres
0.26.3
I just want kysely to return that column as a number
Im not sure if raw queries will simply be always returned as string
I tried:
and both return as string
Solution
The
pg
driver returns numeric type as a string. Use the pg-types
package to configure the type.GitHub
GitHub - brianc/node-pg-types: Type parsing for node-postgres
Type parsing for node-postgres. Contribute to brianc/node-pg-types development by creating an account on GitHub.
got it, thanks
Unknown User•14mo ago
Message Not Public
Sign In & Join Server To View