summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2008-01-09 18:09:49 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2008-01-09 18:09:49 +0000
commiteefd1f78a2ead8245791140e54fa3c32c4b41794 (patch)
tree89c4a65ec1096ab7fbd506f9f365e4a15fa7090e /lib/sqlalchemy
parent6eb9c11e7b0b99d7bc76633fbfebf6e280ae9994 (diff)
downloadsqlalchemy-eefd1f78a2ead8245791140e54fa3c32c4b41794.tar.gz
redid the _for_ddl String/Text deprecation warning correctly [ticket:912]
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/databases/access.py2
-rw-r--r--lib/sqlalchemy/databases/firebird.py2
-rw-r--r--lib/sqlalchemy/databases/informix.py2
-rw-r--r--lib/sqlalchemy/databases/maxdb.py2
-rw-r--r--lib/sqlalchemy/databases/mssql.py2
-rw-r--r--lib/sqlalchemy/databases/mysql.py2
-rw-r--r--lib/sqlalchemy/databases/oracle.py2
-rw-r--r--lib/sqlalchemy/databases/postgres.py4
-rw-r--r--lib/sqlalchemy/databases/sqlite.py2
-rw-r--r--lib/sqlalchemy/databases/sybase.py2
-rw-r--r--lib/sqlalchemy/logging.py2
-rw-r--r--lib/sqlalchemy/sql/compiler.py2
-rw-r--r--lib/sqlalchemy/types.py2
13 files changed, 14 insertions, 14 deletions
diff --git a/lib/sqlalchemy/databases/access.py b/lib/sqlalchemy/databases/access.py
index 78e3a9997..bf972a1c3 100644
--- a/lib/sqlalchemy/databases/access.py
+++ b/lib/sqlalchemy/databases/access.py
@@ -378,7 +378,7 @@ class AccessCompiler(compiler.DefaultCompiler):
class AccessSchemaGenerator(compiler.SchemaGenerator):
def get_column_specification(self, column, **kwargs):
- colspec = self.preparer.format_column(column) + " " + column.type.dialect_impl(self.dialect).get_col_spec()
+ colspec = self.preparer.format_column(column) + " " + column.type.dialect_impl(self.dialect, _for_ddl=True).get_col_spec()
# install a sequence if we have an implicit IDENTITY column
if (not getattr(column.table, 'has_sequence', False)) and column.primary_key and \
diff --git a/lib/sqlalchemy/databases/firebird.py b/lib/sqlalchemy/databases/firebird.py
index 247400179..5e231e872 100644
--- a/lib/sqlalchemy/databases/firebird.py
+++ b/lib/sqlalchemy/databases/firebird.py
@@ -585,7 +585,7 @@ class FBSchemaGenerator(sql.compiler.SchemaGenerator):
def get_column_specification(self, column, **kwargs):
colspec = self.preparer.format_column(column)
- colspec += " " + column.type.dialect_impl(self.dialect).get_col_spec()
+ colspec += " " + column.type.dialect_impl(self.dialect, _for_ddl=True).get_col_spec()
default = self.get_column_default_string(column)
if default is not None:
diff --git a/lib/sqlalchemy/databases/informix.py b/lib/sqlalchemy/databases/informix.py
index 3ad490f44..f27e7a5b8 100644
--- a/lib/sqlalchemy/databases/informix.py
+++ b/lib/sqlalchemy/databases/informix.py
@@ -434,7 +434,7 @@ class InfoSchemaGenerator(compiler.SchemaGenerator):
colspec += " SERIAL"
self.has_serial = True
else:
- colspec += " " + column.type.dialect_impl(self.dialect).get_col_spec()
+ colspec += " " + column.type.dialect_impl(self.dialect, _for_ddl=True).get_col_spec()
default = self.get_column_default_string(column)
if default is not None:
colspec += " DEFAULT " + default
diff --git a/lib/sqlalchemy/databases/maxdb.py b/lib/sqlalchemy/databases/maxdb.py
index b5d397d54..be1c4e70c 100644
--- a/lib/sqlalchemy/databases/maxdb.py
+++ b/lib/sqlalchemy/databases/maxdb.py
@@ -953,7 +953,7 @@ class MaxDBIdentifierPreparer(compiler.IdentifierPreparer):
class MaxDBSchemaGenerator(compiler.SchemaGenerator):
def get_column_specification(self, column, **kw):
colspec = [self.preparer.format_column(column),
- column.type.dialect_impl(self.dialect).get_col_spec()]
+ column.type.dialect_impl(self.dialect, _for_ddl=True).get_col_spec()]
if not column.nullable:
colspec.append('NOT NULL')
diff --git a/lib/sqlalchemy/databases/mssql.py b/lib/sqlalchemy/databases/mssql.py
index d90c286b1..7aeedad98 100644
--- a/lib/sqlalchemy/databases/mssql.py
+++ b/lib/sqlalchemy/databases/mssql.py
@@ -956,7 +956,7 @@ class MSSQLCompiler(compiler.DefaultCompiler):
class MSSQLSchemaGenerator(compiler.SchemaGenerator):
def get_column_specification(self, column, **kwargs):
- colspec = self.preparer.format_column(column) + " " + column.type.dialect_impl(self.dialect).get_col_spec()
+ colspec = self.preparer.format_column(column) + " " + column.type.dialect_impl(self.dialect, _for_ddl=True).get_col_spec()
# install a IDENTITY Sequence if we have an implicit IDENTITY column
if (not getattr(column.table, 'has_sequence', False)) and column.primary_key and \
diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py
index 41b35156e..588ea341d 100644
--- a/lib/sqlalchemy/databases/mysql.py
+++ b/lib/sqlalchemy/databases/mysql.py
@@ -1956,7 +1956,7 @@ class MySQLSchemaGenerator(compiler.SchemaGenerator):
"""Builds column DDL."""
colspec = [self.preparer.format_column(column),
- column.type.dialect_impl(self.dialect).get_col_spec()]
+ column.type.dialect_impl(self.dialect, _for_ddl=True).get_col_spec()]
default = self.get_column_default_string(column)
if default is not None:
diff --git a/lib/sqlalchemy/databases/oracle.py b/lib/sqlalchemy/databases/oracle.py
index 79a276d62..7ac8f8951 100644
--- a/lib/sqlalchemy/databases/oracle.py
+++ b/lib/sqlalchemy/databases/oracle.py
@@ -690,7 +690,7 @@ class OracleCompiler(compiler.DefaultCompiler):
class OracleSchemaGenerator(compiler.SchemaGenerator):
def get_column_specification(self, column, **kwargs):
colspec = self.preparer.format_column(column)
- colspec += " " + column.type.dialect_impl(self.dialect).get_col_spec()
+ colspec += " " + column.type.dialect_impl(self.dialect, _for_ddl=True).get_col_spec()
default = self.get_column_default_string(column)
if default is not None:
colspec += " DEFAULT " + default
diff --git a/lib/sqlalchemy/databases/postgres.py b/lib/sqlalchemy/databases/postgres.py
index eacd0c7e1..3c0314e64 100644
--- a/lib/sqlalchemy/databases/postgres.py
+++ b/lib/sqlalchemy/databases/postgres.py
@@ -115,7 +115,7 @@ class PGArray(sqltypes.Concatenable, sqltypes.TypeEngine):
item_type = item_type()
self.item_type = item_type
- def dialect_impl(self, dialect):
+ def dialect_impl(self, dialect, **kwargs):
impl = self.__class__.__new__(self.__class__)
impl.__dict__.update(self.__dict__)
impl.item_type = self.item_type.dialect_impl(dialect)
@@ -694,7 +694,7 @@ class PGSchemaGenerator(compiler.SchemaGenerator):
else:
colspec += " SERIAL"
else:
- colspec += " " + column.type.dialect_impl(self.dialect).get_col_spec()
+ colspec += " " + column.type.dialect_impl(self.dialect, _for_ddl=True).get_col_spec()
default = self.get_column_default_string(column)
if default is not None:
colspec += " DEFAULT " + default
diff --git a/lib/sqlalchemy/databases/sqlite.py b/lib/sqlalchemy/databases/sqlite.py
index b357f48de..92645e524 100644
--- a/lib/sqlalchemy/databases/sqlite.py
+++ b/lib/sqlalchemy/databases/sqlite.py
@@ -386,7 +386,7 @@ class SQLiteCompiler(compiler.DefaultCompiler):
class SQLiteSchemaGenerator(compiler.SchemaGenerator):
def get_column_specification(self, column, **kwargs):
- colspec = self.preparer.format_column(column) + " " + column.type.dialect_impl(self.dialect).get_col_spec()
+ colspec = self.preparer.format_column(column) + " " + column.type.dialect_impl(self.dialect, _for_ddl=True).get_col_spec()
default = self.get_column_default_string(column)
if default is not None:
colspec += " DEFAULT " + default
diff --git a/lib/sqlalchemy/databases/sybase.py b/lib/sqlalchemy/databases/sybase.py
index c170a9723..f461125aa 100644
--- a/lib/sqlalchemy/databases/sybase.py
+++ b/lib/sqlalchemy/databases/sybase.py
@@ -827,7 +827,7 @@ class SybaseSQLSchemaGenerator(compiler.SchemaGenerator):
#colspec += " numeric(30,0) IDENTITY"
colspec += " Integer IDENTITY"
else:
- colspec += " " + column.type.dialect_impl(self.dialect).get_col_spec()
+ colspec += " " + column.type.dialect_impl(self.dialect, _for_ddl=True).get_col_spec()
if not column.nullable:
colspec += " NOT NULL"
diff --git a/lib/sqlalchemy/logging.py b/lib/sqlalchemy/logging.py
index 7c2bd636c..57e7bcfd7 100644
--- a/lib/sqlalchemy/logging.py
+++ b/lib/sqlalchemy/logging.py
@@ -31,7 +31,7 @@ import sys, warnings
# py2.5 absolute imports will fix....
logging = __import__('logging')
-
+# why is this in the "logging" module?
class SADeprecationWarning(DeprecationWarning):
pass
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py
index 70343a7b4..35a12efe3 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, _for_ddl=True).get_col_spec()
+ return typeclause.type.dialect_impl(self.dialect).get_col_spec()
def visit_textclause(self, textclause, **kwargs):
if textclause.typemap is not None:
diff --git a/lib/sqlalchemy/types.py b/lib/sqlalchemy/types.py
index b2819ece0..1a5d0ab56 100644
--- a/lib/sqlalchemy/types.py
+++ b/lib/sqlalchemy/types.py
@@ -392,7 +392,7 @@ class String(Concatenable, TypeEngine):
def dialect_impl(self, dialect, **kwargs):
_for_ddl = kwargs.pop('_for_ddl', False)
- if self.length is None:
+ if _for_ddl and self.length is None:
warn_deprecated("Using String type with no length for CREATE TABLE is deprecated; use the Text type explicitly")
return TypeEngine.dialect_impl(self, dialect, **kwargs)