summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/expression.py
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Changed behavior of Select.correlate() to ignore correlations to froms that ↵Luke Cyca2013-03-071-25/+34
| | | | don't exist in the superquery.
* - A clear error message is emitted if an event handlerMike Bayer2013-02-251-1/+8
| | | | | | | | | | attempts to emit SQL on a Session within the after_commit() handler, where there is not a viable transaction in progress. [ticket:2662] - rework how SessionTransaction maintains state, using symbols instead. - add lots of notes and cross-linking for session events. - add a link to :func:`.select()` within :meth:`.FromClause.select`.
* The :meth:`.ColumnOperators.in_` operator will now coerceMike Bayer2013-02-021-0/+2
| | | | | values of ``None`` to :func:`.null`. [ticket:2496]
* happy new year (see #2645)Diana Clarke2013-01-011-1/+1
|
* Fixed bug whereby using a label_length on dialect that was smallerMike Bayer2012-12-081-6/+11
| | | | | | than the size of actual column identifiers would fail to render the columns correctly in a SELECT statement. [ticket:2610]
* - multivalued inserts, [ticket:2623]Mike Bayer2012-12-081-55/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - update "not supported" messages for empty inserts, mutlivalue inserts - rework the ValuesBase approach for multiple value sets so that stmt.parameters does store a list for multiple values; the _has_multiple_parameters flag now indicates which of the two modes the statement is within. it now raises exceptions if a subsequent call to values() attempts to call a ValuesBase with one mode in the style of the other mode; that is, you can't switch a single- or multi- valued ValuesBase to the other mode, and also if a multiple value is passed simultaneously with a kwargs set. Added tests for these error conditions - Calling values() multiple times in multivalue mode now extends the parameter list to include the new parameter sets. - add error/test if multiple *args were passed to ValuesBase.values() - rework the compiler approach for multivalue inserts, back to where _get_colparams() returns the same list of (column, value) as before, thereby maintaining the identical number of append() and other calls when multivalue is not enabled. In the case of multivalue, it makes a last-minute switch to return a list of lists instead of the single list. As it constructs the additional lists, the inline defaults and other calculated default parameters of the first parameter set are copied into the newly generated lists so that these features continue to function for a multivalue insert. Multivalue inserts now add no additional function calls to the compilation for regular insert constructs. - parameter lists for multivalue inserts now includes an integer index for all parameter sets. - add detailed documentation for ValuesBase.values(), including careful wording to describe the difference between multiple values and an executemany() call. - add a test for multivalue insert + returning - it works ! - remove the very old/never used "postgresql_returning"/"firebird_returning" flags.
* merge latest defaultMike Bayer2012-12-081-5/+6
|\
| * fixing broken links (see #2625)Diana Clarke2012-12-051-2/+2
| |
| * - BinaryExpression now keeps track of "left" and "right" as passed in,Mike Bayer2012-12-021-3/+4
| | | | | | | | | | so that they can be compared in ``__nonzero__`` prior to their self_group() step. [ticket:2621]
* | updatebase: add support for multi parametersIdan Kamara2012-12-061-9/+22
|/
* just a pep8 pass of lib/sqlalchemy/sql/Diana Clarke2012-11-191-28/+118
|
* Fixed bug in type_coerce() whereby typing informationMike Bayer2012-11-121-0/+2
| | | | | | | | could be lost if the statement were used as a subquery inside of another statement, as well as other similar situations. Among other things, would cause typing information to be lost when the Oracle/mssql dialects would apply limit/offset wrappings. [ticket:2603]
* Fixed bug whereby the ".key" of a Column wasn't beingMike Bayer2012-10-311-2/+4
| | | | | | | used when producing a "proxy" of the column against a selectable. This probably didn't occur in 0.7 since 0.7 doesn't respect the ".key" in a wider range of scenarios. [ticket:2597]
* - add class_ to AliasedInspMike Bayer2012-10-261-0/+17
| | | | | | - redefine inspect(Class.attrname).parent to be always an inspectable target; either Mapper or AliasedInsp - add most major features to 08 migration, document, link
* Added :meth:`.ColumnOperators.notin_`,Mike Bayer2012-10-241-0/+3
| | | | | | :meth:`.ColumnOperators.notlike`, :meth:`.ColumnOperators.notilike` to :class:`.ColumnOperators`. [ticket:2580]
* - [feature] "scalar" selects now have a WHERE methodMike Bayer2012-10-151-5/+9
| | | | | | | | | | | | | | | | | | | | to help with generative building. Also slight adjustment regarding how SS "correlates" columns; the new methodology no longer applies meaning to the underlying Table column being selected. This improves some fairly esoteric situations, and the logic that was there didn't seem to have any purpose. - [feature] Some support for auto-rendering of a relationship join condition based on the mapped attribute, with usage of core SQL constructs. E.g. select([SomeClass]).where(SomeClass.somerelationship) would render SELECT from "someclass" and use the primaryjoin of "somerelationship" as the WHERE clause. This changes the previous meaning of "SomeClass.somerelationship" when used in a core SQL context; previously, it would "resolve" to the parent selectable, which wasn't generally useful. Related to [ticket:2245].
* - use our new Cls.memoized_name._reset(self) method in place of all those ↵Mike Bayer2012-09-231-4/+4
| | | | | | __dict__.pop(), remove reset_memoized
* - aaand actually get is/isnot to be usable with None/NULLMike Bayer2012-09-221-2/+5
|
* - [bug] Added missing operators is_(), isnot()Mike Bayer2012-09-221-0/+2
| | | | | | to the ColumnOperators base, so that these long-available operators are present as methods like all the other operators. [ticket:2544]
* - [bug] CompileError is raised when VARCHAR withMike Bayer2012-09-101-1/+1
| | | | | no length is attempted to be emitted, same way as MySQL. [ticket:2505]
* - [feature] The cast() and extract() constructsMike Bayer2012-09-101-8/+12
| | | | | | | | | will now be produced via the func.* accessor as well, as users naturally try to access these names from func.* they might as well do what's expected, even though the returned object is not a FunctionElement. [ticket:2562]
* `lshift` (<<) and `rshift` (>>) are also supported as optional operators.Mike Bayer2012-09-041-0/+2
|
* - [bug] Fixed a regression since 0.6 regardingMike Bayer2012-08-311-4/+7
| | | | | | | | | | | | | | | | result-row targeting. It should be possible to use a select() statement with string based columns in it, that is select(['id', 'name']).select_from('mytable'), and have this statement be targetable by Column objects with those names; this is the mechanism by which query(MyClass).from_statement(some_statement) works. At some point the specific case of using select(['id']), which is equivalent to select([literal_column('id')]), stopped working here, so this has been re-instated and of course tested. [ticket:2558]
* - [feature] Reworked the startswith(), endswith(),Mike Bayer2012-08-271-34/+3
| | | | | | | | | | | | contains() operators to do a better job with negation (NOT LIKE), and also to assemble them at compilation time so that their rendered SQL can be altered, such as in the case for Firebird STARTING WITH [ticket:2470] - [feature] firebird - The "startswith()" operator renders as "STARTING WITH", "~startswith()" renders as "NOT STARTING WITH", using FB's more efficient operator. [ticket:2470]