Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: supporting Tortoise ORM #1069

Open
jamesbraza opened this issue Mar 22, 2024 · 1 comment
Open

Request: supporting Tortoise ORM #1069

jamesbraza opened this issue Mar 22, 2024 · 1 comment
Labels

Comments

@jamesbraza
Copy link

The problem

I came from a company that uses SQLAlchemy + factory_boy, and I loved it. Now, I have joined a company that uses Tortoise ORM. It would be nice to continue using factory_boy, as it's useful.

I see as of https://github.com/FactoryBoy/factory_boy/releases/tag/3.3.0, the ORMS docs (link) don't mention Tortoise ORM.

Proposed solution

It would be nice to either:

  • Add basic support for Tortoise ORM to factory_boy, and document it in the ORMs page
  • Document on how to use the currently existing Tortoise ORM with factory_boy in the ORMs page

Extra notes

None at this time

@rbarrois
Copy link
Member

rbarrois commented Apr 9, 2024

Hi,

Thanks for the suggestion.
I do not think any of the maintainers use Tortoise ORM — and I'm not too keen on adding support for every ORM under the sun.
We're already stretched somewhat thin, so I'm not too keen on adding a further maintenance load on ourselves, I'm sorry.

However, the second option you suggest is interesting: we could describe a TortoiseModelFactory as an example in an How to create a base factory for another ORM document!

Do you have some details as to how Tortoise handles:

  • Building instances (without saving them to the database);
  • Creating instances in the database;
  • SQL session management;
  • The get_or_create pattern?

@rbarrois rbarrois added the Doc label Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants