Skip to content

Sqlmodel update#18

Merged
ChaseHutcheson merged 6 commits intomainfrom
sqlmodel-update
Jul 29, 2025
Merged

Sqlmodel update#18
ChaseHutcheson merged 6 commits intomainfrom
sqlmodel-update

Conversation

@ChaseHutcheson
Copy link
Contributor

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

  • [ ]

This comment was marked as outdated.

@dev-youngstown dev-youngstown deleted a comment from Copilot AI Jul 29, 2025
@nwinsen nwinsen requested review from Copilot and nwinsen July 29, 2025 17:58
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@ChaseHutcheson ChaseHutcheson merged commit 0f18d50 into main Jul 29, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants