plugins-workspace icon indicating copy to clipboard operation
plugins-workspace copied to clipboard

[sql] Select the sql column datatype Decimal is not support.

Open XPH0816 opened this issue 1 year ago • 6 comments

I request as select price from room

Here's my db table: image

Result: image

XPH0816 avatar Jun 09 '24 08:06 XPH0816

Thanks for the report! Are we talking about sqlite, mysql or postgresql?

FabianLars avatar Jun 09 '24 10:06 FabianLars

for my situation, I just using mysql.

XPH0816 avatar Jun 09 '24 10:06 XPH0816

Ah i think i remember. Since DECIMAL can't (or shouldn't) be converted to f64 i wasn't sure how to best send it to the js side so i just left it out for later. Still don't know any better (i never use sql myself) so this probably has to wait for the plugin's partial rewrite.

FabianLars avatar Jun 09 '24 11:06 FabianLars

Noted with Thanks

XPH0816 avatar Jun 09 '24 12:06 XPH0816

change the type by sql. for example: SELECT CAST(id AS SIGNED) as id FROM table

Tenodec avatar Jul 08 '24 03:07 Tenodec

To follow up on what @Tenodec said, it worked for me casting the decimal value as CHAR, otherwise it rounds the value in certain scenarios. For example: SELECT CAST(price AS CHAR) as price FROM table

daniellcc avatar Aug 10 '24 04:08 daniellcc

I also got this error, but in postgresql. There are some other types that are unsupported like arrays, real, decimal

Will the plugin partial rewrite add support for more types both in postgresql and in mysql?

orpos avatar Nov 03 '24 14:11 orpos

Will the plugin partial rewrite add support for more types both in postgresql and in mysql?

Not necessarily, no. This is not the goal of the rewrite and type support can be added before/after the rewrite (this part of the code shouldn't change much in the rewrite). A large part of the rewrite already happened but i forgot about this issue.

FabianLars avatar Nov 03 '24 15:11 FabianLars