Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLite as Datasource #18376

Closed
fr-ser opened this issue Aug 4, 2019 · 11 comments
Closed

SQLite as Datasource #18376

fr-ser opened this issue Aug 4, 2019 · 11 comments

Comments

@fr-ser
Copy link

fr-ser commented Aug 4, 2019

What would you like to be added:

I would like to use SQLite as a datasource.

Why is this needed:

Many smaller IoT applications use SQLite as their storage and it is not always trivial to change that behavior.

I would also be willing to implement this feature myself, I am just wondering where to start and if this is a good idea at all.

@com2u
Copy link

com2u commented Aug 5, 2019

Great idea! I like this feature as well.

@renaudrenaud
Copy link

Interesting. I have plenty of use cases for this!

@fr-ser
Copy link
Author

fr-ser commented Aug 6, 2019

As far as I currently see it, this would be a change in the Grafana source code (and not a plugin).

If any core member gives this idea a "get-go" I would try to tackle it. Any further information or possible pitfalls would also be very much appreciated 😉

@micelshima
Copy link

Thumbs Up!

@ilgrank
Copy link

ilgrank commented Sep 27, 2019

I fully agree, a SQLite plugin would be sweet. Native support would be even better.
Alas, the devs already commented that they won't add SQLite as an internal datasource and no one seems to be developing an SQLite input plugin.
See: #1542 (adlerweb comment on 27 Sep 2018)

@fr-ser
Copy link
Author

fr-ser commented Sep 27, 2019

Hmm. In that case I guess I'll look into Plugins a bit more. My previous assumption was, that plugins only work in the frontend via HTTP requests, but maybe not... I'll check it out later...

@freekvh
Copy link

freekvh commented Jan 10, 2020

So, this is not happening? Would be sweet with the default home-assistant docker...

@jonathanlb
Copy link

While it's not a totally generic SQL source, it's relatively straightforward to use Express/Fiber/etc to expose some SQLite queries to Grafana's simple-json-datasource.

For example, sqlite32grafana exposes SQLite3 columns as timeseries to Grafana.

@fr-ser
Copy link
Author

fr-ser commented Oct 11, 2020

I created a plugin that queries an SQLite reachable on the Grafana host (can be through a network drive).
I would consider this the first step towards my goal.

https://github.com/fr-ser/grafana-sqlite-datasource

This solves the case where Grafana and SQLite are hosted on the same device. A second use case would be SQLite on the same machine as the user and Grafana hosted somewhere else. This is still open

@kevinvh001
Copy link

Hi fr-ser,
I use Grafana on my MacBook Pro to visualise live data ported from Victron-Venus_Docker_Grafana. The data is ported to Grafana via http://localport:3000 and it works well.
I wish to visualise similar historical data stored on my hard drive. I am struggling because I have no programming capability or understanding of database structures.
I installed your SQLite plugin on my Venus-Docker_Grafana installation, but it will not accept the Path "/Users/kevinhiscox/Documents/sqlite3/GXData.sqlite3". It cannot find the database file which is definitely on my HD. I suspect the issue is caused by Grafana receiving the live data from http://localport:3000.
I them quit Venus-Docker_Grafana and installed a standalone Grafana installation with "brew install grafana". I started Grafana with Terminal and then opened Grafana in Safari using http://localport:3000. OK - new clean Grafana installation. I then tried installing your SQLite plugin but when I clicked on DataSources, I got a message saying "The following plugins are disabled and not shown in the list below:
frser-sqlite-datasource Modified signature"
Can you help me please?

@fr-ser
Copy link
Author

fr-ser commented May 31, 2021

@kevinvh001 Please open an issue in the plugin-repo if you are experiencing problems: https://github.com/fr-ser/grafana-sqlite-datasource/issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants