npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-red-contrib-connectionmanager

v0.1.4

Published

Node-RED implements generalised connections manager.

Downloads

75

Readme

node-red-contrib-connectionmanager

Node-Red generalized connection manager to allow connection pooling and UOW (unit of work) over multiple nodes. Maximizes asynchronous processing which is dependent on driver provider. Some drivers allow for more asynchronous processing. Tries to enable a common framework for connections which includes common pooling and minimization of variance in language implementations. For example for SQL alignment with ISO standard. Should help minimize swap between technologies. Other languages will be evolved as developed.

Currently handles following connection types:

  • postgreSQL
  • Cassandra
  • DataStax
  • monetdb
  • neo4j
  • db2

and has been built in a way to readily add more types. Very quick if driver base aligns with deployed type.

Simple example for neo4j connection

General Overview

Results in msg. Note, example is results for neoj4. For relational connections results standardized. In future, will give option of standardised form versus "as per software provider".

General Overview Results

Features

  • Connection acquired and used across a series of nodes so transactional UOW can be formed
  • More than once connection can be involved in UOW
  • Releases a connection if it has not been released for a minute. Cater form work flows that have not properly completed or unexpected error
  • Works with PostgreSQL, neo4j, Cassandra, Db2, Monetdb and DataStax.
  • Simple data mappings
  • Array input for multiple execution of statement. Useful for bulk loads
  • The one statement and set of values can be sent to multiple connections
  • Aggregation of results into one form across multiple connections
  • Mustache template for statements

Standardisation

  • postgres parameter markers as ? in line with ISO
  • Optional one form of result output regardless of driver type which is aggregated

Node Summary

  • Connection Manager - Configuration of connection pool including size
  • Get Connection - acquires a connection for the work flow
  • Release Connection - releases all connections back to pool
  • Statement - statement to be executed against connection pool or all connection pools
  • Admin Connections - get details on pool and manage pool

Nodes in Detail

Connection Manager

Configurations nodes that can be accessed via get connection.

Connection Manager Node

Get Connection

Get a connection for a message and adds to the message as a property. A message can have many connections. Connection is used by all subsequent statement nodes.

Get Connection Node

Release Connection

Releases all connections from a message and frees connections to be used by new messages. Message can be committed or rolled back to checkpoint, All statements executed from get connection can be formed as part of UOW.

Release Connection Node

Statement

The statement will be executed against connection associated with the message. This can be minimized to only one of the connections by detailing the connection name. Mustache template for statements per message or once at node start. Message has access to msg. values along with node. values. This allows some tailoring of statement to cope with variances in DBMS. Result can be converted into the one form being array of rows and columns with data aggregated if more than one connection used.

Statement Node

Admin Connection

This node takes in actions specified by the topic. Valid actions:

  • list - Output payload contain metrics on connection pools
  • releasestale - Puts connections that appear to be active back into pool
  • releaseFree - releases connections from pool that are free
  • toggleDebug - Sends more debug information to system log

In future will be used as a means of dynamically changes certain properties such as pool size.

Admin Connection Node

Data-Stax Cloud Connection

Generate the secure-connect zip file from DataStax and update options file as follows:

Admin Connection DataStax Cloud


To Do List

  1. Add transactional - option on connection manager and release to have commit/rollback
  • Standardised results format, at moment default of driver
  • Access performance metrics
  • Dynamically change size of pool
  • Wait on connection to become free
  • Configurable stale connection cycle
  • Specific Mustache properties to allow for DBMS variance, e.g. "limit" vs "fetch first"

Install

Run the following command in the root directory of your Node-RED install

npm install node-red-contrib-connectionmanager

Tests

Test/example flow in test/generalTest.json

Note The examples will require the drivers to be installed

Test postgres and monetdb


Version

0.1.4 Bug fix for bug fix

0.1.3 Bug fix node-red depreciated features on nodes-started, added initial test connection test, timeout for postgresql rather than wait indefinitely

0.1.1 Bug fix commits DataStax and Cassandra as concept doesn't exist

0.1.0 Add DataStax and Cassandra. Include drivers rather than separate install. Add limited mustache on statements. Performance metrics.

0.0.7 Use new feature in postgresql to return columns as array

0.0.6 fix bug with postgresql when parameters > 9.

0.0.4 fix bug on statement.

0.0.3 fix bug with error handling and arrays. Add pg in to package dependencies. More debug details.

0.0.2 get rid of monetdb warning. Add in access to flow.get env.get, global.get

0.0.1 base


Author

Peter Prib