summaryrefslogtreecommitdiff
path: root/test/orm/inheritance/test_query.py
Commit message (Collapse)AuthorAgeFilesLines
* - fix some unclear phrases in query regarding polymorphic,Mike Bayer2012-02-161-2136/+0
| | | | | | | | slowly approaching [ticket:2333] - pep8 most of the big old polymorphic tests, break lots of the inheritance/test_query tests into individual tests since these are the ones that are easily broken when screwing with query
* follow the pattern set earlier in the testsDiana Clarke2011-12-111-35/+13
|
* whitespace passDiana Clarke2011-12-111-998/+1427
|
* - The behavior of =/!= when comparing a scalar selectMike Bayer2011-09-231-1/+1
| | | | | | | | | | | to a value will no longer produce IN/NOT IN as of 0.8; this behavior is a little too heavy handed (use in_() if you want to emit IN) and now emits a deprecation warning. To get the 0.8 behavior immediately and remove the warning, a compiler recipe is given at http://www.sqlalchemy.org/docs/07/dialects/mssql.html#scalar-select-comparisons to override the behavior of visit_binary(). [ticket:2277]
* - Fixed bug regarding calculation of "from" listMike Bayer2011-09-051-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for a select() element. The "from" calc is now delayed, so that if the construct uses a Column object that is not yet attached to a Table, but is later associated with a Table, it generates SQL using the table as a FROM. This change impacted fairly deeply the mechanics of how the FROM list as well as the "correlates" collection is calculated, as some "clause adaption" schemes (these are used very heavily in the ORM) were relying upon the fact that the "froms" collection would typically be cached before the adaption completed. The rework allows it such that the "froms" collection can be cleared and re-generated at any time. [ticket:2261] - RelationshipProperty.Comparator._criterion_exists() adds an "_orm_adapt" annotation to the correlates target, to work with the change in [ticket:2261]. It's not clear if the change to correlation+adaption mechanics will affect end user code yet. - FromClause now uses group_expirable_memoized_property for late-generated values like primary key, _columns, etc. The Select class adds some tokens to this object and has the nice effect that FromClause doesn't need to know about Select's names anymore. An additional change might be to have Select use a different group_expirable_memoized_property so that it's collection of attribute names are specific to Select though this isn't really necessary right now.
* - Fixed bug where query.join() + aliased=TrueMike Bayer2011-07-301-0/+112
| | | | | | | | from a joined-inh structure to itself on relationship() with join condition on the child table would convert the lead entity into the joined one inappropriately. [ticket:2234] Also in 0.6.9.
* - remove test.sql._base, test.engine._base, test.orm._base, move those ↵Mike Bayer2011-03-271-12/+13
| | | | | | | classes to a new test.lib.fixtures module - move testing.TestBase to test.lib.fixtures - massive search and replace
* - move all the setup_classes(cls) and setup_mappers(cls) to use aMike Bayer2011-03-271-7/+7
| | | | | local cls.Basic, cls.Comparable base class so that there is no ambiguity or hash identity behaviors getting in the way of class registration.
* - move _fixtures to work via the normal methods of _base.MappedTest, convertMike Bayer2011-03-261-5/+5
| | | | | | | all referncing tests to not use globals - tests that deal with pickle specifically load the fixture classes from test.lib.pickleable, which gets some more classes added - removed weird sa05 pickling tests that don't matter
* - remove @testing.resolve_artifact_names, replace with direct attributeMike Bayer2011-03-261-29/+69
| | | | | | | access to the cls/self.tables/classes registries - express orm/_base.py ORMTest in terms of engine/_base.py TablesTest, factor out common steps into TablesTest, remove AltEngineTest as a separate class. will further consolidate these base classes
* blow away some globals in the search for what makes resolve_artifact_names ↵Mike Bayer2011-03-161-37/+62
| | | | fail (possibly when there's already globals in the way...)
* - Changed the underlying approach to query.count().Mike Bayer2011-03-091-0/+19
| | | | | | | | | | | | | | | | | | | query.count() is now in all cases exactly: query. from_self(func.count(literal_column('1'))). scalar() That is, "select count(1) from (<full query>)". This produces a subquery in all cases, but vastly simplifies all the guessing count() tried to do previously, which would still fail in many scenarios particularly when joined table inheritance and other joins were involved. If the subquery produced for an otherwise very simple count is really an issue, use query(func.count()) as an optimization. [ticket:2093]
* - Fixed bug regarding "subqueryload" strategy wherebyMike Bayer2011-01-061-19/+86
| | | | | the join would fail if using a multi-level load of the form from A->joined-subclass->C [ticket:2014]
* - whitespace removal bonanzaMike Bayer2011-01-021-122/+122
|
* - sqlalchemy.test and nose plugin moves back to being entirelyMike Bayer2010-11-281-4/+4
|\ | | | | | | | | | | | | | | | | | | | | | | outside of "sqlalchemy" and under "test/". Rationale: - coverage plugin works without issue, without need for an awkward additional package install - command line for "nosetests" isn't polluted with SQLAlchemy options [ticket:1949]
| * - move sqlalchemy.test to test.libMike Bayer2010-11-151-4/+4
| |
* | - merge 2-arg form of query.join(), [ticket:1923]Mike Bayer2010-11-261-21/+24
| |
* | - merge reverse inheriting col order, [ticket:1892]Mike Bayer2010-11-201-7/+37
|\ \
| * | - the ordering of columns in a multi-column property now is inMike Bayer2010-11-201-7/+37
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | reverse order of which they were added to the property. A typical effect of this is that the ".id" attribute on a joined-inheritance subclass, where both parent/child tables name the PK column ".id", will reference the ".id" column of the child table, not the parent, thus allowing join conditions and such to be constructed more intuitively. This is a behavior change for some joined-table inheritance queries. [ticket:1892] - it's now an error condition to map to a join where multiple same-named columns from each table combine themselves implicitly. An explicit mention in the "properties" dictionary should be specified, using a list of columns, or column_property(*cols) with declarative. [ticket:1892]
* | - move LIMIT/OFFSET rendering to be as bind parameters, for all backendsMike Bayer2010-08-291-3/+4
|/ | | | | | | | | | which support it. This includes SQLite, MySQL, Postgresql, Firebird, Oracle (already used binds with ROW NUMBER OVER), MSSQL (when ROW NUMBER is used, not TOP). Not included are Informix, Sybase, MaxDB, Access [ticket:805] - LIMIT/OFFSET parameters need to stay as literals within SQL constructs. This because they may not be renderable as binds on some backends.
* help test with an order byMike Bayer2010-03-251-1/+1
|
* - fix some final pathing stuff, we weren't getting all the loads in theMike Bayer2010-03-241-14/+27
| | | | | inheritance examples, now its improved ! - final doc pass
* - To accomodate the fact that there are now two kinds of eagerMike Bayer2010-03-241-20/+20
| | | | | | | | | | | | | | | | loading available, the new names for eagerload() and eagerload_all() are joinedload() and joinedload_all(). The old names will remain as synonyms for the foreseeable future. - The "lazy" flag on the relationship() function now accepts a string argument for all kinds of loading: "select", "joined", "subquery", "noload" and "dynamic", where the default is now "select". The old values of True/ False/None still retain their usual meanings and will remain as synonyms for the foreseeable future. - Added documentation to tutorial,mapper doc, api docs for subqueryload, subqueryload_all, and other options.
* this version works with *all* the polymorphic scenarios by putting the ↵Mike Bayer2010-03-241-6/+9
| | | | | | | subquery into an aliased(), so that it can be controlled. self ref breaks now. will move the joining out to use orm.join().
* this one is unbelievableMike Bayer2010-03-231-1/+24
|
* getting inheritance to work. some complex cases may have to fail for the ↵Mike Bayer2010-03-231-3/+53
| | | | time being.
* - added add_columns() to Query - pending deprecates add_column()Mike Bayer2010-03-231-1/+2
| | | | - refined subquery strategy to use more public Query API
* - The official name for the relation() function is nowMike Bayer2010-03-171-19/+19
| | | | | | relationship(), to eliminate confusion over the relational algebra term. relation() however will remain available in equal capacity for the foreseeable future. [ticket:1740]
* restore common_parent logic in correspoinds_to, fixes [ticket:1657]Mike Bayer2010-01-151-0/+6
|
* - replace the tip of the path info with the subclass mapper being used.Mike Bayer2010-01-131-0/+26
| | | | | | | that way accurate "load_path" info is available for options invoked during deferred loads. we lose AliasedClass path elements this way, but currently, those are not needed at this stage.
* deprecations per [ticket:1498]:Mike Bayer2009-10-151-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - deprecated PassiveDefault - use DefaultClause. - the BINARY and MSBinary types now generate "BINARY" in all cases. Omitting the "length" parameter will generate "BINARY" with no length. Use BLOB to generate an unlengthed binary column. - the "quoting='quoted'" argument to MSEnum/ENUM is deprecated. It's best to rely upon the automatic quoting. - "shortname" attribute on bindparam() is removed. - fold_equivalents flag on join is deprecated (will remain until [ticket:1131] is implemented) - "scalar" flag on select() is removed, use select.as_scalar(). - 'transactional' flag on sessionmaker() and others is removed. Use 'autocommit=True' to indicate 'transactional=False'. - 'polymorphic_fetch' argument on mapper() is removed. Loading can be controlled using the 'with_polymorphic' option. - 'select_table' argument on mapper() is removed. Use 'with_polymorphic=("*", <some selectable>)' for this functionality. - 'proxy' argument on synonym() is removed. This flag did nothing throughout 0.5, as the "proxy generation" behavior is now automatic. - Passing a single list of elements to eagerload(), eagerload_all(), contains_eager(), lazyload(), defer(), and undefer() instead of multiple positional -args is deprecated. - Passing a single list of elements to query.order_by(), query.group_by(), query.join(), or query.outerjoin() instead of multiple positional *args is deprecated. - query.iterate_instances() is removed. Use query.instances(). - Query.query_from_parent() is removed. Use the sqlalchemy.orm.with_parent() function to produce a "parent" clause, or alternatively query.with_parent(). - query._from_self() is removed, use query.from_self() instead. - the "comparator" argument to composite() is removed. Use "comparator_factory". - RelationProperty._get_join() is removed. - the 'echo_uow' flag on Session is removed. Use logging on the "sqlalchemy.orm.unitofwork" name. - session.clear() is removed. use session.expunge_all(). - session.save(), session.update(), session.save_or_update() are removed. Use session.add() and session.add_all(). - the "objects" flag on session.flush() remains deprecated. - the "dont_load=True" flag on session.merge() is deprecated in favor of "load=False". - passing an InstanceState (internal SQLAlchemy state object) to attributes.init_collection() or attributes.get_history() is deprecated. These functions are public API and normally expect a regular mapped object instance. - the 'engine' parameter to declarative_base() is removed. Use the 'bind' keyword argument.
* - unit test fixesMike Bayer2009-10-101-1/+2
| | | | | - py3k readme - removed column.sequence accessor
* merged r6357 of rel_0_5 branchMike Bayer2009-09-161-0/+198
|
* - contains_eager() now works with the automaticallyMike Bayer2009-09-161-1/+1
| | | | | | | | | | generated subquery that results when you say "query(Parent).join(Parent.somejoinedsubclass)", i.e. when Parent joins to a joined-table-inheritance subclass. Previously contains_eager() would erroneously add the subclass table to the query separately producing a cartesian product. An example is in the ticket description. [ticket:1543]
* - Inserting NULL into a primary key + foreign key columnMike Bayer2009-08-311-1/+4
| | | | | | | | | | | will allow the "not null constraint" error to raise, not an attempt to execute a nonexistent "col_id_seq" sequence. [ticket:1516] - autoincrement SELECT statements, i.e. those which select from a procedure that modifies rows, now work with server-side cursor mode (the named cursor isn't used for such statements.)
* merge 0.6 series to trunk.Mike Bayer2009-08-061-9/+10
|
* - unit tests have been migrated from unittest to nose.Mike Bayer2009-06-101-0/+1113
See README.unittests for information on how to run the tests. [ticket:970]