gpt4 book ai didi

python - 我可以在 alembic 上使用 .py 文件而不是 .ini 文件吗?

转载 作者:太空宇宙 更新时间:2023-11-04 10:22:51 30 4
gpt4 key购买 nike

我想使用 alembic.py 而不是 alembic.ini 进行配置。
但我找不到任何此类配置的示例。
有什么办法可以不使用 alembic.ini 吗?

最佳答案

你在找this吗:

from alembic.config import Config
alembic_cfg = Config()
alembic_cfg.set_main_option("script_location", "myapp:migrations")
alembic_cfg.set_main_option("url", "postgresql://foo/bar")
alembic_cfg.set_section_option("mysection", "foo", "bar")

关于python - 我可以在 alembic 上使用 .py 文件而不是 .ini 文件吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31238642/

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