]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
add table_names() for mysql. maybe it works.
authorJonathan Ellis <jbellis@gmail.com>
Sun, 29 Jul 2007 04:23:32 +0000 (04:23 +0000)
committerJonathan Ellis <jbellis@gmail.com>
Sun, 29 Jul 2007 04:23:32 +0000 (04:23 +0000)
lib/sqlalchemy/databases/mysql.py

index 26800e32b314b720e89c472de460f6192873aeb1..85984663668c02dd6b5360482666d632b52a3099 100644 (file)
@@ -1091,6 +1091,10 @@ class MySQLDialect(ansisql.ANSIDialect):
               connection.execute('SELECT DATABASE()').scalar()
             return name
 
+    def table_names(self, connection, schema):
+        s = "SHOW TABLES"
+        return [row[0] for row in connection.execute(s)]
+
     def has_table(self, connection, table_name, schema=None):
         # SHOW TABLE STATUS LIKE and SHOW TABLES LIKE do not function properly
         # on macosx (and maybe win?) with multibyte table names.