Mike Bayer [Sat, 7 Dec 2013 22:20:05 +0000 (17:20 -0500)]
- A DBAPI that raises an error on ``connect()`` which is not a subclass
of dbapi.Error (such as ``TypeError``, ``NotImplementedError``, etc.)
will propagate the exception unchanged. Previously,
the error handling specific to the ``connect()`` routine would both
inappropriately run the exception through the dialect's
:meth:`.Dialect.is_disconnect` routine as well as wrap it in
a :class:`sqlalchemy.exc.DBAPIError`. It is now propagated unchanged
in the same way as occurs within the execute process. [ticket:2881]
- add tests for this in test_parseconnect, but also add tests in test_execute
to ensure the execute() behavior as well
Mike Bayer [Sat, 7 Dec 2013 00:57:19 +0000 (19:57 -0500)]
- The :class:`.QueuePool` has been enhanced to not block new connection
attempts when an existing connection attempt is blocking. Previously,
the production of new connections was serialized within the block
that monitored overflow; the overflow counter is now altered within
it's own critical section outside of the connection process itself.
[ticket:2880]
Mike Bayer [Fri, 6 Dec 2013 20:53:59 +0000 (15:53 -0500)]
- Made a slight adjustment to the logic which waits for a pooled
connection to be available, such that for a connection pool
with no timeout specified, it will every half a second break out of
the wait to check for the so-called "abort" flag, which allows the
waiter to break out in case the whole connection pool was dumped;
normally the waiter should break out due to a notify_all() but it's
possible this notify_all() is missed in very slim cases.
This is an extension of logic first introduced in 0.8.0, and the
issue has only been observed occasionally in stress tests.
Mike Bayer [Fri, 6 Dec 2013 20:53:59 +0000 (15:53 -0500)]
- Made a slight adjustment to the logic which waits for a pooled
connection to be available, such that for a connection pool
with no timeout specified, it will every half a second break out of
the wait to check for the so-called "abort" flag, which allows the
waiter to break out in case the whole connection pool was dumped;
normally the waiter should break out due to a notify_all() but it's
possible this notify_all() is missed in very slim cases.
This is an extension of logic first introduced in 0.8.0, and the
issue has only been observed occasionally in stress tests.
Mike Bayer [Fri, 6 Dec 2013 00:03:31 +0000 (19:03 -0500)]
- The precedence rules for the :meth:`.ColumnOperators.collate` operator
have been modified, such that the COLLATE operator is now of lower
precedence than the comparison operators. This has the effect that
a COLLATE applied to a comparison will not render parenthesis
around the comparison, which is not parsed by backends such as
MSSQL. The change is backwards incompatible for those setups that
were working around the issue by applying :meth:`.Operators.collate`
to an individual element of the comparison expression,
rather than the comparison expression as a whole. [ticket:2879]
Mike Bayer [Tue, 3 Dec 2013 18:46:41 +0000 (13:46 -0500)]
- The :class:`.DeferredReflection` class has been enhanced to provide
automatic reflection support for the "secondary" table referred
to by a :func:`.relationship`. "secondary", when specified
either as a string table name, or as a :class:`.Table` object with
only a name and :class:`.MetaData` object will also be included
in the reflection process when :meth:`.DeferredReflection.prepare`
is called. [ticket:2865]
- clsregistry._resolver() now uses a stateful _class_resolver()
class in order to handle the work of mapping strings to
objects. This is to provide for simpler extensibility, namely
a ._resolvers collection of ad-hoc name resolution functions;
the DeferredReflection class adds its own resolver here in order
to handle relationship(secondary) names which generate new
Table objects.
Mike Bayer [Mon, 2 Dec 2013 17:40:50 +0000 (12:40 -0500)]
- Added new argument ``include_backrefs=True`` to the
:func:`.validates` function; when set to False, a validation event
will not be triggered if the event was initated as a backref to
an attribute operation from the other side. [ticket:1535]
- break out validation tests into an updated module test_validators
Mike Bayer [Sat, 30 Nov 2013 22:31:00 +0000 (17:31 -0500)]
- the pronoun removal commit. there was only one instance of a
standalone gendered pronoun with a gender-neutral subject, but also
have replaced all occurences of "his/her", "his or her", etc. The docs have always
strived to account for both genders in any non-specific singular pronoun,
however recent controversy in the community suggests
that a zero-gendered-pronoun policy is probably best going forward.
Mike Bayer [Sat, 30 Nov 2013 20:30:24 +0000 (15:30 -0500)]
- re-document synonyms and remove warnings about "superseded"; synonyms
are still useful, just include notes that for more complex descriptor operations,
hybrids are probably preferable
Mike Bayer [Sat, 30 Nov 2013 18:53:26 +0000 (13:53 -0500)]
- Fixed bug where values within an ENUM weren't escaped for single
quote signs. Note that this is backwards-incompatible for existing
workarounds that manually escape the single quotes. [ticket:2878]
Mike Bayer [Sat, 30 Nov 2013 00:06:33 +0000 (19:06 -0500)]
- add support for bindparam() called from AsFromText
- get PG dialect to work around "no nonexistent binds" rule for now,
though we might want to reconsider this behavior
Mike Bayer [Fri, 29 Nov 2013 23:15:52 +0000 (18:15 -0500)]
Fixed bug where in Py2K a unicode literal would not be accepted
as the string name of a class or other argument within
declarative using :func:`.relationship`.
Mike Bayer [Fri, 29 Nov 2013 19:36:24 +0000 (14:36 -0500)]
- New improvements to the :func:`.text` construct, including
more flexible ways to set up bound parameters and return types;
in particular, a :func:`.text` can now be turned into a full
FROM-object, embeddable in other statements as an alias or CTE
using the new method :meth:`.TextClause.columns`.
[ticket:2877]
Mike Bayer [Fri, 29 Nov 2013 03:25:09 +0000 (22:25 -0500)]
- fix up rendering of "of"
- move out tests, dialect specific out of compiler, compiler tests use new API,
legacy API tests in test_selecatble
- add support for adaptation of ForUpdateArg, alias support in compilers
Mike Bayer [Wed, 27 Nov 2013 04:24:13 +0000 (23:24 -0500)]
- the wrapped memoized_property here was not working, as the attribute name
didn't match. use straight memoized_props here for now, add a perf test to check it
Mike Bayer [Mon, 25 Nov 2013 19:46:58 +0000 (14:46 -0500)]
- adjustment, the spec says: "Within the user and password field, any ":",
"@", or "/" must be encoded." - so re-apply encoding to both password
and username, don't encode spaces as plus signs, don't encode any chars
outside of :, @, / on stringification - but we still parse for any
%XX character (is that right?)
Mike Bayer [Sun, 24 Nov 2013 23:11:37 +0000 (18:11 -0500)]
- The :func:`.create_engine` routine and the related
:func:`.make_url` function **no longer URL encode the password**.
Database passwords that include characters like spaces, plus signs
and anything else should now represent these characters directly,
without any URL escaping. [ticket:2873]
Mike Bayer [Sat, 23 Nov 2013 22:03:48 +0000 (17:03 -0500)]
- Some refinements to the :class:`.AliasedClass` construct with regards
to descriptors, like hybrids, synonyms, composites, user-defined
descriptors, etc. The attribute
adaptation which goes on has been made more robust, such that if a descriptor
returns another instrumented attribute, rather than a compound SQL
expression element, the operation will still proceed.
Addtionally, the "adapted" operator will retain its class; previously,
a change in class from ``InstrumentedAttribute`` to ``QueryableAttribute``
(a superclass) would interact with Python's operator system such that
an expression like ``aliased(MyClass.x) > MyClass.x`` would reverse itself
to read ``myclass.x < myclass_1.x``. The adapted attribute will also
refer to the new :class:`.AliasedClass` as its parent which was not
always the case before. [ticket:2872]
Mike Bayer [Sat, 23 Nov 2013 01:04:19 +0000 (20:04 -0500)]
- The precision used when coercing a returned floating point value to
Python ``Decimal`` via string is now configurable. The
flag ``decimal_return_scale`` is now supported by all :class:`.Numeric`
and :class:`.Float` types, which will ensure this many digits are taken
from the native floating point value when it is converted to string.
If not present, the type will make use of the value of ``.scale``, if
the type supports this setting and it is non-None. Otherwise the original
default length of 10 is used. [ticket:2867]
Mike Bayer [Fri, 22 Nov 2013 23:35:36 +0000 (18:35 -0500)]
- Fixed bug where SQL statement would be improperly ASCII-encoded
when a pre-DBAPI :class:`.StatementError` were raised within
:meth:`.Connection.execute`, causing encoding errors for
non-ASCII statements. The stringification now remains within
Python unicode thus avoiding encoding errors. [ticket:2871]
Mike Bayer [Fri, 22 Nov 2013 22:56:35 +0000 (17:56 -0500)]
Fixed bug where Oracle ``VARCHAR`` types given with no length
(e.g. for a ``CAST`` or similar) would incorrectly render ``None CHAR``
or similar. [ticket:2870]
Mike Bayer [Thu, 21 Nov 2013 18:30:32 +0000 (13:30 -0500)]
- Fixed bug which prevented the ``serializer`` extension from working
correctly with table or column names that contain non-ASCII
characters. [ticket:2869]
Mike Bayer [Thu, 21 Nov 2013 18:16:49 +0000 (13:16 -0500)]
- Fixed a regression caused by :ticket:`2812` where the repr() for
table and column names would fail if the name contained non-ascii
characters. [ticket:2868]
Mike Bayer [Wed, 20 Nov 2013 00:29:18 +0000 (19:29 -0500)]
- The :class:`.RowProxy` object is now sortable in Python as a regular
tuple is; this is accomplished via ensuring tuple() conversion on
both sides within the ``__eq__()`` method as well as
the addition of a ``__lt__()`` method. [ticket:2848]
Mike Bayer [Wed, 20 Nov 2013 00:16:26 +0000 (19:16 -0500)]
- The ``viewonly`` flag on :func:`.relationship` will now prevent
attribute history from being written on behalf of the target attribute.
This has the effect of the object not being written to the
Session.dirty list if it is mutated. Previously, the object would
be present in Session.dirty, but no change would take place on behalf
of the modified attribute during flush. The attribute still emits
events such as backref events and user-defined events and will still
receive mutations from backrefs. [ticket:2833]
Vraj Mohan [Fri, 15 Nov 2013 13:41:00 +0000 (08:41 -0500)]
Remove reference to defunct class
We should probably reword this entirely as, IMHO, this should be in the
changelog and not in the doc proper (which should only describe the
current state of affairs).