Skip to main content

Ryx ORM

Django-style ORM for Python and Rust. Powered by a shared Rust SQL engine.
Async-native Python API, Rust-native API, compiled query planning, and sqlx-backed execution.

v0.1.xPython 3.10+PostgreSQLMySQLSQLite
import ryx
from ryx import Model, BooleanField, CharField, IntField, Q

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 ORMSQLAlchemyRyx
APIErgonomicVerboseErgonomic
RuntimeSync PythonAsync PythonAsync Python + Rust execution
Query enginePythonPythonRust compiler + sqlx backend
BackendsAllAllPG ยท MySQL ยท SQLite
MigrationsBuilt-inAlembicBuilt-in

Featuresโ€‹

Architectureโ€‹

Ryx ORM Architecture

Quick Startโ€‹

pip install ryx
import asyncio, ryx
from ryx import Model, CharField
from ryx.migrations import MigrationRunner

class Article(Model):
title = CharField(max_length=200)

async def main():
await ryx.setup("sqlite:///app.db")
await MigrationRunner([Article]).migrate()
await Article.objects.create(title="Hello Ryx")
print(await Article.objects.all())

asyncio.run(main())

What's Nextโ€‹