Node-RED SQLITE stores Data Base on windows

#1

Hi there !

I wanna store the temperature measurement and the time when the measurement was done; actually works fine on my flow (I've a UI to display the table, I made it using dashboard), the problem is I don't know where the sqlite node save the data base file, I can't find it ... I tried using the file node but doesn't works ...

OS: Windows 10 pro x64
sqlite: https://flows.nodered.org/node/node-red-node-sqlite

0 Likes

#2

what are the node configuration options?

0 Likes

#4

thanks ukmoose...

0 Likes

#5

OK so the sqlite node will save to the sqlite database that you must have installed separately.

0 Likes

#6

Well, that's a problem, I've not installed sqlite database separately ... I searched in google and found this tutorial: http://noderedguide.com/tutorial-sqlite-and-node-red/ ... Never say that I must install database separately; nevertheless, when start node-red in windows PowerShell show this:

Looks like sqlite already exist: "7 Jul 19:27:02 - [info] [sqlitedb:2536932f.016bcc] opened sqlite ok"

0 Likes

#7

Please, could you explain me how its works?

0 Likes

#8

Absolutely no idea!
My experience is primarily based on these tutorials for the Raspberry Pi.

http://randomnerdtutorials.com/sqlite-with-node-red-and-raspberry-pi/

Which starts off by stating "Install SQLlite"

0 Likes

#9

Not sure what you mean by that. It seems that it is working (other than, obviously, the flow is trying to create a table that has already been created once.

0 Likes

#10

I have no problem with the flow, works OK ... I wanna know where the sqlite node saves (in my windows PC ) the database called "sqlite" ... in previous replies I posted the setting sqlite node (Node-RED SQLITE stores Data Base on windows)

In this reply: Node-RED SQLITE stores Data Base on windows
I'm saying that the node "sqlitedb:2536932f.016bcc" open the database called "sqlite", but I don't know where the file is ....

0 Likes

#11

Well, this example was usefull: https://medium.com/@supotsaeea/node-red-sqlite-d78a57ec4561

I assumed that the database file made by sqlite node will be save in C:\Users_username_.node-red ... I was wrong, I don't know where is

0 Likes

#12

I don't use windows but presumably there is a search program that you could use to find it. However in Linux you can specify a full path to the file, so presumably you can do that in windows too.

0 Likes

#13

@kharlos04 I ran into the same issues - plenty of Linux tutorials... that don't seem to work under Windows.

Here is the solution that I found: https://github.com/mpolinowski/nodered-sqlite

Mostly a best-of from the tutorials - but verified to work under Windows 10.

TL;DR

1.) Install SQLite
2.) Use the CLI tool to create a database, e.g. inside the .node-red installation folder (be aware that the file is not created right away - you can call .databases from the SQLite3 tool to have it show up)
3.) Install the sqlite node in node-red, drag the node into your flow and type in the absolute path to the .db file created in the step above.

0 Likes

#14

The clue is in the background default text. Put in an absolute path. If you don't put in any path, it will create it in your userDir folder (default ~/.node-red).

If you don't start the name with an absolute path, the path will be relative to the userDir folder.

You should perhaps raise an issue (or do a pull request) on the node-red-nodes github in order to improve the documentation.

0 Likes