summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/mysql/pymysql.py
Commit message (Collapse)AuthorAgeFilesLines
* Replace all http:// links to https://Federico Caselli2021-07-041-1/+1
| | | | | | Also replace http://pypi.python.org/pypi with https://pypi.org/project Change-Id: I84b5005c39969a82140706472989f2a30b0c7685
* add ssl_check_hostname option in mysqldbJerry Zhao2021-05-071-0/+9
| | | | | | | | | | | | | Added support for the ``ssl_check_hostname=`` parameter in mysql connection URIs and updated the mysql dialect documentation regarding secure connections. Original pull request courtesy of Jerry Zhao. Fixes: #5397 Closes: #5759 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5759 Pull-request-sha: 75f4bdc68d4b5745c518472e8bc2b02cec0f81e6 Change-Id: I964bfa7a4c15e215a3ad6e2b907cb78f5b3e5036
* Default caching to opt-out for 3rd party dialectsMike Bayer2021-04-011-0/+1
| | | | | | | | | | | | | | | | | | | Added a new flag to the :class:`_engine.Dialect` class called :attr:`_engine.Dialect.supports_statement_cache`. This flag now needs to be present directly on a dialect class in order for SQLAlchemy's :ref:`query cache <sql_caching>` to take effect for that dialect. The rationale is based on discovered issues such as :ticket:`6173` revealing that dialects which hardcode literal values from the compiled statement, often the numerical parameters used for LIMIT / OFFSET, will not be compatible with caching until these dialects are revised to use the parameters present in the statement only. For third party dialects where this flag is not applied, the SQL logging will show the message "dialect does not support caching", indicating the dialect should seek to apply this flag once they have verified that no per-statement literal values are being rendered within the compilation phase. Fixes: #6184 Change-Id: I6fd5b5d94200458d4cb0e14f2f556dbc25e27e22
* Update connect args for pymysql 1.0.0; aiomysql fixesMike Bayer2021-01-071-0/+7
| | | | | | | | | | | | | Fixed deprecation warnings that arose as a result of the release of PyMySQL 1.0, including deprecation warnings for the "db" and "passwd" parameters now replaced with "database" and "password". For the 1.4 version of this patch, we are also changing tox.ini to refer to a local branch of aiomysql that fixes pymysql compatibility issues. Fixes: #5821 Change-Id: I93876b52b2d96b52308f22aeb4f244ac5766a82f
* happy new yearMike Bayer2021-01-041-1/+1
| | | | Change-Id: Ic5bb19ca8be3cb47c95a0d3315d84cb484bac47c
* Deprecate engine-wise ss cursors; repair mariadbconnectorMike Bayer2020-09-131-4/+0
| | | | | | | | | | | | | | | | | | | The server_side_cursors engine-wide feature relies upon regexp parsing of statements a well as general guessing as to when the feature should be used. This is not within the 2.0 way of doing things and should be removed. Additionally, mariadbconnector defaults to unbuffered cursors; add new cursor hooks so that mariadbconnector can specify buffered or unbuffered cursors without too much difficulty. This will also correctly default mariadbconnector to buffered cursors which should repair the segfaults we've been getting. Try to restore the assert_raises that was removed in 5b6dfc0c38bf1f01da4b8 to see if mariadbconnector segfaults are resolved. Change-Id: I77f1c972c742e40694972f578140bb0cac8c39eb
* happy new yearMike Bayer2020-01-011-1/+1
| | | | Change-Id: I08440dc25e40ea1ccea1778f6ee9e28a00808235
* Detect PyMySQL connection was killedMike Bayer2019-11-111-1/+4
| | | | | | | | | | | Added "Connection was killed" message interpreted from the base pymysql.Error class in order to detect closed connection, based on reports that this message is arriving via a pymysql.InternalError() object which indicates pymysql is not handling it correctly. Change-Id: If6bbe0eb5993e1996c0c5de752eebaf7446cf93e References: https://github.com/PyMySQL/PyMySQL/issues/816 Fixes: #4945
* happy new yearMike Bayer2019-01-111-1/+1
| | | | Change-Id: I6a71f4924d046cf306961c58dffccf21e9c03911
* Post black reformattingMike Bayer2019-01-061-5/+5
| | | | | | | | | | | | | Applied on top of a pure run of black -l 79 in I7eda77fed3d8e73df84b3651fd6cfcfe858d4dc9, this set of changes resolves all remaining flake8 conditions for those codes we have enabled in setup.cfg. Included are resolutions for all remaining flake8 issues including shadowed builtins, long lines, import order, unused imports, duplicate imports, and docstring issues. Change-Id: I4f72d3ba1380dd601610ff80b8fb06a2aff8b0fe
* Run black -l 79 against all source filesMike Bayer2019-01-061-4/+8
| | | | | | | | | | | | | | This is a straight reformat run using black as is, with no edits applied at all. The black run will format code consistently, however in some cases that are prevalent in SQLAlchemy code it produces too-long lines. The too-long lines will be resolved in the following commit that will resolve all remaining flake8 issues including shadowed builtins, long lines, import order, unused imports, duplicate imports, and docstring issues. Change-Id: I7eda77fed3d8e73df84b3651fd6cfcfe858d4dc9
* Use MySQL protocol-level ping.Maxim Bublis2018-07-091-0/+8
| | | | | | | | | | Utilizes MySQL protocol-level pings for disconnection detection. This is just a 5-byte packet followed by a 7-byte response. Affects MySQLdb, MySQL Connector and PyMySQL dialects. Change-Id: I672f75e3746878d88987a31750444dde0cf8eb9b Pull-request: https://github.com/zzzeek/sqlalchemy/pull/460
* Update URL for PyMySQL documentationLogan Rosen2018-06-281-1/+1
|
* happy new yearMike Bayer2018-01-121-1/+1
| | | | Change-Id: I3ef36bfd0cb0ba62b3123c8cf92370a43156cf8f
* update for 2017 copyrightMike Bayer2017-01-041-1/+1
| | | | Change-Id: I4e8c2aa8fe817bb2af8707410fa0201f938781de
* Add support for server side cursors to mysqldb and pymysqlRoman Podoliaka2016-11-101-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows to skip buffering of the results on the client side, e.g. the following snippet: table = sa.Table( 'testtbl', sa.MetaData(), sa.Column('id', sa.Integer, primary_key=True), sa.Column('a', sa.Integer), sa.Column('b', sa.String(512)) ) table.create(eng, checkfirst=True) with eng.connect() as conn: result = conn.execute(table.select().limit(1)).fetchone() if result is None: for _ in range(1000): conn.execute( table.insert(), [{'a': random.randint(1, 100000), 'b': ''.join(random.choice(string.ascii_letters) for _ in range(100))} for _ in range(1000)] ) with eng.connect() as conn: for row in conn.execution_options(stream_results=True).execute(table.select()): pass now uses ~23 MB of memory instead of ~327 MB on CPython 3.5.2 and PyMySQL 0.7.9. psycopg2 implementation and execution options (stream_results, server_side_cursors) are reused. Change-Id: I4dc23ce3094f027bdff51b896b050361991c62e2
* - happy new yearMike Bayer2016-01-291-1/+1
|
* - Fixed unicode support for PyMySQL when using an "executemany"Mike Bayer2015-03-221-0/+5
| | | | | | | | | operation with unicode parameters. SQLAlchemy now passes both the statement as well as the bound parameters as unicode objects, as PyMySQL generally uses string interpolation internally to produce the final statement, and in the case of executemany does the "encode" step only on the final statement. fixes #3337
* - more updates to the unicode mess to frame this inMike Bayer2015-03-221-3/+3
| | | | as up-to-date recommendations as possible
* - reorganize MySQL docs re: unicode, other cleanup and updatesMike Bayer2015-03-201-0/+6
|
* - copyright 2015Mike Bayer2015-03-101-1/+1
|
* - Updated the "supports_unicode_statements" flag to True for MySQLdbMike Bayer2014-12-041-2/+1
| | | | | | | | | and Pymysql under Python 2. This refers to the SQL statements themselves, not the parameters, and affects issues such as table and column names using non-ASCII characters. These drivers both appear to support Python 2 Unicode objects without issue in modern versions. fixes #3121
* - apply pep8 formatting to sqlalchemy/sql, sqlalchemy/util, sqlalchemy/dialects,Brian Jarrett2014-07-201-4/+5
| | | | sqlalchemy/orm, sqlalchemy/event, sqlalchemy/testing
* - break up the <authors> copyright comment as part of a passMike Bayer2014-07-091-1/+2
| | | | to get all flake8 passing
* - Fixed bug which prevented MySQLdb-based dialects (e.g.Mike Bayer2014-02-031-0/+1
| | | | | | | | | | pymysql) from working in Py3K, where a check for "connection charset" would fail due to Py3K's more strict value comparison rules. The call in question wasn't taking the database version into account in any case as the server version was still None at that point, so the method overall has been simplified to rely upon connection.character_set_name(). [ticket:2933]
* - happy new yearMike Bayer2014-01-051-1/+1
|
* - Improvements to the operation of the pymysql dialect onMike Bayer2013-04-211-12/+8
| | | | | | | | Python 3, including some important decode/bytes steps. Issues remain with BLOB types due to driver issues. Courtesy Ben Trofatter. - start using util.py3k, we will eventually remove the sa2to3 fixer entirely
* Added workaround for pymysql3 double wrapping ProgrammingErrors to pymysql ↵Ben Trofatter2013-03-181-0/+12
| | | | | | dialect. Added workaround for pymysql3 return a bytes object when queried for isolation level.
* happy new year (see #2645)Diana Clarke2013-01-011-1/+1
|
* kill me now, pep8 pass, so closeDiana Clarke2012-11-201-1/+2
|
* juts a 'expected 2 blank lines' pep8 passDiana Clarke2012-11-191-0/+1
|
* - rework the sphinx customizations into distinct modulesMike Bayer2012-10-191-14/+6
| | | | | | | - build a new Sphinx extension that allows dialect info to be entered as directives which is then rendered consistently throughout all dialect/dbapi sections - break out the "empty_strings" requirement for oracle test
* - move out maxdbMike Bayer2012-10-181-0/+3
| | | | | | - begin consolidating docs for dialects to be more self contained - add a separate section for "external" dialects - not sure how we're going to go with this yet.
* more import cleanupsMike Bayer2012-08-071-1/+1
|
* trailing whitespace bonanzaMike Bayer2012-07-281-8/+8
|
* happy new yearMike Bayer2012-01-041-1/+1
|
* - [bug] Unicode adjustments allow latest pymysqlMike Bayer2011-11-021-0/+1
| | | | (post 0.4) to pass 100% on Python 2.
* - New DBAPI support for pymysql, a pure Python portMike Bayer2011-01-261-0/+38
of MySQL-python. [ticket:1991]