Merged
Conversation
nwinsen
reviewed
Jul 29, 2025
nwinsen
approved these changes
Jul 29, 2025
There was a problem hiding this comment.
Pull Request Overview
This PR migrates the project from SQLAlchemy ORM with custom base classes to SQLModel, combining Pydantic models with SQL table definitions. The change modernizes the codebase by leveraging SQLModel's integration of Pydantic for better type safety and validation.
- Replaced SQLAlchemy ORM imports and patterns with SQLModel equivalents
- Updated dependencies to include sqlmodel and upgraded FastAPI and Python versions
- Refactored database models, CRUD operations, and session management to use SQLModel
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| requirements.txt | Added sqlmodel dependency and upgraded FastAPI, Python, and other packages |
| app/models/v1/user.py | Converted User model from SQLAlchemy ORM to SQLModel with Field definitions |
| app/models/mixin.py | Created new TimestampMixin using SQLModel Field with SQLAlchemy column options |
| app/db/session.py | Updated session creation to use SQLModel Session class |
| app/db/base.py | Replaced custom Base class with SQLModel |
| app/crud/v1/base.py | Refactored CRUD base class to use SQLModel patterns and db.exec() methods |
| app/crud/v1/crud_user.py | Updated user CRUD operations to use SQLModel select statements |
| Multiple API endpoints | Updated imports from sqlalchemy.orm.Session to sqlmodel.Session |
| app/api/v1/deps.py | Refactored database session management and query patterns |
| Dockerfile | Upgraded Python version from 3.10 to 3.13 |
Comments suppressed due to low confidence (1)
project-api/requirements.txt:17
- The version 0.0.24 for sqlmodel appears to be non-existent. The latest stable version as of my knowledge cutoff is 0.0.22. Please verify this version exists or use a known stable version like 0.0.22.
sqlmodel==0.0.24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I did
Updated dependencies and code to use sqlmodel where applicable
Why I did it
Requested change + better with pydantic
How to test it