diff --git a/README.md b/README.md index 368b624..54d8afe 100644 --- a/README.md +++ b/README.md @@ -49,3 +49,21 @@ You will need to restart Node-RED for it to pick-up [**Postgrestor**](https://gi

+ + +## Notes for docker + +On some docker installations, the user/password msut be configured via environment variables as shown below. + +``` +############################## + nodered: + image: snuids/nodered:v0.20.8-v10 + container_name: nodered + environment: + - TZ=Europe/Paris + - PGHOST=mypostgres + - PGDATABASE=mydatabase + - PGPASSWORD=mypassword + - PGUSER=muuser +``` \ No newline at end of file diff --git a/package.json b/package.json index 511b995..5731ea2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "postgrestor", - "version": "0.0.2", + "version": "0.0.3", "scripts": { "test": "eslint postgrestor.js" }, diff --git a/postgrestor.js b/postgrestor.js index 4c16cbe..94971fb 100644 --- a/postgrestor.js +++ b/postgrestor.js @@ -69,8 +69,10 @@ module.exports = function(RED) { node.error(error); }); try { + var renderedtemplate=mustache.render(config.query, template).replace(/'/g,"'"); + msg.payload = yield client.query( - mustache.render(config.query, template) + renderedtemplate ); node.send(msg); client.release();