diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2009-10-26 00:32:39 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2009-10-26 00:32:39 +0000 |
commit | 5119ce78b5c47f89a9dfca2a2781cec60551a0e7 (patch) | |
tree | 57d266f7e3445be001bc6264223d2e73f256520a /lib/sqlalchemy/test/engines.py | |
parent | eb9763febe58655ca0f61fa758925c56b94ece9b (diff) | |
download | sqlalchemy-5119ce78b5c47f89a9dfca2a2781cec60551a0e7.tar.gz |
- The psycopg2 dialect now uses psycopg2's "unicode extension"
on all new connections, which allows all String/Text/etc.
types to skip the need to post-process bytestrings into
unicode (an expensive step due to its volume). Other
dialects which return unicode natively (pg8000, zxjdbc)
also skip unicode post-processing.
- String/Text/Unicode types now skip the unicode() check
on each result column value if the dialect has
detected the DBAPI as returning Python unicode objects
natively. This check is issued on first connect
using "SELECT CAST 'some text' AS VARCHAR(10)" or
equivalent, then checking if the returned object
is a Python unicode. This allows vast performance
increases for native-unicode DBAPIs, including
pysqlite/sqlite3, psycopg2, and pg8000.
Diffstat (limited to 'lib/sqlalchemy/test/engines.py')
-rw-r--r-- | lib/sqlalchemy/test/engines.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/sqlalchemy/test/engines.py b/lib/sqlalchemy/test/engines.py index 187ad2ff0..31d1658af 100644 --- a/lib/sqlalchemy/test/engines.py +++ b/lib/sqlalchemy/test/engines.py @@ -287,3 +287,11 @@ class ReplayableSession(object): raise AttributeError(key) else: return result + +def unwrap_connection(conn): + if conn.__class__.__name__ == 'Recorder': + return conn._subject + elif conn.__class__.__name__ == 'Player': + return None + else: + return conn |