Ryx ORM
Django-style Python ORM. Powered by Rust.
Ergonomic query API. Async-native. Zero GIL blocking. Compiled performance.
v0.1.0Python 3.10+PostgreSQLMySQLSQLite
import ryx
from ryx import Model, CharField, IntField, Q, Count, Sum
class Post(Model):
title = CharField(max_length=200)
views = IntField(default=0)
active = BooleanField(default=True)
await ryx.setup("postgres://user:pass@localhost/mydb")
posts = await (
Post.objects
.filter(Q(active=True) | Q(views__gte=1000))
.exclude(title__startswith="Draft")
.order_by("-views")
.limit(20)
)
Why Ryx
| Django ORM | SQLAlchemy | Ryx | |
|---|---|---|---|
| API | Ergonomic | Verbose | Ergonomic |
| Runtime | Sync Python | Async Python | Async Rust |
| GIL blocking | Yes | Yes | Zero |
| Backends | All | All | PG · MySQL · SQLite |
| Migrations | Built-in | Alembic | Built-in |
Features
⚡
Rust Performance
Queries compiled and executed in Rust. Zero Python event-loop blocking.
🐍
Django-like API
Familiar .filter(), Q objects, aggregations, and relationships.
🔗
Relationships
ForeignKey, OneToOne, ManyToMany with select_related and prefetch_related.
📊
Aggregations
Count, Sum, Avg, Min, Max with GROUP BY and HAVING support.
🔄
Transactions
Async context managers with nested savepoints and auto-rollback.
🚀
Migrations
Auto-detect schema changes, generate and apply — no manual SQL.
🔍
30+ Field Types
From AutoField to JSONField, with built-in validation.
📡
Signals & Hooks
Observer pattern with pre/post save, delete, update lifecycle events.
Architecture
Quick Start
pip install maturin
maturin develop # compile Rust + install
import asyncio, ryx
from ryx import Model, CharField
class Article(Model):
title = CharField(max_length=200)
async def main():
await ryx.setup("sqlite:///app.db")
await ryx.migrate([Article])
await Article.objects.create(title="Hello Ryx")
print(await Article.objects.all())
asyncio.run(main())
What's Next
- Installation — Set up Ryx in your project
- Quick Start — Write your first queries in 5 minutes
- Core Concepts — Deep dive into models, fields, and migrations
- Querying — Master the QuerySet API