From 732a38e21493448b0340c93f5699d17495aa3fb0 Mon Sep 17 00:00:00 2001 From: dceejay Date: Mon, 16 Mar 2015 16:25:57 +0000 Subject: [PATCH] remove deprecated postgress node now that npm search includes nodes --- storage/postgres/110-postgres.html | 114 ---------------------------- storage/postgres/110-postgres.js | 87 --------------------- storage/postgres/README.md | 4 + storage/postgres/icons/postgres.png | Bin 582 -> 0 bytes 4 files changed, 4 insertions(+), 201 deletions(-) delete mode 100644 storage/postgres/110-postgres.html delete mode 100644 storage/postgres/110-postgres.js create mode 100644 storage/postgres/README.md delete mode 100644 storage/postgres/icons/postgres.png diff --git a/storage/postgres/110-postgres.html b/storage/postgres/110-postgres.html deleted file mode 100644 index 1445b1db..00000000 --- a/storage/postgres/110-postgres.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - diff --git a/storage/postgres/110-postgres.js b/storage/postgres/110-postgres.js deleted file mode 100644 index f83e7ff8..00000000 --- a/storage/postgres/110-postgres.js +++ /dev/null @@ -1,87 +0,0 @@ -/** - * Copyright 2013, 2015 Kris Daniels, IBM Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - **/ - -module.exports = function(RED) { - var pg=require('pg'); - var named=require('node-postgres-named'); - var querystring = require('querystring'); - - function PostgresDatabaseNode(n) { - RED.nodes.createNode(this,n); - this.hostname = n.hostname; - this.port = n.port; - this.db = n.db; - this.user = this.credentials.user; - this.password = this.credentials.password; - } - - RED.nodes.registerType("postgresdb",PostgresDatabaseNode,{ - credentials: { - user: {type:"text"}, - password: {type: "password"} - } - }); - - function PostgresNode(n) { - RED.nodes.createNode(this,n); - - this.topic = n.topic; - this.postgresdb = n.postgresdb; - this.postgresConfig = RED.nodes.getNode(this.postgresdb); - this.sqlquery = n.sqlquery; - this.output = n.output; - - var node = this; - - if(this.postgresConfig) - { - - var conString = 'postgres://'+this.postgresConfig.user +':' + this.postgresConfig.password + '@' + this.postgresConfig.hostname + ':' + this.postgresConfig.port + '/' + this.postgresConfig.db; - node.clientdb = new pg.Client(conString); - named.patch(node.clientdb); - - node.clientdb.connect(function(err){ - if(err) { node.error(err); } - else { - node.on('input', - function(msg){ - if(!msg.queryParameters) msg.queryParameters={}; - node.clientdb.query(msg.payload, - msg.queryParameters, - function (err, results) { - if(err) { node.error(err); } - else { - if(node.output) - { - msg.payload = results.rows; - node.send(msg); - } - } - }); - }); - } - }); - } else { - this.error("missing postgres configuration"); - } - - this.on("close", function() { - if(node.clientdb) node.clientdb.end(); - }); - } - - RED.nodes.registerType("postgres",PostgresNode); -} diff --git a/storage/postgres/README.md b/storage/postgres/README.md new file mode 100644 index 00000000..09be7ba6 --- /dev/null +++ b/storage/postgres/README.md @@ -0,0 +1,4 @@ +node-red-node-postgres +====================== + +Moved to: https://www.npmjs.com/package/node-red-contrib-postgres diff --git a/storage/postgres/icons/postgres.png b/storage/postgres/icons/postgres.png deleted file mode 100644 index 6ae1a806dc392476df57ee0218679cd0612c2b26..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 582 zcmV-M0=fN(P)Px#24YJ`L;wH)0002_L%V+f000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2i^t* z6&5c^W?UTr00G8HL_t(o!|j*5N<%>qhG#Z+2!etSAP7M$#Lh}YY%FY23$}I!1PRz! z`UF;joo|prlstijg)d=YZ4u08vw`Jg&z?OOypgHSnVFsa=dwGqA`ANK1Za_e;0$;M zUVxn{fP|=%AzydwoX(hKfOG*9kheU11GKGt*%LW{W^`JzJg^40GjwWJZ(+Z z(P@f2?v0TCtWbfYq#m#ZT*iPo0d@l$ye2kV0d76I_do+!@_?a|RK*q}&`_b_aQSJ+6=;jdM}pl{)rn8Pp3!w(&y9#o?e{}us1F^`TIEDAR}V#Q>=2m} zv&v`H4jTDI^zXp*f7{CwPaosQ(q!+l9xxJ-iHNKf>O~a-8rT