From 0326f3cf014ffb4928b4c6051d2fca13cb6945d7 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 2 Feb 2014 16:33:54 -0500 Subject: - Added :paramref:`.MetaData.reflect.**dialect_kwargs` to support dialect-level reflection options for all :class:`.Table` objects reflected. - Added a new dialect-level argument ``postgresql_ignore_search_path``; this argument is accepted by both the :class:`.Table` constructor as well as by the :meth:`.MetaData.reflect` method. When in use against Postgresql, a foreign-key referenced table which specifies a remote schema name will retain that schema name even if the name is present in the ``search_path``; the default behavior since 0.7.3 has been that schemas present in ``search_path`` would not be copied to reflected :class:`.ForeignKey` objects. The documentation has been updated to describe in detail the behavior of the ``pg_get_constraintdef()`` function and how the ``postgresql_ignore_search_path`` feature essentially determines if we will honor the schema qualification reported by this function or not. [ticket:2922] --- lib/sqlalchemy/sql/schema.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'lib/sqlalchemy/sql') diff --git a/lib/sqlalchemy/sql/schema.py b/lib/sqlalchemy/sql/schema.py index ef4b4cfa5..a9d5a69b1 100644 --- a/lib/sqlalchemy/sql/schema.py +++ b/lib/sqlalchemy/sql/schema.py @@ -3153,7 +3153,8 @@ class MetaData(SchemaItem): def reflect(self, bind=None, schema=None, views=False, only=None, extend_existing=False, - autoload_replace=True): + autoload_replace=True, + **dialect_kwargs): """Load all available table definitions from the database. Automatically creates ``Table`` entries in this ``MetaData`` for any @@ -3198,6 +3199,14 @@ class MetaData(SchemaItem): .. versionadded:: 0.9.1 + :param \**dialect_kwargs: Additional keyword arguments not mentioned above are + dialect specific, and passed in the form ``_``. + See the documentation regarding an individual dialect at + :ref:`dialect_toplevel` for detail on documented arguments. + + .. versionadded:: 0.9.2 - Added :paramref:`.MetaData.reflect.**dialect_kwargs` + to support dialect-level reflection options for all :class:`.Table` + objects reflected. """ if bind is None: @@ -3212,6 +3221,8 @@ class MetaData(SchemaItem): 'autoload_replace': autoload_replace } + reflect_opts.update(dialect_kwargs) + if schema is None: schema = self.schema -- cgit v1.2.1