I mainly use raw sqlite expressions in my flask apps. I recently started to play with flask-SQLAlchemy. I would like to know what is the main advantage to use sqlalchemy over RAW sqlite expressions in my app. I know that with ORM I am not locked in one database engine and I can switch to Mysql for example without changing ORM code. Are there any other advantages?
In my flask app I use:
from flask import g
import sqlite3
@app.before_request
def before_request():
g.db = sqlite3.connect(DATA_DIR + "/myDB.db")
@app.teardown_request
def teardown_request(exception):
if hasattr(g, 'db'):
g.db.close()
In this case when I want to change DB structure I simply use smart app like Navicat and then I update raw statements. In SQLAlchemy it is little pain to change structure. Thank you very much in advance.