Expand description
Fletch persistence adapter for the Aro web framework.
This crate implements the persistence ports defined in aro-core
using fletch (SQLx-based) as the underlying database layer.
Commonly needed fletch types are re-exported so downstream crates
do not need fletch as a direct dependency for basic use.
§Multi-database support
Enable a database backend via Cargo features (sqlite, postgres, mysql).
Types are generic over sqlx::Database; pass the backend type to
AppDatabaseExt::database and construct FletchRepository from a
matching fletch_orm::Pool.
§Transaction-scoped repositories
Use FletchTransactionManager::transaction with a
FletchTransactionContext to obtain FletchTransactionalRepository
instances whose writes participate in the open transaction.
Re-exports§
pub use database::AppDatabaseExt;pub use query::EntityQuery;pub use repo::FletchDatabase;pub use repo::FletchEntity;pub use repo::FletchRepository;pub use repo::FletchTransactionalRepository;pub use transaction::FletchTransactionContext;pub use transaction::FletchTransactionManager;pub use fletch_orm;
Modules§
- database
- Extension trait for registering a fletch database connection with
App. - error
- Error conversion from fletch errors to aro-core domain errors.
- prelude
- Convenience re-exports for typical fletch-backed persistence development.
- query
- Query and pagination adapters for
FletchRepository. - repo
- Generic fletch-backed repository adapter.
- transaction
- Fletch transaction manager adapter.
Structs§
- Column
- A column in a database table.
- Page
- A page of results returned from a repository query.
- Page
Request - A request for a specific page of results.
- Pool
- A connection pool wrapping
sqlx::Pool. - Pool
Builder - Builder for configuring a
Poolbefore connecting. - Pool
Config - Declarative pool configuration.
- Transaction
- A database transaction with auto-rollback on drop.
Enums§
- Column
Type - The data type of a column.
- Fletch
Error - Errors that can occur during database operations.
- Value
- A dynamically-typed database value used for bind parameters.
Traits§
- Entity
- Describes the schema of a database-backed entity.
- FromRow
- A record that can be built from a row returned by the database.
- Paginatable
- Trait for repositories that support paginated queries over all rows.
- Queryable
- Trait for repositories that support filtered and sorted queries.
- Repository
- Core CRUD repository trait for a given entity type.