Async psycopg driver throws errors (greenlet has not been spawned) when sqlalchemy lazy loads relationships.
Possible affect:
I suppose that due to sa_relationship_kwargs={"lazy": "joined"} used now large and redundant amounts of data are loaded through relations (i.e. user -> invitation -> other user -> other invitation -> ...).
Known solutions:
Make DB connections synchronous
Prevent relationships to be lazy loaded by loading it manually or at the moment when a main object is loaded
The very last option is chosen
Reproduction
Remove sa_relationship_kwargs={"lazy": "joined"} from relationship definitions
All relationships are removed out of harm's way. Honestly, they are nightmare. I don't know how to make them work properly (without tons of extra methods or attributes) with asynchronous DB drivers.
Solved in e6fa5bb
Describe the bug
Async psycopg driver throws errors (greenlet has not been spawned) when sqlalchemy lazy loads relationships.
Possible affect:
I suppose that due to
sa_relationship_kwargs={"lazy": "joined"}
used now large and redundant amounts of data are loaded through relations (i.e. user -> invitation -> other user -> other invitation -> ...).Known solutions:
Reproduction
sa_relationship_kwargs={"lazy": "joined"}
from relationship definitionsScreenshots / Additional context
Some info