Migrate from SQL templates to SQLAlchemy
Closed this issue · 0 comments
PaulCCCCCCH commented
Background: we execute raw SQL statements and SQL templates when creating the database or performing operations. These are defined in back-end/utils/db.py
and back-end/utils/db_ops.py
.
This makes our database workflow overly complex. It's better to use an ORM library instead. SQLAlchemy
is one of the most widely used ORM library for Python and it integrates the best with Flask.
The task is to rewrite the definition of all data tables with Python class
and replace our own wrapper functions with SQLAlchemy
operations.