diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-09-26 14:55:44 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-09-26 14:55:44 +0000 |
| commit | e37a3a961c9f5bf822f86682c0f96418281d3e42 (patch) | |
| tree | a47128eca7327fd6e4ce63bc655775eddd7cc846 /lib/sqlalchemy/sql/expression.py | |
| parent | a0838e0c476f7deab5b67f431c8ce107974b9313 (diff) | |
| download | sqlalchemy-e37a3a961c9f5bf822f86682c0f96418281d3e42.tar.gz | |
- the behavior of String/Unicode types regarding that they auto-convert
to TEXT/CLOB when no length is present now occurs *only* for an exact type
of String or Unicode with no arguments. If you use VARCHAR or NCHAR
(subclasses of String/Unicode) with no length, they will be interpreted
by the dialect as VARCHAR/NCHAR; no "magic" conversion happens there.
This is less surprising behavior and in particular this helps Oracle keep
string-based bind parameters as VARCHARs and not CLOBs [ticket:793].
Diffstat (limited to 'lib/sqlalchemy/sql/expression.py')
| -rw-r--r-- | lib/sqlalchemy/sql/expression.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/sqlalchemy/sql/expression.py b/lib/sqlalchemy/sql/expression.py index dac5d7a74..d649fc0ff 100644 --- a/lib/sqlalchemy/sql/expression.py +++ b/lib/sqlalchemy/sql/expression.py @@ -1758,9 +1758,11 @@ class _BindParamClause(ClauseElement, _CompareMixin): self.type = type_ # TODO: move to types module, obviously + # using VARCHAR/NCHAR so that we dont get the genericized "String" + # type which usually resolves to TEXT/CLOB type_map = { - str : sqltypes.String, - unicode : sqltypes.Unicode, + str : sqltypes.VARCHAR, + unicode : sqltypes.NCHAR, int : sqltypes.Integer, float : sqltypes.Numeric, type(None):sqltypes.NullType |
