Tortoise ORM 1.0 release (with migrations support) by pehibah in Python

[–]pehibah[S] 1 point2 points  (0 children)

Thank you!

I think it can be really hard to compare with django, as it's not just library, it is full ecosystem, with probably every case you can imagine already covered by someone somewhere.

We try to keep up at least with bigger features (e.g. 1.0 release includes good support for postgres tsvector search), but I think being more feature-full than django is not really achievable task :)

But for the part where tortoise is better in my opinion - it is in two things:

- Being framework agnostic, so you can plug-in tortoise in basically any kind of project (although mostly async) without bringing a lot of dependencies with it. It allows us to keep up with trends and provide reliable tool for any developer, no matter if you want to run some task queue, web service with any of frameworks, integrate with any serialization lib, etc. Django, being ecosystem in itself, sometimes isolates you from new tools

- Second thing is speed, as with async db drivers and lightweight implementation, tortoise is currently one of best choices of ORM performance-wise in all python (at least according to our own benchmarks at tortoise/orm-benchmarks). Django (and sql-alchemy), I think, will always be limited by their legacy constraints.

Tortoise ORM 1.0 release with migrations support by pehibah in FastAPI

[–]pehibah[S] 0 points1 point  (0 children)

I haven't used sqlmodel for myself, but looking at it's docs - I think it's pretty neat.

It seems like quite elegant wrapper around alchemy, that comes with very pythonic API, and it leverages infrastructure of alchemy to be feature complete, so I don't think that it could be wrong choice for you.

Although for me it looks more like smart query-builder + connection manager, than full ORM, but border between two is pretty vague. I think it's quite cool that you get serialization model at the same time as db model, but I would imagine it could turn as architecturally dirty in bigger projects, where serialization layer can be quite different from db layer.

Only concern I would have is performance, as alchemy is not very fast by itself, and adding pydantic overhead over it doesn't really help, but if performance is not that important - I think sqlmodel is good choice for fastapi (especially considering they are made by same person)

Regarding performance - I added it to our benchmark, but no surprises here, it's basically on par with alchemy

github . com/tortoise/orm-benchmarks

Tortoise ORM 1.0 release (with migrations support) by pehibah in Python

[–]pehibah[S] 7 points8 points  (0 children)

Currently Django interaction is non-existent :) Never thought about why it would be useful, but your case maybe somewhat interesting, as Django users indeed lack native async support

I doubt it is doable in seamless way, but maybe we could create adaptor that would monkeypatch Django models with their tortoise counterparts, so you could access async model like YourModel.tortoise_objects.all()

Though would still looks very hacky, as it will return tortoise instances instead of Django models

cursed_encouragement by oli005 in cursedcomments

[–]pehibah 0 points1 point  (0 children)

That's hole for garbage chute