DDLΒΆ

Because of some of the limitations in the SQLAlchemy API, it’s not possible to create tables using sqlalchemy.schema.Table.create() or sqlalchemy.schema.MetaData.create_all(). Luckily, SQLAlchemy provides an API that still makes it possible to create tables and perform other DDL operations.

Instead of:

users = Table("users", metadata,
    Column("id", Integer(), primary_key=True),
    Column("name", String()),
)

users.create(engine)

or

metadata.create_all()

You can use sqlalchemy.schema.CreateTable:

from sqlalchemy.schema import CreateTable

d = engine.execute(CreateTable(users))