summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/expression.py
Commit message (Collapse)AuthorAgeFilesLines
...
* - pending deprecation in 0.7 for the execute/scalar on clauseelementMike Bayer2010-09-071-6/+10
|
* - rewrote the "connections" sectionMike Bayer2010-09-051-4/+30
| | | | | | | | | - improved pool docs - typos etc. - ClauseElement.execute() and scalar() make no sense - these are depreacted. The official home is Executable. - alias() is not executable, allowing it is sloppy so this goes under the deprecated umbrella
* docstring for query.correlate, [ticket:1889]Mike Bayer2010-08-291-3/+3
|
* - Similarly, for relationship(), foreign_keys,Mike Bayer2010-08-211-3/+3
| | | | | | | remote_side, order_by - all column-based expressions are enforced - lists of strings are explicitly disallowed since this is a very common error
* - 79 chars for expressionMike Bayer2010-08-141-428/+559
| | | | - fix typo in test
* get slightly better about deprecations in docstrings, tho this is kind of an ↵Mike Bayer2010-08-091-2/+3
| | | | uphill climb
* - the _Label construct, i.e. the one that is producedMike Bayer2010-08-071-11/+9
| | | | | | | | | | | whenever you say somecol.label(), now counts itself in its "proxy_set" unioned with that of it's contained column's proxy set, instead of directly returning that of the contained column. This allows column correspondence operations which depend on the identity of the _Labels themselves to return the correct result - fixes ORM bug [ticket:1852].
* - the text() construct, if placed in a columnMike Bayer2010-08-031-3/+3
| | | | | | | | oriented situation, will at least return NULLTYPE for its type instead of None, allowing it to be used a little more freely for ad-hoc column expressions than before. literal_column() is still the better choice, however.
* - Specifying a non-column based argumentMike Bayer2010-08-021-0/+8
| | | | | | | | for column_mapped_collection, including string, text() etc., will raise an error message that specifically asks for a column element, no longer misleads with incorrect information about text() or literal(). [ticket:1863]
* - if @classproperty is used with a regular class-boundMike Bayer2010-08-021-1/+1
| | | | | | | | | | | | | | mapper property attribute, it will be called to get the actual attribute value during initialization. Currently, there's no advantage to using @classproperty on a column or relationship attribute of a declarative class that isn't a mixin - evaluation is at the same time as if @classproperty weren't used. But here we at least allow it to function as expected. - docs for column_property() with declarative - mixin docs in declarative made more clear - mixins are optional - each subsection starts with, "in *declarative mixins*", to reduce confusion
* document the crap out of text(), Session.execute()Mike Bayer2010-07-201-18/+75
|
* - func.XXX() doesn't inadvertently resolve to non-FunctionMike Bayer2010-05-131-1/+3
| | | | classes (e.g. fixes func.text()). [ticket:1798]
* - the _make_proxy() method of ColumnClause and Column now useMike Bayer2010-05-101-1/+13
| | | | | | | self.__class__ to determine the class of object to be returned instead of hardcoding to ColumnClause/Column, making it slightly easier to produce specific subclasses of these which work in alias/subquery situations.
* - expr.in_() now accepts a text() construct as the argument.Mike Bayer2010-05-081-2/+9
| | | | | | Grouping parenthesis are added automatically, i.e. usage is like `col.in_(text("select id from table"))`. [ticket:1793]
* remove a few superfluous importsMike Bayer2010-04-291-10/+11
|
* - beef up the --reversetop test option to embed RandomSet throughout the ORMMike Bayer2010-04-151-0/+3
| | | | | | | - with m2m we have to go back to the previous approach of having both sides of the DP fire off, tracking each pair of objects. history may not be consistently present in one side or the other - this revealed a whole lot of issues with self-referential m2m, which are fixed
* - somejoin.select(fold_equivalents=True) is no longerMike Bayer2010-04-111-6/+1
| | | | | deprecated, and will eventually be rolled into a more comprehensive version of the feature for [ticket:1729].
* - Added new 'compiled_cache' execution option. A dictionaryMike Bayer2010-04-071-0/+17
| | | | | | | | | | where Compiled objects will be cached when the Connection compiles a clause expression into a dialect- and parameter- specific Compiled object. It is the user's responsibility to manage the size of this dictionary, which will have keys corresponding to the dialect, clause element, the column names within the VALUES or SET clause of an INSERT or UPDATE, as well as the "batch" mode for an INSERT or UPDATE statement.
* - Restored some bind-labeling logic from 0.5 which ensuresMike Bayer2010-03-311-0/+10
| | | | | | | | that tables with column names that overlap another column of the form "<tablename>_<columnname>" won't produce errors if column._label is used as a bind name during an UPDATE. Test coverage which wasn't present in 0.5 has been added. [ticket:1755]
* - Added with_hint() method to Query() construct. This callsMike Bayer2010-03-271-1/+29
| | | | | | | | | | directly down to select().with_hint() and also accepts entities as well as tables and aliases. See with_hint() in the SQL section below. [ticket:921] - Added with_hint() method to select() construct. Specify a table/alias, hint text, and optional dialect name, and "hints" will be rendered in the appropriate place in the statement. Works for Oracle, Sybase, MySQL. [ticket:921]
* - join() will now simulate a NATURAL JOIN by default. Meaning,Mike Bayer2010-03-191-2/+6
| | | | | | | | if the left side is a join, it will attempt to join the right side to the rightmost side of the left first, and not raise any exceptions about ambiguous join conditions if successful even if there are further join targets across the rest of the left. [ticket:1714]
* - The except_() method now renders as MINUS on Oracle,Mike Bayer2010-03-161-8/+13
| | | | | which is more or less equivalent on that platform. [ticket:1712]
* whitespace fixes to improve readability (shortened excessively long lines, ↵Brad Allen2010-03-151-28/+42
| | | | and one 5-space indentation block corrected to 4 spaces).
* fixed up docs for execution_options() across all three locations.Mike Bayer2010-03-091-1/+13
|
* base tests passMike Bayer2010-03-091-1/+1
|
* still thinking about stuff hereMike Bayer2010-03-081-3/+11
|
* working on getting operators/left hand type awareness into the "bind" ↵Mike Bayer2010-03-081-26/+29
| | | | coercion. this system has to be figured out somehow
* - adjusted the literal coercion rules to take the left side's type into ↵Mike Bayer2010-03-011-0/+2
| | | | | | | | account, if it is compatible with what was found for the right, so that things like oracle CHAR conversions work. - oracle dialect specific tests pass again.
* - make tuple a little more friendlyMike Bayer2010-02-281-0/+1
|
* - Made sqlalchemy.sql.expressions.Executable part of publicMike Bayer2010-02-121-22/+32
| | | | | | | | | | | API, used for any expression construct that can be sent to execute(). FunctionElement now inherits Executable so that it gains execution_options(), which are also propagated to the select() that's generated within execute(). Executable in turn subclasses _Generative which marks any ClauseElement that supports the @_generative decorator - these may also become "public" for the benefit of the compiler extension at some point.
* - The type/expression system now does a more complete jobMike Bayer2010-02-111-45/+43
| | | | | | | | | | | | | | | | | | of determining the return type from an expression as well as the adaptation of the Python operator into a SQL operator, based on the full left/right/operator of the given expression. In particular the date/time/interval system created for Postgresql EXTRACT in [ticket:1647] has now been generalized into the type system. The previous behavior which often occured of an expression "column + literal" forcing the type of "literal" to be the same as that of "column" will now usually not occur - the type of "literal" is first derived from the Python type of the literal, assuming standard native Python types + date types, before falling back to that of the known type on the other side of the expression. Also part of [ticket:1683].
* - FunctionElement subclasses are now directly executable theMike Bayer2010-02-071-3/+4
| | | | | | | | | | | same way any func.foo() construct is, with automatic SELECT being applied when passed to execute(). - The "type" and "bind" keyword arguments of a func.foo() construct are now local to "func." constructs and are not part of the FunctionElement base class, allowing a "type" to be handled in a custom constructor or class-level variable.
* - Added math negation operator support, -x.Mike Bayer2010-02-051-0/+6
|
* fix the kwargs scoping. mysteriously was affecting pool gcingMike Bayer2010-01-291-4/+5
|
* - inline some code and turn some instance-level defaults into class levelMike Bayer2010-01-291-3/+7
|
* - the "autocommit" flag on select() and text() as wellMike Bayer2010-01-281-19/+44
| | | | | | as select().autocommit() are deprecated - now call .execution_options(autocommit=True) on either of those constructs, also available directly on Connection and orm.Query.
* against is optionalMike Bayer2010-01-281-1/+1
|
* - allow exists(s.as_scalar()) to workMike Bayer2010-01-281-1/+1
|
* add an informative error msg for non-collection passed to select()Mike Bayer2010-01-281-2/+8
|
* - Added a tuple_() construct, allows sets of expressionsMike Bayer2010-01-251-5/+38
| | | | | | | | | to be compared to another set, typically with IN against composite primary keys or similar. Also accepts an IN with multiple columns. The "scalar select can have only one column" error message is removed - will rely upon the database to report problems with col mismatch.
* - union(), intersect(), except() and other "compound" typesMike Bayer2010-01-251-5/+1
| | | | | | | | | | | | | | | | of statements have more consistent behavior w.r.t. parenthesizing. Each compound element embedded within another will now be grouped with parenthesis - previously, the first compound element in the list would not be grouped, as SQLite doesn't like a statement to start with parenthesis. However, Postgresql in particular has precedence rules regarding INTERSECT, and it is more consistent for parenthesis to be applied equally to all sub-elements. So now, the workaround for SQLite is also what the workaround for PG was previously - when nesting compound elements, the first one usually needs ".alias().select()" called on it to wrap it inside of a subquery. [ticket:1665]
* - Connection has execution_options(), generative methodMike Bayer2010-01-241-5/+7
| | | | | | | | | which accepts keywords that affect how the statement is executed w.r.t. the DBAPI. Currently supports "stream_results", causes psycopg2 to use a server side cursor for that statement. Can also be set upon select() and text() constructs directly as well as ORM Query().
* not ready to put execution_options in the text()/select() constructors yetMike Bayer2010-01-241-9/+3
|
* statement_options -> execution_optionsMike Bayer2010-01-171-30/+32
|
* - added "statement_options()" to Query, to so options can beMike Bayer2010-01-161-22/+43
| | | | | | | | | | | | | | | | | | | | | passed to the resulting statement. Currently only Select-statements have these options, and the only option used is "stream_results", and the only dialect which knows "stream_results" is psycopg2. - Query.yield_per() will set the "stream_results" statement option automatically. - Added "statement_options()" to Selects, which set statement specific options. These enable e.g. dialect specific options such as whether to enable using server side cursors, etc. - The psycopg2 now respects the statement option "stream_results". This option overrides the connection setting "server_side_cursors". If true, server side cursors will be used for the statement. If false, they will not be used, even if "server_side_cursors" is true on the connection. [ticket:1619] - added a "frozendict" from http://code.activestate.com/recipes/414283/, adding more default collections as immutable class vars on Query, Insert, Select
* happy new yearMike Bayer2010-01-071-1/+1
|
* - Fixed a column arithmetic bug that affected columnMike Bayer2010-01-031-1/+2
| | | | | | | | | correspondence for cloned selectables which contain free-standing column expressions. This bug is generally only noticeable when exercising newer ORM behavior only availble in 0.6 via [ticket:1568], but is more correct at the SQL expression level as well. [ticket:1617]
* - clarify ForeignKey docs, copy operationMike Bayer2010-01-021-186/+187
| | | | - link all classes/functions in expressions
* - calling expr.in_([]), i.e. with an empty list, emits a warningMike Bayer2009-12-291-1/+9
| | | | | | | | | before issuing the usual "expr != expr" clause. The "expr != expr" can be very expensive, and it's preferred that the user not issue in_() if the list is empty, instead simply not querying, or modifying the criterion as appropriate for more complex situations. [ticket:1628]
* - Fixed bug preventing alias() of an alias() from beingMike Bayer2009-12-181-1/+1
| | | | | cloned or adapted (occurs frequently in ORM operations). [ticket:1641]