[Sqlalchemy-commits] sqlalchemy: GAE dialect now supports the use of credentials
Brought to you by:
zzzeek
From: <co...@sq...> - 2012-12-29 01:45:53
|
details: http://hg.sqlalchemy.org/sqlalchemy/sqlalchemy/rev/c252cfb0dfe2 changeset: 9031:c252cfb0dfe2 user: Owen Nelson <on...@gm...> date: Fri Dec 28 20:18:20 2012 -0500 description: GAE dialect now supports the use of credentials Subject: sqlalchemy: Fixes issue where GAE error handling can cause AttributeError: 'NoneType' object has no attribute 'group' details: http://hg.sqlalchemy.org/sqlalchemy/sqlalchemy/rev/f78e0c61446f changeset: 9032:f78e0c61446f user: Owen Nelson <on...@gm...> date: Fri Dec 28 20:20:23 2012 -0500 description: Fixes issue where GAE error handling can cause AttributeError: 'NoneType' object has no attribute 'group' Subject: sqlalchemy: changelog for pullreq 33 details: http://hg.sqlalchemy.org/sqlalchemy/sqlalchemy/rev/5f57be8b6cd4 changeset: 9033:5f57be8b6cd4 user: Mike Bayer <mi...@zz...> date: Fri Dec 28 20:45:39 2012 -0500 description: changelog for pullreq 33 diffstat: doc/build/changelog/changelog_08.rst | 14 ++++++++++++++ lib/sqlalchemy/dialects/mysql/gaerdbms.py | 8 ++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diffs (45 lines): diff -r 2f2d7c1b8a72 -r 5f57be8b6cd4 doc/build/changelog/changelog_08.rst --- a/doc/build/changelog/changelog_08.rst Sun Dec 23 18:15:12 2012 -0500 +++ b/doc/build/changelog/changelog_08.rst Fri Dec 28 20:45:39 2012 -0500 @@ -8,6 +8,20 @@ :released: December 14, 2012 .. change:: + :tags: mysql, feature + :pullreq: 33 + + GAE dialect now accepts username/password arguments in the URL, + courtesy Owen Nelson. + + .. change:: + :tags: mysql, bug + :pullreq: 33 + + GAE dialect won't fail on None match if the error code can't be extracted + from the exception throw; courtesy Owen Nelson. + + .. change:: :tags: orm, bug :tickets: 2637 diff -r 2f2d7c1b8a72 -r 5f57be8b6cd4 lib/sqlalchemy/dialects/mysql/gaerdbms.py --- a/lib/sqlalchemy/dialects/mysql/gaerdbms.py Sun Dec 23 18:15:12 2012 -0500 +++ b/lib/sqlalchemy/dialects/mysql/gaerdbms.py Fri Dec 28 20:45:39 2012 -0500 @@ -44,11 +44,15 @@ return NullPool def create_connect_args(self, url): - return [[], {'database': url.database}] + return [[], {'database': url.database, + 'user': url.username, + 'password': url.password}] def _extract_error_code(self, exception): match = re.compile(r"^(\d+):").match(str(exception)) - code = match.group(1) + # The rdbms api will wrap then re-raise some types of errors + # making this regex return no matches. + code = match.group(1) if match else None if code: return int(code) |