1.. _schema_toplevel: 2 3========================== 4Schema Definition Language 5========================== 6 7.. module:: sqlalchemy.schema 8 9This section references SQLAlchemy **schema metadata**, a comprehensive system of describing and inspecting 10database schemas. 11 12The core of SQLAlchemy's query and object mapping operations are supported by 13*database metadata*, which is comprised of Python objects that describe tables 14and other schema-level objects. These objects are at the core of three major 15types of operations - issuing CREATE and DROP statements (known as *DDL*), 16constructing SQL queries, and expressing information about structures that 17already exist within the database. 18 19Database metadata can be expressed by explicitly naming the various components 20and their properties, using constructs such as 21:class:`~sqlalchemy.schema.Table`, :class:`~sqlalchemy.schema.Column`, 22:class:`~sqlalchemy.schema.ForeignKey` and 23:class:`~sqlalchemy.schema.Sequence`, all of which are imported from the 24``sqlalchemy.schema`` package. It can also be generated by SQLAlchemy using a 25process called *reflection*, which means you start with a single object such 26as :class:`~sqlalchemy.schema.Table`, assign it a name, and then instruct 27SQLAlchemy to load all the additional information related to that name from a 28particular engine source. 29 30A key feature of SQLAlchemy's database metadata constructs is that they are 31designed to be used in a *declarative* style which closely resembles that of 32real DDL. They are therefore most intuitive to those who have some background 33in creating real schema generation scripts. 34 35.. toctree:: 36 :maxdepth: 2 37 38 metadata 39 reflection 40 defaults 41 constraints 42 ddl 43 44