mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 00:56:02 +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) {
|
function modifyRow(row, columns) {
|
||||||
columns.forEach((col) => {
|
columns.forEach((col) => {
|
||||||
if (row[col.name] instanceof Uint8Array) {
|
if (row[col.name] instanceof Uint8Array || row[col.name] instanceof ArrayBuffer) {
|
||||||
row[col.name] = { $binary: { base64: row[col.name].toString('base64') } };
|
row[col.name] = { $binary: { base64: Buffer.from(row[col.name]).toString('base64') } };
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return row;
|
return row;
|
||||||
|
|||||||
Reference in New Issue
Block a user