Supporting SQLAlchemy Core and old versions of SQLAlchemy #14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When trying to use
atlas-provider-sqlalchemy
, a number of problems were identified:The provider only supports SQLAlchemy ORM models, not SQLAlchemy Core tables.
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:
Added support for SQLAlchemy Core tables.
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.Small cosmetic changes have also been made (consistent using of quotes, not exiting from the library code and throwing exceptions instead, etc.)