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]
Mike Bayer [Thu, 11 Oct 2012 00:12:25 +0000 (20:12 -0400)]
- create new sqlalchemy.testing.suite.test_types, starting with Unicode round trip tests.
- clean out existing test_types:UnicodeTest to be strictly individual unit tests
against Unicode(), String(), etc. with no database access.
Mike Bayer [Wed, 10 Oct 2012 23:34:29 +0000 (19:34 -0400)]
- [feature] Added "collation" parameter to all
String types. When present, renders as
COLLATE <collation>. This to support the
COLLATE keyword now supported by several
databases including MySQL, SQLite, and Postgresql.
[ticket:2276]
- [change] The Text() type renders the length
given to it, if a length was specified.
Mike Bayer [Wed, 10 Oct 2012 18:25:21 +0000 (14:25 -0400)]
- [feature] Added TIME type to mysql dialect,
accepts "fst" argument which is the new
"fractional seconds" specifier for recent
MySQL versions. The datatype will interpret
a microseconds portion received from the driver,
however note that at this time most/all MySQL
DBAPIs do not support returning this value.
[ticket:2534]
- attempted to modernize the types tests in test_mysql a little, though has a long
way to go
Mike Bayer [Mon, 8 Oct 2012 18:41:35 +0000 (14:41 -0400)]
- [feature] Various API tweaks to the "dialect"
API to better support highly specialized
systems such as the Akiban database, including
more hooks to allow an execution context to
access type processors.
Mike Bayer [Sat, 6 Oct 2012 16:46:02 +0000 (12:46 -0400)]
- [bug] Continuing [ticket:2566] regarding extra
state post-flush due to event listeners;
any states that are marked as "dirty" from an
attribute perspective, usually via column-attribute
set events within after_insert(), after_update(),
etc., will get the "history" flag reset
in all cases, instead of only those instances
that were part of the flush. This has the effect
that this "dirty" state doesn't carry over
after the flush and won't result in UPDATE
statements. A warning is emitted to this
effect; the set_committed_state()
method can be used to assign attributes on objects
without producing history events. [ticket:2582]
Victor Olex [Fri, 5 Oct 2012 20:31:20 +0000 (13:31 -0700)]
it is sensible to add NCHAR and NVARCHAR as recognized data types for sqlite dialect because they are widely used and because of the type affinity mechanism of sqlite
Mike Bayer [Thu, 4 Oct 2012 22:26:55 +0000 (18:26 -0400)]
- add back __engine_options__
- break test_insert tests into explicitly get_lastrowid() vs. implicit_returning tests,
fix up requirements to split them out
Mike Bayer [Thu, 4 Oct 2012 21:36:02 +0000 (17:36 -0400)]
- don't call get_lastrowid() on explicit returning
- don't hardwire "subqueries" requirement in the base, mysql < 4.1 isn't working anyway
- don't need explicit FB/PG exclusions in test_returning
- hit db.connect() for the returning requirement
Mike Bayer [Thu, 4 Oct 2012 17:50:36 +0000 (13:50 -0400)]
- [feature] The Session will produce warnings
when unsupported methods are used inside the
"execute" portion of the flush. These are
the familiar methods add(), delete(), etc.
as well as collection and related-object
manipulations, as called within mapper-level
flush events
like after_insert(), after_update(), etc.
It's been prominently documented for a long
time that SQLAlchemy cannot guarantee
results when the Session is manipulated within
the execution of the flush plan,
however users are still doing it, so now
there's a warning. Maybe someday the Session
will be enhanced to support these operations
inside of the flush, but for now, results
can't be guaranteed.
Mike Bayer [Wed, 3 Oct 2012 14:52:14 +0000 (10:52 -0400)]
- [bug] Fixed Session accounting bug whereby replacing
a deleted object in the identity map with another
object of the same primary key would raise a
"conflicting state" error on rollback(),
if the replaced primary key were established either
via non-unitofwork-established INSERT statement
or by primary key switch of another instance.
[ticket:2583]
Mike Bayer [Mon, 1 Oct 2012 05:59:59 +0000 (01:59 -0400)]
- fix the fixture here that wasn't creating consistently
- rewrite --dropfirst to be more industrial strength, includes views
- fix order_by="foreign_key" to maintain the same ordering as
metadata.sorted_tables. Not ideal that this was the other way throughout
0.7 but this is still a little-used method, in contrast to metadata.sorted_tables.
Mike Bayer [Mon, 1 Oct 2012 00:17:49 +0000 (20:17 -0400)]
- [feature] the MS Access dialect has been
moved to its own project on Bitbucket,
taking advantage of the new SQLAlchemy
dialect compliance suite. The dialect is
still in very rough shape and probably not
ready for general use yet, however
it does have *extremely* rudimental
functionality now.
Mike Bayer [Sun, 30 Sep 2012 22:23:21 +0000 (18:23 -0400)]
mssql: - [bug] Fixed bug where reflection of primary key constraint
would double up columns if the same constraint/table
existed in multiple schemas.
- force returns_rows to False for inserts where we know rows shouldnt be returned;
allows post_exec() to use the cursor without issue
Mike Bayer [Sun, 30 Sep 2012 21:18:14 +0000 (17:18 -0400)]
- [bug] Fixed bug in over() construct whereby
passing an empty list for either partition_by
or order_by, as opposed to None, would fail
to generate correctly.
Courtesy Gunnlaugur Por Briem.
[ticket:2574]
Mike Bayer [Sun, 30 Sep 2012 20:57:23 +0000 (16:57 -0400)]
- [bug] Fixed compiler bug whereby using a correlated
subquery within an ORDER BY would fail to render correctly
if the stament also used LIMIT/OFFSET, due to mis-rendering
within the ROW_NUMBER() OVER clause. Fix courtesy
sayap [ticket:2538]
Mike Bayer [Sun, 30 Sep 2012 20:00:46 +0000 (20:00 +0000)]
- [bug] The CreateIndex construct in Oracle
will now schema-qualify the name of the index
to be that of the parent table. Previously this
name was omitted which apparently creates the
index in the default schema, rather than that
of the table.