Add bind capability to sqlite and mysql nodes

Thanks to Scott Penrose for the patch.
This commit is contained in:
dceejay
2015-01-26 10:57:13 +00:00
parent d7dc9dae20
commit 5982da8495
6 changed files with 10 additions and 6 deletions

View File

@@ -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;