summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2008-01-05 22:59:18 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2008-01-05 22:59:18 +0000
commit8fe38c7e956675eb9b6c859848200d8dcc7a9589 (patch)
tree922a48aafb9fece7e9b4b9fde469d46c389d1692 /lib/sqlalchemy/sql
parent68a9e6cb1fc53d6a989fa3ef6febcbe7ee304ebd (diff)
downloadsqlalchemy-8fe38c7e956675eb9b6c859848200d8dcc7a9589.tar.gz
- changed name of TEXT to Text since its a "generic" type; TEXT name is
deprecated until 0.5. The "upgrading" behavior of String to Text when no length is present is also deprecated until 0.5; will issue a warning when used for CREATE TABLE statements (String with no length for SQL expression purposes is still fine) [ticket:912]
Diffstat (limited to 'lib/sqlalchemy/sql')
-rw-r--r--lib/sqlalchemy/sql/compiler.py2
-rw-r--r--lib/sqlalchemy/sql/expression.py17
2 files changed, 2 insertions, 17 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py
index 35a12efe3..70343a7b4 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -286,7 +286,7 @@ class DefaultCompiler(engine.Compiled):
return index.name
def visit_typeclause(self, typeclause, **kwargs):
- return typeclause.type.dialect_impl(self.dialect).get_col_spec()
+ return typeclause.type.dialect_impl(self.dialect, _for_ddl=True).get_col_spec()
def visit_textclause(self, textclause, **kwargs):
if textclause.typemap is not None:
diff --git a/lib/sqlalchemy/sql/expression.py b/lib/sqlalchemy/sql/expression.py
index 8ad537e74..b3b04b678 100644
--- a/lib/sqlalchemy/sql/expression.py
+++ b/lib/sqlalchemy/sql/expression.py
@@ -1729,27 +1729,12 @@ class _BindParamClause(ClauseElement, _CompareMixin):
self.shortname = shortname
if type_ is None:
- self.type = self.type_map.get(type(value), sqltypes.NullType)()
+ self.type = sqltypes.type_map.get(type(value), sqltypes.NullType)()
elif isinstance(type_, type):
self.type = type_()
else:
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.VARCHAR,
- unicode : sqltypes.NCHAR,
- int : sqltypes.Integer,
- float : sqltypes.Numeric,
- datetime.date : sqltypes.Date,
- datetime.datetime : sqltypes.DateTime,
- datetime.time : sqltypes.Time,
- datetime.timedelta : sqltypes.Interval,
- type(None):sqltypes.NullType
- }
-
def _clone(self):
c = ClauseElement._clone(self)
if self.unique: