Giter Club home page Giter Club logo

node-red-nodes-cf-sqldb-dashdb's Introduction

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.

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

node-red-nodes-cf-sqldb-dashdb's People

Contributors

navargas avatar smchamberlin avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.