Skip to content

Commit

Permalink
feat: Allow hex engine to be used (#641)
Browse files Browse the repository at this point in the history
Co-authored-by: Johannes Vogel <31311694+johannes-vogel@users.noreply.github.com>
  • Loading branch information
BobdenOs and johannes-vogel authored May 16, 2024
1 parent 2cd2349 commit bca0c01
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hana/lib/HANAService.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ class HANAService extends SQLService {
})

const withclause = withclauses.length ? `WITH ${withclauses} ` : ''
const ret = withclause + (values.length === 1 ? values[0] : 'SELECT * FROM ' + values.map(v => `(${v})`).join(' UNION ALL ') + ' ORDER BY "_path_" ASC')
const ret = withclause + (values.length === 1 ? values[0] : 'SELECT * FROM ' + values.map(v => `(${v})`).join(' UNION ALL ')) + ' ORDER BY "_path_" ASC'
DEBUG?.(ret)
return ret
}
Expand Down Expand Up @@ -535,8 +535,8 @@ class HANAService extends SQLService {
// Making each row a maximum size of 2gb instead of the whole result set to be 2gb
// Excluding binary columns as they are not supported by FOR JSON and themselves can be 2gb
const rawJsonColumn = sql.length
? `(SELECT ${sql} FROM DUMMY FOR JSON ('format'='no', 'omitnull'='no', 'arraywrap'='no') RETURNS NVARCHAR(2147483647)) AS "_json_"`
: `TO_NCLOB('{}') AS "_json_"`
? `(SELECT ${sql} FROM JSON_TABLE('[{}]', '$' COLUMNS(I FOR ORDINALITY)) FOR JSON ('format'='no', 'omitnull'='no', 'arraywrap'='no') RETURNS NVARCHAR(2147483647)) AS "_json_"`
: `'{}' AS "_json_"`

let jsonColumn = rawJsonColumn
if (structures.length) {
Expand Down

0 comments on commit bca0c01

Please sign in to comment.