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

feat!: Refactor most of the files for tests to pass on sqlalchemy2. #232

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bvanelli
Copy link

@bvanelli bvanelli commented Jun 28, 2024

Add supports to SQLAlchemy 2.0, at least where the tests are concerned:

  • Migrate all references of relation to relationship instead
  • Use session.add() for all objects that were not added to the session. Previously, the objects were added immediately after an instance was created
  • Added engine.dispose on the book close to make sure the database can be deleted.
  • Modified all tests to use the open_book() as a contextmanager, to prevent the deleting of the database files to raise an error of being opened in another process
  • Replace references to engine.execute by conn.execute instead.
  • Bumped some versions on requirements to make it installable for me (windows 10, python 3.10), but I believe some other versions can be bumped too.

Closes #218

TODOS:

  • Correct examples/ files, as they also need to use the new format from sqlalchemy
  • Change documentation where is required
  • Fix failing test def test_create_with_FK(self): that I could not fix

BREAKINGCHANGE: Some older versions of sqlalchemy might not be supported
anymore.
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.

Support sqlalchemy 2.0
1 participant