U a4 @s@dZddlmZddlmZddlmZGdddeZeZdS) a .. dialect:: mysql+pymysql :name: PyMySQL :dbapi: pymysql :connectstring: mysql+pymysql://:@/[?] :url: https://pymysql.readthedocs.io/ Unicode ------- Please see :ref:`mysql_unicode` for current recommendations on unicode handling. .. _pymysql_ssl: SSL Connections ------------------ The PyMySQL DBAPI accepts the same SSL arguments as that of MySQLdb, described at :ref:`mysqldb_ssl`. See that section for examples. MySQL-Python Compatibility -------------------------- The pymysql DBAPI is a pure Python port of the MySQL-python (MySQLdb) driver, and targets 100% compatibility. Most behavioral notes for MySQL-python apply to the pymysql driver as well. )MySQLDialect_mysqldb) langhelpers)py3kcsdeZdZdZdZdZdZdZej ddZ e ddZ dfdd Z fd d Zer\d d ZZS)MySQLDialect_pymysqlpymysqlTNc Cs8ztdj}|j|_WdSttfk r2YdSXdS)Nzpymysql.cursorsTF) __import__cursorsZSSCursorZ _sscursor ImportErrorAttributeError)selfr r bC:\Users\vtejo\AppData\Local\Temp\pip-unpacked-wheel-nyjtotrf\sqlalchemy\dialects\mysql\pymysql.pysupports_server_side_cursors9s  z1MySQLDialect_pymysql.supports_server_side_cursorscCstdS)Nr)r)clsr r rdbapiBszMySQLDialect_pymysql.dbapics&|dkrtdd}tt|j||dS)Nuser)username)_translate_args)dictsuperrcreate_connect_args)r urlr __class__r rrFs   z(MySQLDialect_pymysql.create_connect_argscsJtt||||rdSt||jjrBt|}d|kp@d|kSdSdS)NTzalready closedzconnection was killedF)rr is_disconnect isinstancerErrorstrlower)r e connectioncursorZstr_err rrMs  z"MySQLDialect_pymysql.is_disconnectcCs$t|jdtr|jd}|jdS)N)rargs Exception)r exceptionr r r_extract_error_code\s z(MySQLDialect_pymysql._extract_error_code)N)__name__ __module__ __qualname__ZdriverZsupports_statement_cacheZdescription_encodingZsupports_unicode_statementsZsupports_unicode_bindsrZmemoized_propertyr classmethodrrrrr' __classcell__r r rrr-s   rN)__doc__Zmysqldbrutilrrrdialectr r r rs    5