graphql-codegen-rust 0.1.0

Generate Rust ORM code from GraphQL schemas
Documentation

GraphQL Rust Codegen

The missing piece for offline-first applications 🚀

CI codecov Crates.io Docs.rs

Rust License PRs Welcome

A powerful Rust CLI tool that transforms GraphQL schemas into production-ready database code. Built specifically for developers creating offline-first applications with Tauri, it bridges the gap between GraphQL APIs and local data persistence.

📦 Installation

From Crates.io (Recommended)

cargo install graphql-codegen-rust

From Source

git clone https://github.com/michakfromparis/graphql-codegen-rust.git
cd graphql-codegen-rust
cargo build --release

🚀 Quick Start

# Initialize your project
graphql-codegen-rust init \
  --url https://api.example.com/graphql \
  --orm diesel \
  --db sqlite \
  --output ./src/db

That's it! You'll get:

  • Database entities with proper Rust types
  • Migration files for schema setup
  • Relationship mappings for foreign keys
  • Type-safe ORM code ready for production

📚 Documentation

✨ Key Features

  • 🔍 Dual Schema Support: GraphQL introspection + SDL file parsing
  • 🗄️ Multi-ORM Ready: Diesel and Sea-ORM support out of the box
  • 💾 Database Agnostic: SQLite, PostgreSQL, and MySQL
  • 🔄 Migration Generation: Automatic SQL migration files
  • 🔗 Smart Relationships: Foreign key detection and ORM relationships
  • 🎯 Type Safety: Compile-time guarantees for your data layer
  • ⚡ Performance: Native Rust speed with zero runtime overhead
  • 🔧 Tauri Native: Seamless desktop app integration

🎯 Perfect For

  • Offline-first Tauri applications
  • Local data synchronization workflows
  • Type-safe database layer generation
  • Rapid GraphQL-to-SQL prototyping
  • Enterprise data persistence needs

Ready to build offline-first apps with confidence? Dive into the Getting Started guide.

📄 License

MIT License - see LICENSE for details.