summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql
Commit message (Collapse)AuthorAgeFilesLines
* - use inline=True for the insert..select here so it works on oracleMike Bayer2013-07-121-0/+11
|
* Fixed bug where the expression system relied upon the ``str()``Mike Bayer2013-07-123-5/+23
| | | | | | | | | | | | 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]
* - Added new method to the :func:`.insert` constructMike Bayer2013-07-052-3/+52
| | | | | | | | | | :meth:`.Insert.from_select`. Given a list of columns and a selectable, renders ``INSERT INTO (table) (columns) SELECT ..``. While this feature is highlighted as part of 0.9 it is also backported to 0.8.3. [ticket:722] - The :func:`.update`, :func:`.insert`, and :func:`.delete` constructs will now interpret ORM entities as FROM clauses to be operated upon, in the same way that select() already does. Also in 0.8.3.
* Fixed bug when using multi-table UPDATE where a supplementalMike Bayer2013-07-021-2/+2
| | | | | | | table is a SELECT with its own bound parameters, where the positioning of the bound parameters would be reversed versus the statement itself when using MySQL's special syntax. [ticket:2768]
* - rework of correlation, continuing on #2668, #2746Mike Bayer2013-06-262-60/+184
| | | | | | | | | | | | | | | | | | | | | | | | - add support for correlations to propagate all the way in; because correlations require context now, need to make sure a select enclosure of any level takes effect any number of levels deep. - fix what we said correlate_except() was supposed to do when we first released #2668 - "the FROM clause is left intact if the correlated SELECT is not used in the context of an enclosing SELECT..." - it was not considering the "existing_froms" collection at all, and prohibited additional FROMs from being placed in an any() or has(). - add test for multilevel any() - lots of docs, including glossary entries as we really need to define "WHERE clause", "columns clause" etc. so that we can explain correlation better - based on the insight that a SELECT can correlate anything that ultimately came from an enclosing SELECT that links to this one via WHERE/columns/HAVING/ORDER BY, have the compiler keep track of the FROM lists that correspond in this way, link it to the asfrom flag, so that we send to _get_display_froms() the exact list of candidate FROMs to correlate. no longer need any asfrom logic in the Select() itself - preserve 0.8.1's behavior for correlation when no correlate options are given, not to mention 0.7 and prior's behavior of not propagating implicit correlation more than one level.. this is to reduce surprises/hard-to-debug situations when a user isn't trying to correlate anything.
* The resolution of :class:`.ForeignKey` objects to theirMike Bayer2013-06-231-1/+3
| | | | | | | | | | | | | | | | | | 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]
* Provided a new attribute for :class:`.TypeDecorator`Mike Bayer2013-06-221-2/+5
| | | | | | | | | called :attr:`.TypeDecorator.coerce_to_is_types`, to make it easier to control how comparisons using ``==`` or ``!=`` to ``None`` and boolean types goes about producing an ``IS`` expression, or a plain equality expression with a bound parameter. [ticket:2744]
* cleanupMike Bayer2013-06-082-15/+6
|
* - tests for the alias() APIMike Bayer2013-06-081-11/+90
| | | | - docs docs docs
* - Fixed an obscure bug where the wrong results would beMike Bayer2013-06-071-0/+2
| | | | | | | | | | | 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-061-6/+5
| | | | | | | 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".
* Merge branch 'ticket_2587'Mike Bayer2013-06-044-31/+170
|\ | | | | | | | | | | Conflicts: test/profiles.txt test/sql/test_selectable.py
| * - add coverage for result map rewritingMike Bayer2013-06-041-1/+6
| | | | | | | | | | - fix the result map rewriter for col mismatches, since the rewritten select at the moment typically has more columns than the original
| * - if the select() does not have use_labels on, then we just renderMike Bayer2013-06-041-0/+1
| | | | | | | | | | | | the joins as is, regardless of the dialect not supporting it. use_labels=True indicates a higher level of automation and also can maintain the labels between rewritten and not. use_labels=False indicates a manual use case.
| * - support for a__b_dc, i.e. two levels of nestingMike Bayer2013-06-041-4/+19
| |
| * - improve overlapping selectables, apply to both query and relationshipMike Bayer2013-06-042-6/+20
| | | | | | | | | | | | - clean up inspect() calls within query._join() - make sure join.alias(flat) propagates - fix almost all assertion tests
| * here's the flat join thing. it just works. Changing the existing compiled ↵Mike Bayer2013-06-041-5/+14
| | | | | | | | | | | | SQL assertions might even be most of the tests we need (though dedicated sql tests would be needed anyway)
| * and this commentMike Bayer2013-06-041-0/+4
| |
| * rewriting scheme now works.Mike Bayer2013-06-041-71/+43
| |
| * capture the really hard one in a test (hooray)Mike Bayer2013-06-041-1/+1
| |
| * OK this is the broken version, need to think a lot more about thisMike Bayer2013-06-032-2/+46
| |
| * working through tests....Mike Bayer2013-06-021-1/+13
| |
| * - figured out what the from_self() thing was about, part of query.statement, ↵Mike Bayer2013-06-023-9/+4
| | | | | | | | | | | | but would like to improve upon query.statement needing to do this
| * getting things to join without subqueries, but some glitches in the compiler ↵Mike Bayer2013-06-023-7/+13
| | | | | | | | | | | | step when we do query.count() are showing
| * implement join rewriting inside of visit_select(). Currently this is global ↵Mike Bayer2013-06-023-13/+75
| | | | | | | | or not based on fixing nested_join_translation as True or not.
* | - remove the ``__iter__()`` with notimplemented since it interferesMike Bayer2013-06-031-5/+0
| | | | | | | | with legitimate iterable detection, [ticket:2726]
* | - add changelog/migration noteMike Bayer2013-06-031-9/+9
| | | | | | | | - inline the label check
* | Merge branch 'master' into ticket_1068Mike Bayer2013-06-037-109/+82
|\ \ | |/
| * - implement armin's awesome metaclass adaptor, can drop the refs to MetaBase.Mike Bayer2013-05-302-9/+8
| |
| * - the distinct hash code logic here is entirely obsolete as you canMike Bayer2013-05-301-11/+0
| | | | | | | | | | do eq_() on columnelements now with a meaningful bool; jython is entirely a non-starter right now in any case as 2.7 doesn't support common accessors like __defaults__
| * fix an errant str checkMike Bayer2013-05-261-1/+1
| |
| * a pass where we try to squash down as many list()/keys() combinationsMike Bayer2013-05-261-2/+2
| | | | | | | | as possible
| * Merge branch 'master' into rel_0_9Mike Bayer2013-05-261-1/+1
| |\
| * \ Merge branch 'master' into rel_0_9Mike Bayer2013-05-261-2/+2
| |\ \
| * | | sqlite testsMike Bayer2013-05-261-2/+2
| | | |
| * | | most of ORM passing...Mike Bayer2013-05-041-0/+1
| | | |
| * | | - unicode literals need to just be handled differently if they have utf-8Mike Bayer2013-05-041-3/+3
| | | | | | | | | | | | | | | | | | | | encoded in them vs. unicode escaping. not worth figuring out how to combine these right now
| * | | - test_types, test_compiler, with sqlite at leastMike Bayer2013-04-281-2/+1
| | | |
| * | | - endless isinstance(x, str)s....Mike Bayer2013-04-283-71/+65
| | | |
| * | | import of "sqlalchemy" and "sqlalchemy.orm" works.Mike Bayer2013-04-273-26/+15
| | | |
| * | | plugging awayMike Bayer2013-04-271-1/+1
| | | |
| * | | - the raw 2to3 runMike Bayer2013-04-277-90/+92
| | | | | | | | | | | | | | | | - went through examples/ and cleaned out excess list() calls
* | | | magic accessors to the rescueMike Bayer2013-05-272-7/+20
| | | |
* | | | still not locating more nested expressions, may need to match on nameMike Bayer2013-05-271-11/+37
| | | |
* | | | attempt number one, doesn't detect though if the label in the order by is ↵Mike Bayer2013-05-271-3/+19
| |_|/ |/| | | | | | | | not directly present there.
* | | fix this testMike Bayer2013-05-261-1/+1
| |/ |/|
* | Show the conflicting column in the warning!Chris Withers2013-05-261-2/+2
|/
* heh dont need that eitherMike Bayer2013-04-251-7/+1
|
* dont need thisMike Bayer2013-04-251-6/+0
|
* everything passes with this!!!!!!! holy crap !!!!! and its the simplest of allMike Bayer2013-04-252-3/+15
|