toolu-orm-macros
Procedural macros for toolu-orm. Transforms annotated structs into full ORM entities with schema definitions, type-safe column constants, view types, and row mapping.
Stack
- Proc-macro: syn 2, quote 1, proc-macro2 1
- Schema: toolu-orm-core (TableDef, ColumnDef, ColumnType)
Architecture
src/
├── lib.rs # 3 proc macros: table, FromRow, ColumnEnum
├── column_enum.rs # #[derive(ColumnEnum)] implementation
├── from_row.rs # #[derive(FromRow)] field/attribute parsing
├── from_row_expand.rs # Per-driver row reads + impl_derived_from_row! call
├── paths.rs # Absolute, consumer-resolved crate paths
├── view.rs # #[view] attribute processing
├── parse/
│ ├── column_parsing.rs # Parse #[column(...)] attributes
│ └── index_parsing.rs # Parse #[index] / #[unique_index]
└── expand/
├── schema_expansion.rs # Generate TableSchema impl
└── columns_expansion.rs # Generate Column<T> constants module
Usage
use table;
use *;
// Generated: UserRow::table_def(), UserRow::columns::ID, UserRow::columns::EMAIL, etc.
Development