summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/expression.py
Commit message (Collapse)AuthorAgeFilesLines
...
* - copyright 2015Mike Bayer2015-03-101-1/+1
|
* - correctionsMike Bayer2014-12-271-1/+1
| | | | - attempt to add a script to semi-automate the fixing of links
* - Reversing a change that was made in 0.9, the "singleton" natureMike Bayer2014-10-191-3/+3
| | | | | | | | | of the "constants" :func:`.null`, :func:`.true`, and :func:`.false` has been reverted. These functions returning a "singleton" object had the effect that different instances would be treated as the same regardless of lexical use, which in particular would impact the rendering of the columns clause of a SELECT statement. fixes #3170
* renamed aggregatefilter to funcfilter, since it is thatIlja Everilä2014-09-111-3/+3
|
* implementation for <aggregate_fun> FILTER (WHERE ...)Ilja Everilä2014-09-101-1/+3
|
* - The :func:`~.expression.column` and :func:`~.expression.table`Mike Bayer2014-09-011-1/+2
| | | | | | | | | | | | | | | | | | | | | 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-20/+26
| | | | sqlalchemy/orm, sqlalchemy/event, sqlalchemy/testing
* - break up the <authors> copyright comment as part of a passMike Bayer2014-07-091-1/+2
| | | | to get all flake8 passing
* - Restored the import for :class:`.Function` to the ↵Mike Bayer2014-04-051-1/+1
| | | | | | ``sqlalchemy.sql.expression`` import namespace, which was removed at the beginning of 0.9.
* - happy new yearMike Bayer2014-01-051-1/+1
|
* make generativeselect availableMike Bayer2013-11-291-1/+1
|
* - New improvements to the :func:`.text` construct, includingMike Bayer2013-11-291-2/+2
| | | | | | | | more flexible ways to set up bound parameters and return types; in particular, a :func:`.text` can now be turned into a full FROM-object, embeddable in other statements as an alias or CTE using the new method :meth:`.TextClause.columns`. [ticket:2877]
* Import CTE so that API doc can be generatedVraj Mohan2013-11-141-1/+1
|
* An overhaul of expression handling for special symbols particularlyMike Bayer2013-10-231-5/+6
| | | | | | | | | | with conjunctions, e.g. ``None`` :func:`.expression.null` :func:`.expression.true` :func:`.expression.false`, including consistency in rendering NULL in conjunctions, "short-circuiting" of :func:`.and_` and :func:`.or_` expressions which contain boolean constants, and rendering of boolean constants and expressions as compared to "1" or "0" for backends that don't feature ``true``/``false`` constants. [ticket:2804]
* - The ``version_id_generator`` parameter of ``Mapper`` can now be specifiedMike Bayer2013-08-251-1/+2
| | | | | | | | | | | | | | | | | | | | | to rely upon server generated version identifiers, using triggers or other database-provided versioning features, by passing the value ``False``. The ORM will use RETURNING when available to immediately load the new version identifier, else it will emit a second SELECT. [ticket:2793] - The ``eager_defaults`` flag of :class:`.Mapper` will now allow the newly generated default values to be fetched using an inline RETURNING clause, rather than a second SELECT statement, for backends that support RETURNING. - Added a new variant to :meth:`.ValuesBase.returning` called :meth:`.ValuesBase.return_defaults`; this allows arbitrary columns to be added to the RETURNING clause of the statement without interfering with the compilers usual "implicit returning" feature, which is used to efficiently fetch newly generated primary key values. For supporting backends, a dictionary of all fetched values is present at :attr:`.ResultProxy.returned_defaults`. - add a glossary entry for RETURNING - add documentation for version id generation, [ticket:867]
* - apply an import refactoring to the ORM as wellMike Bayer2013-08-141-32/+31
| | | | | | | | | - rework the event system so that event modules load after their targets, dependencies are reversed - create an improved strategy lookup system for the ORM - rework the ORM to have very few import cycles - move out "importlater" to just util.dependency - other tricks to cross-populate modules in as clear a way as possible
* fix missing savepoint structuresMike Bayer2013-08-121-0/+3
|
* - A large refactoring of the ``sqlalchemy.sql`` package has reorganizedMike Bayer2013-08-121-6606/+79
| | | | | | | | | | | | | | | | | | | | | | the import structure of many core modules. ``sqlalchemy.schema`` and ``sqlalchemy.types`` remain in the top-level package, but are now just lists of names that pull from within ``sqlalchemy.sql``. Their implementations are now broken out among ``sqlalchemy.sql.type_api``, ``sqlalchemy.sql.sqltypes``, ``sqlalchemy.sql.schema`` and ``sqlalchemy.sql.ddl``, the last of which was moved from ``sqlalchemy.engine``. ``sqlalchemy.sql.expression`` is also a namespace now which pulls implementations mostly from ``sqlalchemy.sql.elements``, ``sqlalchemy.sql.selectable``, and ``sqlalchemy.sql.dml``. Most of the "factory" functions used to create SQL expression objects have been moved to classmethods or constructors, which are exposed in ``sqlalchemy.sql.expression`` using a programmatic system. Care has been taken such that all the original import namespaces remain intact and there should be no impact on any existing applications. The rationale here was to break out these very large modules into smaller ones, provide more manageable lists of function names, to greatly reduce "import cycles" and clarify the up-front importing of names, and to remove the need for redundant functions and documentation throughout the expression package.
* - The :meth:`.Operators.notin_` operator added in 0.8 now properlyMike Bayer2013-08-071-1/+4
| | | | | produces the negation of the expression "IN" returns when used against an empty collection. Also in 0.8.3.
* - Fixed bug in common table expression system where if the CTE wereMike Bayer2013-07-311-4/+4
| | | | | | used only as an ``alias()`` construct, it would not render using the WITH keyword. Also in 0.8.3, 0.7.11. [ticket:2783]
* - 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-121-1/+4
| | | | | | | | | | | | 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-051-2/+49
| | | | | | | | | | :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.
* - rework of correlation, continuing on #2668, #2746Mike Bayer2013-06-261-43/+111
| | | | | | | | | | | | | | | | | | | | | | | | - 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.
* 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]
* - tests for the alias() APIMike Bayer2013-06-081-11/+90
| | | | - docs docs docs
* Merge branch 'ticket_2587'Mike Bayer2013-06-041-9/+19
|\ | | | | | | | | | | Conflicts: test/profiles.txt test/sql/test_selectable.py
| * - improve overlapping selectables, apply to both query and relationshipMike Bayer2013-06-041-1/+2
| | | | | | | | | | | | - 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)
| * getting things to join without subqueries, but some glitches in the compiler ↵Mike Bayer2013-06-021-4/+4
| | | | | | | | | | | | step when we do query.count() are showing
* | Merge branch 'master' into ticket_1068Mike Bayer2013-06-031-59/+47
|\ \ | |/
| * - 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__
| * Merge branch 'master' into rel_0_9Mike Bayer2013-05-261-1/+1
| |\
| * \ Merge branch 'master' into rel_0_9Mike Bayer2013-05-261-2/+2
| |\ \
| * | | most of ORM passing...Mike Bayer2013-05-041-0/+1
| | | |
| * | | - test_types, test_compiler, with sqlite at leastMike Bayer2013-04-281-2/+1
| | | |
| * | | - endless isinstance(x, str)s....Mike Bayer2013-04-281-50/+45
| | | |
| * | | - the raw 2to3 runMike Bayer2013-04-271-40/+44
| | | | | | | | | | | | | | | | - went through examples/ and cleaned out excess list() calls
* | | | magic accessors to the rescueMike Bayer2013-05-271-0/+13
| |_|/ |/| |
* | | 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-251-2/+14
|
* Fully implemented the IS and IS NOT operators withMike Bayer2013-04-221-12/+34
| | | | | | | | | | regards to the True/False constants. An expression like ``col.is_(True)`` will now render ``col IS true`` on the target platform, rather than converting the True/ False constant to an integer bound parameter. This allows the ``is_()`` operator to work on MySQL when given True/False constants. [ticket:2682]
* A major fix to the way in which a select() object producesMike Bayer2013-04-111-6/+40
| | | | | | | | | | | | | | | | | | | labeled columns when apply_labels() is used; this mode produces a SELECT where each column is labeled as in <tablename>_<columnname>, to remove column name collisions for a multiple table select. The fix is that if two labels collide when combined with the table name, i.e. "foo.bar_id" and "foo_bar.id", anonymous aliasing will be applied to one of the dupes. This allows the ORM to handle both columns independently; previously, 0.7 would in some cases silently emit a second SELECT for the column that was "duped", and in 0.8 an ambiguous column error would be emitted. The "keys" applied to the .c. collection of the select() will also be deduped, so that the "column being replaced" warning will no longer emit for any select() that specifies use_labels, though the dupe key will be given an anonymous label which isn't generally user-friendly. [ticket:2702]
* no need to use getattr() hereMike Bayer2013-03-171-0/+2
|
* doc updatesMike Bayer2013-03-111-29/+29
|
* - repair doctest for SQL expression tutorialMike Bayer2013-03-111-1/+35
| | | | | | | | - remove most use of "whereclause" and "from_obj", not done yet, part of [ticket:2679] - add links to method chained versions for all Select.append_XYZ() calls - add "method chaining" and "generative" to glossary
* - since correlation is now always at least semi-automatic, remove theMike Bayer2013-03-091-28/+30
| | | | | | ability for correlation to have any effect for a SELECT that's stated in the FROM. - add a new exhaustive test suite for correlation to test_compiler