You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got an issue when upgrading from 2.5.1 to 3.0.0.
I'm using a joined hierarchy system and two different databases (sqlite and postgresql).
I realized that if an object from the postgresql DB was expired, the system would try to load it from the default DB, sqlite in my case, even if it came originally from the postgresql DB.
Running the code raises an exception stating that the 'Notices' table does not exist, because it is trying to get it from the default DB instead of the "second"
The expected behaviour is that the object would be reloaded when needed.
Environment:
Python version: 3.10
Flask-SQLAlchemy version: 3.0.0
SQLAlchemy version: 1.4.36
The text was updated successfully, but these errors were encountered:
You can't have foreign keys between databases, and that hasn't changed. That's just a limitation of databases, not something that Flask-SQLAlchemy or SQLAlchemy can change.
OK, I see what's going on, the order that our Session.get_bind checks things to find the right bind can fail for joined inheritance in some cases (and probably for other types of queries). When it fails to find a specific bind, it falls back to the default bind.
Hi,
I got an issue when upgrading from 2.5.1 to 3.0.0.
I'm using a joined hierarchy system and two different databases (sqlite and postgresql).
I realized that if an object from the postgresql DB was expired, the system would try to load it from the default DB, sqlite in my case, even if it came originally from the postgresql DB.
Here's a minimal code to reproduce the issue:
Running the code raises an exception stating that the 'Notices' table does not exist, because it is trying to get it from the default DB instead of the "second"
The expected behaviour is that the object would be reloaded when needed.
Environment:
The text was updated successfully, but these errors were encountered: