This document describes the stability guarantees for entity-derive and how
semantic versioning is applied to the crate.
This crate follows Semantic Versioning 2.0.0:
- MAJOR (1.0.0 → 2.0.0): Breaking changes to stable APIs
- MINOR (1.0.0 → 1.1.0): New features, backward-compatible
- PATCH (1.0.0 → 1.0.1): Bug fixes, backward-compatible
While the crate is below version 1.0.0:
- MINOR bumps may include breaking changes
- PATCH bumps are always backward-compatible
- Breaking changes are documented in CHANGELOG.md
The following are considered stable and follow semver:
#[derive(Entity)]
#[entity(table = "...", schema = "...", sql = "...", dialect = "...", uuid = "...")]
pub struct Entity {
#[id]
pub id: Uuid,
#[field(create, update, response, skip)]
pub field: T,
#[auto]
pub timestamp: DateTime<Utc>,
}Attribute names and their accepted values are stable. New attributes may be added in minor versions but existing attributes will not change behavior.
For an entity User, these type names are stable:
| Type | Name Pattern |
|---|---|
| Create DTO | Create{Name}Request |
| Update DTO | Update{Name}Request |
| Response DTO | {Name}Response |
| Repository trait | {Name}Repository |
| Row struct | {Name}Row |
| Insertable struct | Insertable{Name} |
The following trait methods and their signatures are stable:
trait {Name}Repository: Send + Sync {
type Error: std::error::Error + Send + Sync;
type Pool;
fn pool(&self) -> &Self::Pool;
async fn create(&self, dto: Create{Name}Request) -> Result<{Name}, Self::Error>;
async fn find_by_id(&self, id: IdType) -> Result<Option<{Name}>, Self::Error>;
async fn update(&self, id: IdType, dto: Update{Name}Request) -> Result<{Name}, Self::Error>;
async fn delete(&self, id: IdType) -> Result<bool, Self::Error>;
async fn list(&self, limit: i64, offset: i64) -> Result<Vec<{Name}>, Self::Error>;
}CreateRequestincludes fields marked with#[field(create)]UpdateRequestincludes fields marked with#[field(update)], wrapped inOption<T>Responseincludes fields marked with#[field(response)]and#[id]- All DTOs derive
Debug,Clone,Serialize,Deserialize
These feature flags are stable:
| Flag | Purpose |
|---|---|
postgres |
PostgreSQL support via sqlx |
api |
OpenAPI schema generation (utoipa) |
validate |
Validation derive (validator) |
The following may change without a major version bump:
The exact SQL queries generated are not part of the public API. While they will remain functionally equivalent, the specific query text may change.
Anything under entity::parse is internal and may change. Only re-exported
types in the public API are stable.
These features are planned but not yet implemented:
clickhousedialectmongodbdialect- Relations (
#[belongs_to],#[has_many]) - Soft delete (
#[soft_delete]) - Lifecycle hooks
- Helper structs and their internal fields
- Implementation details of
Fromconversions - Order of generated items
- Removing or renaming attributes
- Changing attribute behavior
- Removing generated types or methods
- Changing method signatures in generated traits
- Removing feature flags
- Adding new attributes
- Adding new methods to generated traits (with default impls)
- Adding new feature flags
- Changing generated SQL (if functionally equivalent)
- Performance improvements
- Bug fixes that correct clearly wrong behavior
- Adding new derive macros to generated types
- Current MSRV: 1.92.0
- MSRV bumps are considered breaking changes pre-1.0
- Post-1.0, MSRV bumps require at least a minor version bump
If you believe a change violated this policy, please open an issue with:
- Version before and after the change
- Code that worked before but broke after
- Expected vs actual behavior
We take backward compatibility seriously and will issue patch releases to fix accidental breakage.