]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Promoted format_table_seq from mysql to ansisql. Formats a fully qualified table...
authorJason Kirtland <jek@discorporate.us>
Wed, 1 Aug 2007 00:12:42 +0000 (00:12 +0000)
committerJason Kirtland <jek@discorporate.us>
Wed, 1 Aug 2007 00:12:42 +0000 (00:12 +0000)
lib/sqlalchemy/ansisql.py
lib/sqlalchemy/databases/mysql.py

index 22227d56a84dbee26e46dfef764c8a294ba75a17..01e0a3c9d3dbfc6c2462bec38c96bb631d4b7ea0 100644 (file)
@@ -1072,4 +1072,18 @@ class ANSIIdentifierPreparer(object):
         
         return self.format_column(column, use_table=True, name=column_name, table_name=table_name)
 
+
+    def format_table_seq(self, table, use_schema=True):
+        """Format table name and schema as a tuple."""
+
+        # Dialects with more levels in their fully qualified references
+        # ('database', 'owner', etc.) could override this and return
+        # a longer sequence.
+
+        if use_schema and getattr(table, 'schema', None):
+            return (self.quote_identifier(table.schema),
+                    self.format_table(table, use_schema=False))
+        else:
+            return (self.format_table(table, use_schema=False), )
+
 dialect = ANSIDialect
index d25d3d041caf17aca0598eb544caa10cc49f839c..331b672bdf5bdf2a15b9c69833b5137cdcaef34d 100644 (file)
@@ -1535,16 +1535,6 @@ class MySQLIdentifierPreparer(ansisql.ANSIIdentifierPreparer):
         # just leave everything as-is.
         return value
 
-    def format_table_seq(self, table, use_schema=True):
-        """Format table name and schema as a tuple."""
-
-        if use_schema and getattr(table, 'schema', None):
-            return (self.quote_identifier(table.schema),
-                    self.format_table(table, use_schema=False))
-        else:
-            return (self.format_table(table, use_schema=False), )
-
-
 class MySQLCharsetOnConnect(object):
     """Use an alternate connection character set automatically."""