Browse by Topic
Popular
Popular Posts
Latest
Latest Python Posts
Python Alembic: Add, Drop, and Rename Columns
Learn how to add, drop, and rename columns with Alembic migrations in Python, including batch operations for SQLite and the key data-loss and locking trade-offs.
Python Alembic Autogenerate with SQLAlchemy
Learn how Alembic autogenerate compares SQLAlchemy models to your database, how to configure `env.py`, and how to review or edit the migrations it generates.
Python Alembic Migrations: Revision, Upgrade, and Downgrade
Learn how to create, apply, and revert Alembic migrations in Python with the revision, upgrade, and downgrade commands.
Python SQLAlchemy ORM vs Core: Which to Use
python sqlalchemy orm vs core: Compare SQLAlchemy Core and ORM APIs: their design, query construction, performance tradeoffs, and which to pick for your Python project.
Fixing the Python SQLAlchemy N+1 Problem
python sqlalchemy n plus one problem: Learn how the N+1 query problem appears in SQLAlchemy, how to detect it, and how joinedload and selectinload fix it without sacri...
Python SQLAlchemy Connection Pooling
Understand SQLAlchemy connection pooling in Python: pool types, capacity settings, preventing stale connections, and diagnosing pool timeouts.
SQLAlchemy Async Engine and Async Session Explained
python sqlalchemy async engine and async session: Understand how SQLAlchemy's AsyncEngine and AsyncSession wrap the sync ORM, run queries with await, manage transactio...
SQLAlchemy Lazy vs Eager Loading: joinedload and selectinload
Understand why SQLAlchemy's default lazy loading causes N+1 queries, and how eager loading with joinedload and selectinload avoids the problem.
SQLAlchemy Transactions: Commit, Rollback, Flush, and Refresh
Understand SQLAlchemy session transactions: flush, commit, rollback, and refresh — how each operation sends SQL, ends transactions, and syncs object state.
Python SQLAlchemy Subqueries, EXISTS, and Raw SQL
Learn how to use SQLAlchemy subqueries and EXISTS clauses, and when raw SQL is the better choice, with practical Python examples and tradeoffs.