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

Update for SQL Alchemy 2 #385

Draft
wants to merge 211 commits into
base: master
Choose a base branch
from
Draft

Update for SQL Alchemy 2 #385

wants to merge 211 commits into from

Conversation

martinburchell
Copy link
Collaborator

@martinburchell martinburchell commented Jan 31, 2025

Fixes #322

This started to cause problems with pytest with:

from alembic.config import Config

Python was looking in server/camcops_server/alembic
This doesn't have any effect because SQL Alchemy is loaded first with -W error::sqlalchemy.exc.RemovedIn20Warning on the command line
Note that this won't work unmodified with SQL Alchemy 1.4 because of the failed import of Double
from sqlalchemy.types
get_rows_fieldnames_from_query() no longer supported with SQLAlchemy 2.0
Include fixed cardinal_pythonlib which closes the connection to the database after getting the version table.
and rename it to temp_session (and temp_engine).
It looks like we can't use MappedColumn in places where we are setting the type in the
arguments, so we need a non-mapped version as well.
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.

Update to SQLAlchemy 2.0
1 participant