From: Jonathan Ellis Date: Sun, 29 Jul 2007 04:23:32 +0000 (+0000) Subject: add table_names() for mysql. maybe it works. X-Git-Tag: rel_0_4beta1~151 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cbb9e7f191b5bedf7ef7ee53244fda8ab9d4d46b;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git add table_names() for mysql. maybe it works. --- diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py index 26800e32b3..8598466366 100644 --- a/lib/sqlalchemy/databases/mysql.py +++ b/lib/sqlalchemy/databases/mysql.py @@ -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.