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

Supporting SQLAlchemy Core and old versions of SQLAlchemy #14

Merged
merged 2 commits into from
May 15, 2024

Conversation

vshender
Copy link
Contributor

When trying to use atlas-provider-sqlalchemy, a number of problems were identified:

  1. The provider only supports SQLAlchemy ORM models, not SQLAlchemy Core tables.

  2. During its work the provider imports files with models, which means that the dependencies that the project requires must be installed (e.g. pgvector-python), which means it's easiest to run the provider in the virtual environment of the project itself. At the same time, the provider has a specific version of SQLAlchemy in its dependencies, which may not be compatible with the version of the library used by the project.

(We at PandaDoc have encountered both of these problems because we use SQLAlchemy Core and the SQLAlchemy version is 1.4).

This pull request attempts to solve both of these problems as follows:

  1. Added support for SQLAlchemy Core tables.

  2. Added support for different versions of SQLAlchemy. To do this, SQLAlchemy was removed from the atlas-provider-sqlalchemy dependencies (implying that the SQLAlchemy version of the project for which the provider will run will be used) and the code was rewritten so that the provider works with SQLAlchemy versions 1.2, 1.3, 1.4, and 2.0. Tox is used for testing all these versions.

  3. Small cosmetic changes have also been made (consistent using of quotes, not exiting from the library code and throwing exceptions instead, etc.)

@vshender vshender force-pushed the bunch-of-improvements branch 3 times, most recently from a66e64c to 2dba6de Compare May 13, 2024 11:57
@vshender
Copy link
Contributor Author

I'm sorry, I don't know why one of the integration tests is failing. I didn't make any changes that could cause one integration test to fail while the others passed, so I suspect the problem is not with the pull request.

@ronenlu
Copy link
Member

ronenlu commented May 13, 2024

@vshender Thank you for your contribution!
You are right, the reason the integration test is failing is not the PR, its because it requires repo secret to run.
Since your PR is from forked repo that doesnt contain the required secret, the test fails.

@ronenlu ronenlu merged commit eb38580 into ariga:master May 15, 2024
4 of 5 checks passed
@ronenlu
Copy link
Member

ronenlu commented May 15, 2024

@vshender You can download the latest release: https://pypi.org/project/atlas-provider-sqlalchemy/

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.

None yet

2 participants