Socket
Socket
Sign inDemoInstall

node-red-nodes-cf-sqldb-dashdb

Package Overview
Dependencies
65
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    node-red-nodes-cf-sqldb-dashdb

Node-RED nodes to access SQLDB and dashDB services on Bluemix


Version published
Weekly downloads
64
decreased by-26.44%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

node-red-node-cf-sqldb

Node-RED nodes to work with a database in a SQLDB or dashDB service that is integrated with IBM Bluemix.

Install

Install from npm

npm install node-red-nodes-cf-sqldb-dashdb

Usage

This package contains 4 nodes -- two pairs of nodes for each of SQLDB and dashDB services. The node pairs work almost identically, so the documentation contained here applies to both. For each service, a query and an output node is provided. The query nodes let you issue a query against your SQLDB or dashDB service and pass along the result set in the msg object. The output nodes store elements from the msg object into your SQLDB or dashDB service database.

Query node usage:

You will need to fill in the following fields:

-- Service should point to your SQLDB or dashDB service.

-- Query is the SQL select query you wish to execute on your dashDB service database. If the field is empty, it will get the query from the msg.payload.

These fields are optional:

-- Parameter Markers is a comma delimited set of json paths. These will replace any question marks that you place in your SQL query, in the order that they appear.

-- Name: Optionally give your node a name

The results of your query will be returned as a JSON array in msg.payload. If there are any errors during execution of the query, the payload will be null and the error will be returned in msg.error.

Output node usage:

The output node will get the values to insert from msg.payload.

So for example, you might create a function node that flows into your sqldb output node with code like this:

msg.payload = 
{
  TS : 'TIMESTAMP',
  SCREENNAME : msg.tweet.user.screen_name,
  TWEET : msg.payload,
  SENTIMENT : msg.sentiment.score,
  LOCATION : msg.location
}
return msg;

This would assume that you have a table already created with columns (TS, SCREENNAME, TWEET, SENTIMENT, LOCATION). 'TIMESTAMP' string is a special keyword that the node will replace with a real DB2 timestamp before insertion. If you are missing a required column, an error will be displayed in the debug view.

For output node configuration, you will need to fill in the following fields:

-- Service should point to your SQLDB or dashDB service.

-- Table should point to the table you wish to insert the values into. This table needs to exist already in the database and needs to contain the same number of columns that you are inserting through this node. The data types of the columns have to match. The data coming into the node through the msg.payload needs to be in the format accepted by DB2 and within the appropriate ranges/parameters for that datatype.

The following fields are optional:

-- Name: Optionally give your node a name, otherwise the default will be the table name.

Authors

Keywords

FAQs

Last updated on 20 Feb 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc