Expand description
Model traits for Ferro ORM
Provides Laravel-like active record pattern over SeaORM entities.
§Scoped Queries
Use the ScopedQuery trait to define reusable query scopes:
ⓘ
impl ScopedQuery for animals::Entity {
type Scope = AnimalScope;
}
enum AnimalScope {
ForShelter(i64),
Available,
Species(String),
}
// Usage:
let animals = Animal::scoped(AnimalScope::ForShelter(shelter_id))
.and(AnimalScope::Available)
.all()
.await?;Macros§
- define_
scopes - Macro to define scopes for an entity
Structs§
- Scoped
Query Builder - Query builder with scopes applied
Traits§
- Model
- Trait providing Laravel-like read operations on SeaORM entities
- Model
Mut - Trait providing Laravel-like write operations on SeaORM entities
- Scope
- A scope that can be applied to a query
- Scoped
Query - Trait for defining reusable query scopes on entities