1.0.1 • Published 4 years ago

node-red-contrib-postgrestor-mac v1.0.1

Weekly downloads
-
License
Apache
Repository
github
Last release
4 years ago

node-red-contrib-pg

Node-red-contrib-postgrestor :space_invader: is a Node-RED node allowing basic access to Postgres :elephant: database.

This fork has updated dependencies and allows to Parameterized query

Pass them as a parameter array *params of the msg object.

Node-red-contrib-postgrestor sets up a console to execute queries against the configured database.

msg.payload will contain the result object of the query. It has the following properties:

  • command: The sql command that was executed (e.g. "SELECT", "UPDATE", etc.)
  • rowCount: The number of rows affected by the SQL statement
  • oid: The oid returned
  • rows: An array of rows

Postgres implements a template engine allowing parameterized queries:

/* INTEGER id COLUMN */
SELECT * FROM table WHERE id = {{ msg.id }}

/* VARCHAR id COLUMN */
SELECT * FROM table WHERE id = '{{ msg.id }}'



SELECT * FROM table where name = $1;
1.0.1

4 years ago

1.0.0

4 years ago