]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- The method signature of :meth:`.Dialect.reflecttable`, which in
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 11 Oct 2013 16:48:46 +0000 (12:48 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 11 Oct 2013 16:48:46 +0000 (12:48 -0400)
all known cases is provided by :class:`.DefaultDialect`, has been
tightened to expect ``include_columns`` and ``exclude_columns``
arguments without any kw option, reducing ambiguity - previously
``exclude_columns`` was missing. [ticket:2748]

doc/build/changelog/changelog_09.rst
lib/sqlalchemy/engine/default.py
lib/sqlalchemy/engine/interfaces.py

index aec107acd130dcb00b14c1fd19d6de10de743a6a..fc4f79f4c8084381b31d4fdec683724656b9e6d1 100644 (file)
 .. changelog::
     :version: 0.9.0
 
+    .. change::
+        :tags: bug, engine
+        :tickets: 2748
+
+        The method signature of :meth:`.Dialect.reflecttable`, which in
+        all known cases is provided by :class:`.DefaultDialect`, has been
+        tightened to expect ``include_columns`` and ``exclude_columns``
+        arguments without any kw option, reducing ambiguity - previously
+        ``exclude_columns`` was missing.
+
     .. change::
         :tags: bug, sql
         :tickets: 2831
index 609375c39913ee41a028c4a0b025547133fec8d1..b2dbccb173db65b9e9d8955e27908eeb48c4b0b8 100644 (file)
@@ -289,8 +289,7 @@ class DefaultDialect(interfaces.Dialect):
         """
         return sqltypes.adapt_type(typeobj, self.colspecs)
 
-    def reflecttable(self, connection, table, include_columns,
-                    exclude_columns=None):
+    def reflecttable(self, connection, table, include_columns, exclude_columns):
         insp = reflection.Inspector.from_engine(connection)
         return insp.reflecttable(table, include_columns, exclude_columns)
 
index c94af5b1c75f79752c58706602cc44f75c25ac5c..06c4fca62f427e4d4322fcead988b0040fb3a20e 100644 (file)
@@ -193,19 +193,21 @@ class Dialect(object):
 
         pass
 
-    def reflecttable(self, connection, table, include_columns=None):
+    def reflecttable(self, connection, table, include_columns, exclude_columns):
         """Load table description from the database.
 
         Given a :class:`.Connection` and a
         :class:`~sqlalchemy.schema.Table` object, reflect its columns and
-        properties from the database.  If include_columns (a list or
-        set) is specified, limit the autoload to the given column
-        names.
+        properties from the database.
 
-        The default implementation uses the
-        :class:`~sqlalchemy.engine.reflection.Inspector` interface to
-        provide the output, building upon the granular table/column/
-        constraint etc. methods of :class:`.Dialect`.
+        The implementation of this method is provided by
+        :meth:`.DefaultDialect.reflecttable`, which makes use of
+        :class:`.Inspector` to retrieve column information.
+
+        Dialects should **not** seek to implement this method, and should
+        instead implement individual schema inspection operations such as
+        :meth:`.Dialect.get_columns`, :meth:`.Dialect.get_pk_constraint`,
+        etc.
 
         """
 
@@ -248,7 +250,7 @@ class Dialect(object):
 
         Deprecated.  This method is only called by the default
         implementation of :meth:`.Dialect.get_pk_constraint`.  Dialects should
-        instead implement this method directly.
+        instead implement the :meth:`.Dialect.get_pk_constraint` method directly.
 
         """