WIP: Render database schema using Mermaid.js

Still need to:
* Move mermaid.js to static files
* Make template for mermaid wrapper
* Create new page for SQL viewer then add explorer
This commit is contained in:
Peter Stockings
2024-11-06 22:48:51 +11:00
parent 30ba59381c
commit 3a07b9d97f
5 changed files with 127 additions and 0 deletions

2
db.py
View File

@@ -10,6 +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 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
@@ -19,6 +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)
db_url = urlparse(os.environ['DATABASE_URL'])
# if db_url is null then throw error
if not db_url: