Crate rustling_derive

Crate rustling_derive 

Source
Expand description

§rustling-derive ⚙️

Procedural macros for automatic repository generation in the Rustling ORM ecosystem.

This crate provides convenient #[derive(...)] macros that automatically implement repository and entity patterns for MongoDB and PostgreSQL.

§✨ Available Macros

  • #[derive(Repository)] — derive a PostgreSQL repository implementation
  • #[derive(MongoRepository)] — derive a MongoDB repository implementation
  • #[derive(Entity)] — derive helper methods for SQL entities (columns & values)

§💡 Example

use rustling_derive::{Entity, Repository};

#[derive(Entity)]
struct User {
    id: i32,
    name: String,
    email: String,
}

#[derive(Repository)]
#[entity(User)]
#[id(i32)]
#[table("users")]
struct UserRepository;

See the crate README for setup instructions.

Derive Macros§

Entity