HEX
Server: LiteSpeed
System: Linux us-phx-web1284.main-hosting.eu 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: u300739242 (300739242)
PHP: 8.2.30
Disabled: system, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/connectors/mxodbc.pyc
�
���ec@sddZddlZddlZddlZddlmZddlmZdefd��YZdS(	s_
Provide a SQLALchemy connector for the eGenix mxODBC commercial
Python adapter for ODBC. This is not a free product, but eGenix
provides SQLAlchemy with a license for use in continuous integration
testing.

This has been tested for use with mxODBC 3.1.2 on SQL Server 2005
and 2008, using the SQL Server Native driver. However, it is
possible for this to be used on other database platforms.

For more info on mxODBC, see https://www.egenix.com/

.. deprecated:: 1.4 The mxODBC DBAPI is deprecated and will be removed
   in a future version. Please use one of the supported DBAPIs to
   connect to mssql.

i����Ni(t	Connectori(twarn_deprecatedtMxODBCConnectorcBs�eZdZeZeZeZeZe	d��Z
e	d��Zd�Zd�Z
d�Zd�Zd�Zd�Zdd	�Zdd
�ZRS(tmxodbccCs�|j�tj}|dkr2ddlm}nJd|krQddlm}n+|dkrpddlm}ntd��td	d
d�|S(Ntwin32i����(tWindowstlinux(tunixODBCtdarwin(tiODBCs'Unrecognized platform for mxODBC imports�The mxODBC DBAPI is deprecated and will be removedin a future version. Please use one of the supported DBAPIs toconnect to mssql.tversions1.4(	t_load_mx_exceptionstsystplatformtmx.ODBCRRR	tImportErrorR(tclsR
tModule((sM/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/connectors/mxodbc.pytdbapi+s
	cCs$ddlmaddlmadS(s�Import mxODBC exception classes into the module namespace,
        as if they had been imported normally. This is done here
        to avoid requiring all SQLAlchemy users to install mxODBC.
        i����(tInterfaceError(tProgrammingErrorN(RRR(R((sM/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/connectors/mxodbc.pyRCscs�fd�}|S(Ncs@�jj|_�jj|_�jj|_�j�|_dS(N(	RtMIXED_STRINGFORMATtstringformattPYDATETIME_DATETIMEFORMATtdatetimeformattDECIMAL_DECIMALFORMATt
decimalformatt_error_handlerterrorhandler(tconn(tself(sM/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/connectors/mxodbc.pytconnectNs((RR((RsM/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/connectors/mxodbc.pyt
on_connectMscs#ddlm��fd�}|S(siReturn a handler that adjusts mxODBC's raised Warnings to
        emit Python standard warnings.
        i����(tWarningcsPt|��r@tf|_tjdt|�d|dd�n||��dS(Ntmessagetcategoryt
stackleveli(t
issubclassR!t	__bases__twarningstwarntstr(t
connectiontcursort
errorclasst
errorvalue(t
MxOdbcWarning(sM/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/connectors/mxodbc.pyt
error_handler\s
	(t
mx.ODBC.ErrorR!(RR/((R.sM/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/connectors/mxodbc.pyRVs	cCs^|jdd�}|j|j�|jd�}|jdd�|jdd�|f|fS(s�Return a tuple of \*args, \**kwargs for creating a connection.

        The mxODBC 3.x connection constructor looks like this:

            connect(dsn, user='', password='',
                    clear_auto_commit=1, errorhandler=None)

        This method translates the values in the provided URI
        into args and kwargs needed to instantiate an mxODBC Connection.

        The arg 'errorhandler' is not used by SQLAlchemy and will
        not be populated.

        tusernametuserthosttporttdatabaseN(ttranslate_connect_argstupdatetquerytpoptNone(Rturltoptstargs((sM/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/connectors/mxodbc.pytcreate_connect_argsgscCsRt||jj�r%dt|�kSt||jj�rJdt|�kStSdS(Nsconnection already closeds[08S01](t
isinstanceRRR)tErrortFalse(RteR*R+((sM/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/connectors/mxodbc.pyt
is_disconnect}s
cCs�|j}g}tjd�}x\|j|jd�d�D]>}y|jt|��Wq;tk
rx|j|�q;Xq;Wt|�S(Ns[.\-]ii(	R*tretcompiletsplittgetinfotappendtintt
ValueErrorttuple(RR*t	dbapi_conR
trtn((sM/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/connectors/mxodbc.pyt_get_server_version_info�s	#
cCs7|r/|jjdd�}|tkr+tStStSdS(Ntnative_odbc_executetauto(texecution_optionstgettTrueRA(RtcontextRP((sM/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/connectors/mxodbc.pyt_get_direct�s
	cCs#|j||d|j|��dS(Ntdirect(texecutemanyRV(RR+t	statementt
parametersRU((sM/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/connectors/mxodbc.pytdo_executemany�scCs#|j||d|j|��dS(NRW(texecuteRV(RR+RYRZRU((sM/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/connectors/mxodbc.pyt
do_execute�sN(t__name__t
__module__tdriverRAtsupports_sane_multi_rowcountRTtsupports_unicode_statementstsupports_unicode_bindstsupports_native_decimaltclassmethodRRR RR>RCRORVR:R[R](((sM/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/connectors/mxodbc.pyR"s
					
		(	t__doc__RDRR'tRtutilRR(((sM/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/connectors/mxodbc.pyt<module>s