summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/visitors.py
Commit message (Collapse)AuthorAgeFilesLines
* - happy new yearMike Bayer2014-01-051-1/+1
|
* Fixed bug where the expression system relied upon the ``str()``Mike Bayer2013-07-121-2/+13
| | | | | | | | | | | | form of a some expressions when referring to the ``.c`` collection on a ``select()`` construct, but the ``str()`` form isn't available since the element relies on dialect-specific compilation constructs, notably the ``__getitem__()`` operator as used with a Postgresql ``ARRAY`` element. The fix also adds a new exception class :class:`.UnsupportedCompilationError` which is raised in those cases where a compiler is asked to compile something it doesn't know how to. Also in 0.8.3. [ticket:2780]
* cleanupMike Bayer2013-06-081-11/+5
|
* - figured out what the from_self() thing was about, part of query.statement, ↵Mike Bayer2013-06-021-1/+3
| | | | | | but would like to improve upon query.statement needing to do this
* implement join rewriting inside of visit_select(). Currently this is global ↵Mike Bayer2013-06-021-1/+6
| | | | or not based on fixing nested_join_translation as True or not.
* - implement armin's awesome metaclass adaptor, can drop the refs to MetaBase.Mike Bayer2013-05-301-1/+1
|
* import of "sqlalchemy" and "sqlalchemy.orm" works.Mike Bayer2013-04-271-5/+3
|
* plugging awayMike Bayer2013-04-271-1/+1
|
* - the raw 2to3 runMike Bayer2013-04-271-3/+1
| | | | - went through examples/ and cleaned out excess list() calls
* happy new year (see #2645)Diana Clarke2013-01-011-1/+1
|
* just a pep8 pass of lib/sqlalchemy/sql/Diana Clarke2012-11-191-10/+34
|
* -whitespace bonanza, contdMike Bayer2012-07-281-17/+17
|
* absolute imports in core, sqlMike Bayer2012-06-231-1/+1
|
* - merged #1401 branch from bitbucketMike Bayer2012-04-221-6/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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/+3
| | | | | | | | | | - got everything working. just need to update error strings
| * initial annotations approach to join conditions. all tests pass, plus ↵Mike Bayer2012-02-061-3/+3
| | | | | | | | | | | | additional tests in #1401 pass. would now like to reorganize RelationshipProperty more around the annotations concept.
* | revert this, the instrumentation here is conditionalMike Bayer2012-03-131-2/+2
| |
* | add most of Brad Allen's doc updates, [ticket:2434]Mike Bayer2012-03-131-8/+28
|\ \ | |/ |/|
| * Tiny wording fix in a commentBrad Allen2011-03-161-2/+2
| |
| * Slight sanity/clarity improvement to the way VisitableType binds theBrad Allen2011-03-161-9/+30
| | | | | | | | | | | | | | | | _compiler_dispatch. This code change has no functional or performance implications, but it helps make the docstring easier to write. Mostly this commit is about docstring improvements and comments to explain optimizations.
* | happy new yearMike Bayer2012-01-041-1/+1
| |
* | - rewrite cloned_traverse() and replacement_traverse() to use a straightMike Bayer2011-07-241-42/+38
|/ | | | | | | | | | | | | | | | 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"
* - The compiler extension now supports overriding the defaultMike Bayer2011-02-091-13/+16
| | | | | | | compilation of expression._BindParamClause including that the auto-generated binds within the VALUES/SET clause of an insert()/update() statement will also use the new compilation rules. [ticket:2042]
* - whitespace removal bonanzaMike Bayer2011-01-021-26/+26
|
* - clean up copyright, update for 2011, stamp every file withMike Bayer2011-01-021-0/+6
| | | | | a consistent tag - AUTHORS file
* - Table.create() and Table.drop() no longer apply metadata-Mike Bayer2010-04-161-2/+2
| | | | level create/drop events. [ticket:1771]
* - the compiler extension now allows @compiles decoratorsMike Bayer2010-03-301-10/+11
| | | | | | on base classes that extend to child classes, @compiles decorators on child classes that aren't broken by a @compiles decorator on the base class.
* merge from branches/clauseelement-nonzeroPhilip Jenvey2009-09-241-2/+2
| | | | | | 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-4/+1
|
* merged -r5299:5438 of py3k warnings branch. this fixes some sqlite py2.6 ↵Mike Bayer2008-12-181-3/+3
| | | | | | | | testing issues, and also addresses a significant chunk of py3k deprecations. It's mainly expicit __hash__ methods. Additionally, most usage of sets/dicts to store columns uses util-based placeholder names.
* - turn __visit_name__ into an explicit member.Mike Bayer2008-12-111-10/+11
| | | | [ticket:1244]
* - removed creepy exec call for nowMike Bayer2008-12-061-7/+7
| | | | | - removed unnecessary isinstance() from class_mapper() - removed unnecessary and py3k incompatible "dictionary sort" from association table delete
* docstring updatesMike Bayer2008-11-071-0/+53
|
* - moved _FigureVisitName into visitiors.VisitorType, added Visitor base ↵Mike Bayer2008-10-251-15/+42
| | | | | | | class to reduce dependencies - implemented _generative decorator for select/update/insert/delete constructs - other minutiae
* - Always use native dequeJason Kirtland2008-07-151-4/+4
|
* - Removed 2.3 set emulations/enhancements.Jason Kirtland2008-07-151-1/+1
| | | | (sets.Set-based collections & DB-API returns still work.)
* r4695 merged to trunk; trunk now becomes 0.5.Mike Bayer2008-05-091-143/+139
| | | | 0.4 development continues at /sqlalchemy/branches/rel_0_4
* - simplified __create_lazy_clause to make better usage of the new ↵Mike Bayer2008-04-141-2/+1
| | | | | | | | | local/remote pairs collection - corrected the direction of local/remote pairs for manytoone - added new tests which demonstrate lazyloading working when the bind param is embedded inside of a SQL function, when _local_remote_pairs argument is used; fixes the viewonly version of [ticket:610] - removed needless kwargs check from visitors.traverse
* - merged -r4458:4466 of query_columns branchMike Bayer2008-04-071-1/+8
| | | | | | | - this branch changes query.values() to immediately return an iterator, adds a new "aliased" construct which will be the primary method to get at aliased columns when using values() - tentative ORM versions of _join and _outerjoin are not yet public, would like to integrate with Query better (work continues in the branch) - lots of fixes to expressions regarding cloning and correlation. Some apparent ORM bug-workarounds removed. - to fix a recursion issue with anonymous identifiers, bind parameters generated against columns now just use the name of the column instead of the tablename_columnname label (plus the unique integer counter). this way expensive recursive schemes aren't needed for the anon identifier logic. This, as usual, impacted a ton of compiler unit tests which needed a search-n-replace for the new bind names.
* - merged with_polymorphic branch, which was merged with query_columns branchMike Bayer2008-03-291-25/+12
| | | | | | | | | | | | | | | | | - removes everything to do with select_table, which remains as a keyword argument synonymous with with_polymorphic=('*', select_table). - all "polymorphic" selectables find their way to Query by way of _set_select_from() now, so that all joins/aliasing/eager loads/etc. is handled consistently. Mapper has methods for producing polymorphic selectables so that Query and eagerloaders alike can get to them. - row aliasing simplified, so that they don't need to nest. they only need the source selectable and adapt to whatever incoming columns they get. - Query is more egalitarian about mappers/columns now. Still has a strong sense of "entity zero", but also introduces new unpublished/experimental _values() method which sets up a columns-only query. - Query.order_by() and Query.group_by() take *args now (also still take a list, will likely deprecate in 0.5). May want to do this for select() as well. - the existing "check for False discriminiator" "fix" was not working completely, added coverage - orphan detection was broken when the target object was a subclass of the mapper with the orphaned relation, fixed that too.
* a few more tweaksMike Bayer2008-03-251-5/+3
|
* removed AbstractClauseProcessor, merged its copy-and-visit behavior into ↵Mike Bayer2008-03-241-31/+113
| | | | ClauseVisitor
* - more fixes to the LIMIT/OFFSET aliasing applied with Query + eagerloads,Mike Bayer2007-12-161-14/+11
| | | | | | | | in this case when mapped against a select statement [ticket:904] - _hide_froms logic in expression totally localized to Join class, including search through previous clone sources - removed "stop_on" from main visitors, not used - "stop_on" in AbstractClauseProcessor part of constructor, ClauseAdapter sets it up based on given clause - fixes to is_derived_from() to take previous clone sources into account, Alias takes self + cloned sources into account. this is ultimately what the #904 bug was.
* - all kinds of cleanup, tiny-to-slightly-significant speed improvementsMike Bayer2007-11-241-0/+12
|
* more changes to traverse-and-clone; a particular element will only be cloned ↵Mike Bayer2007-11-081-3/+12
| | | | | | | | once and is then re-used. the FROM calculation of a Select normalizes the list of hide_froms against all previous incarnations of each FROM clause, using a tag attached from cloned clause to previous.
* - eager loading with LIMIT/OFFSET applied no longer adds the primaryMike Bayer2007-11-031-0/+8
| | | | | | | table joined to a limited subquery of itself; the eager loads now join directly to the subquery which also provides the primary table's columns to the result set. This eliminates a JOIN from all eager loads with LIMIT/OFFSET. [ticket:843]
* - rewritten ClauseAdapter merged from the eager_minus_join branch; this is a ↵Mike Bayer2007-11-031-10/+6
| | | | | | | | much simpler and "correct" version which will copy all elements exactly once, except for those which were replaced with target elements. It also can match a wider variety of target elements including joins and selects on identity alone.
* 1. Module layout. sql.py and related move into a package called "sql".Mike Bayer2007-08-181-0/+87
2. compiler names changed to be less verbose, unused classes removed. 3. Methods on Dialect which return compilers, schema generators, identifier preparers have changed to direct class references, typically on the Dialect class itself or optionally as attributes on an individual Dialect instance if conditional behavior is needed. This takes away the need for Dialect subclasses to know how to instantiate these objects, and also reduces method overhead by one call for each one. 4. as a result of 3., some internal signatures have changed for things like compiler() (now statement_compiler()), preparer(), etc., mostly in that the dialect needs to be passed explicitly as the first argument (since they are just class references now). The compiler() method on Engine and Connection is now also named statement_compiler(), but as before does not take the dialect as an argument. 5. changed _process_row function on RowProxy to be a class reference, cuts out 50K method calls from insertspeed.py