From cbb9e7f191b5bedf7ef7ee53244fda8ab9d4d46b Mon Sep 17 00:00:00 2001 From: Jonathan Ellis Date: Sun, 29 Jul 2007 04:23:32 +0000 Subject: add table_names() for mysql. maybe it works. --- lib/sqlalchemy/databases/mysql.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/sqlalchemy/databases/mysql.py') diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py index 26800e32b..859846636 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. -- cgit v1.2.1