You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simplify the database session management and CLI tooling to delegate to standard SQLAlchemy/Alembic rather than wrapping them.
rx.session Changes
Becomes a thin context manager over sqlalchemy.orm.Session
Configured via REFLEX_DB_URL environment variable (or [tool.reflex] config)
No custom session subclass, no framework-specific session logic
Supports both sync and async sessions via standard SQLAlchemy APIs
reflex db CLI Changes
reflex db init → generates a standard alembic.ini and alembic/ directory, pre-configured with REFLEX_DB_URL
reflex db makemigrations → delegates to alembic revision --autogenerate
reflex db migrate → delegates to alembic upgrade head
No custom migration/autogenerate logic — standard Alembic handles everything
Users who outgrow the convenience wrapper can use alembic directly with zero friction
Motivation
The current implementation wraps Alembic with custom logic that occasionally diverges from standard behavior, creating confusion for users familiar with Alembic. By delegating to standard tooling, we reduce maintenance burden and make the Reflex database experience identical to the broader Python ecosystem.
Activity
linear commentedon Mar 25, 2026
ENG-9188