Where in the topic field, we have the query CREATE TABLE RANDOMNUM( TIMESTAMP INT PRIMARY KEY NOT NULL, VALUE INT NOT NULL, BOOL INT NOT NULL)Īs you can see, this demo table is called “ RANDOMNUM“, and it has three columns, TIMESTAMP( Primary key column ), VALUE, and BOOL. A simple way to do that is to connect an inject node to the sqlite node and setup the inject node to deliver the SQL command as the message topic. To create a table to store some data, all we need to do is send the appropriate SQL command to the sqlite node. Creating your first tableĪs documented on the info tab of the sqlite node, the node takes in SQL queries in the input msg.topic, and then returns responses in the output msg.payload. We will also look at how to view and manage this data later on. Drag a sqlite node to the empty canvas, and we are ready to move on.įor demo purposes, we are going to create a table and inject random numbers at a constant time interval. Once the sqlite node is installed, you should see the sqlite node in your left panel. In the search field enter sqlite and you will see results similar to the screen shot below.Ĭhoose node-red-node-sqlite and select install. Installing the sqlite nodeįirst, you will need to ensure that you have installed the sqlite node since it is not installed by default in Node-RED.įrom the main menu, select menu->manage palette and then using the manage palette configuration box, select the “Install” tab. If you’re new to Node RED you might find our introductory lectures helpful. Graphing the data from the DB using the standard Node-RED UI nodesįor more information on SQLite take a look at.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |