How to do a safe (constraint) implicit join in SQLAlchemy? -


i consider safe join 1 constrained foreign key. , implicit 1 mentions target.

in sqlalchemy, session.query(user).join(addresse) might or might not constraint, depending on whether sqlalchemy knows relation between user , addresses.

sometimes construct complicated query , want make sure joins constraint. how can check that? best if sqlalchemy gives me exception when implicit .join(table) didn’t find foreign key...

example “complicated query”:

session.query(addr_alias1).join(user).join(addr_alias2)

for last join, overly explicit way .join(addr_alias2, user.addresses), said, want implicit syntax, barks if failed.

sqlalchemy so.

unfortunately, tutorial suggests otherwise , api documentation doesn’t clear up.


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -