From: LunarShaddow Date: Mon, 8 May 2017 04:31:50 +0000 (+0800) Subject: Break the lines to fit pdf and fix another broken syntax X-Git-Tag: rel_1_0_18~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=714fd6a015ec4390657d59956d44227ead66364d;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Break the lines to fit pdf and fix another broken syntax (cherry picked from commit 3d19fb6d53c2aa0fdb7944569fa697c75785634c) Change-Id: Ib3460a95f3387b51075c23600cb394b0af08d8f2 --- diff --git a/lib/sqlalchemy/dialects/mysql/base.py b/lib/sqlalchemy/dialects/mysql/base.py index a45cc90453..56a2a8681d 100644 --- a/lib/sqlalchemy/dialects/mysql/base.py +++ b/lib/sqlalchemy/dialects/mysql/base.py @@ -179,8 +179,8 @@ Most MySQL DBAPIs offer the option to set the client character set for a connection. This is typically delivered using the ``charset`` parameter in the URL, such as:: - e = create_engine("mysql+pymysql://scott:tiger@localhost/\ -test?charset=utf8") + e = create_engine( + "mysql+pymysql://scott:tiger@localhost/test?charset=utf8") This charset is the **client character set** for the connection. Some MySQL DBAPIs will default this to a value such as ``latin1``, and some @@ -198,8 +198,8 @@ that includes codepoints more than three bytes in size, this new charset is preferred, if supported by both the database as well as the client DBAPI, as in:: - e = create_engine("mysql+pymysql://scott:tiger@localhost/\ -test?charset=utf8mb4") + e = create_engine( + "mysql+pymysql://scott:tiger@localhost/test?charset=utf8mb4") At the moment, up-to-date versions of MySQLdb and PyMySQL support the ``utf8mb4`` charset. Other DBAPIs such as MySQL-Connector and OurSQL @@ -211,8 +211,8 @@ the MySQL schema and/or server configuration may be required. .. seealso:: `The utf8mb4 Character Set \ -`_ - \ -in the MySQL documentation + `_ - \ + in the MySQL documentation Unicode Encoding / Decoding ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -233,7 +233,8 @@ DBAPI's handling of unicode, such that it instead will return data of the ``str`` type or ``bytes`` type, with data in the configured charset:: # connect while disabling the DBAPI's unicode encoding/decoding - e = create_engine("mysql+mysqldb://scott:tiger@localhost/test?charset=utf8&use_unicode=0") + e = create_engine( + "mysql+mysqldb://scott:tiger@localhost/test?charset=utf8&use_unicode=0") Current recommendations for modern DBAPIs are as follows: