6 releases
| 0.1.7 | Aug 28, 2025 |
|---|---|
| 0.1.6 | Aug 28, 2025 |
#5 in #storeit
155 downloads per month
Used in 3 crates
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 defaultRowAdapterimplementation for it to be used in a repository.#[repository(...)]: An attribute macro that generates a complete, asynchronous repository module for an entity.
storeit_macros
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:
- Workspace README and examples: https://github.com/dahankzter/storeit-rs#readme
MSRV: 1.70 License: MIT OR Apache-2.0
Dependencies
~1–1.8MB
~32K SLoC