Skip to content

Commit 756751e

Browse files
use hana data format version 7 for bool support
1 parent b799d3f commit 756751e

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

hana/lib/drivers/hdb.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,13 @@ const { Readable, Stream, promises: { pipeline } } = require('stream')
22
const { StringDecoder } = require('string_decoder')
33
const { text } = require('stream/consumers')
44

5-
const cds = require('@sap/cds')
65
const hdb = require('hdb')
76
const iconv = require('iconv-lite')
87

98
const { driver, prom, handleLevel } = require('./base')
109
const { resultSetStream } = require('./stream')
1110
const { wrap_client } = require('./dynatrace')
1211

13-
if (cds.env.features.sql_simple_queries === 3) {
14-
// Make hdb return true / false
15-
const Reader = require('hdb/lib/protocol/Reader.js')
16-
Reader.prototype._readTinyInt = Reader.prototype.readTinyInt
17-
Reader.prototype.readTinyInt = function () {
18-
const ret = this._readTinyInt()
19-
return ret == null ? ret : !!ret
20-
}
21-
}
22-
2312
const credentialMappings = [
2413
{ old: 'certificate', new: 'ca' },
2514
{ old: 'encrypt', new: 'useTLS' },
@@ -35,6 +24,7 @@ class HDBDriver extends driver {
3524
constructor(creds) {
3625
creds = {
3726
fetchSize: 1 << 16, // V8 default memory page size
27+
dataFormatSupport: 7, // with 7 hana supports booleans
3828
...creds,
3929
}
4030

0 commit comments

Comments
 (0)