finds.dev← search

// the find

tortoise/tortoise-orm

★ 5,578 · Python · Apache-2.0 · updated Jun 2026

Familiar asyncio ORM for python, built with relations in mind

Tortoise ORM is an async-native Python ORM with a Django-like API, targeting FastAPI/Sanic/asyncio applications that need proper relation support without blocking I/O. It supports PostgreSQL, MySQL, SQLite, MSSQL, and Oracle with multiple async driver options per database. If you're building an async Python backend and miss Django's ORM ergonomics, this is the most mature option in that space.

Built-in migration framework with a CLI that does autodetection, reversible operations, RunPython/RunSQL, and multi-app projects — no need to bolt on Alembic separately. Multiple async driver choices per database (asyncpg vs psycopg for Postgres, aiomysql vs asyncmy for MySQL) means you're not locked into one library's quirks. Pydantic integration is first-class with generated serializers, not an afterthought. Benchmarks against SQLAlchemy async and others show competitive performance on PostgreSQL reads and writes.

The async context manager requirement for iteration is a footgun — you get silently cached results on the second loop, which will cause subtle bugs if you're not paying attention. Global Tortoise.init() state means testing and multi-tenancy are annoying; there's no clean per-request connection scoping like SQLAlchemy sessions give you. The migration autodetector has known gaps with complex schema changes (renaming models, cross-app FK changes), and the comprehensive_migrations_project example has 25 migrations just to cover edge cases — a sign the happy path isn't that wide. MS SQL and Oracle support is via asyncodbc which is slower and less battle-tested than the PostgreSQL drivers.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →