Flask does not ship an ORM. Options: Approach When sqlite3 / DB-API driver small apps, learning, full SQL control Flask-SQLAlchemy most apps — models, sessions, relationships Flask-Migrate (Alembic) schema migrations for SQLAlchemy models The connection-per-request pattern Open a connection lazily, store it on g, and close it in teardownappcontext. Always use parameterised queries (? placeholders) — never format user input into SQL. Flask-SQLAlchemy in brief