From 04e8a839b4bc6a612b88ff793755865591b48ac4 Mon Sep 17 00:00:00 2001 From: Jason Kirtland Date: Tue, 31 Jul 2007 00:19:23 +0000 Subject: MetaData can now reflect() all tables in the database en-masse thanks to table_names(). table_names changed to accept an explicit connection ThreadLocalMetaData constructor now takes no arguments. If case_sensitive is needed in a multi-bind context, move it to Table or subclass TLMD to force it. Banished **kwargs from MetaData Lots of class doc and docstring improvements around MetaData and TLMD. Some engine->bind internal naming updates + reorg in schema. MySQL table_names now return Unicode. (Also, a unicode reflect() unit test is needed.) --- lib/sqlalchemy/databases/mysql.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/sqlalchemy/databases/mysql.py') diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py index 2c54c2512..d25d3d041 100644 --- a/lib/sqlalchemy/databases/mysql.py +++ b/lib/sqlalchemy/databases/mysql.py @@ -1156,10 +1156,13 @@ class MySQLDialect(ansisql.ANSIDialect): return name def table_names(self, connection, schema): + """Return a Unicode SHOW TABLES from a given schema.""" + charset = self._detect_charset(connection) rp = connection.execute("SHOW TABLES FROM %s" % self.preparer().quote_identifier(schema)) - return [row[0] for row in _compat_fetchall(rp, charset=charset)] + return [row[0].decode(charset) + for row in _compat_fetchall(rp, charset=charset)] def has_table(self, connection, table_name, schema=None): # SHOW TABLE STATUS LIKE and SHOW TABLES LIKE do not function properly -- cgit v1.2.1