3 ms·
You can use raw queries for that. What kind of features are you referring to?
by plumeria 11y ago
You can use raw queries for that. What kind of features are you referring to?
- hardwaresofton 11y agoX feature that exists in the period after dbms release and before SA support -- categorical ORM problem. Also, I'm fully aware of using raw queries in SA/most ORMs -- my point is that if you have to drop down to raw queries, you're paying (mindshare/complexity/concentration/project size/whatever) for an incomplete abstraction you just had to side-step. Just to make sure there's no hostilities -- I'm not saying "don't use ORMs", because that would be dumb, as they offer tremendous value (and no downsides except for maybe complexity, as you can easily write custom queries) -- I just want to point out that the argument against them still stands, so don't drink too much of the koolaid.
- zzzeek 11y agoconsider that the "rendering of a SELECT string" is only like 10% of what the ORM is doing for you when you create and run `session.query()`. There is: 1. mapping the columns in the SELECT statement to the object attributes 2. dealing with the execution, result set, unicode, type conversion, etc. etc. idiosyncrasies of the underlying database driver as well as the target database backend, 3. routing various parts of each result row not just to different attributes on the mapped class but also into related attributes and collections of other classes all at the same time (e.g. eager loading) 4. maintaining the unit of work / identity map semantics as these rows are loaded 5. presenting the result set as a hierarchical object structure rather than a straight list of rows.