~guoqiao/charm-grafana:LPBug-1685179-hardcoded-sqlite-id

Last commit made on 2020-01-13
Get this branch:
git clone -b LPBug-1685179-hardcoded-sqlite-id https://git.launchpad.net/~guoqiao/charm-grafana
Only Joe Guo can upload to this branch. If you are Joe Guo please log in for upload directions.

Branch merges

Branch information

Name:
LPBug-1685179-hardcoded-sqlite-id
Repository:
lp:~guoqiao/charm-grafana

Recent commits

9abc82a... by Joe Guo

add .gitignore to ignore __pycache__

Signed-off-by: Joe Guo <email address hidden>

903cd88... by Joe Guo

add unit_tests

Signed-off-by: Joe Guo <email address hidden>

31b8f7a... by Joe Guo

add reactive/__init__.py

Signed-off-by: Joe Guo <email address hidden>

f18a856... by Joe Guo

add param conn to help test for update_or_create_datasource

so we can use a test sqlite conn in tests.

Signed-off-by: Joe Guo <email address hidden>

9868698... by Joe Guo

rename check_datasource to update_or_create_datasource

The original name is not accurate for what this function is doing.

Signed-off-by: Joe Guo <email address hidden>

94fa29e... by Joe Guo

improve check_datasource

use sql condition to get datasource directly instead of for loop

Signed-off-by: Joe Guo <email address hidden>

c598c96... by Joe Guo

simplify values placeholder generate in get_ds_insert_sql

Signed-off-by: Joe Guo <email address hidden>

3f698eb... by Joe Guo

split generate_query into get_ds_update_sql and get_ds_insert_sql

No need to mix update and insert in one function here.

Signed-off-by: Joe Guo <email address hidden>

04204be... by Joe Guo

fix missing where condition in sql

While updating datasource record, the where condition is missing in sql.
Normally there is only 1 record, so it still worked before.

Signed-off-by: Joe Guo <email address hidden>

c2fbef4... by Joe Guo

add get_sqlite_db to remove duplicated code

Signed-off-by: Joe Guo <email address hidden>