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

v0.1.0

Published

Crate DB support for Node-RED

Downloads

8

Readme

Crate Client for Node-RED

NPM

An independently-made Node-RED wrapper for the Crate elastic data store, installed locally or anywhere else that can be referenced by a URL. There are both input and output nodes included for interacting with the Crate HTTP endpoint API.

Please note: Crate is a trademark of Crate Technology Gmbh, registered in the E.U. and in other countries.

What's all this about?

Calm down, you're safe here. I'll explain everything.

Node-RED

From Node-RED's own web page:

Node-RED is a tool for wiring together hardware devices, APIs and online services in new and interesting ways.

Crate

From Crate's own web page:

Crate is a new breed of database to serve today’s mammoth data needs. Based on the familiar SQL syntax, Crate combines high availability, resiliency, and scalability in a distributed design that allows you to query mountains of data in realtime, not batches.

We solve your data scaling problems and make administration a breeze. Easy to scale, simple to use.

Installation

Run this command in the root directory of your Node-RED installation:

npm install node-red-contrib-crate

Note that this will also install the nodes' sole dependency - node-crate, on which this Node-RED package is built. All credit to megastef - you the man.

Usage

Once installed (and after restarting Node-RED and refreshing its page in your browser), you'll see some nodes labelled "crate" in your node locker under the 'storage' section.

The node with both an input and an output is (confusingly) our input node. This node allows you to get information from your crate database.

The node with only an input is our output node. This allows you to send information to your crate database and save it there.

When you drag either node to your workspace, you'll need to open its options and either add a crate database (if you haven't already), or select one. Adding a database is as simple as pasting in the database's _sql HTTP endpoint URL.

For the output node you can specify a table to send the information to in the node's options.

Both nodes take their information from a msg object passed to them. Below are the specs for each node's msg inputs. Note that these are also visible if you select a node in Node-RED and view the info tab on the right of the screen.

Ouput node msg object

  • msg.table (semi-optional): Specify which table to insert the data into (this will override the option entered in the node config window if set, allowing you to use one output node to send to multiple tables). Note that table must be set either in the node options or in this property.
  • msg.data (required): The JS data object you want to insert in the table, in the form { columnName1: 'value1', columnName2: 'value2' }.
  • msg.where (optional): Makes the insert an update action instead, where your string condition is met, e.g. 'columnName3=5'.

Input node msg object

  • msg.query (required): An sql-style string query, for example:
"select * from tweets where text like ?"
  • msg.args (required): Arguments for your query, in an array, e.g. ['%crate%'].

Features

Currently, the output node provides support for:

  • Inserts
  • Updates
  • One output node can provide access to multiple tables within a Crate database through use of the msg.table property passed to it that can override options set on the node.

The input node provides support for:

  • Querying

For more on these features and how they work in Crate, check out their docs.

Roadmap

  • BLOBs
  • Bulk actions