Skip to content

jagadeesh32/chakra-orm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chakra ORM

Rust-Powered Database Velocity

The first cross-language ORM that combines Rust performance with Python elegance.

Python Rust License

Features

  • Blazing Fast — Rust core handles query building, SQL generation, and connection pooling
  • Cross-Language — First-class Python and Rust support with feature parity
  • Async Native — Built for async from day one, with sync convenience wrappers
  • Type Safe — Compile-time validation in Rust, runtime + type hints in Python
  • Auto Migrations — Django-quality migrations without the framework lock-in
  • Database Agnostic — PostgreSQL, MySQL, SQLite, Oracle with unified API

Installation

Python

pip install chakra-orm

Rust

[dependencies]
chakra = "0.1"

Quick Example

Python

from chakra import Model, Field, String, Integer, Session

class User(Model):
    __tablename__ = "users"

    id = Field(Integer, primary_key=True)
    name = Field(String(100))
    email = Field(String(255), unique=True)

async with Session() as session:
    # Create
    user = User(name="Alice", email="alice@example.com")
    session.add(user)
    await session.commit()

    # Query
    users = await User.objects.filter(name__startswith="A").all()

Rust

use chakra::prelude::*;

#[derive(Model)]
#[chakra(table = "users")]
struct User {
    #[chakra(primary_key)]
    id: i64,
    name: String,
    #[chakra(unique)]
    email: String,
}

let pool = chakra::connect("postgresql://localhost/db").await?;

// Create
let mut user = User { id: 0, name: "Alice".into(), email: "alice@example.com".into() };
user.insert(&pool).await?;

// Query
let users = User::query()
    .filter(User::name().starts_with("A"))
    .all(&pool)
    .await?;

Documentation

Full documentation is available at https://chakra-orm.dev

Building the Docs

# Install dependencies
pip install mkdocs-material mkdocs-minify-plugin mkdocs-git-revision-date-localized-plugin

# Serve locally
mkdocs serve

# Build
mkdocs build

Contributing

Contributions are welcome! Please read our Contributing Guide for details.

License

MIT License - see LICENSE for details.


Chakra ORM — Where Performance Meets Elegance

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages