Skip to content

Commit

Permalink
chore: revert decimals are always strings on hana (#700)
Browse files Browse the repository at this point in the history
It's decided that the prerelase of cds 8 will not switch the default of
`cds.env.features.string_decimals`.
In order to not lose precision on HANA with the prerelease, we have to
remove the interpretation of the flag.
Maybe we should rename the flag in the future to be sqlite specific.
  • Loading branch information
johannes-vogel committed Jun 19, 2024
1 parent eaf8e3b commit e17febd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions hana/lib/HANAService.js
Original file line number Diff line number Diff line change
Expand Up @@ -1093,9 +1093,8 @@ class HANAService extends SQLService {
Vector: e => `TO_NVARCHAR(${e})`,
// Reading int64 as string to not loose precision
Int64: expr => `TO_NVARCHAR(${expr})`,
// REVISIT: always cast to string in next major
// Reading decimal as string to not loose precision
Decimal: cds.env.features.string_decimals ? expr => `TO_NVARCHAR(${expr})` : undefined,
Decimal: expr => `TO_NVARCHAR(${expr})`,

// HANA types
'cds.hana.ST_POINT': e => `(SELECT NEW ST_POINT(TO_NVARCHAR(${e})).ST_X() as "x", NEW ST_POINT(TO_NVARCHAR(${e})).ST_Y() as "y" FROM DUMMY WHERE (${e}) IS NOT NULL FOR JSON ('format'='no', 'omitnull'='no', 'arraywrap'='no') RETURNS NVARCHAR(2147483647))`,
Expand Down

0 comments on commit e17febd

Please sign in to comment.