ww5'@ѯ d Z ddlZddlmZ ddlmZ ddlmZ ddlmZ dd l m
Z
dd
lmZ G d de Z
G d
de Z G d de
e ZeZdS )a
.. dialect:: mysql+pyodbc
:name: PyODBC
:dbapi: pyodbc
:connectstring: mysql+pyodbc://:@
:url: http://pypi.python.org/pypi/pyodbc/
.. note:: The PyODBC for MySQL dialect is not well supported, and
is subject to unresolved character encoding issues
which exist within the current ODBC drivers available.
(see http://code.google.com/p/pyodbc/issues/detail?id=25).
Other dialects for MySQL are recommended.
Pass through exact pyodbc connection string::
import urllib
connection_string = (
'DRIVER=MySQL ODBC 8.0 ANSI Driver;'
'SERVER=localhost;'
'PORT=3307;'
'DATABASE=mydb;'
'UID=root;'
'PWD=(whatever);'
'charset=utf8mb4;'
)
params = urllib.parse.quote_plus(connection_string)
connection_uri = "mysql+pyodbc:///?odbc_connect=%s" % params
N )MySQLDialect)MySQLExecutionContext)TIME )util)PyODBCConnector)Timec e Zd Zd ZdS )_pyodbcTIMEc d }|S )Nc | S )N )values t/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib64/python3.11/site-packages/sqlalchemy/dialects/mysql/pyodbc.pyprocessz-_pyodbcTIME.result_processor..process4 s L r )selfdialectcoltyper s r result_processorz_pyodbcTIME.result_processor3 s r N)__name__
__module____qualname__r r r r r r 2 s# r r c e Zd Zd ZdS )MySQLExecutionContext_pyodbcc | }| d | d }| |S )NzSELECT LAST_INSERT_ID()r )
create_cursorexecutefetchoneclose)r cursor lastrowids r
get_lastrowidz*MySQLExecutionContext_pyodbc.get_lastrowid<