summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/expression.py
Commit message (Collapse)AuthorAgeFilesLines
...
* - Fixed bug whereby comparison of columnMike Bayer2011-06-121-1/+4
| | | | | | | | | expression to a Query() would not call as_scalar() on the underlying SELECT statement to produce a scalar subquery, in the way that occurs if you called it on Query().subquery(). [ticket:2190] - some cleanup to test.orm.test_query
* - Added the same "columns-only" check toMike Bayer2011-06-081-2/+9
| | | | | | mapper.polymorphic_on as used in relationship.order_by, foreign_keys, remote_side, etc.
* - Adjusted the __contains__() method ofMike Bayer2011-06-041-0/+9
| | | | | | | | | a RowProxy result row such that no exception throw is generated internally; NoSuchColumnError() also will generate its message regardless of whether or not the column construct can be coerced to a string. [ticket:2178]. Also in 0.6.8.
* fix some testsMike Bayer2011-06-021-1/+16
|
* - move Operators and ColumnOperators into sqlalchemy.sql.operators - since thisMike Bayer2011-05-281-424/+1
| | | | | is strictly a system of routing Python operators into functions. Keep the references available in expression.py for the near future.
* - Streamlined the process by which a SelectMike Bayer2011-05-281-11/+3
| | | | | | | | | determines what's in it's '.c' collection. Behaves identically, except that a raw ClauseList() passed to select([]) (which is not a documented case anyway) will now be expanded into its individual column elements instead of being ignored.
* - get all comparison operators to document with sphinx - column based, ↵Mike Bayer2011-05-261-79/+321
| | | | | | relationship based. Should fix misunderstandings like [ticket:2177]
* - add some docs to hybrid comparators, operators/comparator logic at the baseMike Bayer2011-05-221-1/+62
|
* - Fixed bug whereby nesting a label of a select()Mike Bayer2011-05-181-5/+7
| | | | | | | | | | | | with another label in it would produce incorrect exported columns. Among other things this would break an ORM column_property() mapping against another column_property(). [ticket:2167]. Also in 0.6.8 - _Label() is always against a column or selectable. remove uncovered case of label against something else. - start taking notes to clean up some of this labeling stuff, which will be [ticket:2168]
* - move documentation of available execution options to Connection - this is ↵Mike Bayer2011-04-171-46/+24
| | | | | | | | | | the main place these should be used - Executable disallows "compiled_cache" option for now which was previously being ignored [ticket:2131] - Query now passes execution options to the Connection rather than the statement so that all options are allowed including compiled cache.
* - Added explicit true()/false() constructs to expressionMike Bayer2011-04-171-3/+51
| | | | | | | lib - coercion rules will intercept "False"/"True" into these constructs. In 0.6, the constructs were typically converted straight to string, which was no longer accepted in 0.7. [ticket:2117]
* a crapload of doc tweaks including [ticket:1666], thanks Toby !Mike Bayer2011-04-161-42/+108
|
* - fixed bug where "from" clause gathering from anMike Bayer2011-04-141-2/+2
| | | | | | over() clause would be an itertools.chain() and not a list, causing "can only concatenate list" TypeError when combined with other clauses.
* - The limit/offset keywords to select() as wellMike Bayer2011-04-071-4/+8
| | | | | | | | | | | as the value passed to select.limit()/offset() will be coerced to integer. [ticket:2116] (also in 0.6.7) - Oracle dialect adds use_binds_for_limits=False create_engine() flag, will render the LIMIT/OFFSET values inline instead of as binds, reported to modify the execution plan used by Oracle. [ticket:2116] (Also in 0.6.7)
* - add some function examples, [ticket:2107]Mike Bayer2011-04-021-0/+2
| | | | | | - have "packagenames" be present on FunctionElement by default so that compiler.visit_function() can be called - add a test for that
* - Added new generic function "next_value()", acceptsMike Bayer2011-03-201-4/+6
| | | | | | | | | | | | | | | | | | | | a Sequence object as its argument and renders the appropriate "next value" generation string on the target platform, if supported. Also provides ".next_value()" method on Sequence itself. [ticket:2085] - added tests for all the conditions described in [ticket:2085] - postgresql dialect will exec/compile a Sequence that has "optional=True". the optional flag is now only checked specifically in the context of a Table primary key evaulation. - func.next_value() or other SQL expression can be embedded directly into an insert() construct, and if implicit or explicit "returning" is used in conjunction with a primary key column, the newly generated value will be present in result.inserted_primary_key. [ticket:2084]
* - some doc reorgMike Bayer2011-03-171-114/+114
| | | | | | | | | | - change engine.Connection to _connection_cls so sphinx doesn't get upset - globally add "." to all :class:`Foo` - start naming sections that are mostly docstrings "API Documentation - blah blah" - move some ad-hoc docstrings into "API" sections, there is some inconsistency here and it may be that we just have to leave it that way - add "internals" rsts to core, orm, I'm not super thrilled how these look but they are targeted by some of the public api docs, users typically become aware of these anyway
* corrected a bunch of spelling typosDiana Clarke2011-02-281-3/+3
|
* Fixed doc problem. Thanks Toby Ho.Michael Trier2011-03-141-1/+1
|
* - The concept of associating a ".bind" directly with aMike Bayer2011-02-101-39/+34
| | | | | | | | ClauseElement has been explicitly moved to Executable, i.e. the mixin that describes ClauseElements which represent engine-executable constructs. This change is an improvement to internal organization and is unlikely to affect any real-world usage. [ticket:2048]
* - Added over() function, method to FunctionElementMike Bayer2011-02-101-4/+160
| | | | | | | | classes, produces the _Over() construct which in turn generates "window functions", i.e. "<window function> OVER (PARTITION BY <partition by>, ORDER BY <order by>)". [ticket:1844]
* - Query.distinct() now accepts column expressionsMike Bayer2011-02-101-41/+100
| | | | | | | | | | | | | | | | | | | as *args, interpreted by the Postgresql dialect as DISTINCT ON (<expr>). [ticket:1069] - select.distinct() now accepts column expressions as *args, interpreted by the Postgresql dialect as DISTINCT ON (<expr>). Note this was already available via passing a list to the `distinct` keyword argument to select(). [ticket:1069] - select.prefix_with() accepts multiple expressions (i.e. *expr), 'prefix' keyword argument to select() accepts a list or tuple. - Passing a string to the `distinct` keyword argument of `select()` for the purpose of emitting special MySQL keywords (DISTINCTROW etc.) is deprecated - use `prefix_with()` for this. - put kw arguments to select() in order - restore docs for _SelectBase, renamed from _SelectBaseMixin
* - figured out the ::autodata directive, can move the docstring forMike Bayer2011-02-091-0/+35
| | | | | | | expression.func into the .py module - added a note about logging only being checked on new connections, as one user had this issue awhile back, and I suspect it for a current ML user issue
* yikes, change that name on the Alias class tooMike Bayer2011-01-301-6/+6
|
* - Added a `name` argument to `Query.subquery()`, to allowMike Bayer2011-01-301-33/+79
| | | | | | | | a fixed name to be assigned to the alias object. [ticket:2030] - changed the kw name 'alias' to 'name' on the alias() standalone function. - fixed up some alias/join docstrings
* rename 'frozendict' to 'immutabledict', since 'frozen' implies hashabilityMike Bayer2011-01-201-3/+3
| | | | | like frozenset which isn't really the purpose of 'immutabledict' (could be someday, in which case, we'd change the name back :) )
* - execution_options() on Connection acceptsMike Bayer2011-01-161-11/+25
| | | | | | | | | | "isolation_level" argument, sets transaction isolation level for that connection only until returned to the connection pool, for thsoe backends which support it (SQLite, Postgresql) [ticket:2001] - disallow the option on Engine (use isolation_level to create_engine()), Executable (we don't want to check/set per statement) - docs
* - getting slightly more consistent behavior for the edge case of pk columnsMike Bayer2011-01-151-7/+8
| | | | | | with server default - autoincrement is now false with any server_default, so these all return None, applies consistency to [ticket:2020], [ticket:2021]. if prefetch is desired a "default" should be used instead of server_default.
* - whitespace removal bonanzaMike Bayer2011-01-021-207/+207
|
* - clean up copyright, update for 2011, stamp every file withMike Bayer2011-01-021-2/+2
| | | | | a consistent tag - AUTHORS file
* - remove OrderedSet usage from a critical areaMike Bayer2010-12-221-11/+0
|
* - apply pep8 to compiler.pyMike Bayer2010-12-211-4/+4
| | | | | - deprecate Compiled.compile() - have __init__ do compilation if statement is present.
* callcount reductionMike Bayer2010-12-201-14/+20
|
* Added NULLS FIRST and NULLS LAST support.Michael Trier2010-12-191-3/+39
| | | | | It's implemented as an extension to the asc() and desc() operators, called nullsfirst() and nullslast(). [ticket:723]
* - why type.dialect_impl(dialect).bind_processor(dialect), caching just the impl?Mike Bayer2010-12-131-3/+0
| | | | | | just call type._cached_bind_processor(dialect), cache the impl *and* the processor function. same for result sets. - use plain dict + update for defaultexecutioncontext.execution_options
* - callcountsMike Bayer2010-12-101-17/+40
|
* various formatting and hyperlinking fixesMike Bayer2010-12-091-0/+4
|
* - merge default tipMike Bayer2010-12-051-7/+35
|\
| * - Fixed operator precedence rules for multipleMike Bayer2010-11-251-7/+35
| | | | | | | | | | | | | | | | | | | | | | | | chains of a single non-associative operator. I.e. "x - (y - z)" will compile as "x - (y - z)" and not "x - y - z". Also works with labels, i.e. "x - (y - z).label('foo')" [ticket:1984] - Single element tuple expressions inside an IN clause parenthesize correctly, also from [ticket:1984], added tests for PG - re-fix again importlater, [ticket:1983]
* | - replace util.py with util/ package, [ticket:1986]Mike Bayer2010-11-281-1/+1
| |
* | - the "type_map" dictionary in sqlalchemy.types is now private,Mike Bayer2010-11-281-1/+1
| | | | | | | | i.e. is named "_type_map". [ticket:1870]
* | - _literal_as_text raises if the incoming arg is not a Visitable or basestring.Mike Bayer2010-11-281-1/+3
| | | | | | | | [ticket:1847]
* | - bindparam() gets a new option "callable", which is a lambda or defMike Bayer2010-11-201-18/+48
| | | | | | | | | | | | | | | | | | | | evaluated at execution time to determine the value. This replaces the implicit recognition of callables sent as the primary value of bindparam(), which was an undocumented behavior used by the ORM. The argument is separated now so that values can be passed to bindparams that are also callables without ambiguity, such as user defined objects that include a __call__() method. [ticket:1950]
* | - adapt initial patch from [ticket:1917] to current tipMike Bayer2010-11-161-45/+78
|/ | | | - raise TypeError for immutability
* - move inline "import" statements to use new "util.importlater()" construct. ↵Mike Bayer2010-11-131-30/+11
| | | | | | | | | cuts down on clutter, timeit says there's a teeny performance gain, at least where the access is compared against attr.subattr. these aren't super-critical calls anyway - slight inlining in _class_to_mapper
* - Added type_coerce(expr, type_) expression element.Mike Bayer2010-10-231-2/+50
| | | | | | Treats the given expression as the given type when evaluating expressions and processing result rows, but does not affect the generation of SQL, other than an anonymous label.
* - fix a typo that was apparently not really impacting anythingMike Bayer2010-09-251-1/+1
|
* doc editsMike Bayer2010-09-221-10/+13
|
* - as_scalar(), label() can be called on a selectableMike Bayer2010-09-181-3/+10
| | | | | which contains a Column that is not yet named. [ticket:1862]
* - An informative error message is raised if a ColumnMike Bayer2010-09-181-9/+11
| | | | | | | | | which has not yet been assigned a name, i.e. as in declarative, is used in a context where it is exported to the columns collection of an enclosing select() construct, or if any construct involving that column is compiled before its name is assigned. [ticket:1862]