summaryrefslogtreecommitdiff
path: root/test/sql/test_selectable.py
Commit message (Collapse)AuthorAgeFilesLines
* - [bug] column.label(None) now produces anMike Bayer2012-04-241-6/+5
| | | | | | anonymous label, instead of returning the column object itself, consistent with the behavior of label(column, None). [ticket:2168]
* - [bug] The names of the columns on theMike Bayer2012-04-241-2/+11
| | | | | | | | .c. attribute of a select().apply_labels() is now based on <tablename>_<colkey> instead of <tablename>_<colname>, for those columns that have a distinctly named .key. [ticket:2397]
* - merged #1401 branch from bitbucketMike Bayer2012-04-221-7/+91
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - resolved some serious speed hits I missed, we need to ensure only deannotated columns are used in the local/remote collections and soforth so that hash lookups against mapped columns don't dig into __eq__() - fix some other parity mismatches regarding stuff from [ticket:2453], including finding another case where _deep_annotate() was doing the wrong thing, new tests. - [feature] Major rewrite of relationship() internals now allow join conditions which include columns pointing to themselves within composite foreign keys. A new API for very specialized primaryjoin conditions is added, allowing conditions based on SQL functions, CAST, etc. to be handled by placing the annotation functions remote() and foreign() inline within the expression when necessary. Previous recipes using the semi-private _local_remote_pairs approach can be upgraded to this new approach. [ticket:1401]
| * - figured out again why deannotate must clone()Mike Bayer2012-02-111-3/+33
| | | | | | | | | | - got everything working. just need to update error strings
| * - got m2m, local_remote_pairs, etc. workingMike Bayer2012-02-091-1/+3
| | | | | | | | | | | | | | | | - using new traversal that returns the product of both sides of a binary, starting to work with (a+b) == (c+d) types of joins. primaryjoins on functions working - annotations working, including reversing local/remote when doing backref
| * initial annotations approach to join conditions. all tests pass, plus ↵Mike Bayer2012-02-061-0/+19
| | | | | | | | | | | | additional tests in #1401 pass. would now like to reorganize RelationshipProperty more around the annotations concept.
* | - reopened #2453, needed to put in the original patch as well to cover the caseMike Bayer2012-04-031-2/+32
| | | | | | | | of column_property() objs building off each other
* | - [bug] Fixed bug in expression annotationMike Bayer2012-03-311-0/+24
| | | | | | | | | | | | | | mechanics which could lead to incorrect rendering of SELECT statements with aliases and joins, particularly when using column_property(). [ticket:2453]
* | - [bug] Fixed bug whereby a primaryjoinMike Bayer2012-03-121-0/+10
|/ | | | | | | | | condition with a "literal" in it would raise an error on compile with certain kinds of deeply nested expressions which also needed to render the same bound parameter name more than once. [ticket:2425]
* - [bug] Added support for using the .keyMike Bayer2012-02-051-0/+23
| | | | | | | | | | | | of a Column as a string identifier in a result set row. The .key is currently listed as an "alternate" name for a column, and is superseded by the name of a column which has that key value as its regular name. For the next major release of SQLAlchemy we may reverse this precedence so that .key takes precedence, but this is not decided on yet. [ticket:2392]
* - [bug] Fixed bug whereby column_property() createdMike Bayer2011-12-031-20/+17
| | | | | | | | | | | | | | | | | | | | | | | | | against ORM-level column could be treated as a distinct entity when producing certain kinds of joined-inh joins. [ticket:2316] - [bug] related to [ticket:2316], made some adjustments to the change from [ticket:2261] regarding the "from" list on a select(). The _froms collection is no longer memoized, as this simplifies various use cases and removes the need for a "warning" if a column is attached to a table after it was already used in an expression - the select() construct will now always produce the correct expression. There's probably no real-world performance hit here; select() objects are almost always made ad-hoc, and systems that wish to optimize the re-use of a select() would be using the "compiled_cache" feature. A hit which would occur when calling select.bind has been reduced, but the vast majority of users shouldn't be using "bound metadata" anyway :).
* - [bug] further tweak to the fix from [ticket:2261],Mike Bayer2011-11-191-0/+21
| | | | | | | | | | | | so that generative methods work a bit better off of cloned (this is almost a non-use case though). In particular this allows with_only_columns() to behave more consistently. Added additional documentation to with_only_columns() to clarify expected behavior, which changed as a result of [ticket:2261]. [ticket:2319] - document the crap out of with_only_columns, include caveats about the change, etc.
* - Fixed bug whereby with_only_columns() method ofMike Bayer2011-09-211-0/+8
| | | | | Select would fail if a selectable were passed. [ticket:2270]. Also in 0.6.9.
* - Changed the update() method on association proxyMike Bayer2011-09-141-1/+0
| | | | | | | | dictionary to use a duck typing approach, i.e. checks for "keys", to discern between update({}) and update((a, b)). Previously, passing a dictionary that had tuples as keys would be misinterpreted as a sequence. [ticket:2275]
* - Fixed bug regarding calculation of "from" listMike Bayer2011-09-051-3/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* - rework Annotated to no longer use __cmp__(), supply an __eq__() thatMike Bayer2011-07-241-0/+18
| | | | | works with ColumnElement as well as works with non-__eq__() suppliers, works with sets, on Py3K as well.
* - rewrite cloned_traverse() and replacement_traverse() to use a straightMike Bayer2011-07-241-0/+7
| | | | | | | | | | | | | | | | recursive descent with clone() + _copy_internals(). This is essentially what it was doing anyway with lots of unnecessary steps. Fix Alias() to honor the given clone() function which may have been the reason the traversal hadn't been fixed sooner. Alias._copy_internals() will specifically skip an alias of a Table as a more specific form of what it was doing before. This may need to be further improved such that ClauseAdapter or replacement_traverse() send it some specific hints what not to dig into; **kw has been added to all _copy_internals() to support this. replacement/clone traversal is at least clear now. - apply new no_replacement_traverse annotation to join created by _create_joins(), fixes [ticket:2195] - can replace orm.query "_halt_adapt" with "no_replacement_traverse"
* - Fixed subtle bug that caused SQL to blowMike Bayer2011-06-271-1/+10
| | | | | | | up if: column_property() against subquery + joinedload + LIMIT + order by the column property() occurred. [ticket:2188]. Also in 0.6.9
* - Fixed a subtle bug involving columnMike Bayer2011-06-271-0/+18
| | | | | correspondence in a selectable with the same column repeated. Affects [ticket:2188].
* use default dialect hereMike Bayer2011-05-291-0/+1
|
* - Streamlined the process by which a SelectMike Bayer2011-05-281-0/+28
| | | | | | | | | determines what's in it's '.c' collection. Behaves identically, except that a raw ClauseList() passed to select([]) (which is not a documented case anyway) will now be expanded into its individual column elements instead of being ignored.
* - Fixed bug whereby nesting a label of a select()Mike Bayer2011-05-181-1/+51
| | | | | | | | | | | | with another label in it would produce incorrect exported columns. Among other things this would break an ORM column_property() mapping against another column_property(). [ticket:2167]. Also in 0.6.8 - _Label() is always against a column or selectable. remove uncovered case of label against something else. - start taking notes to clean up some of this labeling stuff, which will be [ticket:2168]
* - Changed the handling in determination of joinMike Bayer2011-05-071-0/+61
| | | | | | | | | | | conditions such that foreign key errors are only considered between the two given tables. That is, t1.join(t2) will report FK errors that involve 't1' or 't2', but anything involving 't3' will be skipped. This affects join(), as well as ORM relationship and inherit condition logic. Will keep the more conservative approach to [ticket:2153] in 0.6.
* - remove test.sql._base, test.engine._base, test.orm._base, move those ↵Mike Bayer2011-03-271-5/+6
| | | | | | | classes to a new test.lib.fixtures module - move testing.TestBase to test.lib.fixtures - massive search and replace
* - whitespace removal bonanzaMike Bayer2011-01-021-34/+34
|
* - move sqlalchemy.test to test.libMike Bayer2010-11-151-2/+2
|
* - the _Label construct, i.e. the one that is producedMike Bayer2010-08-071-5/+25
| | | | | | | | | | | whenever you say somecol.label(), now counts itself in its "proxy_set" unioned with that of it's contained column's proxy set, instead of directly returning that of the contained column. This allows column correspondence operations which depend on the identity of the _Labels themselves to return the correct result - fixes ORM bug [ticket:1852].
* - experimenting with pytidy with mods as a textmate plugin alongMike Bayer2010-07-101-259/+332
| | | | the path to 78 chars. eh
* - Modified the internals of "column annotation" such thatMike Bayer2010-06-141-0/+18
| | | | | | | a custom Column subclass can safely override _constructor to return Column, for the purposes of making "configurational" column classes that aren't involved in proxying, etc.
* - join() will now simulate a NATURAL JOIN by default. Meaning,Mike Bayer2010-03-191-10/+98
| | | | | | | | if the left side is a join, it will attempt to join the right side to the rightmost side of the left first, and not raise any exceptions about ambiguous join conditions if successful even if there are further join targets across the rest of the left. [ticket:1714]
* - fixed internal error which would occur if calling has()Mike Bayer2010-03-111-0/+14
| | | | | or similar complex expression on a single-table inheritance relation(). [ticket:1731]
* - Fixed a column arithmetic bug that affected columnMike Bayer2010-01-031-0/+13
| | | | | | | | | correspondence for cloned selectables which contain free-standing column expressions. This bug is generally only noticeable when exercising newer ORM behavior only availble in 0.6 via [ticket:1568], but is more correct at the SQL expression level as well. [ticket:1617]
* merge from branches/clauseelement-nonzeroPhilip Jenvey2009-09-241-8/+8
| | | | | | adds a __nonzero__ to _BinaryExpression to avoid faulty comparisons during hash collisions (which only occur on Jython) fixes #1547
* merge 0.6 series to trunk.Mike Bayer2009-08-061-2/+1
|
* merged [ticket:1486] fix from 0.6Mike Bayer2009-07-281-8/+43
|
* - unit tests have been migrated from unittest to nose.Mike Bayer2009-06-101-0/+524
See README.unittests for information on how to run the tests. [ticket:970]