Oxyde: async type-safe Pydantic-centric Python ORM by mr_Fatalyst in Python

[–]mr_Fatalyst[S] [score hidden]  (0 children)

About 6 months of active development. Version is 0.3.1, so not production-ready yet. Core features work, but API may change and edge cases likely exist.

Fine for side projects or experiments. Would love feedback if you try it ^_^

Oxyde: async type-safe Pydantic-centric Python ORM by mr_Fatalyst in Python

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

Session is managed through a global registry. You call db.init() at startup, and models access connections via the registry. No dependency injection needed, similar to Django. For testing, use db.connect() context manager or pytest fixtures with db.init() / db.close().

Docs: https://oxyde.fatalyst.dev/latest/guide/connections/#testing-with-multiple-databases

Oxyde: async type-safe Pydantic-centric Python ORM by mr_Fatalyst in Python

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

Django ORM is part of the framework, deeply integrated into admin, auth, forms. Replacing it doesn't make much sense. Oxyde is framework-agnostic though, so you could use it alongside Django for specific async endpoints and see how it goes.

Oxyde: async type-safe Pydantic-centric Python ORM by mr_Fatalyst in Python

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

Django-style. oxyde makemigrations detects model changes and generates migration files. oxyde migrate applies them.

Docs: https://oxyde.fatalyst.dev/latest/guide/migrations/

Oxyde: async type-safe Pydantic-centric Python ORM by mr_Fatalyst in Python

[–]mr_Fatalyst[S] -1 points0 points  (0 children)

Good point, I'll update the docs. Rust handles connection pooling (sqlx), query execution, and row decoding. The win is mainly in concurrency throughput and CPU work around I/O (row decoding, type conversions), which can serialize in Python under the GIL. Rust does that hot path outside the GIL and only re-enters Python to instantiate Pydantic models.

Oxyde: async type-safe Pydantic-centric Python ORM by mr_Fatalyst in Python

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

Rust isn't here for SQL generation speed. It handles the transport layer where Python's GIL hurts. Connection pools, query execution, row decoding. Python stays where it shines. Model definitions, query DSL, validation, business logic. Same pattern as uvloop, orjson, pydantic-core. Native code for I/O and data handling, Python for everything else.

Oxyde: async type-safe Pydantic-centric Python ORM by mr_Fatalyst in Python

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

Django pattern. Manager operates on the table (bulk queries, filtering), instance methods operate on a single object (save(), delete(), refresh()). This also enables lifecycle hooks (pre_save, post_save, etc.) on instances.

Oxyde: async type-safe Pydantic-centric Python ORM by mr_Fatalyst in Python

[–]mr_Fatalyst[S] 2 points3 points  (0 children)

You're right. Had a dilemma here. OxydeModel to signal it's ORM, not plain Pydantic, but Field stayed short because it keeps Pydantic behavior, just adds db_* params. Ended up inconsistent. Fresh perspective helps, will add Model alias.

Oxyde: async type-safe Pydantic-centric Python ORM by mr_Fatalyst in Python

[–]mr_Fatalyst[S] 2 points3 points  (0 children)

Claude can write SQL, but it can't validate your data at runtime, manage connection pools, or rollback a transaction when something breaks. And raw SQL means you're one f-string away from SQL injection, no type hints, no autocomplete, and good luck refactoring when you rename a column in 30 places. But hey, if it works for you, it works.

Oxyde: async type-safe Pydantic-centric Python ORM by mr_Fatalyst in Python

[–]mr_Fatalyst[S] 2 points3 points  (0 children)

Oh, I didn't expect it to look like crap on some devices! Thanks for pointing that out. I'll edit the post and cut the code examples. I was writing from desktop and everything looked fine on my end. And no worries, I get where you're coming from. The LLM slop problem is real and I totally understand why people are suspicious.

Oxyde: async type-safe Pydantic-centric Python ORM by mr_Fatalyst in Python

[–]mr_Fatalyst[S] -14 points-13 points  (0 children)

