From 87c24c498cb660e7a8d7d4dd5f630b967f79d3c8 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 15 Oct 2020 18:18:03 -0400 Subject: Genericize setinputsizes and support pyodbc Reworked the "setinputsizes()" set of dialect hooks to be correctly extensible for any arbirary DBAPI, by allowing dialects individual hooks that may invoke cursor.setinputsizes() in the appropriate style for that DBAPI. In particular this is intended to support pyodbc's style of usage which is fundamentally different from that of cx_Oracle. Added support for pyodbc. Fixes: #5649 Change-Id: I9f1794f8368bf3663a286932cfe3992dae244a10 --- lib/sqlalchemy/engine/events.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/sqlalchemy/engine/events.py') diff --git a/lib/sqlalchemy/engine/events.py b/lib/sqlalchemy/engine/events.py index 9f30a83ce..ccc6c5968 100644 --- a/lib/sqlalchemy/engine/events.py +++ b/lib/sqlalchemy/engine/events.py @@ -792,10 +792,9 @@ class DialectEvents(event.Events): or a dictionary of string parameter keys to DBAPI type objects for a named bound parameter execution style. - Most dialects **do not use** this method at all; the only built-in - dialect which uses this hook is the cx_Oracle dialect. The hook here - is made available so as to allow customization of how datatypes are set - up with the cx_Oracle DBAPI. + The setinputsizes hook overall is only used for dialects which include + the flag ``use_setinputsizes=True``. Dialects which use this + include cx_Oracle, pg8000, asyncpg, and pyodbc dialects. .. versionadded:: 1.2.9 -- cgit v1.2.1