Browse Source

* Minor fixes

dependabot/pip/gunicorn-22.0.0
Harish.K 7 years ago
parent
commit
187753ce16
  1. 12
      Readme.md
  2. 2
      run.sh
  3. 2
      server.py

12
Readme.md

@ -1,6 +1,6 @@
# SQL chart # SQL chart
Draw chart any SQL queries
Draw chart for any SQL queries
## What is this? ## What is this?
@ -13,6 +13,16 @@ A simple web application to visualize data from any arbitrary SQL query.
* available columns in the data will be shown in UI. visualize the data by dragging columns into required axis. Also choose requied aggregation function for pivot table * available columns in the data will be shown in UI. visualize the data by dragging columns into required axis. Also choose requied aggregation function for pivot table
* Entire state of the graph ( SQL, columns in each axis, aggregation function etc ) is stored in the URL ( in URL hash ) so that we can reload the page without loosing the data. * Entire state of the graph ( SQL, columns in each axis, aggregation function etc ) is stored in the URL ( in URL hash ) so that we can reload the page without loosing the data.
## How to run this
```bash
git clone https://github.com/harish2704/sql-chart
cd sql-chart
pip2 install -r requirements.txt --user
# Edit config file and set database connection url. For details, refer https://docs.sqlalchemy.org/en/latest/core/engines.html
./run.sh
```
## Thanks ## Thanks
* Authors of pivottable ( https://github.com/nicolaskruchten/pivottable ). The UI code is shamelessly copied from one of the examples given in this project. * Authors of pivottable ( https://github.com/nicolaskruchten/pivottable ). The UI code is shamelessly copied from one of the examples given in this project.
* Simple backed api server ( server.js ) is written in https://falconframework.org/. * Simple backed api server ( server.js ) is written in https://falconframework.org/.

2
run.sh

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env bash
[ -f ./env.sh ] && . ./env.sh && export DB_CONNECTION
[ -f ./config ] && . ./config && export DB_CONNECTION
gunicorn server:api gunicorn server:api

2
server.py

@ -6,7 +6,7 @@ import datetime
import os import os
db_url = os.environ[ 'DB_CONNECTION' ] if 'DB_CONNECTION' in os.environ else 'postgresql://postgres@localhost/postgres' db_url = os.environ[ 'DB_CONNECTION' ] if 'DB_CONNECTION' in os.environ else 'postgresql://postgres@localhost/postgres'
eng = sqlalchemy.create_engine(db_url, pool_size=1, pool_recycle=3600)
eng = sqlalchemy.create_engine(db_url, pool_recycle=3600)
conn = eng.connect() conn = eng.connect()
print "Connected to db" print "Connected to db"

Loading…
Cancel
Save