Expand description
Procedural macros for SQLModel Rust.
sqlmodel-macros is the compile-time codegen layer. It turns Rust structs into
fully described SQL models by generating static metadata and trait implementations.
§Role In The Architecture
- Model metadata:
#[derive(Model)]produces aModelimplementation with table/column metadata consumed by query, schema, and session layers. - Validation:
#[derive(Validate)]generates field validation glue. - Schema export:
#[derive(JsonSchema)]enables JSON schema generation for API documentation or tooling.
These macros are used by application crates via the sqlmodel facade.
Attribute Macros§
- query
- Attribute macro for defining SQL functions in handlers.