{"full_name":"tortoise/tortoise-orm","owner":"tortoise","name":"tortoise-orm","shard":"1","url":"https://github.com/tortoise/tortoise-orm","description":"Familiar asyncio ORM for python, built with relations in mind","homepage":"https://tortoise.github.io","topics":["orm","asyncio","async","python3","sqlite","postgresql","mysql"],"tag_pages":["async","asyncio","mysql","orm","postgresql","python3","sqlite"],"language":"Python","license":"Apache-2.0","avatar":"https://avatars.githubusercontent.com/u/42678965?v=4","created_at":"2018-03-29T16:52:10Z","pushed_at":"2026-11-12T09:12:21Z","metrics":{"stars":5643,"forks":545,"watchers":44,"issues":1310,"prs":991,"releases":133,"issues_open":468,"issues_closed":842,"prs_open":93,"prs_closed":187,"prs_merged":711,"discussions":96},"growth":{"day":{"stars":1,"forks":-1,"base_day":"2026-11-15"}},"history":{"dates":["2026-11-10","2026-11-11","2026-11-12","2026-11-13","2026-11-14","2026-11-15","2026-11-16"],"stars":[5647,5647,5645,5644,5643,5642,5643],"forks":[544,544,544,545,546,546,545],"watchers":[null,42,42,42,42,42,44],"issues_open":[null,466,465,465,466,467,468],"prs_open":[null,90,89,89,90,92,93]},"boards":{"daily_watchers":182,"debut":71},"same_owner":[],"issues":[{"number":819,"title":"CTE Support","comments":22,"created_at":"2021-07-10T14:03:31Z"},{"number":1094,"title":"Error: Resetting connection with an active transaction <asyncpg.connection.Connection object at 0x00000....>","comments":20,"created_at":"2022-03-27T18:35:08Z"},{"number":99,"title":"Usage with Tornado (was: No DB associated to model)","comments":17,"created_at":"2019-02-03T03:29:29Z"},{"number":2056,"title":"The as_query method in the queryset.py file has been removed","comments":14,"created_at":"2026-01-14T09:17:02Z"},{"number":237,"title":"Ensure generate_schema EXACTLY the same as SHOW CREATE TABLE in MySQL","comments":14,"created_at":"2019-11-13T09:22:44Z"},{"number":841,"title":"How to select parent that contains certain children from his ManyToMany relation? ","comments":13,"created_at":"2021-07-28T18:31:47Z"},{"number":70,"title":"GIS support","comments":11,"created_at":"2018-12-05T19:33:17Z"},{"number":756,"title":"[help needed] Filter for list of relations does not work","comments":10,"created_at":"2021-05-05T14:32:31Z"}],"discussions":[{"number":2235,"title":"Is the project active ?","comments":1,"category":"Q&A","created_at":"2026-07-04T21:13:28Z"},{"number":2233,"title":"Is it possible to tweak behavior of migration?","comments":3,"category":"Q&A","created_at":"2026-07-01T13:00:54Z"},{"number":2073,"title":"How to serialize annotate fields using pydantic_model_creator in Tortoise ORM?","comments":1,"category":"Q&A","created_at":"2026-02-07T00:31:39Z"},{"number":2012,"title":"Support instance-level update() with expressions and automatic refresh","comments":0,"category":"Ideas","created_at":"2025-10-20T10:47:09Z"},{"number":2011,"title":"ssh tunnel","comments":0,"category":"Ideas","created_at":"2025-10-20T10:24:48Z"},{"number":2009,"title":"Search","comments":0,"category":"Ideas","created_at":"2025-10-13T03:11:39Z"},{"number":1990,"title":"Unified state of objects","comments":0,"category":"Q&A","created_at":"2025-08-11T09:05:22Z"},{"number":1975,"title":"With supabase","comments":0,"category":"General","created_at":"2025-06-26T16:04:47Z"}],"latest_release":{"name":"v1.1.9","tag":"1.1.9","published_at":"2026-10-14T05:48:41Z","body":"## What's Changed\r\n\r\n### Added\r\n\r\n- ``Q.__bool__()`` so ``Q`` objects with no filters/children (including nested empty ``Q`` children) are falsy. (#2227)\r\n- PostgreSQL ``password`` credential now accepts a sync or async callable, resolved once per new connection, to support short-lived credentials such as AWS RDS/Aurora IAM tokens and Azure Entra ID tokens. (#2261)\r\n\r\n### Changed\r\n\r\n- `tortoise.contrib.starlette` now only supports Starlette 1.0+ (This does not affect FastAPI users; you can continue using FastAPI with any version of Starlette). (#2282)\r\n\r\n### Fixed\r\n\r\n- Aggregates now apply `_filter` when the aggregated argument is an F() or a combined expression (e.g. `Sum(F(\"price\") * F(\"qty\"), _filter=Q(status=\"paid\"))`). Previously the filter was silently dropped and every row was aggregated. (#2290)\r\n- Negating an already negated Q now cancels out: ~~Q(...) and .exclude(~Q(...)) used to keep a single NOT, so they returned the rows the caller meant to drop. (#2291)\r\n- PostgreSQL and Oracle ``RemoveIndex`` / partial ``RemoveConstraint`` now schema-qualify ``DROP INDEX``, so indexes on models with ``Meta.schema`` can be dropped when they are not on the connection ``search_path``. (#2288)\r\n- ``ForeignKeyField``/``OneToOneField`` no longer lose a declared ``source_field`` when deconstructed. ``makemigrations`` wrote the generated ``<field>_id`` backing field name as the column name, so a migrated schema disagreed with ``generate_schemas()`` and neither path reported an error. (#2284)\r\n- ``QuerySet.distinct().count()`` no longer counts rows duplicated by a join (e.g. filtering on a m2m relation); it now counts distinct primary keys and matches the number of rows the query returns. (#2255)\r\n- ``DecimalField`` no longer strips the scale it just applied: ``to_python_value()`` called ``.normalize()`` immediately after ``.quantize()``, so a ``DecimalField(max_digits=12, decimal_places=2)`` holding ``100.00`` came back as ``Decimal('1E+2')`` and rendered as ``1E+2`` in strings, f-strings and JSON. (#2271)\r\n- BlackSheep: ``register_tortoise`` now enables the global connection fallback, so database access works when BlackSheep runs handlers in tasks other than the one that initialized the ORM. (#2248)\r\n- fix(queryset): support DELETE/UPDATE with filters on related fields. (#2269)\r\n- Fix naive DatetimeField timezone drift. (#2277)\r\n- A model with its own ``Meta`` now inherits ``Meta.ordering`` from its abstract base model when it does not define its own. (#2236)\r\n- The return type hint for ``IntEnumField``/``CharEnumField`` is now ``tortoise.fields.Field[EnumType]`` instead of ``EnumType``. (#2243)\r\n- Make EmailValidator allowed_domains actually restrict domains. (#2252)\r\n- ``AlterModelOptions`` now clears options that were removed from the model, instead of only merging in the ones that remain; removing a model docstring no longer makes ``makemigrations`` regenerate the same migration on every run. (#2279)\r\n- ``Model.update_or_create()`` now applies the caller's defaults after losing a concurrent insert, re-reading the current row through the existing transactional update path. Creation is attempted at most twice, with a final locked read after the last conflict; repeated concurrent deletions that exhaust recovery raise ``OperationalError`` rather than retrying indefinitely. (#2276)\r\n- psycopg: the connection pool now validates a connection on checkout, so one silently dropped by the network while idle (a firewall or load balancer closing it, a DB restart, ...) gets transparently replaced instead of being handed to the caller and failing with ``psycopg.OperationalError: the connection is closed``. The check is a cheap no-op query on an already-open socket, so the added latency per checkout is negligible next to a real query. (#2285)\r\n- Fixed ``prefetch_related()`` on m2m fields ignoring ``select_related()``, ``annotate()``, and ``order_by()`` applied to the prefetched queryset. (#2205)\r\n- ``pydantic_model_creator`` no longer raises ``Ty","is_prerelease":false},"readme":false,"readme_zh":false,"news":[],"stale":false,"snapshot_at":"2026-11-16T09:23:14Z","history_start":"2026-09-06"}