tortoise / tortoise/tortoise-orm

[Feature] Support Trio

Open
#1,826 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
5.6k
Forks
516
Avg merge
2d 21h
Merged PRs (30d)
9

Description

Currently Tortoise only supports code using the stdlib asyncio framework. I have a project that uses the trio async framework and I wanted to use Tortoise for the database functionality but ran into errors from Tortoise using asyncio.

The changes required to support trio would be substituting asyncio with the anyio package. This would most likely require some API changes to support the structured concurrency patterns used in trio/anyio.

I likely won't end up using Tortoise in my trio-based project, at least for now, but I wanted to open this issue to see whether this might be possible to support.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing Tortoise's use of the stdlib asyncio framework and the proposed anyio substitution. Assess the API changes needed for Trio and anyio structured-concurrency patterns; done means Tortoise can provide database functionality to Trio-based projects without asyncio-related errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.