Skip to content

Problem with SQLAlchemy 2 DeclarativeBase model imports #26

@knucklesuganda

Description

@knucklesuganda

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Data storage layerRelated to anything that works with databugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions