3

我正在查看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)
)

我想bulk insert调用一个特定的模式,kpi但我不知道该怎么做。有人可以帮我吗?

4

1 回答 1

2

到目前为止,我找到的答案是使用 sqlalchemy 函数,如下所示:

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'
)
于 2013-12-05T10:16:25.190 回答