Update SQLite database via REST API

Hello everyone,

I was wondering if it would be possible to update an SQLite3 database via the REST API using Grafana v8.2.5 with the SQLite3 plugin and Ubuntu 20.04.
So far I have been able to query and retrieve data from the SQLite3 database using the API-URL /api/ds/query described in:

In order to Update the database I tried to use the same POST method using a different query for example “CREATE TABLE TEST (test text)”. The response
{“results”:{“A”:{“frames”:[{“schema”:{“name”:response",“refId”:“A”,“meta”:{executedQueryString":“CREATE TABLE TEST (test text)”}, “fields”:},“data”:{“values”:}}]}}}
indicates the SQLite3 command has been executed successfully. However checking the database, the new table has not been created. So I was wondering if there is some kind of PUT method to update the SQLite3 database, which I am not able to find? Or could this even be some kind of Linux permission issue?

Thank you in advance.

welcome to the :grafana: forum, @maxmustermann20022

are you using this data source plugin?

1 Like

Hello @mattabrams ,

thank you. Yes, that’s the plugin Im using to handle SQLite data bases.

hmmm, I’ve never used that third-party data source plugin. Here is the official repo. It looks very well maintained, so I would maybe make an issue there.

I think most data source plugins communicate with their database counterparts on a read-only level, for security reasons.

In other words, these plugins generally GET data out, not PUT or POST data in…

1 Like
1 Like

Yeah I thought so too. I wrote an own API as a workaround.

Thank you very much for your help.

1 Like

This can give you a REST api over a SQLite database if that helps

1 Like