6 releases

0.1.7 Aug 28, 2025
0.1.6 Aug 28, 2025

#5 in #storeit

Download history 20/week @ 2025-09-03 15/week @ 2025-09-10 3/week @ 2025-09-17 8/week @ 2025-09-24 21/week @ 2025-10-01 14/week @ 2025-10-15 11/week @ 2025-10-22

155 downloads per month
Used in 3 crates

MIT/Apache

34KB
623 lines

Procedural macros for the storeit-rs repository library.

This crate provides two main macros:

  • #[derive(Entity)]: A derive macro that inspects a struct and generates all the necessary metadata and a default RowAdapter implementation for it to be used in a repository.
  • #[repository(...)]: An attribute macro that generates a complete, asynchronous repository module for an entity.

storeit_macros

Crates.io Docs.rs

Procedural macros for the storeit repository framework.

What it provides:

  • #[derive(Entity)]: generates compile-time metadata (table, columns) for your struct and can optionally generate backend-specific RowAdapter impls.
  • #[repository] macro: generate a typed repository module for a specific backend and entity.

Quick example (see the workspace README for full examples):

use storeit::Entity;

#[derive(Entity, Clone, Debug)]
pub struct User {
    #[fetch(id)]
    pub id: Option<i64>,
    pub email: String,
    pub active: bool,
}

These macros are used by the top-level storeit facade; most users will only import from storeit.

Links:

MSRV: 1.70 License: MIT OR Apache-2.0

Dependencies

~1–1.8MB
~32K SLoC