Sign inSign up

navinp/sqlite-webapi

By navinp

•Updated about 6 years ago

Docker image for SQLITE data retrieval in rest API format. GUI and Interface with Grafana.

Image
1

357

navinp/sqlite-webapi repository overview

⁠SQLITE WEB API - INTERFACE TO SQLITE DATABASE

docker run -p 5000:5000 -v /path-to/sqlite-database/data:/usr/src/app/data -e SQLITE_DB="yoursqlite.sqlitedb" -d sqlite-webapi

⁠Rest API Requests

http://localhost:5000/⁠ - Docker Healthcheck URL - returns 'active' when up.

http://localhost:5000/read/select⁠ [sqlite query] - Query data without header in JSON format

http://localhost:5000/raw/select⁠ [sqlite query] - Query SQLite data with column header in JSON format

http://localhost:5000/write/⁠ - Pass Query JSON object via POST method for updating, deleting, inserting data into the SQLITE database

⁠Examples:

Try the below from browser

http://localhost:5000/read/select * from sqlite_master

Try the below from a webpage

{ "query":"insert into logs (log_text) values ( 'Hello World!' );" }

⁠Interfacing with Grafana

Install Simple Json

From Simple Json Datasource Connect to sqlite-webapi from dropdown

Use query http://localhost:5000/query - Grafana to query time series data or table data from SQLITE database.

⁠SQLITE GUI

  1. create table webapi_hist in your database as below

CREATE TABLE quries_history ( query text, time integer not null default (strftime('%s','now')))

  1. http://localhost:5000/report⁠ - GUI to query SQLITE database. Saves history commands as well.

Tag summary

Content type

Image

Digest

Size

30.2 MB

Last updated

about 6 years ago

docker pull navinp/sqlite-webapi