Skip to content

Georm 0.1.0 — A new journey begins!

Choose a tag to compare

@Phundrak Phundrak released this 10 Jun 10:38
· 15 commits to main since this release
d82f9fe

We're excited to announce the first release of Georm, a simple and type-safe ORM for PostgreSQL built on top of SQLx! 🎉

What is Georm?

Georm is a lightweight, opinionated Object-Relational Mapping (ORM) library that provides a clean, type-safe interface for common database operations. It leverages SQLx's compile-time query verification to ensure your database interactions are both safe and efficient.

Features in 0.1.0

✅ Core CRUD Operations

  • Complete Georm trait implementation with all essential database operations:
  • find_all() — Query all records
  • find() — Find by ID
  • create() — Insert new records
  • update() — Update existing records
  • delete() — Remove records
  • delete_by_id() — Remove by ID

✅ Relationship Support

  • Local One-to-One Relationships: When your struct has a foreign key field, Georm automatically generates getter methods to fetch the related entity
  • One-to-Many Relationships: Full support for querying related entities where the foreign key exists in the related table
  • Many-to-Many Relationships: Complete support for complex relationships through junction tables

✅ Type Safety & Performance

  • Compile-time SQL verification using SQLx macros
  • Zero runtime overhead — no reflection or dynamic query building
  • Simple derive macros for easy entity definition

✅ PostgreSQL Native

  • Built specifically for PostgreSQL with full support for its data types
  • Leverages PostgreSQL-specific features and optimizations

Basic Usage

use georm::Georm;

#[derive(Georm)]
#[georm(table = "users")]
pub struct User {
    #[georm(id)]
    pub id: i32,
    pub name: String,
    pub email: String,
}

// All these methods are now available:
let users = User::find_all(&pool).await?;
let user = User::find(&pool, &1).await?;
let new_user = user.create(&pool).await?;

What's Included

  • Comprehensive test suite covering all relationship types
  • CI/CD pipeline with automated testing and quality checks
  • Developer tooling with Nix flakes for reproducible development environment
  • Complete documentation with examples and API reference

Getting Started

Add Georm to your Cargo.toml:

[dependencies]
georm = "0.1.0"
sqlx = { version = "0.8", features = ["runtime-tokio-rustls", "postgres", "macros"] }

Have a look at our README for detailed examples and usage instructions.

What's Next?

This initial release provides a solid foundation for PostgreSQL ORM operations. Future releases will focus on:

  • Remote one-to-one relationships
  • Enhanced relationship querying capabilities
  • Performance optimizations
  • Extended PostgreSQL feature support

Acknowledgments

Built on the excellent SQLx library, Georm aims to provide a simple yet powerful ORM experience for Rust developers working with PostgreSQL.


Full Changelog: https://github.com/Phundrak/georm/commits/0.1.0