summaryrefslogtreecommitdiff
path: root/test/orm/inheritance
Commit message (Collapse)AuthorAgeFilesLines
* Deprecate Mapper.order_byMike Bayer2016-04-193-18/+42
| | | | | | | | | | | This is an old parameter no longer relevant to how SQLAlchemy works, once the Query object was introduced. By deprecating it we establish that we aren't supporting non-working use cases and that we encourage applications to move off of the use of this parameter. Fixes: #3394 Change-Id: I25b9a38142a1537bbcb27d3e8b66a8b265140072
* - skip GC tests here when coverage is enabled, seems to interfereMike Bayer2016-03-081-1/+1
|
* - An improvement to the workings of :meth:`.Query.correlate` suchMike Bayer2016-02-251-3/+72
| | | | | | | that when a "polymorphic" entity is used which represents a straight join of several tables, the statement will ensure that all the tables within the join are part of what's correlating. fixes #3662
* - use regex here, columns dont matter, keep coming up with different orderingsMike Bayer2016-01-231-3/+3
|
* - make this test deterministicMike Bayer2016-01-211-3/+3
|
* - Added new parameter :paramref:`.orm.mapper.passive_deletes` toMike Bayer2016-01-201-0/+236
| | | | | | | | available mapper options. This allows a DELETE to proceed for a joined-table inheritance mapping against the base table only, while allowing for ON DELETE CASCADE to handle deleting the row from the subclass tables. fixes #2349
* - Fixed issue where two same-named relationships that refer toMike Bayer2016-01-191-0/+39
| | | | | | | | a base class and a concrete-inherited subclass would raise an error if those relationships were set up using "backref", while setting up the identical configuration using relationship() instead with the conflicting names would succeed, as is allowed in the case of a concrete mapping. fixes #3630
* - varchar requires a lengthMike Bayer2015-12-221-1/+1
|
* - add the test from ref #3614 as well for testing ref #3611Mike Bayer2015-12-211-0/+60
|
* - Fixed regression caused in 1.0.10 by the fix for :ticket:`3593` whereMike Bayer2015-12-151-18/+99
| | | | | | | the check added for a polymorphic joinedload from a poly_subclass->class->poly_baseclass connection would fail for the scenario of class->poly_subclass->class. fixes #3611
* - Fixed bug which is actually a regression that occurred betweenMike Bayer2015-11-251-1/+130
| | | | | | | | versions 0.8.0 and 0.8.1, due :ticket:`2714`. The case where joined eager loading needs to join out over a subclass-bound relationship when "with_polymorphic" were also used would fail to join from the correct entity. fixes #3593
* - Fixed bug where the "single table inheritance" criteria would beMike Bayer2015-11-111-0/+15
| | | | | | | added onto the end of a query in some inappropriate situations, such as when querying from an exists() of a single-inheritance subclass. fixes #3582
* - use is_() here to more clearly show what's going wrongMike Bayer2015-10-191-13/+25
| | | | on occasional pypy test runs
* - Fixed 1.0 regression where a "deferred" attribute would not populateMike Bayer2015-06-291-0/+56
| | | | | | | | | | correctly if it were loaded within the "optimized inheritance load", which is a special SELECT emitted in the case of joined table inheritance used to populate expired or unloaded attributes against a joined table without loading the base table. This is related to the fact that SQLA 1.0 no longer guesses about loading deferred columns and must be directed explicitly. fixes #3468
* - Fixed 1.0 regression where the enhanced behavior of single-inheritanceMike Bayer2015-06-191-0/+25
| | | | | | | | joins of :ticket:`3222` takes place inappropriately for a JOIN along explicit join criteria with a single-inheritance subclass that does not make use of any discriminator, resulting in an additional "AND NULL" clause. fixes #3462
* - The subquery wrapping which occurs when joined eager loadingMike Bayer2015-03-101-12/+12
| | | | | | | | | is used with a one-to-many query that also features LIMIT, OFFSET, or DISTINCT has been disabled in the case of a one-to-one relationship, that is a one-to-many with :paramref:`.relationship.uselist` set to False. This will produce more efficient queries in these cases. fixes #3249
* - pick around gaining modest dings in callcounts here and thereMike Bayer2015-03-091-6/+3
|
* - Fixed bugs in ORM object comparisons where comparison ofMike Bayer2015-02-201-0/+6
| | | | | | | | | | many-to-one ``!= None`` would fail if the source were an aliased class, or if the query needed to apply special aliasing to the expression due to aliased joins or polymorphic querying; also fixed bug in the case where comparing a many-to-one to an object state would fail if the query needed to apply special aliasing due to aliased joins or polymorphic querying. fixes #3310
* - Fixed bug in single table inheritance where a chain of joinsMike Bayer2014-10-231-0/+59
| | | | | | | | | | | | that included the same single inh entity more than once (normally this should raise an error) could, in some cases depending on what was being joined "from", implicitly alias the second case of the single inh entity, producing a query that "worked". But as this implicit aliasing is not intended in the case of single table inheritance, it didn't really "work" fully and was very misleading, since it wouldn't always appear. fixes #3233
* - Fixed bug where the ON clause for :meth:`.Query.join`,Mike Bayer2014-10-231-0/+25
| | | | | | | and :meth:`.Query.outerjoin` to a single-inheritance subclass using ``of_type()`` would not render the "single table criteria" in the ON clause if the ``from_joinpoint=True`` flag were set. fixes #3232
* - The ON clause rendered when using :meth:`.Query.join`,Mike Bayer2014-10-091-2/+120
| | | | | | | | | | :meth:`.Query.outerjoin`, or the standalone :func:`.orm.join` / :func:`.orm.outerjoin` functions to a single-inheritance subclass will now include the "single table criteria" in the ON clause even if the ON clause is otherwise hand-rolled; it is now added to the criteria using AND, the same way as if joining to a single-table target using relationship or similar. fixes #3222
* - use default dialect for compile test hereMike Bayer2014-08-291-1/+2
|
* - Changed the approach by which the "single inheritance criterion"Mike Bayer2014-08-291-3/+16
| | | | | | | | | | is applied, when using :meth:`.Query.from_self`, or its common user :meth:`.Query.count`. The criteria to limit rows to those with a certain type is now indicated on the inside subquery, not the outside one, so that even if the "type" column is not available in the columns clause, we can filter on it on the "inner" query. fixes #3177
* - ensure all tests are named test_*Mike Bayer2014-07-305-34/+34
|
* - use new Or() directive to test for both SQL variants here, which can varyMike Bayer2014-06-211-7/+16
| | | | based on hash ordering of the ClassManager
* - Additional checks have been added for the case where an inheritingMike Bayer2014-06-202-40/+66
| | | | | | | | | | mapper is implicitly combining one of its column-based attributes with that of the parent, where those columns normally don't necessarily share the same value. This is an extension of an existing check that was added via :ticket:`1892`; however this new check emits only a warning, instead of an exception, to allow for applications that may be relying upon the existing behavior. fixes #3042
* - Fixed bug in subquery eager loading where a long chain ofMike Bayer2014-05-251-0/+2
| | | | | | | eager loads across a polymorphic-subclass boundary in conjunction with polymorphic loading would fail to locate the subclass-link in the chain, erroring out with a missing property name on an :class:`.AliasedClass`. fixes #3055
* Fix many typos throughout the codebasepr/85Alex Gaynor2014-04-261-1/+1
| | | | Found using: https://github.com/intgr/topy
* - rename __multiple__ to __backend__, and apply __backend__ to a large ↵Mike Bayer2014-03-241-0/+1
| | | | | | number of tests. - move out logging tests from test_execute to test_logging
* - repair the fixture/test here to make sure state isn't left over causing ↵Mike Bayer2014-01-271-1/+1
| | | | other tests to fail
* - Fixed an 0.9 regression where the automatic aliasing applied byMike Bayer2014-01-231-0/+36
| | | | | | | | | | :class:`.Query` and in other situations where selects or joins were aliased (such as joined table inheritance) could fail if a user-defined :class:`.Column` subclass were used in the expression. In this case, the subclass would fail to propagate ORM-specific "annotations" along needed by the adaptation. The "expression annotations" system has been corrected to account for this case. [ticket:2918]
* - Support is improved for supplying a :func:`.join` construct as theMike Bayer2014-01-221-3/+5
| | | | | | | | | | target of :paramref:`.relationship.secondary` for the purposes of creating very complex :func:`.relationship` join conditions. The change includes adjustments to query joining, joined eager loading to not render a SELECT subquery, changes to lazy loading such that the "secondary" target is properly included in the SELECT, and changes to declarative to better support specification of a join() object with classes as targets.
* - Fixed a bug involving the new flattened JOIN structures whichMike Bayer2014-01-131-0/+134
| | | | | | | | | | | are used with :func:`.joinedload()` (thereby causing a regression in joined eager loading) as well as :func:`.aliased` in conjunction with the ``flat=True`` flag and joined-table inheritance; basically multiple joins across a "parent JOIN sub" entity using different paths to get to a target class wouldn't form the correct ON conditions. An adjustment / simplification made in the mechanics of figuring out the "left side" of the join in the case of an aliased, joined-inh class repairs the issue. [ticket:2908]
* - dont run deletes hereMike Bayer2014-01-131-0/+1
|
* - Fixed regression where we apparently still create an implicitMike Bayer2014-01-021-0/+1
| | | | | | | | | | alias when saying query(B).join(B.cs), where "C" is a joined inh class; however, this implicit alias was created only considering the immediate left side, and not a longer chain of joins along different joined-inh subclasses of the same base. As long as we're still implicitly aliasing in this case, the behavior is dialed back a bit so that it will alias the right side in a wider variety of cases. [ticket:2903]
* - Fixed bug when using joined table inheritance from a table to aMike Bayer2013-12-161-14/+65
| | | | | | | select/alias on the base, where the PK columns were also not same named; the persistence system would fail to copy primary key values from the base table to the inherited table upon INSERT. [ticket:2885]
* - remove informix dialect, moved out to ↵Mike Bayer2013-11-173-6/+0
| | | | | | https://bitbucket.org/zzzeek/sqlalchemy_informixdb - remove informix, maxdb, access symbols from tests etc.
* An overhaul of expression handling for special symbols particularlyMike Bayer2013-10-231-1/+0
| | | | | | | | | | with conjunctions, e.g. ``None`` :func:`.expression.null` :func:`.expression.true` :func:`.expression.false`, including consistency in rendering NULL in conjunctions, "short-circuiting" of :func:`.and_` and :func:`.or_` expressions which contain boolean constants, and rendering of boolean constants and expressions as compared to "1" or "0" for backends that don't feature ``true``/``false`` constants. [ticket:2804]
* - apply an import refactoring to the ORM as wellMike Bayer2013-08-141-0/+1
| | | | | | | | | - rework the event system so that event modules load after their targets, dependencies are reversed - create an improved strategy lookup system for the ORM - rework the ORM to have very few import cycles - move out "importlater" to just util.dependency - other tricks to cross-populate modules in as clear a way as possible
* - additional fix for [ticket:2750] where on an update, we make sure theMike Bayer2013-06-301-2/+33
| | | | value is present
* add better tests for [ticket:2750]Mike Bayer2013-06-301-3/+45
|
* A warning is emitted when trying to flush an object of an inheritedMike Bayer2013-06-301-3/+23
| | | | | mapped class where the polymorphic discriminator has been assigned to a value that is invalid for the class. [ticket:2750]
* The resolution of :class:`.ForeignKey` objects to theirMike Bayer2013-06-231-1/+2
| | | | | | | | | | | | | | | | | | target :class:`.Column` has been reworked to be as immediate as possible, based on the moment that the target :class:`.Column` is associated with the same :class:`.MetaData` as this :class:`.ForeignKey`, rather than waiting for the first time a join is constructed, or similar. This along with other improvements allows earlier detection of some foreign key configuration issues. Also included here is a rework of the type-propagation system, so that it should be reliable now to set the type as ``None`` on any :class:`.Column` that refers to another via :class:`.ForeignKey` - the type will be copied from the target column as soon as that other column is associated, and now works for composite foreign keys as well. [ticket:1765]
* Fixed bug in polymorphic SQL generation where multiple joined-inheritanceMike Bayer2013-06-151-1/+91
| | | | | | | entities against the same base class joined to each other as well would not track columns on the base table independently of each other if the string of joins were more than two entities long. Also in 0.8.2. [ticket:2759]
* - Fixed an obscure bug where the wrong results would beMike Bayer2013-06-072-13/+134
| | | | | | | | | | | fetched when joining/joinedloading across a many-to-many relationship to a single-table-inheriting subclass with a specific discriminator value, due to "secondary" rows that would come back. The "secondary" and right-side tables are now inner joined inside of parenthesis for all ORM joins on many-to-many relationships so that the left->right join can accurately filtered. [ticket:2369]
* dial back the default "flatness" a bit, it will be there for joinedload and ↵Mike Bayer2013-06-062-11/+55
| | | | | | | query.join(), but if you're dealing with aliased() or with_polymorphic() you need to say "flat=True". Just the one flag though, "flat" implies "aliased".
* a test for what's breaking, plus a non-working fix for it...Mike Bayer2013-06-051-1/+47
|
* - improve overlapping selectables, apply to both query and relationshipMike Bayer2013-06-041-5/+4
| | | | | | - clean up inspect() calls within query._join() - make sure join.alias(flat) propagates - fix almost all assertion tests
* - eager loadsMike Bayer2013-06-041-60/+38
| | | | - two suite of SQL assertions converted
* getting things to join without subqueries, but some glitches in the compiler ↵Mike Bayer2013-06-021-1/+24
| | | | | | step when we do query.count() are showing