summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/databases/mysql.py
diff options
context:
space:
mode:
authorJason Kirtland <jek@discorporate.us>2007-07-31 00:19:23 +0000
committerJason Kirtland <jek@discorporate.us>2007-07-31 00:19:23 +0000
commit04e8a839b4bc6a612b88ff793755865591b48ac4 (patch)
treef6993291f389525ad3b0fed6e1d370a8c66933a3 /lib/sqlalchemy/databases/mysql.py
parenta7e81eda731ddf11994ea77ac556168388c9285b (diff)
downloadsqlalchemy-04e8a839b4bc6a612b88ff793755865591b48ac4.tar.gz
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.)
Diffstat (limited to 'lib/sqlalchemy/databases/mysql.py')
-rw-r--r--lib/sqlalchemy/databases/mysql.py5
1 files changed, 4 insertions, 1 deletions
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