Mike Bayer [Thu, 2 Jan 2014 23:59:26 +0000 (18:59 -0500)]
- Fixed regression where we don't check the given name against the
correct string class when setting up a backref based on a name,
therefore causing the error "too many values to unpack". This was
related to the Py3k conversion. [ticket:2901]
Mike Bayer [Thu, 2 Jan 2014 23:51:49 +0000 (18:51 -0500)]
- A quasi-regression where apparently in 0.8 you can set a class-level
attribute on declarative to simply refer directly to an :class:`.InstrumentedAttribute`
on a superclass or on the class itself, and it
acts more or less like a synonym; in 0.9, this fails to set up enough
bookkeeping to keep up with the more liberalized backref logic
from :ticket:`2789`. Even though this use case was never directly
considered, it is now detected by declarative at the "setattr()" level
as well as when setting up a subclass, and the mirrored/renamed attribute
is now set up as a :func:`.synonym` instead. [ticket:2900]
Mike Bayer [Thu, 2 Jan 2014 23:26:32 +0000 (18:26 -0500)]
- Fixed regression where we apparently still create an implicit
alias when saying query(B).join(B.cs), where "C" is a joined inh
class; however, this implicit alias was created only considering
the immediate left side, and not a longer chain of joins along different
joined-inh subclasses of the same base. As long as we're still
implicitly aliasing in this case, the behavior is dialed back a bit
so that it will alias the right side in a wider variety of cases.
[ticket:2903]
Mike Bayer [Thu, 2 Jan 2014 19:23:14 +0000 (14:23 -0500)]
- support addition of fails_if()/only_on(), just wraps the decorators
- update a few exclusions to support current pymssql. passes all of test_suite and dialect/mssql
Mike Bayer [Sat, 28 Dec 2013 22:50:19 +0000 (17:50 -0500)]
- apply a similar fix for floats to mssql+pyodbc as we did to firebird
- wrangle through osx+pyodbc+freetds to get at least test_suite to pass again
with mssql+pyodbc. invovled adding some silly requirements
Mike Bayer [Sat, 28 Dec 2013 21:37:54 +0000 (16:37 -0500)]
- adjust the behavior of cast() to only provide a type for the bindparam()
if we are coercing straight from string. [ticket:2899]
- rework the tests here to be individual
Ben Alpert [Sat, 28 Dec 2013 06:11:23 +0000 (23:11 -0700)]
session docs: Change `object` to `someobject`
This makes the code block more consistent with the preceding one and also prevents the variable from being colored as a builtin (which `object` is) during syntax highlighting.
Mike Bayer [Fri, 27 Dec 2013 23:25:57 +0000 (18:25 -0500)]
- rework the JSON expression system so that "astext" is called *after*
the indexing. this is for more natural operation.
- also add cast() to the JSON expression to complement astext. This integrates
the CAST call which will be needed frequently. Part of [ticket:2687].
- it's a little unclear how more advanced unicode attribute-access is going to go,
some quick attempts at testing yielded strange error messages from psycopg2.
- do other cross linking as mentioned in [ticket:2687].
Mike Bayer [Fri, 27 Dec 2013 22:10:55 +0000 (17:10 -0500)]
- Declarative does an extra check to detect if the same
:class:`.Column` is mapped multiple times under different properties
(which typically should be a :func:`.synonym` instead) or if two
or more :class:`.Column` objects are given the same name, raising
a warning if this condition is detected. [ticket:2828]
Mike Bayer [Fri, 27 Dec 2013 21:39:54 +0000 (16:39 -0500)]
- Changed the queries used by Firebird to list table and view names
to query from the ``rdb$relations`` view instead of the
``rdb$relation_fields`` and ``rdb$view_relations`` views.
Variants of both the old and new queries are mentioned on many
FAQ and blogs, however the new queries are taken straight from
the "Firebird FAQ" which appears to be the most official source
of info. [ticket:2898]
Mike Bayer [Fri, 27 Dec 2013 18:28:18 +0000 (13:28 -0500)]
- add a test which creates tables and views at the same time, then tests that the lists
of each can be reflected independently. Testing [ticket:2898] at the moment.
Mike Bayer [Fri, 27 Dec 2013 18:20:58 +0000 (13:20 -0500)]
- Fixed bug in Firebird index reflection where the columns within the
index were not sorted correctly; they are now sorted
in order of RDB$FIELD_POSITION.
Mike Bayer [Fri, 27 Dec 2013 18:16:48 +0000 (13:16 -0500)]
- The "asdecimal" flag used with the :class:`.Float` type will now
work with Firebird dialects; previously the decimal conversion was
not occurring.
- scale back some firebird FP numeric tests
Mike Bayer [Sun, 22 Dec 2013 00:51:25 +0000 (19:51 -0500)]
- alter the decorator function, and the newer public_factory function,
to use a named def instead of a lambda. this so that TypeError on wrong
arguments are more legible. [ticket:2884]
Mike Bayer [Fri, 20 Dec 2013 15:26:09 +0000 (10:26 -0500)]
- Fixed issue where a primary key column that has a Sequence on it,
yet the column is not the "auto increment" column, either because
it has a foreign key constraint or ``autoincrement=False`` set,
would attempt to fire the Sequence on INSERT for backends that don't
support sequences, when presented with an INSERT missing the primary
key value. This would take place on non-sequence backends like
SQLite, MySQL. [ticket:2896]
Mike Bayer [Thu, 19 Dec 2013 21:02:14 +0000 (16:02 -0500)]
- Fixed bug with :meth:`.Insert.from_select` method where the order
of the given names would not be taken into account when generating
the INSERT statement, thus producing a mismatch versus the column
names in the given SELECT statement. Also noted that
:meth:`.Insert.from_select` implies that Python-side insert defaults
cannot be used, since the statement has no VALUES clause. [ticket:2895]
Mike Bayer [Wed, 18 Dec 2013 23:26:15 +0000 (18:26 -0500)]
- Improvements to the system by which SQL types generate within
``__repr__()``, particularly with regards to the MySQL integer/numeric/
character types which feature a wide variety of keyword arguments.
The ``__repr__()`` is important for use with Alembic autogenerate
for when Python code is rendered in a migration script.
[ticket:2893]
Mike Bayer [Tue, 17 Dec 2013 22:46:09 +0000 (17:46 -0500)]
- make the json serializer and deserializer per-dialect, so that we are
compatible with psycopg2's per-connection/cursor approach. add round trip tests for
both native and non-native.
Mike Bayer [Tue, 17 Dec 2013 20:38:35 +0000 (15:38 -0500)]
- The :func:`.cast` function, when given a plain literal value,
will now apply the given type to the given literal value on the
bind parameter side according
to the type given to the cast. This essentially replaces what would
normally be the detected type of the literal value. This only
takes effect if the auto-detected type of the literal value is either
"nulltype" (e.g. couldn't detect)
or a type that is of the same "affinity" as the cast type.
The net change here is that the :func:`.cast` function includes more
of the functionality already present in the :func:`.type_coerce` function.
Mike Bayer [Tue, 17 Dec 2013 20:13:39 +0000 (15:13 -0500)]
- rework JSON expressions to be based off __getitem__ exclusively
- add support for "standalone" JSON objects; this involves getting CAST
to upgrade the given type of a bound parameter. should add a core-only test
for this.
- add tests for "standalone" json round trips both with and without unicode
- add mechanism by which we remove psycopg2's "json" handler in order to get
the effect of using our non-native result handlers
Mike Bayer [Tue, 17 Dec 2013 00:32:10 +0000 (19:32 -0500)]
- for [ticket:2651], leaving CheckConstraint alone, preferring to keep
backwards compatibility. A note about backslashing escapes is added.
Because the Text() construct now supports bind params better, the example
given in the code raises an exception now, so that should cover us.
The exception itself has been enhanced to include the key name of the
bound param. We're backporting this to 0.8 but 0.8 doesn't have the
text->bind behavior that raises.
Mike Bayer [Tue, 17 Dec 2013 00:17:41 +0000 (19:17 -0500)]
- An adjustment to the :func:`.subqueryload` strategy which ensures that
the query runs after the loading process has begun; this is so that
the subqueryload takes precedence over other loaders that may be
hitting the same attribute due to other eager/noload situations
at the wrong time. [ticket:2887]
John Anderson [Mon, 16 Dec 2013 20:50:10 +0000 (12:50 -0800)]
Remove terminated connections from the pool.
In pymssql, if you terminate a long running query manually
it will give you a connection reset by peer message, but this
connection remains in the pool and will be re-used.
Mike Bayer [Mon, 16 Dec 2013 20:25:48 +0000 (15:25 -0500)]
- Fixed bug when using joined table inheritance from a table to a
select/alias on the base, where the PK columns were also not same
named; the persistence system would fail to copy primary key values
from the base table to the inherited table upon INSERT.
[ticket:2885]
Mike Bayer [Mon, 16 Dec 2013 02:23:01 +0000 (21:23 -0500)]
- add "force_nocheck" as a way to turn on unicode=force without even
doing the isinstance() check - currently used only by psycopg2 + native enum + py2k.
- didn't realize psycopg2 had UNICODEARRAY extension all this time; replace _PGArray
with just using UNICODEARRAY instead.
- replace unnecessary/inconsistent __import__ in _isolation_lookup.
Mike Bayer [Thu, 12 Dec 2013 18:30:16 +0000 (13:30 -0500)]
- :func:`.composite` will raise an informative error message when the
columns/attribute (names) passed don't resolve to a Column or mapped
attribute (such as an erroneous tuple); previously raised an unbound
local. [ticket:2889]
Mike Bayer [Thu, 12 Dec 2013 17:49:57 +0000 (12:49 -0500)]
- Error message when a string arg sent to :func:`.relationship` which
doesn't resolve to a class or mapper has been corrected to work
the same way as when a non-string arg is received, which indicates
the name of the relationship which had the configurational error.
[ticket:2888]