summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/query.py
Commit message (Collapse)AuthorAgeFilesLines
* more docs on thisMike Bayer2010-09-121-10/+8
|
* unify query.with_parent, util.with_parent, fix docs some moreMike Bayer2010-09-061-37/+18
|
* - query.with_parent() now accepts transient objectsMike Bayer2010-09-061-16/+31
| | | | | | | and will use the non-persistent values of their pk/fk attributes in order to formulate the criterion. Docs are also clarified as to the purpose of with_parent(). - fix for PG test executing an alias()
* almost through.Mike Bayer2010-09-041-2/+7
|
* Apply more memoization to Mapper attributes & subject to group expiry.Jason Kirtland2010-09-031-2/+6
|
* docstring for query.correlate, [ticket:1889]Mike Bayer2010-08-291-3/+22
|
* get slightly better about deprecations in docstrings, tho this is kind of an ↵Mike Bayer2010-08-091-1/+3
| | | | uphill climb
* - some of the refinements from the sa_synonyms branch which willMike Bayer2010-08-081-3/+3
| | | | | | | | | allow the hybrid extension to work, but doesn't re-implement synonym, comparable_property,concreteinheritedproperty - mapper.get_property() and _entity_descriptor use plain getattr() to get at descriptors in all cases, thereby placing more trust in the ultimate class-bound attribute to provide mapped properties
* - worked through about 25% of mappers.rst to implementMike Bayer2010-08-011-4/+21
| | | | | up to date and clear explanations of things, including as much context and description as possible
* - Column-entities (i.e. query(Foo.id)) copy theirrel_0_6_3Mike Bayer2010-07-151-2/+4
| | | | | | | | | | | | | | state more fully when queries are derived from themselves + a selectable (i.e. from_self(), union(), etc.), so that join() and such have the correct state to work from. [ticket:1853] - Fixed bug where Query.join() would fail if querying a non-ORM column then joining without an on clause when a FROM clause is already present, now raises a checked exception the same way it does when the clause is not present. [ticket:1853]
* - added "expr" to the column descriptions accessor, this isMike Bayer2010-07-081-4/+10
| | | | | | an expression that matches on identity the original expression passed to the query. In particular you can pass it into order_by() and similar.
* - 78 charsMike Bayer2010-07-081-19/+69
| | | | | | | | - Added "column_descriptions" accessor to Query, returns a list of dictionaries containing naming/typing information about the entities the Query will return. Can be helpful for building GUIs on top of ORM queries.
* - Query.join() will check for a call of theMike Bayer2010-07-011-3/+12
| | | | | | form query.join(target, clause_expression), i.e. missing the tuple, and raise an informative error message that this is the wrong calling form.
* - query.order_by() now accepts False, which cancelsMike Bayer2010-06-171-9/+26
| | | | | | | | | | | any existing order_by() state on the Query, allowing subsequent generative methods to be called which do not support ORDER BY. This is not the same as the already existing feature of passing None, which suppresses any existing order_by() settings, including those configured on the mapper. False will make it as though order_by() was never called, while None is an active setting.
* - Query.statement, Query.subquery(), etc. now transferMike Bayer2010-06-141-2/+5
| | | | | | | | | | the values of bind parameters, i.e. those specified by query.params(), into the resulting SQL expression. Previously the values would not be transferred and bind parameters would come out as None. - Subquery-eager-loading now works with Query objects which include params(), as well as get() Queries.
* - Pool classes will reuse the same "pool_logging_name" settingMike Bayer2010-05-301-4/+1
| | | | | | | | | | | | | | | | | | | | after a dispose() occurs. - Engine gains an "execution_options" argument and update_execution_options() method, which will apply to all connections generated by this engine. - Added more aggressive caching to the mapper's usage of UPDATE, INSERT, and DELETE expressions. Assuming the statement has no per-object SQL expressions attached, the expression objects are cached by the mapper after the first create, and their compiled form is stored persistently in a cache dictionary for the duration of the related Engine. - change #3 required change #1 so that we could test a set of mappers operating over the course of many engines without memory usage increase.
* some pep-8ingMike Bayer2010-05-131-216/+388
|
* - Added with_hint() method to Query() construct. This callsMike Bayer2010-03-271-1/+24
| | | | | | | | | | directly down to select().with_hint() and also accepts entities as well as tables and aliases. See with_hint() in the SQL section below. [ticket:921] - Added with_hint() method to select() construct. Specify a table/alias, hint text, and optional dialect name, and "hints" will be rendered in the appropriate place in the statement. Works for Oracle, Sybase, MySQL. [ticket:921]
* - fix some final pathing stuff, we weren't getting all the loads in theMike Bayer2010-03-241-9/+16
| | | | | inheritance examples, now its improved ! - final doc pass
* - made final refinements to the feature and we are 100% go on subquery loading.Mike Bayer2010-03-241-1/+13
| | | | | | | - Query.join(Cls.propname, from_joinpoint=True) will check more carefully that "Cls" is compatible with the current joinpoint, and act the same way as Query.join("propname", from_joinpoint=True) in that regard.
* - removed need for _subq_aliasing workaroundMike Bayer2010-03-241-7/+1
| | | | | - removed cruft - all tests pass, now ready for API adjustments ('eagerload'->'joinedload'), docs
* everything everything passes on this one. still want to get rid of that ↵Mike Bayer2010-03-241-1/+2
| | | | hack tho.
* this version works with *all* the polymorphic scenarios by putting the ↵Mike Bayer2010-03-241-2/+1
| | | | | | | subquery into an aliased(), so that it can be controlled. self ref breaks now. will move the joining out to use orm.join().
* - Query.join() will detect if the end result will beMike Bayer2010-03-241-0/+7
| | | | "FROM A JOIN A", and will raise an error if so.
* getting inheritance to work. some complex cases may have to fail for the ↵Mike Bayer2010-03-231-8/+15
| | | | time being.
* - added add_columns() to Query - pending deprecates add_column()Mike Bayer2010-03-231-3/+12
| | | | - refined subquery strategy to use more public Query API
* this version actually works for all existing tests plus simple self-referential.Mike Bayer2010-03-231-7/+8
| | | | I don't like how difficult it was to get Query() to do it, however.
* and here's where it gets *fun* ! so much for being easyMike Bayer2010-03-221-1/+2
|
* - Fixed bug in Query whereby calling q.join(prop).from_self(...).Mike Bayer2010-03-221-3/+5
| | | | | | join(prop) would fail to render the second join outside the subquery, when joining on the same criterion as was on the inside.
* - Fixed bug whereby calling query(A).join(A.bs).add_entity(B)Mike Bayer2010-03-191-1/+2
| | | | | in a joined inheritance scenario would double-add B as a target and produce an invalid query. [ticket:1188]
* - The official name for the relation() function is nowMike Bayer2010-03-171-8/+8
| | | | | | relationship(), to eliminate confusion over the relational algebra term. relation() however will remain available in equal capacity for the foreseeable future. [ticket:1740]
* - query.get() now returns None if queried for an identifierMike Bayer2010-03-131-12/+18
| | | | | | that is present in the identity map with a different class than the one requested, i.e. when using polymorphic loading. [ticket:1727]
* formattingMike Bayer2010-03-111-4/+4
|
* - query.scalar() now raises an exception if more than oneMike Bayer2010-03-111-3/+10
| | | | | row is returned. All other behavior remains the same. [ticket:1735]
* - Calling query.order_by() or query.distinct() before callingMike Bayer2010-03-111-2/+6
| | | | | | query.select_from(), query.with_polymorphic(), or query.from_statement() raises an exception now instead of silently dropping those criterion. [ticket:1736]
* fixed up docs for execution_options() across all three locations.Mike Bayer2010-03-091-7/+7
|
* - A major fix in query.join(), when the "on" clause is anMike Bayer2010-02-241-8/+23
| | | | | | | attribute of an aliased() construct, but there is already an existing join made out to a compatible target, query properly joins to the right aliased() construct instead of sticking onto the right side of the existing join. [ticket:1706]
* - query.one() no longer applies LIMIT to the query, this toMike Bayer2010-02-141-31/+64
| | | | | | | | | ensure that it fully counts all object identities present in the result, even in the case where joins may conceal multiple identities for two or more rows. As a bonus, one() can now also be called with a query that issued from_statement() to start with since it no longer modifies the query. [ticket:1688]
* - Documentation clarification for query.delete()Mike Bayer2010-02-131-4/+8
| | | | [ticket:1689]
* - reduced a bit of overhead in attribute expiration, particularlyMike Bayer2010-02-131-2/+3
| | | | | | | | the version called by column loaders on an incomplete row (i.e. joined table inheritance). there are more dramatic changes that can be made here but this one is conservative so far as far as how much we're altering how InstanceState tracks "expired" attributes.
* - Query called in the context of an expression will renderMike Bayer2010-02-081-2/+12
| | | | | | | | | | | | disambiguating labels in all cases. Note that this does not apply to the existing .statement and .subquery() accessor/method, which still honors the .with_labels() setting that defaults to False. - Query.union() retains disambiguating labels within the returned statement, thus avoiding various SQL composition errors which can result from column name conflicts. [ticket:1676]
* not ready to put execution_options in the text()/select() constructors yetMike Bayer2010-01-241-2/+5
|
* - query.select_from() also accepts mapped classes, aliased()Mike Bayer2010-01-201-2/+12
| | | | | | constructs, and mappers as arguments. In particular this helps when querying from multiple joined-table classes to ensure the full join gets rendered.
* statement_options -> execution_optionsMike Bayer2010-01-171-12/+14
|
* - added "statement_options()" to Query, to so options can beMike Bayer2010-01-161-8/+32
| | | | | | | | | | | | | | | | | | | | | passed to the resulting statement. Currently only Select-statements have these options, and the only option used is "stream_results", and the only dialect which knows "stream_results" is psycopg2. - Query.yield_per() will set the "stream_results" statement option automatically. - Added "statement_options()" to Selects, which set statement specific options. These enable e.g. dialect specific options such as whether to enable using server side cursors, etc. - The psycopg2 now respects the statement option "stream_results". This option overrides the connection setting "server_side_cursors". If true, server side cursors will be used for the statement. If false, they will not be used, even if "server_side_cursors" is true on the connection. [ticket:1619] - added a "frozendict" from http://code.activestate.com/recipes/414283/, adding more default collections as immutable class vars on Query, Insert, Select
* restore common_parent logic in correspoinds_to, fixes [ticket:1657]Mike Bayer2010-01-151-2/+2
|
* NamedTuple is pickleable ! no really with all the protocols too !Mike Bayer2010-01-131-3/+2
|
* OK, you can't merge NamedTuples and such. Fine. New query method.Mike Bayer2010-01-121-0/+53
|
* have paths represented as their actual mapper, not the base mapper, allowingMike Bayer2010-01-111-3/+3
| | | | | more information for custom mapper opts to see what's going on. add a new _reduce_path() function to apply to the path as stored in dictionaries, adds a slight cost overhead.
* - cut down on a few hundred method callsMike Bayer2010-01-111-1/+1
|