Skip to content

Commit

Permalink
fix: Enforce LargeStrings to be Strings for sql_simple_queries=1 (
Browse files Browse the repository at this point in the history
#774)

when using `sql_simple_queries=1` and `hdb` the `NCLOB` columns are
returned as `Buffers` not as `Strings`. With this change these columns
include an output converters that informs `hdb` to handle them as
`Strings`.

---------

Co-authored-by: Johannes Vogel <[email protected]>
Co-authored-by: Max Gruenfelder <[email protected]>
  • Loading branch information
3 people authored Aug 29, 2024
1 parent ce5f856 commit c38a9e6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions hana/lib/HANAService.js
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,7 @@ class HANAService extends SQLService {

static OutputConverters = {
...super.OutputConverters,
LargeString: cds.env.features.sql_simple_queries > 0 ? e => `TO_NVARCHAR(${e})` : undefined,
// REVISIT: binaries should use BASE64_ENCODE, but this results in BASE64_ENCODE(BINTONHEX(${e}))
Binary: e => `BINTONHEX(${e})`,
Date: e => `to_char(${e}, 'YYYY-MM-DD')`,
Expand Down

0 comments on commit c38a9e6

Please sign in to comment.