mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 03:16:01 +00:00
Enhance binary data handling in modifyRow function to support ArrayBuffer conversion to base64
This commit is contained in:
@@ -46,8 +46,8 @@ async function waitForDrain(stream) {
|
||||
|
||||
function modifyRow(row, columns) {
|
||||
columns.forEach((col) => {
|
||||
if (row[col.name] instanceof Uint8Array) {
|
||||
row[col.name] = { $binary: { base64: row[col.name].toString('base64') } };
|
||||
if (row[col.name] instanceof Uint8Array || row[col.name] instanceof ArrayBuffer) {
|
||||
row[col.name] = { $binary: { base64: Buffer.from(row[col.name]).toString('base64') } };
|
||||
}
|
||||
});
|
||||
return row;
|
||||
|
||||
Reference in New Issue
Block a user