From e3b409f6830ba2f1a627aab87a6f701218ba08c9 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 4 Feb 2007 23:45:45 +0000 Subject: - added "schema" argument to all has_table() calls, only supported so far by PG - added basic unit test for PG reflection of tables in an alternate schema --- lib/sqlalchemy/engine/base.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/sqlalchemy/engine/base.py') diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py index 69d9ef955..8871cac1d 100644 --- a/lib/sqlalchemy/engine/base.py +++ b/lib/sqlalchemy/engine/base.py @@ -91,7 +91,7 @@ class Dialect(sql.AbstractDialect): def reflecttable(self, connection, table): """given an Connection and a Table object, reflects its columns and properties from the database.""" raise NotImplementedError() - def has_table(self, connection, table_name): + def has_table(self, connection, table_name, schema=None): raise NotImplementedError() def has_sequence(self, connection, sequence_name): raise NotImplementedError() @@ -516,8 +516,8 @@ class Engine(sql.Executor, Connectable): finally: if connection is None: conn.close() - def has_table(self, table_name): - return self.run_callable(lambda c: self.dialect.has_table(c, table_name)) + def has_table(self, table_name, schema=None): + return self.run_callable(lambda c: self.dialect.has_table(c, table_name, schema=schema)) def raw_connection(self): """returns a DBAPI connection.""" -- cgit v1.2.1