관리-도구
편집 파일: pymysql.cpython-38.pyc
U -?�f� � @ s4 d Z ddlmZ ddlmZ G dd� de�ZeZdS )a� .. dialect:: mysql+pymysql :name: PyMySQL :dbapi: pymysql :connectstring: mysql+pymysql://<username>:<password>@<host>/<dbname>[?<options>] :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 additional examples. If the server uses an automatically-generated certificate that is self-signed or does not match the host name (as seen from the client), it may also be necessary to indicate ``ssl_check_hostname=false`` in PyMySQL:: connection_uri = ( "mysql+pymysql://scott:tiger@192.168.0.134/test" "?ssl_ca=/home/gord/client-ssl/ca.pem" "&ssl_cert=/home/gord/client-ssl/client-cert.pem" "&ssl_key=/home/gord/client-ssl/client-key.pem" "&ssl_check_hostname=false" ) 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� )�langhelpersc sn e Zd ZdZdZdZejdd� �Ze dd� �Z ejdd � �Zd d� Zd� fdd � Z � fdd�Zdd� Z� ZS )�MySQLDialect_pymysql�pymysqlTNc C s8 zt d�j}|j| _W dS ttfk r2 Y dS X d S )Nzpymysql.cursorsTF)� __import__�cursorsZSSCursorZ _sscursor�ImportError�AttributeError)�selfr � r �Q/opt/hc_python/lib64/python3.8/site-packages/sqlalchemy/dialects/mysql/pymysql.py�supports_server_side_cursors@ s z1MySQLDialect_pymysql.supports_server_side_cursorsc C s t d�S )Nr )r )�clsr r r �import_dbapiI s z!MySQLDialect_pymysql.import_dbapic C s� zt d�jj}W n ttfk r* Y dS X t�|j�}z|jd }W n t k r\ Y dS X |dkoz|j pz|j d dk S dS )a determine if pymysql has deprecated, changed the default of, or removed the 'reconnect' argument of connection.ping(). See #10492 and https://github.com/PyMySQL/mysqlclient/discussions/651#discussioncomment-7308971 for background. zpymysql.connectionsTr FZ reconnect� N)r �connections� Connectionr r r Zget_callable_argspec�ping�args� IndexError�defaults)r r ZinspZ reconnect_argr r r �_send_false_to_pingM s ��z(MySQLDialect_pymysql._send_false_to_pingc C s | j r|�d� n|�� dS )NFT)r r )r Zdbapi_connectionr r r �do_pingi s zMySQLDialect_pymysql.do_pingc s"