class Table(DialectKWArgs, SchemaItem, TableClause):
Represent a table in a database.
e.g.:
mytable = Table("mytable", metadata, Column('mytable_id', Integer, primary_key=True), Column('value', String(50)) )
The _schema.Table
object constructs a unique instance of itself based
on its name and optional schema name within the given
_schema.MetaData
object. Calling the _schema.Table
constructor with the same name and same _schema.MetaData
argument
a second time will return the same _schema.Table
object - in this way
the _schema.Table
constructor acts as a registry function.
See Also
:ref:`metadata_describing` - Introduction to database metadata
Constructor arguments are as follows:
Parameters | |
name | The name of this table as represented in the database. The table name, along with the value of the schema parameter,
forms a key which uniquely identifies this Names which contain no upper case characters will be treated as case insensitive names, and will not be quoted unless they are a reserved word or contain special characters. A name with any number of upper case characters is considered to be case sensitive, and will be sent as quoted. To enable unconditional quoting for the table name, specify the flag
quote=True to the constructor, or use the |
metadata | a _schema.MetaData
object which will contain this
table. The metadata is used as a point of association of this table
with other tables which are referenced via foreign key. It also
may be used to associate this table with a particular
.Connectable . |
*args | Additional positional arguments are used primarily
to add the list of _schema.Column
objects contained within this
table. Similar to the style of a CREATE TABLE statement, other
.SchemaItem constructs may be added here, including
.PrimaryKeyConstraint , and
_schema.ForeignKeyConstraint . |
autoload | Defaults to False, unless
:paramref:`_schema.Table.autoload_with`
is set in which case it defaults to True;
Deprecated since version 1.4: The autoload parameter is deprecated and will be removed in
version 2.0. Please use the
:paramref:`_schema.Table.autoload_with` parameter, passing an
engine or connection.
See Also |
autoload_replace | Defaults to True; when using
:paramref:`_schema.Table.autoload`
in conjunction with :paramref:`_schema.Table.extend_existing`,
indicates
that Note that this setting does not impact |
autoload_with | An _engine.Engine or
_engine.Connection object,
or a _reflection.Inspector object as returned by
_sa.inspect
against one, with which this _schema.Table
object will be reflected.
When set to a non-None value, the autoload process will take place
for this table against the given engine or connection. |
extend_existing | When True, indicates that if this
If :paramref:`_schema.Table.extend_existing` or
:paramref:`_schema.Table.keep_existing` are not set,
and the given name
of the new :paramref:`_schema.Table.extend_existing`
will also work in conjunction
with :paramref:`_schema.Table.autoload` to run a new reflection
operation against the database, even if a As is always the case with :paramref:`_schema.Table.autoload`,
Table("mytable", metadata, Column('y', Integer), extend_existing=True, autoload_with=engine ) |
implicit_returning | True by default - indicates that
RETURNING can be used by default to fetch newly inserted primary key
values, for backends which support this. Note that
_sa.create_engine also provides an implicit_returning
flag. |
include_columns | A list of strings indicating a subset of columns to be loaded via the autoload operation; table columns who aren't present in this list will not be represented on the resulting Table object. Defaults to None which indicates all columns should be reflected. |
resolve_fks | Whether or not to reflect
New in version 1.3.
|
info | Optional data dictionary which will be populated into the
.SchemaItem.info attribute of this object. |
keep_existing | When True, indicates that if this Table
is already present in the given If :paramref:`_schema.Table.extend_existing` or
:paramref:`_schema.Table.keep_existing` are not set,
and the given name
of the new |
listeners | A list of tuples of the form (<eventname>, <fn>)
which will be passed to def listen_for_reflect(table, column_info): "handle the column reflection event" # ... t = Table( 'sometable', autoload_with=engine, listeners=[ ('column_reflect', listen_for_reflect) ]) See Also
|
must_exist | When True, indicates that this Table must already
be present in the given _schema.MetaData collection, else
an exception is raised. |
prefixes | A list of strings to insert after CREATE in the CREATE TABLE statement. They will be separated by spaces. |
quote | Force quoting of this table's name on or off, corresponding to True or False. When left at its default of None, the column identifier will be quoted according to whether the name is case sensitive (identifiers with at least one upper case character are treated as case sensitive), or if it's a reserved word. This flag is only needed to force quoting of a reserved word which is not known by the SQLAlchemy dialect. Note setting this flag to False will not provide case-insensitive behavior for table reflection; table reflection will always search for a mixed-case name in a case sensitive fashion. Case insensitive names are specified in SQLAlchemy only by stating the name with all lower case characters. |
quote_schema | same as 'quote' but applies to the schema identifier. |
schema | The schema name for this table, which is required if the table resides in a schema other than the default selected schema for the engine's database connection. Defaults to None. If the owning
New in version 1.0.14: Added the
.BLANK_SCHEMA symbol to
allow a _schema.Table
to have a blank schema name even when the
parent _schema.MetaData specifies
:paramref:`_schema.MetaData.schema`.The quoting rules for the schema name are the same as those for the
name parameter, in that quoting is applied for reserved words or
case-sensitive names; to enable unconditional quoting for the schema
name, specify the flag quote_schema=True to the constructor, or use
the |
comment | Optional string that will render an SQL comment on table creation.
New in version 1.2: Added the :paramref:`_schema.Table.comment`
parameter
to
_schema.Table . |
**kw | 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. |
Method | __init__ |
Constructor for _schema.Table . |
Method | __new__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | __str__ |
Undocumented |
Method | _autoload |
Undocumented |
Method | _extra_kwargs |
Undocumented |
Method | _gen_cache_key |
return an optional cache key. |
Method | _init |
Undocumented |
Method | _init_collections |
Undocumented |
Method | _init_existing |
Undocumented |
Method | _reset_exported |
Undocumented |
Method | _set_parent |
Associate with this SchemaEvent's parent object. |
Method | add_is_dependent_on |
Add a 'dependency' for this Table. |
Method | append_column |
Append a _schema.Column to this _schema.Table . |
Method | append_constraint |
Append a _schema.Constraint to this _schema.Table . |
Method | create |
Issue a CREATE statement for this _schema.Table , using the given .Connectable for connectivity. |
Method | drop |
Issue a DROP statement for this _schema.Table , using the given .Connectable for connectivity. |
Method | exists |
Return True if this table exists. |
Method | to_metadata |
Return a copy of this _schema.Table associated with a different _schema.MetaData . |
Method | tometadata |
Return a copy of this _schema.Table associated with a different _schema.MetaData . |
Class Variable | __visit_name__ |
Undocumented |
Class Variable | _traverse_internals |
Undocumented |
Instance Variable | _extra_dependencies |
Undocumented |
Instance Variable | _prefixes |
Undocumented |
Instance Variable | comment |
Undocumented |
Instance Variable | constraints |
A collection of all _schema.Constraint objects associated with this _schema.Table . |
Instance Variable | foreign_keys |
Return the collection of _schema.ForeignKey marker objects which this FromClause references. |
Instance Variable | fullname |
Undocumented |
Instance Variable | implicit_returning |
_expression.TableClause doesn't support having a primary key or column -level defaults, so implicit returning doesn't apply. |
Instance Variable | indexes |
A collection of all _schema.Index objects associated with this _schema.Table . |
Instance Variable | info |
Info dictionary associated with the object, allowing user-defined data to be associated with this .SchemaItem . |
Instance Variable | metadata |
Undocumented |
Instance Variable | schema |
Define the 'schema' attribute for this _expression.FromClause . |
Property | _autoincrement_column |
No PK or default support so no autoincrement column. |
Property | _sorted_constraints |
Return the set of constraints as a list, sorted by creation order. |
Property | bind |
Return the connectable associated with this Table. |
Property | foreign_key_constraints |
_schema.ForeignKeyConstraint objects referred to by this _schema.Table . |
Property | key |
Return the 'key' for this _schema.Table . |
Inherited from DialectKWArgs
:
Class Method | argument_for |
Add a new kind of dialect-specific keyword argument for this class. |
Method | _kw_reg_for_dialect_cls |
Undocumented |
Method | _validate_dialect_kwargs |
Undocumented |
Class Variable | _dialect_kwargs_traverse_internals |
Undocumented |
Class Variable | _kw_registry |
Undocumented |
Property | dialect_kwargs |
A collection of keyword arguments specified as dialect-specific options to this construct. |
Property | dialect_options |
A collection of keyword arguments specified as dialect-specific options to this construct. |
Property | kwargs |
A synonym for .DialectKWArgs.dialect_kwargs . |
Inherited from SchemaItem
:
Method | _init_items |
Initialize the list of child items for this SchemaItem. |
Method | _schema_item_copy |
Undocumented |
Class Variable | _use_schema_map |
Undocumented |
Class Variable | create_drop_stringify_dialect |
Undocumented |
Inherited from SchemaEventTarget
(via SchemaItem
):
Method | _set_parent_with_dispatch |
Undocumented |
Inherited from Traversible
(via SchemaItem
):
Method | get_children |
Return immediate child .visitors.Traversible elements of this .visitors.Traversible . |
Method | __class_getitem__ |
Undocumented |
Inherited from TableClause
:
Method | delete |
Generate a _expression.delete construct against this _expression.TableClause . |
Method | insert |
Generate an _expression.insert construct against this _expression.TableClause . |
Method | update |
Generate an _expression.update construct against this _expression.TableClause . |
Instance Variable | primary_key |
Return the iterable collection of _schema.Column objects
which comprise the primary key of this _selectable.FromClause . |
Method | _refresh_for_new_column |
Given a column added to the .c collection of an underlying selectable, produce the local version of that column, assuming this selectable ultimately should proxy this column. |
Class Variable | named_with_column |
Undocumented |
Instance Variable | _columns |
Undocumented |
Instance Variable | name |
Undocumented |
Property | _from_objects |
Undocumented |
Property | description |
A brief description of this _expression.FromClause . |
Inherited from DMLTableRole
(via TableClause
):
Class Variable | _role_name |
Undocumented |
Inherited from FromClauseRole
(via TableClause
, DMLTableRole
):
Class Variable | _is_subquery |
Undocumented |
Property | _hide_froms |
Undocumented |
Inherited from ColumnsClauseRole
(via TableClause
, DMLTableRole
, FromClauseRole
):
Property | _select_iterable |
Undocumented |
Inherited from AllowsLambdaRole
(via TableClause
, DMLTableRole
, FromClauseRole
, ColumnsClauseRole
):
Class Variable | allows_lambda |
Undocumented |
Inherited from UsesInspection
(via TableClause
, DMLTableRole
, FromClauseRole
, ColumnsClauseRole
):
Class Variable | _post_inspect |
Undocumented |
Class Variable | uses_inspection |
Undocumented |
Inherited from SQLRole
(via TableClause
, DMLTableRole
, FromClauseRole
, ColumnsClauseRole
, ColumnListRole
):
Class Variable | allows_lambda |
Undocumented |
Class Variable | uses_inspection |
Undocumented |
Inherited from AllowsLambdaRole
(via TableClause
, DMLTableRole
, FromClauseRole
, JoinTargetRole
):
Class Variable | allows_lambda |
Undocumented |
Inherited from UsesInspection
(via TableClause
, DMLTableRole
, FromClauseRole
, JoinTargetRole
):
Class Variable | _post_inspect |
Undocumented |
Class Variable | uses_inspection |
Undocumented |
Inherited from SQLRole
(via TableClause
, DMLTableRole
, FromClauseRole
, JoinTargetRole
, StructuralRole
):
Class Variable | allows_lambda |
Undocumented |
Class Variable | uses_inspection |
Undocumented |
Inherited from Immutable
(via TableClause
):
Method | _clone |
Undocumented |
Method | _copy_internals |
Undocumented |
Method | params |
Undocumented |
Method | unique_params |
Undocumented |
Class Variable | _is_immutable |
Undocumented |
Inherited from FromClause
(via TableClause
):
Method | alias |
Return an alias of this _expression.FromClause . |
Method | is_derived_from |
Return True if this _expression.FromClause is 'derived' from the given FromClause. |
Method | join |
Return a _expression.Join from this _expression.FromClause to another FromClause . |
Method | outerjoin |
No summary |
Method | select |
Return a SELECT of this _expression.FromClause . |
Method | table_valued |
Return a _sql.TableValuedColumn object for this _expression.FromClause . |
Method | tablesample |
Return a TABLESAMPLE alias of this _expression.FromClause . |
Class Variable | c |
Undocumented |
Method | _anonymous_fromclause |
Undocumented |
Method | _generate_fromclause_column_proxies |
Undocumented |
Method | _is_lexical_equivalent |
Return True if this _expression.FromClause and the other represent the same lexical identity. |
Method | _populate_column_collection |
Called on subclasses to establish the .c collection. |
Method | _reset_column_collection |
Reset the attributes linked to the FromClause.c attribute. |
Class Variable | _hide_froms |
Undocumented |
Class Variable | _is_from_clause |
Undocumented |
Class Variable | _is_join |
Undocumented |
Class Variable | _select_iterable |
Undocumented |
Class Variable | _use_schema_map |
Undocumented |
Class Variable | is_selectable |
Undocumented |
Property | _cols_populated |
Undocumented |
Property | columns |
A named-based collection of _expression.ColumnElement objects maintained by this _expression.FromClause . |
Property | entity_namespace |
Return a namespace used for name-based access in SQL expressions. |
Property | exported_columns |
A _expression.ColumnCollection that represents the "exported" columns of this _expression.Selectable . |
Inherited from FromClauseRole
(via TableClause
, FromClause
, AnonymizedFromClauseRole
, StrictFromClauseRole
):
Class Variable | _is_subquery |
Undocumented |
Class Variable | _role_name |
Undocumented |
Inherited from AllowsLambdaRole
(via TableClause
, FromClause
, AnonymizedFromClauseRole
, StrictFromClauseRole
, FromClauseRole
, ColumnsClauseRole
):
Class Variable | allows_lambda |
Undocumented |
Inherited from UsesInspection
(via TableClause
, FromClause
, AnonymizedFromClauseRole
, StrictFromClauseRole
, FromClauseRole
, ColumnsClauseRole
):
Class Variable | _post_inspect |
Undocumented |
Class Variable | uses_inspection |
Undocumented |
Inherited from SQLRole
(via TableClause
, FromClause
, AnonymizedFromClauseRole
, StrictFromClauseRole
, FromClauseRole
, ColumnsClauseRole
, ColumnListRole
):
Class Variable | allows_lambda |
Undocumented |
Class Variable | uses_inspection |
Undocumented |
Inherited from AllowsLambdaRole
(via TableClause
, FromClause
, AnonymizedFromClauseRole
, StrictFromClauseRole
, FromClauseRole
, JoinTargetRole
):
Class Variable | allows_lambda |
Undocumented |
Inherited from UsesInspection
(via TableClause
, FromClause
, AnonymizedFromClauseRole
, StrictFromClauseRole
, FromClauseRole
, JoinTargetRole
):
Class Variable | _post_inspect |
Undocumented |
Class Variable | uses_inspection |
Undocumented |
Inherited from SQLRole
(via TableClause
, FromClause
, AnonymizedFromClauseRole
, StrictFromClauseRole
, FromClauseRole
, JoinTargetRole
, StructuralRole
):
Class Variable | allows_lambda |
Undocumented |
Class Variable | uses_inspection |
Undocumented |
Inherited from Selectable
(via TableClause
, FromClause
):
Method | corresponding_column |
No summary |
Method | lateral |
Return a LATERAL alias of this _expression.Selectable . |
Method | replace_selectable |
Replace all occurrences of _expression.FromClause 'old' with the given _expression.Alias object, returning a copy of this _expression.FromClause . |
Inherited from ReturnsRows
(via TableClause
, FromClause
, Selectable
):
Class Variable | _is_lateral |
Undocumented |
Class Variable | _is_returns_rows |
Undocumented |
Class Variable | _is_select_statement |
Undocumented |
Property | _all_selected_columns |
A sequence of column expression objects that represents the "selected" columns of this _expression.ReturnsRows . |
Property | selectable |
Undocumented |
Inherited from ReturnsRowsRole
(via TableClause
, FromClause
, Selectable
, ReturnsRows
):
Class Variable | _role_name |
Undocumented |
Inherited from SQLRole
(via TableClause
, FromClause
, Selectable
, ReturnsRows
, ReturnsRowsRole
):
Class Variable | allows_lambda |
Undocumented |
Class Variable | uses_inspection |
Undocumented |
Inherited from ClauseElement
(via TableClause
, FromClause
, Selectable
, ReturnsRows
):
Method | compare |
Compare this _expression.ClauseElement to the given _expression.ClauseElement . |
Method | compile |
Compile this SQL expression. |
Method | params |
Return a copy with _expression.bindparam elements replaced. |
Method | self_group |
Apply a 'grouping' to this _expression.ClauseElement . |
Method | unique_params |
Return a copy with _expression.bindparam elements replaced. |
Method | __bool__ |
Undocumented |
Method | __getstate__ |
Undocumented |
Method | __invert__ |
Undocumented |
Method | _clone |
Create a shallow copy of this ClauseElement. |
Method | _cloned_set |
Return the set consisting all cloned ancestors of this ClauseElement. |
Method | _compile_w_cache |
Undocumented |
Method | _compiler |
Return a compiler appropriate for this ClauseElement, given a Dialect. |
Method | _execute_on_connection |
Undocumented |
Method | _negate |
Undocumented |
Method | _negate_in_binary |
a hook to allow the right side of a binary expression to respond to a negation of the binary expression. |
Method | _replace_params |
Undocumented |
Method | _set_propagate_attrs |
Undocumented |
Method | _ungroup |
Return this _expression.ClauseElement without any groupings. |
Method | _with_binary_element_type |
in the context of binary expression, convert the type of this object to the one given. |
Class Variable | _cache_key_traversal |
Undocumented |
Class Variable | _is_bind_parameter |
Undocumented |
Class Variable | _is_clause_list |
Undocumented |
Class Variable | _is_clone_of |
Undocumented |
Class Variable | _is_from_container |
Undocumented |
Class Variable | _is_immutable |
Undocumented |
Class Variable | _is_lambda_element |
Undocumented |
Class Variable | _is_select_container |
Undocumented |
Class Variable | _is_singleton_constant |
Undocumented |
Class Variable | _is_text_clause |
Undocumented |
Class Variable | _is_textual |
Undocumented |
Class Variable | _order_by_label_element |
Undocumented |
Class Variable | is_clause_element |
Undocumented |
Class Variable | stringify_dialect |
Undocumented |
Class Variable | supports_execution |
Undocumented |
Instance Variable | _propagate_attrs |
like annotations, however these propagate outwards liberally as SQL constructs are built, and are set up at construction time. |
Property | _constructor |
return the 'constructor' for this ClauseElement. |
Inherited from SQLRole
(via TableClause
, FromClause
, Selectable
, ReturnsRows
, ClauseElement
):
Class Variable | allows_lambda |
Undocumented |
Class Variable | uses_inspection |
Undocumented |
Inherited from SupportsWrappingAnnotations
(via TableClause
, FromClause
, Selectable
, ReturnsRows
, ClauseElement
):
Method | _annotate |
return a copy of this ClauseElement with annotations updated by the given dictionary. |
Method | _deannotate |
return a copy of this _expression.ClauseElement with annotations removed. |
Method | _with_annotations |
return a copy of this ClauseElement with annotations replaced by the given dictionary. |
Inherited from SupportsAnnotations
(via TableClause
, FromClause
, Selectable
, ReturnsRows
, ClauseElement
, SupportsWrappingAnnotations
):
Property | _annotations_cache_key |
Undocumented |
Inherited from MemoizedHasCacheKey
(via TableClause
, FromClause
, Selectable
, ReturnsRows
, ClauseElement
):
Method | _generate_cache_key |
return a cache key. |
Inherited from HasCacheKey
(via TableClause
, FromClause
, Selectable
, ReturnsRows
, ClauseElement
, MemoizedHasCacheKey
):
Class Variable | inherit_cache |
Indicate if this .HasCacheKey instance should make use of the cache key generation scheme used by its immediate superclass. |
Class Method | _generate_cache_attrs |
generate cache key dispatcher for a new class. |
Class Method | _generate_cache_key_for_object |
Undocumented |
Class Variable | __slots__ |
Undocumented |
Class Variable | _hierarchy_supports_caching |
private attribute which may be set to False to prevent the inherit_cache warning from being emitted for a hierarchy of subclasses. |
Class Variable | _is_has_cache_key |
Undocumented |
Inherited from HasCopyInternals
(via TableClause
, FromClause
, Selectable
, ReturnsRows
, ClauseElement
):
Method | _copy_internals |
Reassign internal elements to be clones of themselves. |
Inherited from Traversible
(via TableClause
, FromClause
, Selectable
, ReturnsRows
, ClauseElement
):
Method | get_children |
Return immediate child .visitors.Traversible elements of this .visitors.Traversible . |
Method | __class_getitem__ |
Undocumented |
Constructor for _schema.Table
.
This method is a no-op. See the top-level
documentation for _schema.Table
for constructor arguments.
Undocumented
Undocumented
return an optional cache key.
The cache key is a tuple which can contain any series of objects that are hashable and also identifies this object uniquely within the presence of a larger SQL expression or statement, for the purposes of caching the resulting query.
The cache key should be based on the SQL compiled structure that would ultimately be produced. That is, two structures that are composed in exactly the same way should produce the same cache key; any difference in the structures that would affect the SQL string or the type handlers should result in a different cache key.
If a structure cannot produce a useful cache key, the NO_CACHE symbol should be added to the anon_map and the method should return None.
Add a 'dependency' for this Table.
This is another Table object which must be created first before this one can, or dropped after this one.
Usually, dependencies between tables are determined via ForeignKey objects. However, for other situations that create dependencies outside of foreign keys (rules, inheriting), this method can manually establish such a link.
Append a _schema.Column
to this _schema.Table
.
The "key" of the newly added _schema.Column
, i.e. the
value of its .key attribute, will then be available
in the .c collection of this _schema.Table
, and the
column definition will be included in any CREATE TABLE, SELECT,
UPDATE, etc. statements generated from this _schema.Table
construct.
Note that this does not change the definition of the table as it exists within any underlying database, assuming that table has already been created in the database. Relational databases support the addition of columns to existing tables using the SQL ALTER command, which would need to be emitted for an already-existing table that doesn't contain the newly added column.
Parameters | |
column | Undocumented |
replace_existing | When True, allows replacing existing columns. When False, the default, an warning will be raised if a column with the same .key already exists. A future version of sqlalchemy will instead rise a warning.
New in version 1.4.0.
|
Append a _schema.Constraint
to this
_schema.Table
.
This has the effect of the constraint being included in any
future CREATE TABLE statement, assuming specific DDL creation
events have not been associated with the given
_schema.Constraint
object.
Note that this does not produce the constraint within the
relational database automatically, for a table that already exists
in the database. To add a constraint to an
existing relational database table, the SQL ALTER command must
be used. SQLAlchemy also provides the
.AddConstraint
construct which can produce this SQL when
invoked as an executable clause.
Issue a CREATE statement for this
_schema.Table
, using the given .Connectable
for connectivity.
Note
the "bind" argument will be required in SQLAlchemy 2.0.
See Also
_schema.MetaData.create_all
.
Issue a DROP statement for this
_schema.Table
, using the given .Connectable
for connectivity.
Note
the "bind" argument will be required in SQLAlchemy 2.0.
See Also
_schema.MetaData.drop_all
.
Return a copy of this _schema.Table
associated with a
different _schema.MetaData
.
E.g.:
m1 = MetaData() user = Table('user', m1, Column('id', Integer, primary_key=True)) m2 = MetaData() user_copy = user.to_metadata(m2)
_schema.Table.to_metadata
function
was renamed from _schema.Table.tometadata
.Parameters | |
metadata | Target _schema.MetaData object,
into which the
new _schema.Table object will be created. |
schema | optional string name indicating the target schema.
Defaults to the special symbol m2 = MetaData(schema='newschema') # user_copy_one will have "newschema" as the schema name user_copy_one = user.to_metadata(m2, schema=None) m3 = MetaData() # schema defaults to None # user_copy_two will have None as the schema name user_copy_two = user.to_metadata(m3, schema=None) |
referred_schema_fn | optional callable which can be supplied
in order to provide for the schema name that should be assigned
to the referenced table of a def referred_schema_fn(table, to_schema, constraint, referred_schema): if referred_schema == 'base_tables': return referred_schema else: return to_schema new_table = table.to_metadata(m2, schema="alt_schema", referred_schema_fn=referred_schema_fn)
New in version 0.9.2.
|
name | optional string name indicating the target table name.
If not specified or None, the table name is retained. This allows
a
New in version 1.0.0.
|
Return a copy of this _schema.Table
associated with a different
_schema.MetaData
.
See _schema.Table.to_metadata
for a full description.
set
=
A collection of all _schema.Constraint
objects associated with
this _schema.Table
.
Includes _schema.PrimaryKeyConstraint
,
_schema.ForeignKeyConstraint
, _schema.UniqueConstraint
,
_schema.CheckConstraint
. A separate collection
_schema.Table.foreign_key_constraints
refers to the collection
of all _schema.ForeignKeyConstraint
objects, and the
_schema.Table.primary_key
attribute refers to the single
_schema.PrimaryKeyConstraint
associated with the
_schema.Table
.
See Also
_schema.Table.constraints
_schema.Table.primary_key
_schema.Table.foreign_key_constraints
_schema.Table.indexes
_reflection.Inspector
set
=
Return the collection of _schema.ForeignKey
marker objects
which this FromClause references.
Each _schema.ForeignKey
is a member of a
_schema.Table
-wide
_schema.ForeignKeyConstraint
.
See Also
_schema.Table.foreign_key_constraints
_expression.TableClause
doesn't support having a primary key or column
-level defaults, so implicit returning doesn't apply.set
=
A collection of all _schema.Index
objects associated with this
_schema.Table
.
See Also
_reflection.Inspector.get_indexes
sqlalchemy.sql.schema.SchemaItem.info
Info dictionary associated with the object, allowing user-defined
data to be associated with this .SchemaItem
.
The dictionary is automatically generated when first accessed.
It can also be specified in the constructor of some objects,
such as _schema.Table
and _schema.Column
.
Define the 'schema' attribute for this _expression.FromClause
.
This is typically None for most objects except that of
_schema.Table
, where it is taken as the value of the
:paramref:`_schema.Table.schema` argument.
_schema.ForeignKeyConstraint
objects referred to by this
_schema.Table
.
This list is produced from the collection of
_schema.ForeignKey
objects currently associated.
See Also
_schema.Table.constraints
_schema.Table.foreign_keys
_schema.Table.indexes
Return the 'key' for this _schema.Table
.
This value is used as the dictionary key within the
_schema.MetaData.tables
collection. It is typically the same
as that of _schema.Table.name
for a table with no
_schema.Table.schema
set; otherwise it is typically of the form
schemaname.tablename.