You just need to query sql and convert the buffer from the output to the base64.
The nodejs lib you use likely returns nodejs buffer as the value of the binary column.
So you need to convert it to the base64 string using abuffer.toString('base64').
In your case, the req.data.logo will be something like aBff2515AasVsdEF in the end.
You can take the code also out of the jsreport and troubleshoot it in the plain nodejs.