opt
/
hc_python
/
lib
/
python3.12
/
site-packages
/
sqlalchemy
/
dialects
/
mysql
/
Go to Home Directory
+
Upload
Create File
root@0UT1S:~$
Execute
By Order of Mr.0UT1S
[DIR] ..
N/A
[DIR] __pycache__
N/A
__init__.py
2.15 KB
Rename
Delete
aiomysql.py
9.78 KB
Rename
Delete
asyncmy.py
9.84 KB
Rename
Delete
base.py
121.57 KB
Rename
Delete
cymysql.py
2.25 KB
Rename
Delete
dml.py
7.59 KB
Rename
Delete
enumerated.py
8.25 KB
Rename
Delete
expression.py
4.02 KB
Rename
Delete
json.py
2.22 KB
Rename
Delete
mariadb.py
1.42 KB
Rename
Delete
mariadbconnector.py
8.42 KB
Rename
Delete
mysqlconnector.py
5.59 KB
Rename
Delete
mysqldb.py
9.30 KB
Rename
Delete
provision.py
3.49 KB
Rename
Delete
pymysql.py
3.99 KB
Rename
Delete
pyodbc.py
4.20 KB
Rename
Delete
reflection.py
22.30 KB
Rename
Delete
reserved_words.py
9.04 KB
Rename
Delete
types.py
23.77 KB
Rename
Delete
# dialects/mysql/cymysql.py # Copyright (C) 2005-2025 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: https://www.opensource.org/licenses/mit-license.php # mypy: ignore-errors r""" .. dialect:: mysql+cymysql :name: CyMySQL :dbapi: cymysql :connectstring: mysql+cymysql://<username>:<password>@<host>/<dbname>[?<options>] :url: https://github.com/nakagami/CyMySQL .. note:: The CyMySQL dialect is **not tested as part of SQLAlchemy's continuous integration** and may have unresolved issues. The recommended MySQL dialects are mysqlclient and PyMySQL. """ # noqa from .base import BIT from .base import MySQLDialect from .mysqldb import MySQLDialect_mysqldb from ... import util class _cymysqlBIT(BIT): def result_processor(self, dialect, coltype): """Convert MySQL's 64 bit, variable length binary string to a long.""" def process(value): if value is not None: v = 0 for i in iter(value): v = v << 8 | i return v return value return process class MySQLDialect_cymysql(MySQLDialect_mysqldb): driver = "cymysql" supports_statement_cache = True description_encoding = None supports_sane_rowcount = True supports_sane_multi_rowcount = False supports_unicode_statements = True colspecs = util.update_copy(MySQLDialect.colspecs, {BIT: _cymysqlBIT}) @classmethod def import_dbapi(cls): return __import__("cymysql") def _detect_charset(self, connection): return connection.connection.charset def _extract_error_code(self, exception): return exception.errno def is_disconnect(self, e, connection, cursor): if isinstance(e, self.dbapi.OperationalError): return self._extract_error_code(e) in ( 2006, 2013, 2014, 2045, 2055, ) elif isinstance(e, self.dbapi.InterfaceError): # if underlying connection is closed, # this is the error you get return True else: return False dialect = MySQLDialect_cymysql
Save