From 274ec6d6edd84e1355fe1c6a80bb0a9965631745 Mon Sep 17 00:00:00 2001 From: Jonathan Ellis Date: Fri, 27 Jul 2007 22:36:37 +0000 Subject: [PATCH] mention include_columns in docs; see #561 (sorry Mike, I did have a unit test but didn't commit it somehow) --- doc/build/content/metadata.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/build/content/metadata.txt b/doc/build/content/metadata.txt index ff854bd39c..39e276d68e 100644 --- a/doc/build/content/metadata.txt +++ b/doc/build/content/metadata.txt @@ -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=` 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=` 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) -- 2.47.3