I'm sure someone has tried, but has anyone done a good job on an ORM that actually lets you select which columns to load and only selects those?
i.e. rails' ActiveRecord allows you to select columns easily in most cases:
User.where(..) # all fields
User.where(..).select(:name, :id) # only two of them
joe.boards.select(:title) # only one in join
joe.boards.pluck(:title) # only column value instead of full objects with one attribute set
Though I recall it's involved for #belongs_to relations.You should also be able to setup the select as a default per-class, other than per query.
I suspect, I likely didn't understand your question, could you expand it?
My apologies if it was a dumb question. :)
.only(… field list…)
.defer(… fields to fetch on demand…)
https://docs.djangoproject.com/en/dev/ref/models/querysets/#...It's really a PIA.
Recently, I've learned about http://jooq.org/ — not having checked in detail yet, it might be easier there.