node-red-contrib-hana-sql 1.0.6

Node-RED node to run SQL statements against a SAP HANA database

npm install node-red-contrib-hana-sql

node-red-contrib-hana-sql

A Node-RED node to read and write to a SAP HANA database.

Install

Either use the Node-RED Menu - Manage Palette - Install, or run the following command in your Node-RED user directory - typically ~/.node-red

npm i node-red-contrib-hana-sql

Usage

Allows basic access to a SAP HANA database.

This node uses the query operation against the configured database. This does allow both INSERTS and DELETES.

By its very nature it allows SQL injection... so be careful out there...

The msg.topic must hold the query for the database, and the result is returned in msg.payload.

Typically the returned payload will be an array of the result rows.

If nothing is found for the key then null is returned.

The reconnect retry timeout in milliseconds can be changed by adding a line to settings.js

hanaReconnectTime: 30000,

The connection pool size can also be changed in settings.js

hanaPoolSize: 10,

An SSL connection can be enabled on the configuration node by switching on Encrypt (and optionally Validate Certificate).

Preparing Queries

msg.payload=[24, 'example-user'];
msg.topic="INSERT INTO users (`userid`, `username`) VALUES (?, ?);"
return msg;

with named parameters:

msg.payload={}
msg.payload.userToChange=42;
msg.payload.newUsername="example-user";
msg.topic="INSERT INTO users (`userid`, `username`) VALUES (:userToChange, :newUsername);"
return msg;

Documentation

Documentation of the SAP HANA client

Node Info

Version: 1.0.6
Updated 1 day ago
License: Apache-2.0
Rating: not yet rated

Categories

Actions

Rate:

Downloads

0 in the last week

Nodes

  • HanaDatabase
  • hana

Keywords

  • node-red
  • sap
  • sap-hana
  • hana
  • sql

Maintainers