summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/schema.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-02-02 16:33:54 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2014-02-02 16:33:54 -0500
commit0326f3cf014ffb4928b4c6051d2fca13cb6945d7 (patch)
tree0f3585321eccf6ba5b7cd97f38490f8c2650ccd5 /lib/sqlalchemy/sql/schema.py
parent4ed4266803cbba480e5785103302eba5b5a86652 (diff)
downloadsqlalchemy-0326f3cf014ffb4928b4c6051d2fca13cb6945d7.tar.gz
- 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]
Diffstat (limited to 'lib/sqlalchemy/sql/schema.py')
-rw-r--r--lib/sqlalchemy/sql/schema.py13
1 files changed, 12 insertions, 1 deletions
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 ``<dialectname>_<argname>``.
+ 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