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-odbc

v2.0.0-beta.0

Published

Node-RED node for making ODBC connections

Downloads

14

Readme

node-red-contrib-odbc

A Node-RED node for making queries and calling procedures through an ODBC connection. Uses the odbc package as the database connector.


Installation

There are two ways to download this package:

  1. From the Node-RED ediot menu, select Manage pallete, then click the Install tab and search for this package.

  2. In your Node-RED user directory (usually ~/.node-red/), download through the npm utility:

    npm install node-red-contrib-odbc

For the odbc connector requirements, please see the documentation for that package.


Usage

node-red-contrib-odbc provides three nodes:

  • ODBC pool: A configuration node for defining your connection string and managing your connections
  • ODBC query: A node for running queries with or without parameters
  • ODBC procedure: A node for calling procedures and functions

ODBC pool

A configuration node that manages connections in an odbc.Pool object. Can take any configuration property recognized by odbc.pool(). The connection pool will initialize the first time a ODBC query node or ODBC pool node runs.

Properties

  • (required) connectionString: <string>

    An ODBC connection string that defines your DSN and/or connection string options

    Example:

    DSN=MyDSN;DFT=2;
  • (optional) initialSize: <number>

    The number of connections created in the Pool when it is initialized

  • (optional) incrementSize: <number>

    The number of connections that are created when the pool is exhausted

  • (optional) maxSize: <number>

    The maximum number of connections allowed in the pool before it won't create any more

  • (optional) shrinkPool: <boolean>

    Whether the number of connections should be reduced to initialSize when they are returned to the pool

  • (optional) connectionTimeout: <number>

    The number of seconds for a connection to remain idle before closing

  • (optional) loginTimeout: <number>

    The number of seconds for an attempt to create a connection before returning to the application

ODBC query

A node that runs a query when input is received. This node can define its own query string and/or parameters, as well as take a query and/or parameters as input. Input values will override any node properties.

Properties

  • (required) connection: <ODBC pool>

    The ODBC pool node that defines the connection settings and manages the connection pool used by this node

  • (optional) query: <string>

    A query string that can optionally contain parameter markers

  • (optional) parameters: <array<any>>

    The parameters to bind to the query string, passed as a JavaScript array. If this property is set with the Node-RED editor, it is a valid JSON string that will be converted to JavaScript.

Inputs

The ODBC query node accepts a payload input that is either a valid JSON string or a JavaScript object with "query" and/or "parameters" properties. These values, when passed on the payload, override node properties.

  • (optional) payload.query <string>:

    A query string that can optionally contain parameter markers

  • (optional) payload.parameters: <array<any>>

    The parameters to bind to the query string. This is either an array in a JSON string, or a JavaScript array.

Outputs

Sends a message with a payload that is the results from the query

ODBC procedure

A node that calls a procedure when input is received. This node can define its own set of catalog, schema, procedure, and parameters to pass to the procedure, as well as take these values as input. Input values will override any node properties.

Properties

  • (required) connection: <ODBC pool>

    The ODBC pool node that defines the connection settings and manages the connection pool used by this node

  • (optional) catalog: <string>

    The catalog that contains the procedure

  • (optional) schema: <string>

    The schema that contains the procedure

  • (optional) procedure: <string>

    The name of the procedure

  • (optional) parameters: <array<any>>

    The parameters to send and/or return from the procedure, passed as a JavaScript array. If this property is set with the Node-RED editor, it is a valid JSON string that will be converted to JavaScript.

Inputs

The ODBC procedure node accepts a payload input that is either a valid JSON string or a JavaScript object with "catalog", "schema", "procedure" and/or "parameters" properties. These values, when passed on the payload, override node properties.

  • (optional) payload.catalog <string>:

    The catalog that contains the procedure

  • (optional) payload.schema <string>:

    The schema that contains the procedure

  • (optional) payload.procedure <string>:

    The name of the procedure

  • (optional) payload.parameters: <array<any>>

    The parameters to bind to the query string. This is either an array in a JSON string, or a JavaScript array.

Examples:

  • JSON string:

    "{"catalog": null, "schema": "MY_SCHEMA", "procedure": "MYPROC", "parameters": [null, 123, "value"]}"

  • JavaScript object:

    { catalog: null, schema: "MY_SCHEMA", procedure: "MYPROC", parameters: [null, 123, "value] }

Outputs

Sends a message with a payload that is the results of the procedure call