diff --git a/hana/lib/drivers/hdb.js b/hana/lib/drivers/hdb.js index 5c956c11f..af39a8d0e 100644 --- a/hana/lib/drivers/hdb.js +++ b/hana/lib/drivers/hdb.js @@ -2,7 +2,6 @@ const { Readable, Stream, promises: { pipeline } } = require('stream') const { StringDecoder } = require('string_decoder') const { text } = require('stream/consumers') -const cds = require('@sap/cds') const hdb = require('hdb') const iconv = require('iconv-lite') @@ -10,16 +9,6 @@ const { driver, prom, handleLevel } = require('./base') const { resultSetStream } = require('./stream') const { wrap_client } = require('./dynatrace') -if (cds.env.features.sql_simple_queries === 3) { - // Make hdb return true / false - const Reader = require('hdb/lib/protocol/Reader.js') - Reader.prototype._readTinyInt = Reader.prototype.readTinyInt - Reader.prototype.readTinyInt = function () { - const ret = this._readTinyInt() - return ret == null ? ret : !!ret - } -} - const credentialMappings = [ { old: 'certificate', new: 'ca' }, { old: 'encrypt', new: 'useTLS' }, @@ -35,6 +24,7 @@ class HDBDriver extends driver { constructor(creds) { creds = { fetchSize: 1 << 16, // V8 default memory page size + dataFormatSupport: 7, // with 7 hana supports booleans ...creds, } diff --git a/hana/package.json b/hana/package.json index c7afc148c..984599085 100644 --- a/hana/package.json +++ b/hana/package.json @@ -26,7 +26,7 @@ }, "dependencies": { "@cap-js/db-service": "^2.1.1", - "hdb": "^0.19.5" + "hdb": "^2.0.0" }, "peerDependencies": { "@sap/hana-client": "^2", diff --git a/package-lock.json b/package-lock.json index 8507e9684..1b5b5089c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,7 +36,7 @@ "license": "Apache-2.0", "dependencies": { "@cap-js/db-service": "^2.1.1", - "hdb": "^0.19.5" + "hdb": "^2.0.0" }, "devDependencies": { "@sap/hana-client": "^2.25.29" @@ -958,15 +958,15 @@ } }, "node_modules/hdb": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/hdb/-/hdb-0.19.12.tgz", - "integrity": "sha512-vv+cjmvr6fNH/s0Q2zOZc4sEjMpSC0KuacFn8dp3L38qM3RA2LLeX70wWhZLESpwvwUf1pQkRfUhZeooFSmv3A==", + "version": "2.25.1", + "resolved": "https://registry.npmjs.org/hdb/-/hdb-2.25.1.tgz", + "integrity": "sha512-/ojm+fki1r+sqMqQjwTLcF1VeL3tkNxMLS/CVKXuUbz6xDco3wdSR0wTh0FzMPUOHnptCErxV6YNUbvdALSFww==", "license": "Apache-2.0", "dependencies": { "iconv-lite": "^0.4.18" }, "engines": { - "node": ">= 0.12" + "node": ">= 18" } }, "node_modules/http-errors": {