summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/engine/default.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2017-09-01 00:11:10 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2017-09-11 14:17:10 -0400
commit31f80b9eaeb3c3435b7f6679b41e434478b1d11c (patch)
tree9802d4470d78768ba2a8812b47fae0f91e689d5c /lib/sqlalchemy/engine/default.py
parent4c97ea116c3686cb03f566f16b0a0e9a9fd33968 (diff)
downloadsqlalchemy-oracle_numeric.tar.gz
Refactor for cx_Oracle version 6oracle_numeric
Drops support for cx_Oracle prior to version 5.x, reworks numeric and binary support. Fixes: #4064 Change-Id: Ib9ae9aba430c15cd2a6eeb4e5e3fd8e97b5fe480
Diffstat (limited to 'lib/sqlalchemy/engine/default.py')
-rw-r--r--lib/sqlalchemy/engine/default.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/sqlalchemy/engine/default.py b/lib/sqlalchemy/engine/default.py
index 8b72c0001..227ff0845 100644
--- a/lib/sqlalchemy/engine/default.py
+++ b/lib/sqlalchemy/engine/default.py
@@ -108,7 +108,6 @@ class DefaultDialect(interfaces.Dialect):
supports_sane_rowcount = True
supports_sane_multi_rowcount = True
- dbapi_type_map = {}
colspecs = {}
default_paramstyle = 'named'
supports_default_values = False
@@ -1112,7 +1111,8 @@ class DefaultExecutionContext(interfaces.ExecutionContext):
return (self.isinsert or self.isupdate) and \
bool(self.compiled.postfetch)
- def set_input_sizes(self, translate=None, exclude_types=None):
+ def set_input_sizes(
+ self, translate=None, include_types=None, exclude_types=None):
"""Given a cursor and ClauseParameters, call the appropriate
style of ``setinputsizes()`` on the cursor, using DB-API types
from the bind parameter's ``TypeEngine`` objects.
@@ -1136,7 +1136,8 @@ class DefaultExecutionContext(interfaces.ExecutionContext):
dbtype = typeengine.dialect_impl(self.dialect).\
get_dbapi_type(self.dialect.dbapi)
if dbtype is not None and \
- (not exclude_types or dbtype not in exclude_types):
+ (not exclude_types or dbtype not in exclude_types) and \
+ (not include_types or dbtype in include_types):
if key in self._expanded_parameters:
inputsizes.extend(
[dbtype] * len(self._expanded_parameters[key]))
@@ -1154,7 +1155,8 @@ class DefaultExecutionContext(interfaces.ExecutionContext):
dbtype = typeengine.dialect_impl(self.dialect).\
get_dbapi_type(self.dialect.dbapi)
if dbtype is not None and \
- (not exclude_types or dbtype not in exclude_types):
+ (not exclude_types or dbtype not in exclude_types) and \
+ (not include_types or dbtype in include_types):
if translate:
# TODO: this part won't work w/ the
# expanded_parameters feature, e.g. for cx_oracle