* Add SQL query executor

* Move mermaid.min.js to static asset
* Create templates for sql logic
This commit is contained in:
Peter Stockings
2024-11-06 23:25:25 +11:00
parent 3a07b9d97f
commit 0f55d42f22
9 changed files with 2147 additions and 19 deletions

4
db.py
View File

@@ -10,7 +10,7 @@ from features.calendar import Calendar
from features.exercises import Exercises
from features.stats import Stats
from features.workout import Workout
from features.sql_viewer import SQLViewer
from features.sql_explorer import SQLExplorer
from utils import count_prs_over_time, get_all_exercises_from_topsets, get_exercise_graph_model, get_stats_from_topsets, get_topsets_for_person, get_weekly_pr_graph_model, get_workout_counts, get_workouts
@@ -20,7 +20,7 @@ class DataBase():
self.stats = Stats(self.execute)
self.workout = Workout(self.execute)
self.exercises = Exercises(self.execute)
self.sql_viewer = SQLViewer(self.execute)
self.sql_explorer = SQLExplorer(self.execute)
db_url = urlparse(os.environ['DATABASE_URL'])
# if db_url is null then throw error
if not db_url: