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]
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.
Mike Bayer [Sat, 29 Sep 2012 17:21:15 +0000 (13:21 -0400)]
- revert the "basedir" thing - running setup.py from the currdir is unfortunately part of the
distutils docs (http://docs.python.org/install/index.html#platform-variations)
Mike Bayer [Thu, 27 Sep 2012 06:37:33 +0000 (02:37 -0400)]
trying different approaches to test layout. in this one, the testing modules
become an externally usable package but still remains within the main sqlalchemy parent package.
in this system, we use kind of an ugly hack to get the noseplugin imported outside of the
"sqlalchemy" package, while still making it available within sqlalchemy for usage by
third party libraries.
Mike Bayer [Wed, 26 Sep 2012 21:21:21 +0000 (17:21 -0400)]
- further reorganization of test suite:
- bootstrap and lib move to all absolute imports
- testing.py is no longer internally referenced.
- requirements move to be a pluggable class which can
be overridden.
- cleanup
in the interests of third party testing, test/lib and test/bootstrap
may move to be an independent package.
Mike Bayer [Tue, 25 Sep 2012 20:54:50 +0000 (16:54 -0400)]
- [bug] Added 'terminating connection' to the list
of messages we use to detect a disconnect with PG, which
appears to be present in some versions when the server
is restarted. [ticket:2570]
Mike Bayer [Sun, 23 Sep 2012 22:09:18 +0000 (18:09 -0400)]
- got firebird running
- add some failure cases
- [bug] Firebird now uses strict "ansi bind rules"
so that bound parameters don't render in the
columns clause of a statement - they render
literally instead.
- [bug] Support for passing datetime as date when
using the DateTime type with Firebird; other
dialects support this.
Mike Bayer [Sun, 23 Sep 2012 17:42:24 +0000 (13:42 -0400)]
- [bug] Columns in reflected primary key constraint
are now returned in the order in which the constraint
itself defines them, rather than how the table
orders them. Courtesy Gunnlaugur Por Briem.
[ticket:2531].
Mike Bayer [Sun, 23 Sep 2012 16:51:24 +0000 (12:51 -0400)]
- [bug] When the primary key column of a Table
is replaced, such as via extend_existing,
the "auto increment" column used by insert()
constructs is reset. Previously it would
remain referring to the previous primary
key column. [ticket:2525]
Mike Bayer [Sun, 23 Sep 2012 16:42:38 +0000 (12:42 -0400)]
- [feature] An explicit error is raised when
a ForeignKeyConstraint() that was
constructed to refer to multiple remote tables
is first used. [ticket:2455]
Mike Bayer [Sun, 23 Sep 2012 15:30:07 +0000 (11:30 -0400)]
- [bug] Adjusted column default reflection code to
convert non-string values to string, to accommodate
old SQLite versions that don't deliver
default info as a string. [ticket:2265]
- factor sqlite column reflection to be like we did for postgresql,
in a separate method.
Mike Bayer [Sat, 22 Sep 2012 20:48:49 +0000 (16:48 -0400)]
- [bug] A tweak to column precedence which moves the
"concat" and "match" operators to be the same as
that of "is", "like", and others; this helps with
parenthesization rendering when used in conjunction
with "IS". [ticket:2564]
Mike Bayer [Sat, 22 Sep 2012 20:14:58 +0000 (16:14 -0400)]
- [bug] Added missing operators is_(), isnot()
to the ColumnOperators base, so that these long-available
operators are present as methods like all
the other operators. [ticket:2544]
Mike Bayer [Sat, 22 Sep 2012 20:03:57 +0000 (16:03 -0400)]
- [bug] Extra logic has been added to the "flush"
that occurs within Session.commit(), such that the
extra state added by an after_flush() or
after_flush_postexec() hook is also flushed in a
subsequent flush, before the "commit" completes.
Subsequent calls to flush() will continue until
the after_flush hooks stop adding new state.
An "overflow" counter of 100 is also in place,
in the event of a broken after_flush() hook
adding new content each time. [ticket:2566]