What is the best way to handle numeric data type database columns in Sails.js?

I have an existing PostgreSQL database with a large number of columns with data types such as "numeric (27.10)" or "numeric (17.2)". In the Sails models that I set up for each table, I list the type of each attribute, both integer and float. However, when Sails outputs JSON for these tables, the data is presented as strings.

I can always run something like parseInt () on the client side, but is there a better way to fix this by reconfiguring the sails?

+4
source share
1 answer

Is there a better way to fix this by reconfiguring the sails?

. , Postgres 131 072 - waayyyy ( , , ) . , Waterline , , float integer ( ?). , , userland.

+3

Source: https://habr.com/ru/post/1609913/


All Articles