summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/expression.py
Commit message (Collapse)AuthorAgeFilesLines
...
* cut down a good deal of Join construction overheadMike Bayer2007-11-181-35/+33
|
* logging fixesMike Bayer2007-11-181-6/+15
|
* - anonymous column expressions are automatically labeled.Mike Bayer2007-11-101-7/+9
| | | | | | | | | | | | | | | | | | | e.g. select([x* 5]) produces "SELECT x * 5 AS anon_1". This allows the labelname to be present in the cursor.description which can then be appropriately matched to result-column processing rules. (we can't reliably use positional tracking for result-column matches since text() expressions may represent multiple columns). - operator overloading is now controlled by TypeEngine objects - the one built-in operator overload so far is String types overloading '+' to be the string concatenation operator. User-defined types can also define their own operator overloading by overriding the adapt_operator(self, op) method. - untyped bind parameters on the right side of a binary expression will be assigned the type of the left side of the operation, to better enable the appropriate bind parameter processing to take effect [ticket:819]
* more changes to traverse-and-clone; a particular element will only be cloned ↵Mike Bayer2007-11-081-14/+25
| | | | | | | | once and is then re-used. the FROM calculation of a Select normalizes the list of hide_froms against all previous incarnations of each FROM clause, using a tag attached from cloned clause to previous.
* - identified some cases where Alias needs to be cloned; but still cant cloneMike Bayer2007-11-081-4/+13
| | | | | | when its an alias of a Table; added some test coverage for one particular case from the doctests - fixed "having" example in doctests, updated eager load example
* - fixed remainder of [ticket:853]Mike Bayer2007-11-071-20/+14
| | | | | | - bindparam 'shortname' is deprecated - fixed testing.assert_compile() to actually generate bind param dict before asserting - added bind param assertions to CRUDTest.test_update
* - <Engine|Connection>._execute_clauseelement becomes a public methodMike Bayer2007-11-071-1/+1
| | | | Connectable.execute_clauseelement
* - oid_column proxies more intelligently off of Select, CompoundSelect - ↵Mike Bayer2007-11-051-18/+73
| | | | | | | | fixes platform-affected bugs in missing the correct "oid" column - locate_all_froms() is expensive; added an attribute-level cache for it - put a huge warning on all select.append_XXX() methods stating that derived collections like locate_all_froms() may become invalid if already initialized
* - base_columns on ColumnElement becomes a list; as usual, because columns in ↵Mike Bayer2007-11-051-30/+20
| | | | | | | | | | | | | | | | CompoundSelects may extend from more than one root column. - keys_ok argument from corresponding_column() removed. no more name-based matching of columns anywhere. - DictDecorator is gone. all row translators provided by orm.util.create_row_adapter(). Mapper and contains_alias() cache the adapters on target mapper to avoid re-computation of adapters. - create_row_adapter() accepts an "equivalent_columns" map as produced by Mapper, so that row adapters can take join conditions into account (as usual again, to help with the CompoundSelects produced by polymorphic_union). - simplified TableSingleton to just provide lookup; moved all initialization into Table. - the "properties" accessor on Mapper is removed; it now throws an informative exception explaining the usage of mapper.get_property() and mapper.iterate_properties
* - rewrote and simplified the system used to "target" columns acrossMike Bayer2007-11-051-112/+75
| | | | | | | | | | | | | | | | | | selectable expressions. On the SQL side this is represented by the "corresponding_column()" method. This method is used heavily by the ORM to "adapt" elements of an expression to similar, aliased expressions, as well as to target result set columns originally bound to a table or selectable to an aliased, "corresponding" expression. The new rewrite features completely consistent and accurate behavior. - the "orig_set" and "distance" elements as well as all associated fanfare are gone (hooray !) - columns now have an optional "proxies" list which is a list of all columns they are a "proxy" for; only CompoundSelect cols proxy more than one column (just like before). set operations are used to determine lineage. - CompoundSelects (i.e. unions) only create one public-facing proxy column per column name. primary key collections come out with just one column per embedded PK column. - made the alias used by eager load limited subquery anonymous.
* - func. objects can be pickled/unpickled [ticket:844]Mike Bayer2007-11-041-0/+8
|
* - rewritten ClauseAdapter merged from the eager_minus_join branch; this is a ↵Mike Bayer2007-11-031-58/+56
| | | | | | | | much simpler and "correct" version which will copy all elements exactly once, except for those which were replaced with target elements. It also can match a wider variety of target elements including joins and selects on identity alone.
* - removed "name" attribute from FromClause, Join, Select, CompoundSelect. ↵Mike Bayer2007-11-031-10/+9
| | | | | | | its needless and led to some very strange anonymous label names - removed what was apparently cruft in some column-targeting code
* - fixed expression translation of text() clauses; this repairs variousMike Bayer2007-10-281-1/+1
| | | | ORM scenarios where literal text is used for SQL expressions
* - Added contains operator (which generate a "LIKE %<other>%" clause).Gaëtan de Menten2007-10-191-2/+20
| | | | - Added test coverage for endswith operator
* change the in_ API to accept a sequence or a selectable [ticket:750]Ants Aasma2007-10-161-12/+18
|
* Assorted unused imports from pyflakes, docstring tweaks, formatting.Jason Kirtland2007-10-131-4/+5
|
* add support for returning results from inserts and updates for postgresql ↵Ants Aasma2007-10-021-10/+14
| | | | 8.2+. [ticket:797]
* - more docstringsMike Bayer2007-09-281-15/+16
| | | | | - Selectable is only used as a marker for FromClause (probably should be removed/both classes merged)
* - doc updates. generated sql docs are against sql.expression now.Mike Bayer2007-09-281-67/+156
| | | | | | | - added SessionExtension docs. - removed old sqlconstruction doc. - changed 'copy_collections' flag in Select to '_copy_collections'; its not really "public".
* - some docstrings for select()Mike Bayer2007-09-261-0/+45
| | | | | - fixed tutorial doctests to adjust for execution changes, session being weak-referencing (reloads objects more frequently which get u'' applied to their __repr__())
* - created a link between QueryContext and SelectionContext; the attributeMike Bayer2007-09-261-8/+0
| | | | | | | | | | | | | | | | dictionary of QueryContext is now passed to SelectionContext inside of Query.instances(), allowing messages to be passed between the two stages. - removed the recent "exact match" behavior of Alias objects, they're back to their usual behavior. - tightened up the relationship between the Query's generation of "eager load" aliases, and Query.instances() which actually grabs the eagerly loaded rows. If the aliases were not specifically generated for that statement by EagerLoader, the EagerLoader will not take effect when the rows are fetched. This prevents columns from being grabbed accidentally as being part of an eager load when they were not meant for such, which can happen with textual SQL as well as some inheritance situations. It's particularly important since the "anonymous aliasing" of columns uses simple integer counts now to generate labels.
* - the behavior of String/Unicode types regarding that they auto-convertMike Bayer2007-09-261-2/+4
| | | | | | | | | to TEXT/CLOB when no length is present now occurs *only* for an exact type of String or Unicode with no arguments. If you use VARCHAR or NCHAR (subclasses of String/Unicode) with no length, they will be interpreted by the dialect as VARCHAR/NCHAR; no "magic" conversion happens there. This is less surprising behavior and in particular this helps Oracle keep string-based bind parameters as VARCHARs and not CLOBs [ticket:793].
* - columns from Alias objects, when used to target result-row columns, must ↵Mike Bayer2007-09-241-0/+8
| | | | | | | | match exactly to the label used in the generated statement. This is so searching for columns in a result row which match aliases won't accidentally match non-aliased columns. fixes errors which can arise in eager loading scenarios.
* - adjusted operator precedence of NOT to match '==' and others, so thatMike Bayer2007-09-081-1/+1
| | | | | | ~(x <operator> y) produces NOT (x <op> y), which is better compatible with MySQL. [ticket:764]. this doesn't apply to "~(x==y)" as it does in 0.3 since ~(x==y) compiles to "x != y", but still applies to operators like BETWEEN.
* [ticket:768] dont assume join criterion consists only of column objectsMike Bayer2007-09-081-1/+2
|
* - took out method calls for oid_columnMike Bayer2007-09-041-38/+16
| | | | | | - reduced complexity of parameter handling during execution; __distill_params does all parameter munging, executioncontext.parameters always holds a list of parameter structures (lists, tuples, or dicts).
* - removed "parameters" argument from clauseelement.compile(), replaced withMike Bayer2007-09-041-13/+15
| | | | | | | | "column_keys". the parameters sent to execute() only interact with the insert/update statement compilation process in terms of the column names present but not the values for those columns. produces more consistent execute/executemany behavior, simplifies things a bit internally.
* - merged inline inserts branchMike Bayer2007-09-011-38/+33
| | | | | | | | | | | | - all executemany() style calls put all sequences and SQL defaults inline into a single SQL statement and don't do any pre-execution - regular Insert and Update objects can have inline=True, forcing all executions to be inlined. - no last_inserted_ids(), lastrow_has_defaults() available with inline execution - calculation of pre/post execute pushed into compiler; DefaultExecutionContext greatly simplified - fixed postgres reflection of primary key columns with no sequence/default generator, sets autoincrement=False - fixed postgres executemany() behavior regarding sequences present, not present, passivedefaults, etc. - all tests pass for sqlite, mysql, postgres; oracle tests pass as well as they did previously including all insert/update/default functionality
* - added **modifiers to _get_from_objectsMike Bayer2007-08-221-1/+1
| | | | - fixed up PG distinct flag
* fixed generative behavior to copy collections, [ticket:752]Mike Bayer2007-08-211-12/+30
|
* - method call removalMike Bayer2007-08-201-18/+22
|
* light docstring tweaks to the poolJason Kirtland2007-08-191-1/+1
| | | | more pedantic DBAPI -> DB-API changes in docstrings
* 1. Module layout. sql.py and related move into a package called "sql".Mike Bayer2007-08-181-0/+3305
2. compiler names changed to be less verbose, unused classes removed. 3. Methods on Dialect which return compilers, schema generators, identifier preparers have changed to direct class references, typically on the Dialect class itself or optionally as attributes on an individual Dialect instance if conditional behavior is needed. This takes away the need for Dialect subclasses to know how to instantiate these objects, and also reduces method overhead by one call for each one. 4. as a result of 3., some internal signatures have changed for things like compiler() (now statement_compiler()), preparer(), etc., mostly in that the dialect needs to be passed explicitly as the first argument (since they are just class references now). The compiler() method on Engine and Connection is now also named statement_compiler(), but as before does not take the dialect as an argument. 5. changed _process_row function on RowProxy to be a class reference, cuts out 50K method calls from insertspeed.py