推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
jenlors
V2EX  ›  Python

各位,有用 tortoise-orm 的吗?

  •  
  •   jenlors · May 16, 2020 · 5409 views
    This topic created in 2322 days ago, the information mentioned may be changed or developed.

    如果你的项目基于 fastapi 或者 starletted 等异步框架,并且需要一个 ORM 框架的话,那么 tortoise-orm 一定是你当前最佳选择了。

    好吧,其实我不是来推荐 tortoise-orm 的,而是她:aerich,一个为 tortoise-orm 而生的数据库迁移工具。

    类似于 alembic for SQLAlchemy,或者 Django ORM 自带的工具。

    当前支持基于 tortoise-orm 的数据库 DDL 更改,目前只支持 MySQL,但是扩展到 postgres 和 sqlite 也是非常容易的。

    如果这个项目对你有所帮助,请不吝 star 。

    项目地址:https://github.com/long2ice/aerich

    3 replies  •  2020-08-06 12:15:03 +08:00
    watsy0007
        1
    watsy0007  
       May 16, 2020
    正在用 tortoise-orm, 迁移工具还是 alembic.
    tortoise-orm 官方后面排期会加入 migration.
    楼主可以提 pr
    jenlors
        2
    jenlors  
    OP
       May 16, 2020
    alembic 只支持 SQLAlchemy 吧?
    johnsona
        3
    johnsona  
       Aug 6, 2020
    alembic 问题一大堆,改个字段名直接删了重新建,改字段类型迁移不生效,伤透了心,手动 ddl 了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   956 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 22:45 · PVG 06:45 · LAX 15:45 · JFK 18:45
    ♥ Do have faith in what you're doing.