I'm looking at the example at bulk_insert.

# Create an ad-hoc table to use for the insert statement.
accounts_table = table('account',
    column('id', Integer),
    column('name', String),
    column('create_date', Date)
)

I would like to bulk insert to a specific schema called kpi but I can't figure out how to do it. Can someone help me out?

有帮助吗?

解决方案

The answer I've found so far is to use the sqlalchemy function instead like below:

accounts_table = sa.Table('accounts_table', sa.MetaData(),
    sa.Column('id', sa.Integer),
    sa.Column('name', sa.String(100)),
    sa.Column('create_date', sa.Date),
    schema='phone'
)
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top