Performance: SQL injection prevention
CRITICAL IMPACT
This concept affects page load speed indirectly by preventing slow database queries and security risks that can degrade user experience.
from sqlalchemy import text user_input = request.args.get('id') query = text("SELECT * FROM users WHERE id = :id") result = db.engine.execute(query, {'id': user_input})
user_input = request.args.get('id') query = f"SELECT * FROM users WHERE id = {user_input}" result = db.engine.execute(query)
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Unsafe string concatenation in SQL | 0 (backend only) | 0 | 0 | [X] Bad |
| Parameterized queries with SQLAlchemy | 0 (backend only) | 0 | 0 | [OK] Good |