From: Mike Bayer Date: Tue, 7 Mar 2023 03:26:33 +0000 (-0500) Subject: update sql server use_setinputsizes docs a bit X-Git-Tag: rel_2_0_6~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dccc4577fec202947adac8da43d40f415433cf6b;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git update sql server use_setinputsizes docs a bit the verbiage here was ambiguous previously. Change-Id: I452ae85bd8b5469d4103970e99cfac752b508274 --- diff --git a/lib/sqlalchemy/dialects/mssql/pyodbc.py b/lib/sqlalchemy/dialects/mssql/pyodbc.py index 3fa7525656..978c501c46 100644 --- a/lib/sqlalchemy/dialects/mssql/pyodbc.py +++ b/lib/sqlalchemy/dialects/mssql/pyodbc.py @@ -337,16 +337,19 @@ fast_executemany=True where it is not supported (assuming :ref:`insertmanyvalues ` is kept enabled, "fastexecutemany" will not take place for INSERT statements in any case). -The behavior of setinputsizes can be customized via the -:meth:`.DialectEvents.do_setinputsizes` hook. See that method for usage -examples. +The use of ``cursor.setinputsizes()`` can be disabled by passing +``use_setinputsizes=False`` to :func:`_sa.create_engine`. -.. versionchanged:: 1.4.1 The pyodbc dialects will not use setinputsizes - unless ``use_setinputsizes=True`` is passed. +When ``use_setinputsizes`` is left at its default of ``True``, the +specific per-type symbols passed to ``cursor.setinputsizes()`` can be +programmatically customized using the :meth:`.DialectEvents.do_setinputsizes` +hook. See that method for usage examples. .. versionchanged:: 2.0 The mssql+pyodbc dialect now defaults to using - setinputsizes for all statement executions with the exception of - cursor.executemany() calls when fast_executemany=True. + ``use_setinputsizes=True`` for all statement executions with the exception of + cursor.executemany() calls when fast_executemany=True. The behavior can + be turned off by passing ``use_setinputsizes=False`` to + :func:`_sa.create_engine`. """ # noqa