Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to SQLAlchemy 2.0 and Pydantic 2.0 #54

Closed
devraj opened this issue Dec 12, 2022 · 1 comment
Closed

Upgrade to SQLAlchemy 2.0 and Pydantic 2.0 #54

devraj opened this issue Dec 12, 2022 · 1 comment
Assignees

Comments

@devraj
Copy link
Member

devraj commented Dec 12, 2022

Is your feature request related to a problem? Please describe.
The template follows the 2.0 syntax (as of SQLAlchemy 1.4.x), 2.0 has entered beta, we should look to move to 2.0 as soon as it's released to ensure we don't lag behind.

While we are there we should also move up Pydantic to v2 which will be dependant on when FastAPI targets the version.

Describe the solution you'd like

  • Upgrade to SQLAlchemy 2 and assess any syntactical changes required
  • Upgrade to Pydantic 2 and see if there are any syntactical changes requires
  • Validate that the Base API still works as expected
  • Document any required changes for migration of existing applications

Describe alternatives you've considered
Not applicable. This is a request for an upgrade

@devraj devraj self-assigned this Dec 12, 2022
devraj added a commit that referenced this issue Jan 9, 2023
sqlalchemy is moving to a declartive syntax, which uses the python type annotation
this is much cleaner and makes the code read a lot better and consistentn with
where fastapi is headed and pydantic

the db package now uses the  class as opposed to the old declarative_base() method
the user model has been moved to using the  syntax

this is the first of the work done on #54
@devraj
Copy link
Member Author

devraj commented Jun 20, 2023

FastAPI is in beta with pydantic v2 support, follow the discussion or beta releases, this will mark an urgency to migrate the stack over these technologies.

devraj added a commit that referenced this issue Jul 2, 2023
moves fastapi and pydantic to the bleeding edge to start migration
of the codebase to use these libraries, this will be a breaking
change and should not be merged in until everything is stable
@devraj devraj closed this as completed Jul 8, 2023
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

No branches or pull requests

1 participant