\H7AZ$dZddlmZddlmZddlmZddlmZddlmZddlmZddlm Z d d l m Z d d l mZGd d eZGddeZGddeZGddeZGdde ZGddeeZeZdS)a> .. dialect:: mssql+mxodbc :name: mxODBC :dbapi: mxodbc :connectstring: mssql+mxodbc://:@ :url: http://www.egenix.com/ Execution Modes --------------- mxODBC features two styles of statement execution, using the ``cursor.execute()`` and ``cursor.executedirect()`` methods (the second being an extension to the DBAPI specification). The former makes use of a particular API call specific to the SQL Server Native Client ODBC driver known SQLDescribeParam, while the latter does not. mxODBC apparently only makes repeated use of a single prepared statement when SQLDescribeParam is used. The advantage to prepared statement reuse is one of performance. The disadvantage is that SQLDescribeParam has a limited set of scenarios in which bind parameters are understood, including that they cannot be placed within the argument lists of function calls, anywhere outside the FROM, or even within subqueries within the FROM clause - making the usage of bind parameters within SELECT statements impossible for all but the most simplistic statements. For this reason, the mxODBC dialect uses the "native" mode by default only for INSERT, UPDATE, and DELETE statements, and uses the escaped string mode for all other statements. This behavior can be controlled via :meth:`~sqlalchemy.sql.expression.Executable.execution_options` using the ``native_odbc_execute`` flag with a value of ``True`` or ``False``, where a value of ``True`` will unconditionally use native bind parameters and a value of ``False`` will unconditionally use string-escaped parameters. )_MSDate) _MSDateTime)_MSTime) MSDialect) VARBINARY)_MSNumeric_pyodbc)MSExecutionContext_pyodbc)types)MxODBCConnectorceZdZdZdS)_MSNumeric_mxodbcz#Include pyodbc's numeric processor.N__name__ __module__ __qualname____doc__t/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib64/python3.11/site-packages/sqlalchemy/dialects/mssql/mxodbc.pyrr9s----rrceZdZdZdS)_MSDate_mxodbcc d}|S)Nc<||jd|jd|jSdS)N-)yearmonthdayvalues rprocessz._MSDate_mxodbc.bind_processor..process?s* %*ZZZeiiHHtrrselfdialectr!s rbind_processorz_MSDate_mxodbc.bind_processor>    rNrrrr%rrrrr=#rrceZdZdZdS)_MSTime_mxodbcc d}|S)Nc<||jd|jd|jSdS)N:)hourminutesecondrs rr!z._MSTime_mxodbc.bind_processor..processJs* %*ZZZu||LLtrrr"s rr%z_MSTime_mxodbc.bind_processorIr&rNr'rrrr*r*Hr(rr*ceZdZdZdZdS)_VARBINARY_mxodbcz mxODBC Support for VARBINARY column types. This handles the special case for null VARBINARY values, which maps None values to the mx.ODBC.Manager.BinaryNull symbol. c@jdSjjfd}|S)Nc6| |SjjSN)dbapi BinaryNull)r DBAPIBinaryr$s rr!z1_VARBINARY_mxodbc.bind_processor..processbs& "{5)))}//r)r6Binary)r#r$r!r8s ` @rr%z _VARBINARY_mxodbc.bind_processor\s@ = 4m*  0 0 0 0 0 0rN)rrrrr%rrrr2r2Ss-     rr2ceZdZdZdS)MSExecutionContext_mxodbcz The pyodbc execution context is useful for enabling SELECT SCOPE_IDENTITY in cases where OUTPUT clause does not work (tables with insert triggers). Nrrrrr;r;lsrr;c veZdZeZdZejeej e ej e ej eeeejeiZdfd ZxZS)MSDialect_mxodbcTNc Vtt|jdi|||_dS)Nr)superr=__init__description_encoding)r#rAparams __class__s rr@zMSDialect_mxodbc.__init__s5.%%.88888$8!!!rr5)rrrr;execution_ctx_cls_need_decimal_fixsqltypesNumericrDateTimerDaterTimer*rr2 LargeBinarycolspecsr@ __classcell__)rCs@rr=r=xs 2 +; ~ ~$/ H9999999999rr=N)rbaserrrrrpyodbcrr r rFconnectors.mxodbcr rrr*r2r;r=r$rrrrRs##L%%%%%%------!!!!!!000000.....)...WW 2 999999 9992 r