gpt4 book ai didi

python - 使用 sqlalchemy 列出索引

转载 作者:太空狗 更新时间:2023-10-30 01:17:19 25 4
gpt4 key购买 nike

是否可以使用 sqlalchemy 列出数据库中的所有索引?

最佳答案

yes .

from sqlalchemy import create_engine
from sqlalchemy.engine import reflection
engine = create_engine('...')
insp = reflection.Inspector.from_engine(engine)
for name in insp.get_table_names():
for index in insp.get_indexes(name):
print index

关于python - 使用 sqlalchemy 列出索引,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5605019/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com