| Crates.io | premix-macros |
| lib.rs | premix-macros |
| version | 1.0.6-alpha |
| created_at | 2026-01-17 17:57:18.934086+00 |
| updated_at | 2026-01-20 20:32:32.42812+00 |
| description | Proc-macros for Premix ORM. |
| homepage | |
| repository | https://github.com/premix-labs/premix-orm |
| max_upload_size | |
| id | 2050866 |
| size | 67,980 |
Procedural macros for Premix ORM.
This crate provides the #[derive(Model)] macro, which automatically implements CRUD logic and database mapping for your Rust structs.
This crate is part of a research prototype. APIs may change and production use is not recommended yet.
Most users should add premix-orm instead. If you use premix-macros
directly, you still need premix-orm because the generated code references it.
[dependencies]
premix-orm = "1.0.6-alpha"
premix-macros = "1.0.6-alpha"
use premix_macros::Model;
use serde::{Deserialize, Serialize};
#[derive(Model, Debug, Serialize, Deserialize)]
pub struct User {
pub id: i32,
pub name: String,
pub email: String,
}
This derives:
table_name()save() (Create/Insert)find_by_id()update()delete()has_many, belongs_to)This project is licensed under the MIT license.