diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2023-03-06 22:26:33 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2023-03-06 22:26:33 -0500 |
commit | dccc4577fec202947adac8da43d40f415433cf6b (patch) | |
tree | 0359d99d94b19424642f43491203632bdd40b980 /lib/sqlalchemy/dialects/mssql/pyodbc.py | |
parent | 5ed17e01b10ffcacdc0c7930d3241dcfa656eadc (diff) | |
download | sqlalchemy-dccc4577fec202947adac8da43d40f415433cf6b.tar.gz |
update sql server use_setinputsizes docs a bit
the verbiage here was ambiguous previously.
Change-Id: I452ae85bd8b5469d4103970e99cfac752b508274
Diffstat (limited to 'lib/sqlalchemy/dialects/mssql/pyodbc.py')
-rw-r--r-- | lib/sqlalchemy/dialects/mssql/pyodbc.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/sqlalchemy/dialects/mssql/pyodbc.py b/lib/sqlalchemy/dialects/mssql/pyodbc.py index 3fa752565..978c501c4 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 <engine_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 |