@sap/hana-client
Advanced tools
Comparing version 2.5.101 to 2.5.104
# Hana Client 2.5.x Drivers | ||
## Version 2.5.101 | ||
Please see the "What’s new in the SAP HANA Client" section in the official HANA client 2.5 documentation: | ||
Please see SAP Note 2937532 - SAP HANA Client 2.5 Release Notes | ||
https://help.sap.com/viewer/product/SAP_HANA_CLIENT/2.5/en-US | ||
For the latest updates please see SAP Note 2937532 - SAP HANA Client 2.5 Release Notes | ||
https://launchpad.support.sap.com/#/notes/2937532 | ||
## Version 2.5.86 | ||
Please see the "What’s new in the SAP HANA Client" section in the official HANA client 2.5 documentation: | ||
https://help.sap.com/viewer/product/SAP_HANA_CLIENT/2.5/en-US | ||
# Hana Client 2.4.x Drivers | ||
@@ -16,0 +12,0 @@ |
@@ -106,12 +106,25 @@ 'use strict'; | ||
function HanaLobStream(resultset, columnIndex, options) { | ||
checkParameter('resultset', resultset) | ||
checkParameter('resultset', resultset); | ||
Readable.call(this, { objectMode: true }); | ||
this.resultset = resultset; | ||
this.columnInfo = this.resultset.getColumnInfo(); | ||
this.columnIndex = columnIndex; | ||
this.options = options || {readSize: DEFAULT_READ_SIZE}; | ||
this.readSize = (this.options.readSize > MAX_READ_SIZE) ? MAX_READ_SIZE : this.options.readSize; | ||
this.offset = 0; | ||
checkColumnIndex(this.columnInfo, columnIndex); | ||
checkLobType(this.columnInfo, columnIndex); | ||
this.isString = this.columnInfo[this.columnIndex].typeName === 'STRING'; | ||
this.offset = 0; | ||
this.readSize = DEFAULT_READ_SIZE; | ||
this.valueAsString = false; | ||
if (options) { | ||
if (isInteger(options.readSize) && options.readSize > 0) { | ||
this.readSize = options.readSize; | ||
} | ||
if (typeof options.valueAsString === "boolean") { | ||
this.valueAsString = options.valueAsString; | ||
} | ||
} | ||
}; | ||
@@ -128,20 +141,47 @@ | ||
var stream = this; | ||
var buffer = createBuffer(this.readSize); | ||
var bufferSize = this.isString ? (this.readSize + 1) * 4 : this.readSize; | ||
var buffer = createBuffer(bufferSize); | ||
this.pause(); | ||
this.resultset.getData(this.columnIndex, this.offset, buffer, 0, this.readSize, function (err, bytesRetrieved) { | ||
if (err === undefined) { | ||
stream.offset += bytesRetrieved; | ||
if (bytesRetrieved > 0) { | ||
if (bytesRetrieved < stream.readSize) { | ||
var buffer2 = createBuffer(bytesRetrieved); | ||
buffer.copy(buffer2, 0, 0, bytesRetrieved); | ||
stream.push(buffer2); | ||
if (stream.isString) { // For CLOB/NCLOB, bytesRetrieved is number of characters. | ||
if (bytesRetrieved > 0) { | ||
let firstNullChar = buffer.indexOf(0); | ||
let newBuffer = createBuffer(firstNullChar); | ||
buffer.copy(newBuffer, 0, 0, firstNullChar); | ||
if (stream.valueAsString) { | ||
stream.push(newBuffer.toString('utf8')); | ||
} else { | ||
stream.push(newBuffer); | ||
} | ||
if (bytesRetrieved < stream.readSize) { | ||
stream.push(null); | ||
} | ||
} else { | ||
stream.push(buffer); | ||
stream.push(null); | ||
} | ||
} else { // LOB | ||
if (bytesRetrieved > 0) { | ||
if (bytesRetrieved < stream.readSize) { | ||
let buffer2 = createBuffer(bytesRetrieved); | ||
buffer.copy(buffer2, 0, 0, bytesRetrieved); | ||
stream.push(buffer2); | ||
stream.push(null); | ||
} else { | ||
stream.push(buffer); | ||
} | ||
} else { | ||
stream.push(null); | ||
} | ||
} | ||
} else { | ||
if (err.code === 100) { // No more result | ||
stream.push(null); | ||
} else { | ||
stream.push(null); | ||
stream.emit('error', err); | ||
} | ||
} else { | ||
stream.emit('error', err); | ||
} | ||
stream.resume(); | ||
}); | ||
@@ -154,30 +194,2 @@ }; | ||
//HanaLobStream.prototype.Read = function (size) { | ||
// try { | ||
// if (size === undefined && size === null) { | ||
// return this.resultset.getValue(this.columnIndex); | ||
// } else { | ||
// if (size <= 0) { | ||
// throw new Error("Invalid parameter 'size'."); | ||
// } | ||
// var buffer = createBuffer(size); | ||
// var bytesRetrieved = this.resultset.getData(this.columnIndex, this.offset, buffer, 0, size); | ||
// this.offset += bytesRetrieved; | ||
// if (bytesRetrieved > 0) { | ||
// if (bytesRetrieved < size) { | ||
// var buffer2 = createBuffer(bytesRetrieved); | ||
// buffer.copy(buffer2, 0, 0, bytesRetrieved); | ||
// return buffer2; | ||
// } else { | ||
// return buffer; | ||
// } | ||
// } else { | ||
// return null; | ||
// } | ||
// } | ||
// } catch (err) { | ||
// this.emit('error', err); | ||
// } | ||
//}; | ||
// Parameter lob stream | ||
@@ -184,0 +196,0 @@ function HanaParameterLobStream(statement, paramIndex, options) { |
@@ -15,3 +15,3 @@ { | ||
}, | ||
"version": "2.5.101", | ||
"version": "2.5.104", | ||
"requires": true, | ||
@@ -18,0 +18,0 @@ "name": "@sap/hana-client", |
@@ -5,3 +5,3 @@ { | ||
"description": "Official SAP HANA Node.js Driver", | ||
"version": "2.5.101", | ||
"version": "2.5.104", | ||
"dependencies": { | ||
@@ -8,0 +8,0 @@ "debug": "3.1.0" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
938
176113717