$12 GRAYBYTE WORDPRESS FILE MANAGER $76

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/cloudlinux/venv/lib/python3.11/site-packages/sqlalchemy/dialects/mysql/

HOME
Current File : /opt/cloudlinux/venv/lib/python3.11/site-packages/sqlalchemy/dialects/mysql//pymysql.py
# mysql/pymysql.py
# Copyright (C) 2005-2021 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php

r"""

.. 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.

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.

"""  # noqa

from .mysqldb import MySQLDialect_mysqldb
from ...util import langhelpers
from ...util import py3k


class MySQLDialect_pymysql(MySQLDialect_mysqldb):
    driver = "pymysql"

    description_encoding = None

    # generally, these two values should be both True
    # or both False.   PyMySQL unicode tests pass all the way back
    # to 0.4 either way.  See [ticket:3337]
    supports_unicode_statements = True
    supports_unicode_binds = True

    def __init__(self, server_side_cursors=False, **kwargs):
        super(MySQLDialect_pymysql, self).__init__(**kwargs)
        self.server_side_cursors = server_side_cursors

    @langhelpers.memoized_property
    def supports_server_side_cursors(self):
        try:
            cursors = __import__("pymysql.cursors").cursors
            self._sscursor = cursors.SSCursor
            return True
        except (ImportError, AttributeError):
            return False

    @classmethod
    def dbapi(cls):
        return __import__("pymysql")

    def create_connect_args(self, url, _translate_args=None):
        if _translate_args is None:
            _translate_args = dict(username="user")
        return super(MySQLDialect_pymysql, self).create_connect_args(
            url, _translate_args=_translate_args
        )

    def is_disconnect(self, e, connection, cursor):
        if super(MySQLDialect_pymysql, self).is_disconnect(
            e, connection, cursor
        ):
            return True
        elif isinstance(e, self.dbapi.Error):
            str_e = str(e).lower()
            return (
                "already closed" in str_e or "connection was killed" in str_e
            )
        else:
            return False

    if py3k:

        def _extract_error_code(self, exception):
            if isinstance(exception.args[0], Exception):
                exception = exception.args[0]
            return exception.args[0]


dialect = MySQLDialect_pymysql

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
14 Aug 2025 9.24 PM
root / root
0755
__pycache__
--
14 Aug 2025 9.24 PM
root / root
0755
__init__.py
2.008 KB
17 Apr 2025 8.10 PM
root / root
0644
base.py
104.768 KB
17 Apr 2025 8.10 PM
root / root
0644
cymysql.py
2.191 KB
17 Apr 2025 8.10 PM
root / root
0644
dml.py
4.652 KB
17 Apr 2025 8.10 PM
root / root
0644
enumerated.py
11.042 KB
17 Apr 2025 8.10 PM
root / root
0644
gaerdbms.py
3.296 KB
17 Apr 2025 8.10 PM
root / root
0644
json.py
1.997 KB
17 Apr 2025 8.10 PM
root / root
0644
mysqlconnector.py
7.704 KB
17 Apr 2025 8.10 PM
root / root
0644
mysqldb.py
8.305 KB
17 Apr 2025 8.10 PM
root / root
0644
oursql.py
7.896 KB
17 Apr 2025 8.10 PM
root / root
0644
provision.py
1.239 KB
17 Apr 2025 8.10 PM
root / root
0644
pymysql.py
2.656 KB
17 Apr 2025 8.10 PM
root / root
0644
pyodbc.py
3.389 KB
17 Apr 2025 8.10 PM
root / root
0644
reflection.py
17.847 KB
17 Apr 2025 8.10 PM
root / root
0644
types.py
24.013 KB
17 Apr 2025 8.10 PM
root / root
0644
zxjdbc.py
3.877 KB
17 Apr 2025 8.10 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF