You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-8Lines changed: 21 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
# node-red-contrib-postgresql
2
2
3
-
[node-red-contrib-postgresql](https://github.com/alexandrainst/node-red-contrib-postgresql) is a [**Node-RED**](https://nodered.org/) node to query a [**PostgreSQL**](https://www.postgresql.org/) 🐘 database.
is a [**Node-RED**](https://nodered.org/) node to query a [**PostgreSQL**](https://www.postgresql.org/) 🐘 database.
4
5
5
6
It supports *splitting* the resultset and *backpressure* (flow control), to allow working with large datasets.
6
7
@@ -10,9 +11,11 @@ It supports *parameterized queries*.
10
11
11
12
The response (rows) is provided in `msg.payload` as an array.
12
13
13
-
An exception is if the *Split results* option is enabled and the *Number of rows per message* set to **1**, then `msg.payload` is not an array but the single-row response.
14
+
An exception is if the *Split results* option is enabled and the *Number of rows per message* is set to **1**,
15
+
then `msg.payload` is not an array but the single-row response.
14
16
15
-
Additional information is provided as `msg.pgsql.rowCount` and `msg.pgsql.command`. See the [underlying documentation](https://node-postgres.com/api/result) for details.
17
+
Additional information is provided as `msg.pgsql.rowCount` and `msg.pgsql.command`.
18
+
See the [underlying documentation](https://node-postgres.com/api/result) for details.
16
19
17
20
In the case of multiple queries, then `msg.pgsql` is an array.
18
21
@@ -73,17 +76,21 @@ You will then need to restart Node-RED.
73
76
## Backpressure
74
77
75
78
This node supports *backpressure* / *flow control*:
76
-
when the *Split results* option is enabled, it waits for a *tick* before releasing the next batch of lines, to make sure the rest of your Node-RED flow is ready to process more data
79
+
when the *Split results* option is enabled, it waits for a *tick* before releasing the next batch of lines,
80
+
to make sure the rest of your Node-RED flow is ready to process more data
77
81
(instead of risking an out-of-memory condition), and also conveys this information upstream.
78
82
79
-
So when the *Split results* option is enabled, this node will only output one message at first, and then awaits a message containing a truthy `msg.tick` before releasing the next message.
83
+
So when the *Split results* option is enabled, this node will only output one message at first,
84
+
and then awaits a message containing a truthy `msg.tick` before releasing the next message.
80
85
81
-
To make this behaviour potentially automatic (avoiding manual wires), this node declares its ability by exposing a truthy `node.tickConsumer` for downstream nodes to detect this feature, and a truthy `node.tickProvider` for upstream nodes.
86
+
To make this behaviour potentially automatic (avoiding manual wires), this node declares its ability by exposing a truthy `node.tickConsumer`
87
+
for downstream nodes to detect this feature, and a truthy `node.tickProvider` for upstream nodes.
82
88
Likewise, this node detects upstream nodes using the same back-pressure convention, and automatically sends ticks.
83
89
84
90
## Sequences for split results
85
91
86
-
When the *Split results* option is enabled (streaming), the messages contain some information following the conventions for [*messages sequences*](https://nodered.org/docs/user-guide/messages#message-sequences).
92
+
When the *Split results* option is enabled (streaming), the messages contain some information following the
93
+
conventions for [*messages sequences*](https://nodered.org/docs/user-guide/messages#message-sequences).
87
94
88
95
```js
89
96
{
@@ -100,7 +107,13 @@ When the *Split results* option is enabled (streaming), the messages contain som
100
107
101
108
## Credits
102
109
103
-
Major rewrite in July 2021 by [Alexandre Alapetite](https://alexandra.dk/alexandre.alapetite) ([Alexandra Institute](https://alexandra.dk)), of parents forks: [andreabat](https://github.com/andreabat/node-red-contrib-postgrestor) / [ymedlop](https://github.com/doing-things-with-node-red/node-red-contrib-postgrestor) / [HySoaKa](https://github.com/HySoaKa/node-red-contrib-postgrestor), with inspiration from [node-red-contrib-re-postgres](https://flows.nodered.org/node/node-red-contrib-re-postgres) ([code](https://github.com/elmagopy/node-red-contrib-re2-postgres)).
110
+
Major rewrite in July 2021 by [Alexandre Alapetite](https://alexandra.dk/alexandre.alapetite) ([Alexandra Institute](https://alexandra.dk)),
<p><ahref="https://github.com/alexandrainst/node-red-contrib-postgresql">node-red-contrib-postgresql</a> is a Node-RED node to query a <ahref="https://www.postgresql.org/">PostgreSQL</a> 🐘 database.</p>
<p>Additional information is provided as <code>msg.pgsql.rowCount</code> and <code>msg.pgsql.command</code>. See the <ahref="https://node-postgres.com/api/result">underlying documentation</a> for details.</p>
0 commit comments