Mike Bayer [Thu, 23 Jun 2011 23:54:50 +0000 (19:54 -0400)]
- the "cascade" section of the session doc was totally screwed up, mappings
used the wrong form, example for cascade_backref used the wrong names.
- rewrite relationship cascade_backrefs doc
Mike Bayer [Wed, 22 Jun 2011 15:45:28 +0000 (11:45 -0400)]
- Added mixin class sqlalchemy.ext.DontWrapMixin.
User-defined exceptions of this type are never
wrapped in StatementException when they
occur in the context of a statement
execution.
- StatementException wrapping will display the
original exception class in the message.
Mike Bayer [Tue, 21 Jun 2011 14:01:46 +0000 (10:01 -0400)]
- Repaired the "no statement condition"
assertion in Query which would attempt
to raise if a generative method were called
after from_statement() were called.
[ticket:2199]. Also in 0.6.9.
Mike Bayer [Thu, 16 Jun 2011 16:09:45 +0000 (12:09 -0400)]
- Repaired the examples/versioning test runner
to not rely upon SQLAlchemy test libs,
nosetests must be run from within
examples/versioning to get around setup.cfg
breaking it.
- Tweak to examples/versioning to pick the
correct foreign key in a multi-level
inheritance situation.
Mike Bayer [Tue, 14 Jun 2011 14:08:34 +0000 (10:08 -0400)]
- Fixed declarative bug where a class inheriting
from a superclass of the same name would fail
due to an unnecessary lookup of the name
in the _decl_class_registry. [ticket:2194]
Mike Bayer [Mon, 13 Jun 2011 00:35:37 +0000 (20:35 -0400)]
- Fixed bug whereby comparison of column
expression to a Query() would not call
as_scalar() on the underlying SELECT
statement to produce a scalar subquery,
in the way that occurs if you called
it on Query().subquery(). [ticket:2190]
- some cleanup to test.orm.test_query
Mike Bayer [Tue, 7 Jun 2011 02:24:07 +0000 (22:24 -0400)]
- Adjusted the pyodbc dialect such that bound
values are passed as bytes and not unicode
if the "Easysoft" unix drivers are detected.
This is the same behavior as occurs with
FreeTDS. Easysoft appears to segfault
if Python unicodes are passed under
certain circumstances.
Mike Bayer [Sun, 5 Jun 2011 16:22:34 +0000 (12:22 -0400)]
- Fixed bug where transaction-level "deleted"
collection wouldn't be cleared of expunged
states, raising an error if they later
became transient [ticket:2182].
Also in 0.6.8.
Mike Bayer [Sun, 5 Jun 2011 15:58:26 +0000 (11:58 -0400)]
- Added a workaround for Python bug 7511 where
failure of C extension build does not
raise an appropriate exception on Windows 64
bit + VC express [ticket:2184]
Mike Bayer [Sun, 5 Jun 2011 00:52:30 +0000 (20:52 -0400)]
- Adjusted the __contains__() method of
a RowProxy result row such that no exception
throw is generated internally;
NoSuchColumnError() also will generate its
message regardless of whether or not the column
construct can be coerced to a string.
[ticket:2178]. Also in 0.6.8.
Mike Bayer [Sun, 5 Jun 2011 00:20:28 +0000 (20:20 -0400)]
- Some unit test fixes regarding numeric arrays,
MATCH operator. A potential floating-point
inaccuracy issue was fixed, and certain tests
of the MATCH operator only execute within an
EN-oriented locale for now. [ticket:2175].
Also in 0.6.8.
Mike Bayer [Sun, 5 Jun 2011 00:04:29 +0000 (20:04 -0400)]
- Modify the text of the message which occurs
when the "identity" key isn't detected on
flush, to include the common cause that
the Column isn't set up to detect
auto-increment correctly; [ticket:2170].
Also in 0.6.8.
Mike Bayer [Sat, 4 Jun 2011 23:53:24 +0000 (19:53 -0400)]
- Accept None from SQLite cursor.fetchone() when
"PRAGMA read_uncommitted" is called to determine
current isolation mode at connect time and
default to SERIALIZABLE; this to support SQLite
versions pre-3.3.0 that did not have this
feature. [ticket:2173]
Mike Bayer [Sat, 4 Jun 2011 23:43:39 +0000 (19:43 -0400)]
- Repaired new "mutable" extension to propagate
events to subclasses correctly; don't
create multiple event listeners for
subclasses either. [ticket:2180]
Mike Bayer [Sat, 4 Jun 2011 23:01:52 +0000 (19:01 -0400)]
- "delete-orphan" cascade is now allowed on
self-referential relationships - this since
SQLA 0.7 no longer enforces "parent with no
child" at the ORM level; this check is left
up to foreign key nullability.
Related to [ticket:1912]
- a lot of cleanup and refactoring on relationship()
init, clarification
Mike Bayer [Thu, 2 Jun 2011 23:52:26 +0000 (19:52 -0400)]
- Unit tests pass 100% on MySQL installed
on windows, after aggressive exclusion of a wide variety
of tests. Not clear to what degree the failures are related to
version 5.5 vs. the usage of windows, in particular the ON UPDATE CASCADE
immediately crashes the server. The features being tested here are all
edge cases not likely to be used in typical MySQL environments.
- Removed the "adjust casing" step that would
fail when reflecting a table on MySQL
on windows with a mixed case name. After some
experimenting with a windows MySQL server, it's
been determined that this step wasn't really
helping the situation much; MySQL does not return
FK names with proper casing on non-windows
platforms either, and removing the step at
least allows the reflection to act more like
it does on other OSes. A warning here
has been considered but its difficult to
determine under what conditions such a warning
can be raised, so punted on that for now -
added some docs instead. [ticket:2181]
- supports_sane_rowcount will be set to False
if using MySQLdb and the DBAPI doesn't provide
the constants.CLIENT module.
Mike Bayer [Thu, 2 Jun 2011 06:52:40 +0000 (02:52 -0400)]
- Deprecate schema/SQL-oriented methods on
Connection/Engine that were never well known
and are redundant: reflecttable(), create(),
drop(), text(), engine.func
- lots of docstrings in engine
Mike Bayer [Thu, 2 Jun 2011 00:25:33 +0000 (20:25 -0400)]
take out a little cruft. Spend two hours trying to make things simpler,
maybe we dont need state.callables (nope we do), maybe we can move populate_state out
(nope we lose speed that way), things are the way they are...
Mike Bayer [Sun, 29 May 2011 00:24:57 +0000 (20:24 -0400)]
- move Operators and ColumnOperators into sqlalchemy.sql.operators - since this
is strictly a system of routing Python operators into functions. Keep the
references available in expression.py for the near future.
Mike Bayer [Sat, 28 May 2011 17:28:38 +0000 (13:28 -0400)]
- Streamlined the process by which a Select
determines what's in it's '.c' collection.
Behaves identically, except that a
raw ClauseList() passed to select([])
(which is not a documented case anyway) will
now be expanded into its individual column
elements instead of being ignored.
Mike Bayer [Fri, 20 May 2011 18:43:06 +0000 (14:43 -0400)]
- Fixed bug whereby mapper mapped to an anonymous
alias would fail if logging were used, due to
unescaped % sign in the alias name. [ticket:2171]
Also in 0.6.8.
Mike Bayer [Thu, 19 May 2011 16:00:47 +0000 (12:00 -0400)]
- Fixed bug in MSSQL dialect whereby the aliasing
applied to a schema-qualified table would leak
into enclosing select statements [ticket:2169].
Also in 0.6.8.
Mike Bayer [Wed, 18 May 2011 16:07:40 +0000 (12:07 -0400)]
- Fixed bug whereby nesting a label of a select()
with another label in it would produce incorrect
exported columns. Among other things this would
break an ORM column_property() mapping against
another column_property(). [ticket:2167].
Also in 0.6.8
- _Label() is always against a column or selectable. remove
uncovered case of label against something else.
- start taking notes to clean up some of this labeling stuff,
which will be [ticket:2168]
Mike Bayer [Sat, 14 May 2011 17:34:29 +0000 (13:34 -0400)]
- make sure we definitely get every connection created
- ensure we lose self.conns, cx_oracle only closes on __del__
- fix reconnectingfixture to lose all connection references
Mike Bayer [Sat, 14 May 2011 14:23:12 +0000 (10:23 -0400)]
- Fixed bugs in sqlalchemy.ext.mutable extension where
`None` was not appropriately handled, replacement
events were not appropriately handled.
[ticket:2143]
Mike Bayer [Thu, 12 May 2011 16:47:09 +0000 (12:47 -0400)]
- polymorphic_union() gets a "cast_nulls" option,
disables the usage of CAST when it renders
the labeled NULL columns. [ticket:1502]
- polymorphic_union() renders the columns in their
original table order, as according to the first
table/selectable in the list of polymorphic
unions in which they appear. (which is itself
an unordered mapping unless you pass an OrderedDict).
Mike Bayer [Tue, 10 May 2011 00:40:33 +0000 (20:40 -0400)]
- given that Oracle's issue is not just open connections, but *closed* ones too, go really
heavy handed and start marking tests as "requires.ad_hoc_engines", add a flag --low-connections
that will switch the engine reaper mechanism to use as *few* distinct engines and connections
as possible, many engine tests that really need their own engines are just skipped.
Mike Bayer [Sat, 7 May 2011 16:52:25 +0000 (12:52 -0400)]
- Changed the handling in determination of join
conditions such that foreign key errors are
only considered between the two given tables.
That is, t1.join(t2) will report FK errors
that involve 't1' or 't2', but anything
involving 't3' will be skipped. This affects
join(), as well as ORM relationship and
inherit condition logic. Will keep the more conservative
approach to [ticket:2153] in 0.6.
Mike Bayer [Sat, 7 May 2011 15:52:14 +0000 (11:52 -0400)]
- mapper() will ignore non-configured foreign keys
to unrelated tables when determining inherit
condition between parent and child class.
This is equivalent to behavior already
applied to declarative. [ticket:2153]
Also in 0.6.8.
Mike Bayer [Sat, 7 May 2011 15:26:00 +0000 (11:26 -0400)]
- Fixed bug where determination of "self referential"
relationship would fail with no workaround
for joined-inh subclass related to itself,
or joined-inh subclass related to a subclass
of that with no cols in the sub-sub class
in the join condition. [ticket:2149]
Also in 0.6.8.
Mike Bayer [Sat, 7 May 2011 15:15:36 +0000 (11:15 -0400)]
- Fixed the error message emitted for "can't
execute syncrule for destination column 'q';
mapper 'X' does not map this column" to
reference the correct mapper. [ticket:2163].
Also in 0.6.8.
- test/orm/test_sync.py covers orm/sync.py 100%
Mike Bayer [Sat, 30 Apr 2011 18:43:03 +0000 (14:43 -0400)]
- rework of Query._adapt_clause to support [ticket:2155],
be clearer in its intent.
- Fine tuning of Query clause adaptation when
from_self(), union(), or other "select from
myself" operation, such that plain SQL expression
elements added to filter(), order_by() etc.
which are present in the nested "from myself"
query *will* be adapted in the same way an ORM
expression element will, since these
elements are otherwise not easily accessible.
[ticket:2155]
Mike Bayer [Thu, 28 Apr 2011 16:10:24 +0000 (12:10 -0400)]
- Removed the usage of the "collections.MutableMapping"
abc from the ext.mutable docs as it was being used
incorrectly and makes the example more difficult
to understand in any case. [ticket:2152]
Mike Bayer [Thu, 28 Apr 2011 02:33:37 +0000 (22:33 -0400)]
- removed the ancient "polymorphic association"
examples and replaced with an updated set of
examples that use declarative mixins,
"generic_associations". Each presents an alternative
table layout.
Mike Bayer [Wed, 27 Apr 2011 16:54:15 +0000 (12:54 -0400)]
- a non_primary mapper will inherit the _identity_class
of the primary mapper. This so that a non_primary
established against a class that's normally in an
inheritance mapping will produce results that are
identity-map compatible with that of the primary
mapper [ticket:2151] (also in 0.6.8)
Mike Bayer [Tue, 26 Apr 2011 01:50:26 +0000 (21:50 -0400)]
- hardcore force every connection into a strong-referenced set, rollback on every test, close on every context.
this uses pool events but bypasses the pool's fairy/record/dispose services. pypy still seems to expose
some holes in that at least as far as what some (or maybe just one, cant find it yet) of the tests does.
haven't tested this too deeply, just on sqlite + postgres, cypthon 2.7 + pypy. will see what the buildbot
says