]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
mention include_columns in docs; see #561
authorJonathan Ellis <jbellis@gmail.com>
Fri, 27 Jul 2007 22:36:37 +0000 (22:36 +0000)
committerJonathan Ellis <jbellis@gmail.com>
Fri, 27 Jul 2007 22:36:37 +0000 (22:36 +0000)
(sorry Mike, I did have a unit test but didn't commit it somehow)

doc/build/content/metadata.txt

index ff854bd39c0eaad9565b37b80c5722b028fc753d..39e276d68e85a3b9bd79772291e76309dc33f9ba 100644 (file)
@@ -156,7 +156,7 @@ Note that the feature of binding engines is **completely optional**.  All of the
 
 #### Reflecting Tables
 
-A `Table` object can be created without specifying any of its contained attributes, using the argument `autoload=True` in conjunction with the table's name and possibly its schema (if not the databases "default" schema).  This will issue the appropriate queries to the database in order to locate all properties of the table required for SQLAlchemy to use it effectively, including its column names and datatypes, foreign and primary key constraints, and in some cases its default-value generating attributes.   To use `autoload=True`, the table's `MetaData` object need be bound to an `Engine` or `Connection`, or alternatively the `autoload_with=<some connectable>` argument can be passed.  Below we illustrate autoloading a table and then iterating through the names of its columns:
+A `Table` object can be created without specifying any of its contained attributes, using the argument `autoload=True` in conjunction with the table's name and possibly its schema (if not the databases "default" schema).  (You can also specify a list or set of column names to autoload as the kwarg include_columns, if you only want to load a subset of the columns in the actual database.)  This will issue the appropriate queries to the database in order to locate all properties of the table required for SQLAlchemy to use it effectively, including its column names and datatypes, foreign and primary key constraints, and in some cases its default-value generating attributes.   To use `autoload=True`, the table's `MetaData` object need be bound to an `Engine` or `Connection`, or alternatively the `autoload_with=<some connectable>` argument can be passed.  Below we illustrate autoloading a table and then iterating through the names of its columns:
 
     {python}
     >>> messages = Table('messages', meta, autoload=True)