py_assimilator icon indicating copy to clipboard operation
py_assimilator copied to clipboard

Problem with SQLAlchemy 2 DeclarativeBase model imports

Open knucklesuganda opened this issue 1 year ago • 1 comments

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 avatar May 06 '23 09:05 knucklesuganda

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

knucklesuganda avatar May 08 '23 07:05 knucklesuganda