summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/context.py
diff options
context:
space:
mode:
authorGord Thompson <gord@gordthompson.com>2022-06-25 10:34:51 -0600
committermike bayer <mike_mp@zzzcomputing.com>2022-06-29 13:02:39 +0000
commitf848140083c316b81456c8c3426ad3fd04caf6fa (patch)
tree53baf5ee691e6a559e60d5c0d86136b01213f653 /lib/sqlalchemy/orm/context.py
parent6a560cf03c302d2ebd9ae7c7dc4d587983096ba4 (diff)
downloadsqlalchemy-f848140083c316b81456c8c3426ad3fd04caf6fa.tar.gz
Change setinputsizes behavior for mssql+pyodbc
The ``use_setinputsizes`` parameter for the ``mssql+pyodbc`` dialect now defaults to ``True``; this is so that non-unicode string comparisons are bound by pyodbc to pyodbc.SQL_VARCHAR rather than pyodbc.SQL_WVARCHAR, allowing indexes against VARCHAR columns to take effect. In order for the ``fast_executemany=True`` parameter to continue functioning, the ``use_setinputsizes`` mode now skips the ``cursor.setinputsizes()`` call specifically when ``fast_executemany`` is True and the specific method in use is ``cursor.executemany()``, which doesn't support setinputsizes. The change also adds appropriate pyodbc DBAPI typing to values that are typed as :class:`_types.Unicode` or :class:`_types.UnicodeText`, as well as altered the base :class:`_types.JSON` datatype to consider JSON string values as :class:`_types.Unicode` rather than :class:`_types.String`. Fixes: #8177 Change-Id: I6c8886663254ae55cf904ad256c906e8f5e11f48
Diffstat (limited to 'lib/sqlalchemy/orm/context.py')
0 files changed, 0 insertions, 0 deletions