Mike Bayer [Sat, 17 Nov 2012 23:53:23 +0000 (18:53 -0500)]
Merged in audriusk/sqlalchemy_pg_hstore (pull request #26). will adjust some aspects of it, including replace userdefinedtype with typeengine, and move mutationdict to be part of sqlalchemy.ext.mutable
Diana Clarke [Sat, 17 Nov 2012 20:28:50 +0000 (15:28 -0500)]
initializing _labels to an empty list so that the other methods don't throw exceptions in the None labels case, but rather return (), [], or {}. this is not backwards compatible, but doubt anyone is relying on those exceptions #2601
Mike Bayer [Wed, 14 Nov 2012 06:18:58 +0000 (01:18 -0500)]
The :meth:`.Connection.connect` and :meth:`.Connection.contextual_connect`
methods now return a "branched" version so that the :meth:`.Connection.close`
method can be called on the returned connection without affecting the
original. Allows symmetry when using :class:`.Engine` and
:class:`.Connection` objects as context managers.
Mike Bayer [Wed, 14 Nov 2012 05:52:31 +0000 (00:52 -0500)]
Fixed :meth:`.MetaData.reflect` to correctly use
the given :class:`.Connection`, if given, without
opening a second connection from that connection's
:class:`.Engine`. [ticket:2604]
Mike Bayer [Wed, 14 Nov 2012 04:43:31 +0000 (23:43 -0500)]
Fixed bug whereby using "key" with Column
in conjunction with "schema" for the owning
Table would fail to locate result rows due
to the MSSQL dialect's "schema rendering"
logic's failure to take .key into account.
Also in 0.7.10. [ticket:2607]
Mike Bayer [Mon, 12 Nov 2012 20:48:40 +0000 (15:48 -0500)]
Fixed bug in type_coerce() whereby typing information
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]
Mike Bayer [Mon, 12 Nov 2012 19:30:18 +0000 (14:30 -0500)]
- support "fails_if" requirements as __requires__; so far this just skips, doesn't
actually run the test
- add requirements for date/datetime/time capabilities
- remove test/sql/test_types->DateTest and create new tests in suite/test_types
- move the StringTest with the "no length create" test to the suite, though this is a
weird test
Mike Bayer [Mon, 12 Nov 2012 17:44:42 +0000 (12:44 -0500)]
Fixed regression where query.update() would produce
an error if an object matched by the "fetch"
synchronization strategy wasn't locally present.
Courtesy Scott Torborg. [ticket:2602]
Mike Bayer [Wed, 31 Oct 2012 18:30:47 +0000 (14:30 -0400)]
Fixed bug whereby the ".key" of a Column wasn't being
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]
Added missing types supported by Sybase to ischema_names mapping
Created a SybaseInspector similar to the PGInspector, with a cached table_id
lookup, and added it to the SybaseDialect as the default inspector.
Added the following methods to SybaseDialect:
get_table_id
get_columns
_get_column_info : support method for get_columns
get_foreign_keys
get_indexes
get_pk_constraint
get_schema_names
get_view_definition
get_view_names
Rewrote the following methods to conform to the style of the rest:
get_table_names
has_table
Reordered colspec builder to put default clause after "NULL/NOT NULL",
instead of before. This fixed a syntax error.
Mike Bayer [Sun, 28 Oct 2012 23:07:56 +0000 (19:07 -0400)]
- do a straight __subclasses__ traversal here, so that we aren't
iterating through all mappers in memory when a new event is tacked
onto an unmapped superclass, also removes the strong ref that was
breaking some GC teardown tests
Mike Bayer [Sun, 28 Oct 2012 18:15:56 +0000 (14:15 -0400)]
- store only MultipleClassMarkers inside of ModuleMarker, then
store ModuleMarkers for multiple roots, one for each token in a
module path. this allows partial path resolution.
- docs to this effect
Mike Bayer [Fri, 26 Oct 2012 23:25:23 +0000 (19:25 -0400)]
- add class_ to AliasedInsp
- redefine inspect(Class.attrname).parent to be always an inspectable
target; either Mapper or AliasedInsp
- add most major features to 08 migration, document, link
Mike Bayer [Wed, 24 Oct 2012 19:37:06 +0000 (15:37 -0400)]
Fixed bug where keyword arguments passed to
:meth:`.Compiler.process` wouldn't get propagated
to the column expressions present in the columns
clause of a SELECT statement. In particular this would
come up when used by custom compilation schemes that
relied upon special flags. [ticket:2593]
Mike Bayer [Wed, 24 Oct 2012 18:02:37 +0000 (14:02 -0400)]
- get 100% lint/pep8 happening for test_compiler; next we will begin
cutting up tests and removing old ones
- move test_in() to test_operators
- slice up migrated operator tests into TOT
Mike Bayer [Tue, 23 Oct 2012 16:08:20 +0000 (12:08 -0400)]
Added a new method :meth:`.Engine.execution_options`
to :class:`.Engine`. This method works similarly to
:class:`.Connection.execution_options` in that it creates
a copy of the parent object which will refer to the new
set of options. The method can be used to build
sharding schemes where each engine shares the same
underlying pool of connections. The method
has been tested against the horizontal shard
recipe in the ORM as well.
Mike Bayer [Mon, 22 Oct 2012 17:54:39 +0000 (13:54 -0400)]
- fix regression from 0.7 where calling get_history with passive
on a never-set collection would fail; made this act just like
scalars for now and added tests. I would think that HISTORY_BLANK
would be more appropriate here but it's too late in the game
to mess with that.
Mike Bayer [Mon, 22 Oct 2012 17:29:12 +0000 (13:29 -0400)]
The auto-correlation feature of :func:`.select`, and
by proxy that of :class:`.orm.Query`, will not
take effect for a SELECT statement that is being
rendered directly in the FROM list of the enclosing
SELECT. Correlation in SQL only applies to column
expressions such as those in the WHERE, ORDER BY,
columns clause. [ticket:2595]
Mike Bayer [Sat, 20 Oct 2012 22:28:02 +0000 (18:28 -0400)]
- move all CHANGES files into the sphinx docs. this is rudimental now
but puts the changelog in a more data driven format, so that we
can begin linking version directives with them as well
as with migration documents, once those are also moved into sphinx.
Mike Bayer [Fri, 19 Oct 2012 23:20:18 +0000 (19:20 -0400)]
- rework the sphinx customizations into distinct modules
- build a new Sphinx extension that allows dialect info
to be entered as directives which is then rendered consistently
throughout all dialect/dbapi sections
- break out the "empty_strings" requirement for oracle test
Mike Bayer [Thu, 18 Oct 2012 22:24:15 +0000 (18:24 -0400)]
- move out maxdb
- begin consolidating docs for dialects to be more self contained
- add a separate section for "external" dialects
- not sure how we're going to go with this yet.
Mike Bayer [Thu, 18 Oct 2012 16:29:41 +0000 (12:29 -0400)]
- [bug] TypeDecorator now includes a generic repr()
that works in terms of the "impl" type by default.
This is a behavioral change for those TypeDecorator
classes that specify a custom __init__ method; those
types will need to re-define __repr__() if they need
__repr__() to provide a faithful constructor representation.
[ticket:2594]
Mike Bayer [Tue, 16 Oct 2012 00:07:13 +0000 (20:07 -0400)]
- [feature] The Query can now load entity/scalar-mixed
"tuple" rows that contain
types which aren't hashable, by setting the flag
"hashable=False" on the corresponding TypeEngine object
in use. Custom types that return unhashable types
(typically lists) can set this flag to False.
[ticket:2592]
- [bug] Applying a column expression to a select
statement using a label with or without other
modifying constructs will no longer "target" that
expression to the underlying Column; this affects
ORM operations that rely upon Column targeting
in order to retrieve results. That is, a query
like query(User.id, User.id.label('foo')) will now
track the value of each "User.id" expression separately
instead of munging them together. It is not expected
that any users will be impacted by this; however,
a usage that uses select() in conjunction with
query.from_statement() and attempts to load fully
composed ORM entities may not function as expected
if the select() named Column objects with arbitrary
.label() names, as these will no longer target to
the Column objects mapped by that entity.
[ticket:2591]
Mike Bayer [Mon, 15 Oct 2012 21:21:38 +0000 (17:21 -0400)]
- [feature] "scalar" selects now have a WHERE method
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].
Mike Bayer [Fri, 12 Oct 2012 21:21:08 +0000 (17:21 -0400)]
- [feature] Improvements to event listening for
mapped classes allows that unmapped classes
can be specified for instance- and mapper-events.
The established events will be automatically
set up on subclasses of that class when the
propagate=True flag is passed, and the
events will be set up for that class itself
if and when it is ultimately mapped.
[ticket:2585]
- [bug] The instrumentation events class_instrument(),
class_uninstrument(), and attribute_instrument()
will now fire off only for descendant classes
of the class assigned to listen(). Previously,
an event listener would be assigned to listen
for all classes in all cases regardless of the
"target" argument passed. [ticket:2590]