Replace SQLModel completely with SQLAlchemy
Is your feature request related to a problem?
SQLModel has limited async support and lacks proper documentation. To fully use async or advanced ORM features, we often end up reaching into the underlying SQLAlchemy anyway. This creates confusion, inconsistent patterns, and adds unnecessary complexity to the codebase.
Describe the solution you'd like
Migrate the project to use SQLAlchemy directly for all ORM and database-related functionality. This will give us:
- Full async support with proper documentation.
- Direct access to all SQLAlchemy features without relying on a wrapper.
- A more maintainable and future-proof solution, since SQLAlchemy is actively developed and widely supported.
Describe alternatives you've considered
- Continuing with SQLModel and patching around its limitations. (Not ideal, leads to tech debt.)
Feature Category
Implementation Details (if you have ideas)
- Replace all model definitions that currently inherit from
SQLModel with pure SQLAlchemy declarative_base() models.
- Use Pydantic (or Pydantic v2
BaseModel) strictly for request/response schemas.
- Update dependencies, migrations, and repositories to align with SQLAlchemy patterns.
- Incrementally refactor instead of a “big bang” migration to reduce risk.
Breaking Changes
If breaking changes, please describe what would break and migration path:
- Existing models and migrations will need to be updated to use SQLAlchemy instead of SQLModel.
- Potential impact on code that expects hybrid SQLModel/Pydantic behavior.
- Migration path: refactor models first, then update schemas and repositories.
Additional Context
- SQLModel is not actively maintained.
- Async support is limited and undocumented.
- SQLAlchemy has better long-term viability, active community support, and complete feature set.
Would you be willing to implement this feature?
Related Issues/PRs
Replace SQLModel completely with SQLAlchemy
Is your feature request related to a problem?
SQLModel has limited async support and lacks proper documentation. To fully use async or advanced ORM features, we often end up reaching into the underlying SQLAlchemy anyway. This creates confusion, inconsistent patterns, and adds unnecessary complexity to the codebase.
Describe the solution you'd like
Migrate the project to use SQLAlchemy directly for all ORM and database-related functionality. This will give us:
Describe alternatives you've considered
Feature Category
Implementation Details (if you have ideas)
SQLModelwith pure SQLAlchemydeclarative_base()models.BaseModel) strictly for request/response schemas.Breaking Changes
If breaking changes, please describe what would break and migration path:
Additional Context
Would you be willing to implement this feature?
Related Issues/PRs