initial realease
Either use the Node-RED Menu - Manage Palette - Install menu, or run the following command in your Node-RED user directory - typically ~/.node-red
npm install node-red-contrib-iris
In the ~/.node-red/settings.js
file add module in (already existing) functionGlobalContext
:
functionGlobalContext: {
// os:require('os'),
iris: require('./node_modules/node-red-contrib-iris/intersystems-iris-native'),
}
You can find the API package under .node-red/node_modules/node-red-contrib-iris/intersystems-iris-native
. Please check the README file for supported operating systems. If your OS is not supported you can get the API from your Intersystems IRIS instance under: ~/IRIS/dev/nodejs/intersystems-iris-native
.
See the documentation for how to load additional modules into Node-RED.
Go to raw.githubusercontent. Do a right click on the page and choose Save Page As… . Afterwards go to the InterSystems Management Portal and navigate to System Explorer > Classes and click on Import. There you select the file you just downloaded and click Import.
When you only operate in one namespace, import the class into this namespace. When you have multiple namespaces you want to have access to, map the class to namespace %ALL.
Set connection properties via the node properties. The Node will build a connection when you deploy and will hold that connection up until you redeploy or disconnect manually.
You can set the default properties in ~/.node-red/node_modules/node-red-contrib-iris/ServerProperties.json
. Or use the SetServerProperties flow under Import > Examples > node-red-contrib-iris > SetServerProperties.
The nodes are secure against SQL injection by parametrize the statements.
Pass the SQL statement as a string in the msg.data field and the node will parameterize the statement itself.
msg.data = "SELECT * FROM NodeRed.Person WHERE Age >= 42 AND Name = 'Max' ";
Or a parameterized statement:
msg.data = {
sql: 'SELECT * FROM NodeRed.Person WHERE Age >= ? AND Name = ? ',
values: [42, 'Max'],
};
See Node description for further informations.
Does not work:
msg.data = "SELECT * FROM NodeRed.Person WHERE Name = 'Smith, John'";
But this will work:
msg.data = {
"sql":"SELECT * FROM NodeRed.Person WHERE Name = ?,
"values":["Smith, John"]
}
npm
GitHub
nodered.org
CHANGELOG
InterSystems Developer Community
by Philipp B.
Powered by InterSystems.