docs.rs failed to build entity-derive-0.3.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
entity-derive-0.5.0
The Problem
Building a typical CRUD application requires writing the same boilerplate over and over: entity struct, create DTO, update DTO, response DTO, row struct, repository trait, SQL implementation, and 6+ From implementations.
That's 200+ lines of boilerplate for a single entity.
The Solution
Done. The macro generates everything else.
Installation
[]
= { = "0.3", = ["postgres"] }
Features
| Feature | Description |
|---|---|
| Zero Runtime Cost | All code generation at compile time |
| Type Safe | Change a field once, everything updates |
| Query Filtering | Type-safe #[filter], #[filter(like)], #[filter(range)] |
| Relations | #[belongs_to] and #[has_many] |
| Projections | Partial views with optimized SELECT |
| Lifecycle Events | Created, Updated, Deleted events |
| Real-Time Streams | Postgres LISTEN/NOTIFY integration |
| Lifecycle Hooks | before_create, after_update, etc. |
| CQRS Commands | Business-oriented command pattern |
| Soft Delete | deleted_at timestamp support |
Documentation
| Topic | Languages |
|---|---|
| Getting Started | |
| Attributes | 🇬🇧 🇷🇺 🇰🇷 🇪🇸 🇨🇳 |
| Examples | 🇬🇧 🇷🇺 🇰🇷 🇪🇸 🇨🇳 |
| Features | |
| Filtering | 🇬🇧 🇷🇺 🇰🇷 🇪🇸 🇨🇳 |
| Relations | 🇬🇧 🇷🇺 🇰🇷 🇪🇸 🇨🇳 |
| Events | 🇬🇧 🇷🇺 🇰🇷 🇪🇸 🇨🇳 |
| Streams | 🇬🇧 🇷🇺 🇰🇷 🇪🇸 🇨🇳 |
| Hooks | 🇬🇧 🇷🇺 🇰🇷 🇪🇸 🇨🇳 |
| Commands | 🇬🇧 🇷🇺 🇰🇷 🇪🇸 🇨🇳 |
| Advanced | |
| Custom SQL | 🇬🇧 🇷🇺 🇰🇷 🇪🇸 🇨🇳 |
| Web Frameworks | 🇬🇧 🇷🇺 🇰🇷 🇪🇸 🇨🇳 |
| Best Practices | 🇬🇧 🇷🇺 🇰🇷 🇪🇸 🇨🇳 |
Quick Reference
Entity Attributes
Field Attributes
// Primary key (auto-generated UUID)
// Auto-generated (timestamps)
// Include in CreateRequest
// Include in UpdateRequest
// Include in Response
// Exclude from all DTOs
// Exact match filter
// ILIKE pattern filter
// Range filter (from/to)
// Foreign key relation
// One-to-many relation
// Partial view