summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql_util.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2007-03-10 02:49:12 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2007-03-10 02:49:12 +0000
commitb2e04755cc5f382596fb174c7381f60dd2972d94 (patch)
treebafe994b93bd2a57633c3b9ffedf39d725844350 /lib/sqlalchemy/sql_util.py
parent585eacba010eee5be719074fa31d3e8b41cc79a9 (diff)
downloadsqlalchemy-b2e04755cc5f382596fb174c7381f60dd2972d94.tar.gz
- the full featureset of the SelectResults extension has been merged
into a new set of methods available off of Query. These methods all provide "generative" behavior, whereby the Query is copied and a new one returned with additional criterion added. The new methods include: filter() - applies select criterion to the query filter_by() - applies "by"-style criterion to the query avg() - return the avg() function on the given column join() - join to a property (or across a list of properties) outerjoin() - like join() but uses LEFT OUTER JOIN limit()/offset() - apply LIMIT/OFFSET range-based access which applies limit/offset: session.query(Foo)[3:5] distinct() - apply DISTINCT list() - evaluate the criterion and return results no incompatible changes have been made to Query's API and no methods have been deprecated. Existing methods like select(), select_by(), get(), get_by() all execute the query at once and return results like they always did. join_to()/join_via() are still there although the generative join()/outerjoin() methods are easier to use. - the return value for multiple mappers used with instances() now returns a cartesian product of the requested list of mappers, represented as a list of tuples. this corresponds to the documented behavior. So that instances match up properly, the "uniquing" is disabled when this feature is used. - strings and columns can also be sent to the *args of instances() where those exact result columns will be part of the result tuples. - query() method is added by assignmapper. this helps with navigating to all the new generative methods on Query.
Diffstat (limited to 'lib/sqlalchemy/sql_util.py')
0 files changed, 0 insertions, 0 deletions