If the node encounters an error, then error is not available for catching by a Catch node. This is because, the node.error is not emitting the message as well. See discussion here.
Count of results
When sending multiple queries to this node, the result does not differentiate between the results from different queries. Specifically, it is hard to know, if a query returned any result at all. See discussion here.
Files changed
postgres.js
Node output
With this change, msg.payload will not change. However, there is an additional field named as _queryCounts that is an array of counts of rows returned by each query.
Test
Import the following flow into the canvas. To test, click on the button of the Inject node to start the flow. You should see the response similar to one pasted below.
Hi, This pull request addresses the following:
Error handling
If the node encounters an error, then error is not available for catching by a Catch node. This is because, the
node.error
is not emitting the message as well. See discussion here.Count of results
When sending multiple queries to this node, the result does not differentiate between the results from different queries. Specifically, it is hard to know, if a query returned any result at all. See discussion here.
Files changed
postgres.js
Node output
With this change,
msg.payload
will not change. However, there is an additional field named as_queryCounts
that is an array of counts of rows returned by each query.Test
Import the following flow into the canvas. To test, click on the button of the Inject node to start the flow. You should see the response similar to one pasted below.
Flow with modified node
Response
Query output
Error output