diff options
author | Jonathan Ellis <jbellis@gmail.com> | 2007-07-29 04:15:14 +0000 |
---|---|---|
committer | Jonathan Ellis <jbellis@gmail.com> | 2007-07-29 04:15:14 +0000 |
commit | a9a1f912fd9445d7496584a256e449ad1fd2a808 (patch) | |
tree | 665b8e937cd5811119f5ce8faa9e844e61190b9e /lib/sqlalchemy/databases/sqlite.py | |
parent | c838a981021b83f5690234b1d55513417306ac61 (diff) | |
download | sqlalchemy-a9a1f912fd9445d7496584a256e449ad1fd2a808.tar.gz |
engine.table_names()
tested vs sqlite and pg. mssql should also be ok (uses ischema like pg.) others are best-guess based on has_table code.
Diffstat (limited to 'lib/sqlalchemy/databases/sqlite.py')
-rw-r--r-- | lib/sqlalchemy/databases/sqlite.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/sqlalchemy/databases/sqlite.py b/lib/sqlalchemy/databases/sqlite.py index 725ea23e2..9492de8da 100644 --- a/lib/sqlalchemy/databases/sqlite.py +++ b/lib/sqlalchemy/databases/sqlite.py @@ -224,6 +224,10 @@ class SQLiteDialect(ansisql.ANSIDialect): def oid_column_name(self, column): return "oid" + + def table_names(self, connection, schema): + s = "SELECT name FROM sqlite_master WHERE type='table'" + return [row[0] for row in connection.execute(s)] def has_table(self, connection, table_name, schema=None): cursor = connection.execute("PRAGMA table_info(%s)" % |