The problem with getting numeric data from the database

Wappler Version : 6.8.0
Operating System : Windows 11
Server Model: NodeJS
Database Type: Postgresql 16
Hosting Type: Ubuntu

Expected behavior

If in the Server Actions Database Query you request data as a numeric number (8,2) from Postgresql (16), then you should get this number. If the number 9.9 is in the database, then you should get 9.9.

Actual behavior

In fact, in Wappler I see 10 instead of 9.9.

How to reproduce

query:

result in Wappler:

Real data in Postgresql:

Could be a similar scenario to this (although this is MySQL related and not PostgreSQL):

1 Like

Thanks for the information. Indeed, in Wappler, these numbers were represented as strings, and 9.9 was exactly '9.9' on the page, unlike how it is presented in the query test. Now I understand why the addition and formatting of numbers didn't work for me - because they were strings. I did a type conversion to SQL and now I see in debug information that these numbers are no longer strings. However, now I have lost their output on the page.... :person_facepalming:

Have you tried refreshing the database schema in Wappler via the Database Manager to see if that helps?

Hmmm, did you use the convert to number formatter on the page binding?

I solved the problem by converting the types in the SQL query to the more standard double precision and integer.

1 Like

The problem with missing data was that initially I used Database Single Query, and then switched to Custom Query. In these cases, the addressing of data in the dataset occurs in different ways. In the case of a single query, you do not need to specify the index in the dataset.

2 Likes

In the future, is it possible to configure the driver so that all postgresql types are handled as expected?

now yes :slight_smile: before the SQL correction, this did not work

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.