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

Problem with SQLAlchemy 2 DeclarativeBase model imports #26

Open
knucklesuganda opened this issue May 6, 2023 · 1 comment
Open

Problem with SQLAlchemy 2 DeclarativeBase model imports #26

knucklesuganda opened this issue May 6, 2023 · 1 comment
Labels
bug Something isn't working Data storage layer Related to anything that works with data

Comments

@knucklesuganda
Copy link
Owner

Problem with SQLAlchemy 2 DeclarativeBase model imports

There is a new class for DeclarativeBase models in SQLAlchemy 2. The problem is in AlchemyRepository querying. If the model import is different from the one in the Repository creation, then SQLAlchemy adds another SQL table selection to the query. That results in big overheads and possible sql errors.

Example:

SELECT * FROM users, users WHERE users.id = 1

However, the query should be:

SELECT * FROM users WHERE users.id = 1
@knucklesuganda knucklesuganda added bug Something isn't working Data storage layer Related to anything that works with data labels May 6, 2023
@knucklesuganda
Copy link
Owner Author

This bug may be the result of SQLAlchemy2, but it still has to be fixed in PyAssimilator

Repository owner deleted a comment from naudachu Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Data storage layer Related to anything that works with data
Projects
None yet
Development

No branches or pull requests

1 participant