I might just be missing something from the docs here, but is there a way to 
raise on attempts to load deferred columns or column properties?

I'm looking to get behavior equivalent to that of raiseload, to prevent 
unintentional N+1 issues when using deferred columns, in the context of an 
API server where e.g. endpoints generally only fetch subsets of columns 
from the model, especially with regard to potentially complex column 
expressions. I believe I can set things up to use load_only to only load 
the columns I care about, but I'm concerned about the ergonomics around 
preventing unintentional N+1 problems from lazy loading other columns.

Thanks,
Jimmy Jia

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/deac3314-fb82-47da-8b78-bff40f633ab2%40googlegroups.com.

Reply via email to