summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/selectable.py
Commit message (Collapse)AuthorAgeFilesLines
* - The behavior of the :func:`.union` construct and related constructsMike Bayer2015-08-121-1/+17
| | | | | | | | | such as :meth:`.Query.union` now handle the case where the embedded SELECT statements need to be parenthesized due to the fact that they include LIMIT, OFFSET and/or ORDER BY. These queries **do not work on SQLite**, and will fail on that backend as they did before, but should now work on all other backends. fixes #2528
* - fix typo in suffix_with() docs, fixes #3502Mike Bayer2015-07-291-1/+1
|
* - Fixed a regression that was incorrectly fixed in 1.0.0b4Mike Bayer2015-04-241-3/+4
| | | | | | | | | | | | | | | | | | (hence becoming two regressions); reports that SELECT statements would GROUP BY a label name and fail was misconstrued that certain backends such as SQL Server should not be emitting ORDER BY or GROUP BY on a simple label name at all; when in fact, we had forgotten that 0.9 was already emitting ORDER BY on a simple label name for all backends, as described in :ref:`migration_1068`, as 1.0 had rewritten this logic as part of :ticket:`2992`. In 1.0.2, the bug is fixed both that SQL Server, Firebird and others will again emit ORDER BY on a simple label name when passed a :class:`.Label` construct that is expressed in the columns clause, and no backend will emit GROUP BY on a simple label name in this case, as even Postgresql can't reliably do GROUP BY on a simple name in every case. fixes #3338, fixes #3385
* - Fixed issue where a straight SELECT EXISTS query would fail toMike Bayer2015-04-201-1/+2
| | | | | | | | | | | | | | | | assign the proper result type of Boolean to the result mapping, and instead would leak column types from within the query into the result map. This issue exists in 0.9 and earlier as well, however has less of an impact in those versions. In 1.0, due to #918 this becomes a regression in that we now rely upon the result mapping to be very accurate, else we can assign result-type processors to the wrong column. In all versions, this issue also has the effect that a simple EXISTS will not apply the Boolean type handler, leading to simple 1/0 values for backends without native boolean instead of True/False. The fix includes that an EXISTS columns argument will be anon-labeled like other column expressions; a similar fix is implemented for pure-boolean expressions like ``not_(True())``. fixes #3372
* Fix typospr/165Ernest Walzel2015-03-261-1/+1
| | | | | agaisnt -> against 'a Alias' -> 'an Alias'
* - Fixed bug in new "label resolution" feature of :ticket:`2992` whereMike Bayer2015-03-211-1/+2
| | | | | | | | the string label placed in the order_by() or group_by() of a statement would place higher priority on the name as found inside the FROM clause instead of a more locally available name inside the columns clause. fixes #3335
* - copyright 2015Mike Bayer2015-03-101-1/+1
|
* - pick around gaining modest dings in callcounts here and thereMike Bayer2015-03-091-2/+3
|
* - random performance whacking vs. 0.9, in particular we have to watchMike Bayer2015-03-081-15/+14
| | | | for the slots-based __getattr__ thing getting hit
* - Added support for CTEs under Oracle. This includes some tweaksMike Bayer2014-12-041-42/+89
| | | | | | | to the aliasing syntax, as well as a new CTE feature :meth:`.CTE.suffix_with`, which is useful for adding in special Oracle-specific directives to the CTE. fixes #3220
* - apply patches to correct for + sign in with_hint() docs,Mike Bayer2014-10-101-3/+2
| | | | fixes #3036
* - cyclomatic complexity: _join_condition goes from E to a BMike Bayer2014-09-271-43/+54
|
* - Added new method :meth:`.Select.with_statement_hint` and ORMMike Bayer2014-09-181-4/+32
| | | | | | method :meth:`.Query.with_statement_hint` to support statement-level hints that are not specific to a table. fixes #3206
* - add in all the method-chained methods to the parameter descriptionsMike Bayer2014-09-091-43/+131
| | | | | on select(). improve some descriptions and add more info for limit()/ offset(), including new 1.0 functionality.
* - rework the previous "order by" system in terms of the new one,Mike Bayer2014-09-081-4/+6
| | | | | | | | unify everything. - create a new layer of separation between the "from order bys" and "column order bys", so that an OVER doesn't ORDER BY a label in the same columns clause - identify another issue with polymorphic for ref #3148, match on label keys rather than the objects
* wip for #3148Mike Bayer2014-09-061-6/+9
|
* - document all the varities of _label on the base ColumnElementMike Bayer2014-09-061-2/+2
| | | | | - replace out _columns_clause_label with a straight boolean flag to reduce the proliferation of labels
* - add logic to compiler such that if stack is empty, we justMike Bayer2014-09-021-0/+1
| | | | | | | | | | | | | | | | stringify a _label_reference() as is. - add .key to _label_reference(), so that when _make_proxy() is called, we don't call str() on it anyway. - add a test to exercise Query's behavior of adding all the order_by expressions to the columns list of the select, assert that things work out when we have a _label_reference there, that it gets sucked into the columns list and spit out on the other side, it's referred to appropriately, etc. _label_reference() could theoretically be resolved at the point we iterate _raw_columns() but it's better to just let things work as they already do (except nicer, since we get "tablename.colname" instead of just "somename" in the columns list) so that we aren't adding a ton of overhead to _columns_plus_names in the common case.
* - The :func:`~.expression.column` and :func:`~.expression.table`Mike Bayer2014-09-011-16/+45
| | | | | | | | | | | | | | | | | | | | | constructs are now importable from the "from sqlalchemy" namespace, just like every other Core construct. - The implicit conversion of strings to :func:`.text` constructs when passed to most builder methods of :func:`.select` as well as :class:`.Query` now emits a warning with just the plain string sent. The textual conversion still proceeds normally, however. The only method that accepts a string without a warning are the "label reference" methods like order_by(), group_by(); these functions will now at compile time attempt to resolve a single string argument to a column or label expression present in the selectable; if none is located, the expression still renders, but you get the warning again. The rationale here is that the implicit conversion from string to text is more unexpected than not these days, and it is better that the user send more direction to the Core / ORM when passing a raw string as to what direction should be taken. Core/ORM tutorials have been updated to go more in depth as to how text is handled. fixes #2992
* - apply pep8 formatting to sqlalchemy/sql, sqlalchemy/util, sqlalchemy/dialects,Brian Jarrett2014-07-201-242/+266
| | | | sqlalchemy/orm, sqlalchemy/event, sqlalchemy/testing
* - Fixed a SQLite join rewriting issue where a subquery that is embeddedMike Bayer2014-07-151-0/+1
| | | | | | | | as a scalar subquery such as within an IN would receive inappropriate substitutions from the enclosing query, if the same table were present inside the subquery as were in the enclosing query such as in a joined inheritance scenario. fixes #3130
* - break up the <authors> copyright comment as part of a passMike Bayer2014-07-091-1/+2
| | | | to get all flake8 passing
* - Fixed bug in INSERT..FROM SELECT construct where selecting from aMike Bayer2014-05-251-1/+1
| | | | | UNION would wrap the union in an anonymous (e.g. unlabled) subquery. fixes #3044
* - more tests, including backend testsMike Bayer2014-05-161-30/+54
| | | | - implement for SQL server, use window functions when simple limit/offset not available
* Merge branch 'issue_3034' of ↵Mike Bayer2014-05-161-7/+68
|\ | | | | | | https://bitbucket.org/dobesv/sqlalchemy/branch/issue_3034 into ticket_3034
| * Remove unused importDobes Vandermeer2014-05-091-6/+29
| |
| * Remove unused importDobes Vandermeer2014-04-251-1/+1
| |
| * Use _offset_clause and _limit_clause, which are always Visitable and usually ↵Dobes Vandermeer2014-04-251-11/+41
| | | | | | | | a BindParameter, instead of _offset and _limit in GenerativeSelect.
| * Proof-of-concept implementation of supporting bindparam for offset and limit ↵Dobes Vandermeer2014-04-241-4/+12
| | | | | | | | on a query.
* | Documentation fix-up: "its" vs. "it's"pr/91Matthias Urlichs2014-05-111-1/+1
| | | | | | | | | | | | | | | | | | Removed ungrammatical apostrophes from documentation, replacing "it's" with "its" where appropriate (but in a few cases with "it is" when that read better). While doing that, I also fixed a couple of minor typos etc. as I noticed them.
* | Fix many typos throughout the codebasepr/85Alex Gaynor2014-04-261-3/+3
|/ | | | Found using: https://github.com/intgr/topy
* escape backslashMike Bayer2014-04-021-1/+1
|
* - reverse order of columns in sample CTEs as this is a UNION and the cols ↵Mike Bayer2014-04-021-3/+1
| | | | | | | | | | need to line up - alter this in the unit tests as well as these queries were just copied from the tests - remove the included_parts.join(parts) from the core CTE doc (also just copied from the test, where we want to make sure joins don't get screwed up with the CTE) as it doesn't contribute to the query itself fixes #3014
* - back off the callcounts a bit for the boolean fixMike Bayer2014-04-011-3/+4
| | | | - rewrite callcounts for select()
* - Fixes to the newly enhanced boolean coercion in :ticket:`2804` whereMike Bayer2014-04-011-2/+2
| | | | | | | the new rules for "where" and "having" woudn't take effect for the "whereclause" and "having" kw arguments of the :func:`.select` construct, which is also what :class:`.Query` uses so wasn't working in the ORM either. fixes #3013 re: #2804
* - add further coverage for join_condition to make sure we get this case whereMike Bayer2014-03-281-1/+1
| | | | there are multiple, equivalent foreign keys
* - fix set syntax supposed to be dictMike Bayer2014-03-281-1/+1
|
* - fix py3k bug re: dictionary values(), fixes #3005Mike Bayer2014-03-281-1/+1
|
* - Improved the check for "how to join from A to B" such that whenMike Bayer2014-03-271-16/+34
| | | | | | | | | a table has multiple, composite foreign keys targeting a parent table, the :paramref:`.relationship.foreign_keys` argument will be properly interpreted in order to resolve the ambiguity; previously this condition would raise that there were multiple FK paths when in fact the foreign_keys argument should be establishing which one is expected. fixes #2965
* - Some changes to how the :attr:`.FromClause.c` collection behavesMike Bayer2014-02-261-7/+8
| | | | | | | | | | | | | | | | | | | | | | | when presented with duplicate columns. The behavior of emitting a warning and replacing the old column with the same name still remains to some degree; the replacement in particular is to maintain backwards compatibility. However, the replaced column still remains associated with the ``c`` collection now in a collection ``._all_columns``, which is used by constructs such as aliases and unions, to deal with the set of columns in ``c`` more towards what is actually in the list of columns rather than the unique set of key names. This helps with situations where SELECT statements with same-named columns are used in unions and such, so that the union can match the columns up positionally and also there's some chance of :meth:`.FromClause.corresponding_column` still being usable here (it can now return a column that is only in selectable.c._all_columns and not otherwise named). The new collection is underscored as we still need to decide where this list might end up. Theoretically it would become the result of iter(selectable.c), however this would mean that the length of the iteration would no longer match the length of keys(), and that behavior needs to be checked out. fixes #2974 - add a bunch more tests for ColumnCollection
* - More fixes to SQLite "join rewriting"; the fix from :ticket:`2967`Mike Bayer2014-02-201-0/+11
| | | | | | | | | | | | | | implemented right before the release of 0.9.3 affected the case where a UNION contained nested joins in it. "Join rewriting" is a feature with a wide range of possibilities and is the first intricate "SQL rewriting" feature we've introduced in years, so we're sort of going through a lot of iterations with it (not unlike eager loading back in the 0.2/0.3 series, polymorphic loading in 0.4/0.5). We should be there soon so thanks for bearing with us :). fixes #2969 re: #2967 - solve the issue of join rewriting inspecting various types of from objects without using isinstance(), by adding some new underscored inspection flags to the FromClause hierarchy.
* - Fixed bug in new :class:`.TextAsFrom` construct where :class:`.Column`-Mike Bayer2014-02-021-0/+6
| | | | | | | | | | oriented row lookups were not matching up to the ad-hoc :class:`.ColumnClause` objects that :class:`.TextAsFrom` generates, thereby making it not usable as a target in :meth:`.Query.from_statement`. Also fixed :meth:`.Query.from_statement` mechanics to not mistake a :class:`.TextAsFrom` for a :class:`.Select` construct. This bug is also an 0.9 regression as the :meth:`.Text.columns` method is called to accommodate the :paramref:`.text.typemap` argument. [ticket:2932]
* seealsos in the tutorialMike Bayer2014-01-251-0/+4
|
* lets document join()Mike Bayer2014-01-241-20/+94
|
* - happy new yearMike Bayer2014-01-051-1/+1
|
* - fix some docstring stuffMike Bayer2014-01-051-0/+8
|
* - call it 0.9.0Mike Bayer2013-12-301-4/+4
|
* - add support for bindparam() called from AsFromTextMike Bayer2013-11-291-0/+4
| | | | | - get PG dialect to work around "no nonexistent binds" rule for now, though we might want to reconsider this behavior
* Merge pull request #46 from vrajmohan/mastermike bayer2013-11-291-1/+1
|\ | | | | More fixes for cross references and reducing warnings (3rd wave)
| * Fix cross referencespr/46Vraj Mohan2013-11-171-1/+1
| |