diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-10-15 18:18:03 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-10-16 14:28:04 -0400 |
| commit | 87c24c498cb660e7a8d7d4dd5f630b967f79d3c8 (patch) | |
| tree | 06f1113c0db30fb1471ac74e69af5a67976b1246 /lib/sqlalchemy/engine/interfaces.py | |
| parent | 41d3e16773e84692b6625ccb67da204b5362d9c3 (diff) | |
| download | sqlalchemy-87c24c498cb660e7a8d7d4dd5f630b967f79d3c8.tar.gz | |
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
Diffstat (limited to 'lib/sqlalchemy/engine/interfaces.py')
| -rw-r--r-- | lib/sqlalchemy/engine/interfaces.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/sqlalchemy/engine/interfaces.py b/lib/sqlalchemy/engine/interfaces.py index b7bd3627b..a7f71f5e5 100644 --- a/lib/sqlalchemy/engine/interfaces.py +++ b/lib/sqlalchemy/engine/interfaces.py @@ -569,6 +569,21 @@ class Dialect(object): raise NotImplementedError() + def do_set_input_sizes(self, cursor, list_of_tuples, context): + """invoke the cursor.setinputsizes() method with appropriate arguments + + This hook is called if the dialect.use_inputsizes flag is set to True. + Parameter data is passed in a list of tuples (paramname, dbtype, + sqltype), where ``paramname`` is the key of the parameter in the + statement, ``dbtype`` is the DBAPI datatype and ``sqltype`` is the + SQLAlchemy type. The order of tuples is in the correct parameter order. + + .. versionadded:: 1.4 + + + """ + raise NotImplementedError() + def create_xid(self): """Create a two-phase transaction ID. |
