MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / MetaData

Class MetaData

lib/sqlalchemy/sql/schema.py:5789–6414  ·  view source on GitHub ↗

A collection of :class:`_schema.Table` objects and their associated schema constructs. Holds a collection of :class:`_schema.Table` objects as well as an optional binding to an :class:`_engine.Engine` or :class:`_engine.Connection`. If bound, the :class:`_schema.Table` objects

Source from the content-addressed store, hash-verified

5787
5788
5789class MetaData(HasSchemaAttr):
5790 """A collection of :class:`_schema.Table`
5791 objects and their associated schema
5792 constructs.
5793
5794 Holds a collection of :class:`_schema.Table` objects as well as
5795 an optional binding to an :class:`_engine.Engine` or
5796 :class:`_engine.Connection`. If bound, the :class:`_schema.Table` objects
5797 in the collection and their columns may participate in implicit SQL
5798 execution.
5799
5800 The :class:`_schema.Table` objects themselves are stored in the
5801 :attr:`_schema.MetaData.tables` dictionary.
5802
5803 :class:`_schema.MetaData` is a thread-safe object for read operations.
5804 Construction of new tables within a single :class:`_schema.MetaData`
5805 object,
5806 either explicitly or via reflection, may not be completely thread-safe.
5807
5808 .. seealso::
5809
5810 :ref:`metadata_describing` - Introduction to database metadata
5811
5812 """
5813
5814 __visit_name__ = "metadata"
5815
5816 def __init__(
5817 self,
5818 schema: Optional[str] = None,
5819 quote_schema: Optional[bool] = None,
5820 naming_convention: Optional[_NamingSchemaParameter] = None,
5821 info: Optional[_InfoType] = None,
5822 ) -> None:
5823 """Create a new MetaData object.
5824
5825 :param schema:
5826 The default schema to use for the :class:`_schema.Table`,
5827 :class:`.Sequence`, and potentially other objects associated with
5828 this :class:`_schema.MetaData`. Defaults to ``None``.
5829
5830 .. seealso::
5831
5832 :ref:`schema_metadata_schema_name` - details on how the
5833 :paramref:`_schema.MetaData.schema` parameter is used.
5834
5835 :paramref:`_schema.Table.schema`
5836
5837 :paramref:`.Sequence.schema`
5838
5839 :param quote_schema:
5840 Sets the ``quote_schema`` flag for those :class:`_schema.Table`,
5841 :class:`.Sequence`, and other objects which make usage of the
5842 local ``schema`` name.
5843
5844 :param info: Optional data dictionary which will be populated into the
5845 :attr:`.SchemaItem.info` attribute of this object.
5846

Callers 15

test_reflectMethod · 0.90
test_reprMethod · 0.90
test_subquery_proxyMethod · 0.90
test_alias_proxyMethod · 0.90
t_fixtureMethod · 0.90
t_fixtureMethod · 0.90
test_renderMethod · 0.90
test_adaptationMethod · 0.90

Calls

no outgoing calls

Tested by 15

test_reflectMethod · 0.72
test_reprMethod · 0.72
test_subquery_proxyMethod · 0.72
test_alias_proxyMethod · 0.72
t_fixtureMethod · 0.72
t_fixtureMethod · 0.72
test_renderMethod · 0.72
test_adaptationMethod · 0.72