mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
Add bind capability to sqlite and mysql nodes
Thanks to Scott Penrose for the patch.
This commit is contained in:
@@ -57,7 +57,8 @@ module.exports = function(RED) {
|
||||
node.on("input", function(msg) {
|
||||
if (typeof msg.topic === 'string') {
|
||||
//console.log("query:",msg.topic);
|
||||
node.mydbConfig.db.all(msg.topic, function(err, row) {
|
||||
var bind = Array.isArray(msg.payload) ? msg.payload : [];
|
||||
node.mydbConfig.db.all(msg.topic, bind, function(err, row) {
|
||||
if (err) { node.warn(err); }
|
||||
else {
|
||||
msg.payload = row;
|
||||
|
||||
Reference in New Issue
Block a user