summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql
Commit message (Collapse)AuthorAgeFilesLines
* redid the _for_ddl String/Text deprecation warning correctly [ticket:912]Mike Bayer2008-01-091-1/+1
|
* - fixed bug in union() so that select() statements which don't deriveMike Bayer2008-01-081-1/+2
| | | | from FromClause objects can be unioned
* - fixed an attribute history bug whereby assigning a new collectionMike Bayer2008-01-071-2/+2
| | | | | | | | | | | to a collection-based attribute which already had pending changes would generate incorrect history [ticket:922] - fixed delete-orphan cascade bug whereby setting the same object twice to a scalar attribute could log it as an orphan [ticket:925] - generative select.order_by(None) / group_by(None) was not managing to reset order by/group by criterion, fixed [ticket:924]
* - changed name of TEXT to Text since its a "generic" type; TEXT name isMike Bayer2008-01-052-17/+2
| | | | | | | deprecated until 0.5. The "upgrading" behavior of String to Text when no length is present is also deprecated until 0.5; will issue a warning when used for CREATE TABLE statements (String with no length for SQL expression purposes is still fine) [ticket:912]
* Experimental: modestly more informative repr() for some expressions (using ↵Jason Kirtland2008-01-051-0/+8
| | | | .description)
* Migrated a few in-function 'from x import y' to the 'global x; if x is None' ↵Jason Kirtland2008-01-051-160/+168
| | | | style.
* add anonymous labels to function callsMike Bayer2008-01-041-1/+1
|
* - further fix to new TypeDecorator, so that subclasses of TypeDecorators ↵Mike Bayer2008-01-021-2/+2
| | | | | | work properly - _handle_dbapi_exception() usage changed so that unwrapped exceptions can be rethrown with the original stack trace
* happy new yearMike Bayer2008-01-012-2/+2
|
* - reworked all lazy/deferred/expired callables to beMike Bayer2007-12-211-2/+3
| | | | | | | | serializable class instances, added pickling tests - cleaned up "deferred" polymorphic system so that the mapper handles it entirely - columns which are missing from a Query's select statement now get automatically deferred during load.
* introductory docstring bonanzaMike Bayer2007-12-181-1/+13
|
* a little pre-lunch decrufting and cleanupMike Bayer2007-12-182-61/+71
|
* get most oracle tests in sql working again....Mike Bayer2007-12-182-1/+5
|
* - cleanup; lambdas removed from properties; properties mirror same-named ↵Mike Bayer2007-12-182-101/+97
| | | | | | functions (more like eventual decorator syntax); remove some old methods, factor out some "raiseerr" ugliness to outer lying functions. - corresponding_column() integrates "require_embedded" flag with other set arithmetic
* - select().as_scalar() will raise an exception if the select does not haveMike Bayer2007-12-181-7/+11
| | | | | | | | | | | | exactly one expression in its columns clause. - added "helper exception" to select.type access, generic functions raise the chance of this happening - a slight behavioral change to attributes is, del'ing an attribute does *not* cause the lazyloader of that attribute to fire off again; the "del" makes the effective value of the attribute "None". To re-trigger the "loader" for an attribute, use session.expire(instance, [attrname]). - fix ormtutorial for IS NULL
* - more fixes to the LIMIT/OFFSET aliasing applied with Query + eagerloads,Mike Bayer2007-12-163-52/+48
| | | | | | | | in this case when mapped against a select statement [ticket:904] - _hide_froms logic in expression totally localized to Join class, including search through previous clone sources - removed "stop_on" from main visitors, not used - "stop_on" in AbstractClauseProcessor part of constructor, ClauseAdapter sets it up based on given clause - fixes to is_derived_from() to take previous clone sources into account, Alias takes self + cloned sources into account. this is ultimately what the #904 bug was.
* moved hide_froms and aggregate_hide_froms to be only on FromClauseMike Bayer2007-12-161-28/+19
|
* - more query testsMike Bayer2007-12-101-7/+33
| | | | | | | | | - trying to refine some of the adaptation stuff - query.from_statement() wont allow further generative criterion - added a warning to columncollection when selectable is formed with conflicting columns (only in the col export phase) - some method rearrangement on schema/columncollection.... - property conflicting relation warning doesnt raise for concrete
* - Query.select_from() now replaces all existing FROM criterion withMike Bayer2007-12-092-6/+12
| | | | | | | | | | the given argument; the previous behavior of constructing a list of FROM clauses was generally not useful as is required filter() calls to create join criterion, and new tables introduced within filter() already add themselves to the FROM clause. The new behavior allows not just joins from the main table, but select statements as well. Filter criterion, order bys, eager load clauses will be "aliased" against the given statement.
* - flush() refactor merged from uow_nontree branch r3871-r3885Mike Bayer2007-12-082-16/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - topological.py cleaned up, presents three public facing functions which return list/tuple based structures, without exposing any internals. only the third function returns the "hierarchical" structure. when results include "cycles" or "child" items, 2- or 3- tuples are used to represent results. - unitofwork uses InstanceState almost exclusively now. new and deleted lists are now dicts which ref the actual object to provide a strong ref for the duration that they're in those lists. IdentitySet is only used for the public facing versions of "new" and "deleted". - unitofwork topological sort no longer uses the "hierarchical" version of the sort for the base sort, only for the "per-object" secondary sort where it still helps to group non-dependent operations together and provides expected insert order. the default sort deals with UOWTasks in a straight list and is greatly simplified. Tests all pass but need to see if svilen's stuff still works, one block of code in _sort_cyclical_dependencies() seems to not be needed anywhere but i definitely put it there for a reason at some point; if not hopefully we can derive more test coverage from that. - the UOWEventHandler is only applied to object-storing attributes, not scalar (i.e. column-based) ones. cuts out a ton of overhead when setting non-object based attributes. - InstanceState also used throughout the flush process, i.e. dependency.py, mapper.save_obj()/delete_obj(), sync.execute() all expect InstanceState objects in most cases now. - mapper/property cascade_iterator() takes InstanceState as its argument, but still returns lists of object instances so that they are not dereferenced. - a few tricks needed when dealing with InstanceState, i.e. when loading a list of items that are possibly fresh from the DB, you *have* to get the actual objects into a strong-referencing datastructure else they fall out of scope immediately. dependency.py caches lists of dependent objects which it loads now (i.e. history collections). - AttributeHistory is gone, replaced by a function that returns a 3-tuple of added, unchanged, deleted. these collections still reference the object instances directly for the strong-referencing reasons mentiontioned, but it uses less IdentitySet logic to generate.
* changed the anonymous numbering scheme to be more appealingMike Bayer2007-12-082-6/+7
| | | | got tests running
* a little refinement to topological options, more to comeMike Bayer2007-12-071-1/+1
|
* fix to unique bind params, you *can* use the same unique bindparam multiple ↵Mike Bayer2007-12-071-1/+1
| | | | | | | times in a statement. the collision check is strictly detecting non-unique's that happen to have the same name.
* - generation of "unique" bind parameters has been simplified to use the sameMike Bayer2007-12-062-25/+27
| | | | | | | | | | "unique identifier" mechanisms as everything else. This doesn't affect user code, except any code that might have been hardcoded against the generated names. Generated bind params now have the form "<paramname>_<num>", whereas before only the second bind of the same name would have this form. - bindparam() objects themselves can be used as keys for execute(), i.e. statement.execute({bind1:'foo', bind2:'bar'})
* some more omit schemas for [ticket:890]Mike Bayer2007-12-051-2/+2
|
* - tables with schemas can still be used in sqlite, firebird,Mike Bayer2007-12-051-1/+1
| | | | schema name just gets dropped [ticket:890]
* - basic framework for generic functions, [ticket:615]Mike Bayer2007-12-053-32/+135
| | | | | | | - changed the various "literal" generation functions to use an anonymous bind parameter. not much changes here except their labels now look like ":param_1", ":param_2" instead of ":literal" - from_obj keyword argument to select() can be a scalar or a list.
* - relaxed rules on column_property() expressions having labels; anyMike Bayer2007-12-041-1/+1
| | | | | | ColumnElement is accepted now, as the compiler auto-labels non-labeled ColumnElements now. a selectable, like a select() statement, still requires conversion to ColumnElement via as_scalar() or label().
* - several ORM attributes have been removed or made private:Mike Bayer2007-12-011-2/+3
| | | | | | | | mapper.get_attr_by_column(), mapper.set_attr_by_column(), mapper.pks_by_table, mapper.cascade_callable(), MapperProperty.cascade_callable(), mapper.canload() - refinements to mapper PK/table column organization, session cascading, some naming convention work
* OrderedSet to appease the unit tests....need to find a way to get rid of thisMike Bayer2007-11-252-2/+2
|
* - named_with_column becomes an attributeMike Bayer2007-11-252-84/+51
| | | | | | | | | - cleanup within compiler visit_select(), column labeling - is_select() removed from dialects, replaced with returns_rows_text(), returns_rows_compiled() - should_autocommit() removed from dialects, replaced with should_autocommit_text() and should_autocommit_compiled() - typemap and column_labels collections removed from Compiler, replaced with single "result_map" collection. - ResultProxy uses more succinct logic in combination with result_map to target columns
* - decruftify old visitors used by orm, convert to functions thatMike Bayer2007-11-241-99/+44
| | | | | | use a common traversal function. - TranslatingDict is finally gone, thanks to column.proxy_set simpleness...hooray ! - shoved "slice" use case on RowProxy into an exception case. knocks noticeable time off of large result set operations.
* - all kinds of cleanup, tiny-to-slightly-significant speed improvementsMike Bayer2007-11-244-87/+111
|
* - added op() operator to instrumented attributes; i.e.Mike Bayer2007-11-182-1/+9
| | | | User.name.op('ilike')('%somename%') [ticket:767]
* some wide zoomark ranges...Mike Bayer2007-11-181-2/+2
|
* cut down a good deal of Join construction overheadMike Bayer2007-11-181-35/+33
|
* logging fixesMike Bayer2007-11-181-6/+15
|
* - DeferredColumnLoader checks row for column, if present sends it toMike Bayer2007-11-141-0/+5
| | | | | ColumnLoader to create the row processor - eager loaders ensure deferred foreign key cols are present in the primary list of columns (and secondary...). because eager loading with LIMIT/OFFSET doesn't re-join to the parent table anymore this is now necessary. [ticket:864]
* - anonymous column expressions are automatically labeled.Mike Bayer2007-11-102-29/+38
| | | | | | | | | | | | | | | | | | | 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-083-25/+52
| | | | | | | | 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-072-23/+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
* - fix to compiled bind parameters to not mistakenly populate NoneMike Bayer2007-11-071-3/+7
| | | | [ticket:853]
* - adjustments to oracle ROWID logic...recent oid changes mean we have toMike Bayer2007-11-051-14/+16
| | | | | | use "rowid" against the select itself (i.e. its just...'rowid', no table name). seems to work OK but not sure if issues will arise - fixes to oracle bind param stuff to account for recent removal of ClauseParameters object.
* - 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-052-32/+22
| | | | | | | | | | | | | | | | 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
|
* - eager loading with LIMIT/OFFSET applied no longer adds the primaryMike Bayer2007-11-031-0/+8
| | | | | | | table joined to a limited subquery of itself; the eager loads now join directly to the subquery which also provides the primary table's columns to the result set. This eliminates a JOIN from all eager loads with LIMIT/OFFSET. [ticket:843]