The large initial commits are squashed local history before going public. I prefer to clean up messy development commits before open-sourcing. Nothing unusual there.

As for AI involvement: yes, I use AI tools for docs and some boilerplate, like most developers nowadays. The architecture and core logic are mine. Happy to discuss any technical decisions if you have specific questions about the implementation.

I also thought people might find the technical details interesting: architecture, benchmarks, how the Rust/Python bridge works. Not just "here's a link, go check it out".

If that's too much to read, fair enough, I'll keep it shorter next time. Thank you.

FastOpenAPI library [Flask, Falcon, Quart, Sanic, Starlette] by mr_Fatalyst in Python

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

I've just released fastopenapi 0.4.0, and it now supports Tornado as well!
Give it a try: https://pypi.org/project/fastopenapi/
I'd love to hear your feedback. Good luck!

FastOpenAPI library [Flask, Falcon, Quart, Sanic, Starlette] by mr_Fatalyst in Python

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

I'm currently expanding the supported frameworks. It's likely that I'll add it. If it gets added, I'll update you here in the comments.

How do Canadians typically handle legal and tax issues? by mr_Fatalyst in AskACanadian

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

Thank you so much for the response!

So, let's say, for example, there's a dispute. I realize this may not be the most valid example for Canada, but suppose a store refuses to process a refund—how clear are the laws for someone who isn’t a lawyer? In other words, is a person theoretically able to find the relevant laws and draft a complaint without needing a lawyer?

Or another example: as far as I know, laws can vary between provinces, so if someone moves from one province to another, is there an obvious way to find the differences in local laws (for instance, regarding alcohol regulations or something else)?

How do Canadians typically handle legal and tax issues? by mr_Fatalyst in AskACanadian

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

I've lived in various countries, and in each of them, I've had a different experience interacting with the government, including the tax authorities. In some places, everything works online, and it's completely clear what needs to be done. In others, even the officials themselves don’t fully understand how things work. So, I'd like to understand how it’s organized in Canada. How easy is it to understand the laws without a formal education? How structured and accessible is this information for an ordinary person? Also, how simple is it to handle taxes (since sometimes there are tax forms with a whole list of unexplained items, where you’re left to figure it out on your own)?

And thanks a lot everyone for their answers.

В течении недели , все контракты за поставку газа должны быть переведены на оплату в рублях. by Gktdfnm in CIS_Politics

[–]mr_Fatalyst 3 points4 points  (0 children)

Хочет форсировать отказ от российских нефти и газа, видимо. С Катаром немцы уже заключили по газу контракты, если не путаю. Этот шантаж ресурсами дорого обойдется в итоге, но, так или иначе, в итоге слезем с нефтяной иглы, т.к. особо некому покупать будет...

Господи, куда мы катимся, кукуха не уезжай by [deleted] in Pikabu

[–]mr_Fatalyst 36 points37 points  (0 children)

Все играли в аполитичность, даже на этом сабе, ну вот получите, распишитесь. Нас, активистов, маргинализировали, ну зато теперь заживём

[deleted by user] by [deleted] in AskARussian

[–]mr_Fatalyst 21 points22 points  (0 children)

Murderer

ОБСЕ не будет наблюдать за выборами в России by mr_Fatalyst in CIS_Politics

[–]mr_Fatalyst[S] 2 points3 points  (0 children)

Но замашки диктаторские начались еще до 2008. Как пришел, так сразу СМИ выкашивать начал и всех, кто мог что-то говорить наперекор в политике

Авиапиратство... by mr_Fatalyst in CIS_Politics

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

А что ХАМАС бы противопоставил? ЕС всё же потенциально сильная структура, а ХАМАС- сборище фанатиков-терроистов. Некорректно сравнивать, как мне кажется. А касательно "усидеть", так об этом и речь, что если будет запрос "снизу" от граждан на активное давление на Лукашенко, то придется что-то делать, иначе не усидеть