Skip to main content

ExperimentChangeRepository

Trait ExperimentChangeRepository 

Source
pub trait ExperimentChangeRepository: Send + Sync {
Show 14 methods // Required methods fn find_by_id( &self, id: i64, ) -> impl Future<Output = AutumnResult<Option<ExperimentChange>>> + Send; fn find_all( &self, ) -> impl Future<Output = AutumnResult<Vec<ExperimentChange>>> + Send; fn save( &self, new: &NewExperimentChange, ) -> impl Future<Output = AutumnResult<ExperimentChange>> + Send; fn update( &self, id: i64, changes: &UpdateExperimentChange, ) -> impl Future<Output = AutumnResult<ExperimentChange>> + Send; fn delete_by_id( &self, id: i64, ) -> impl Future<Output = AutumnResult<()>> + Send; fn count(&self) -> impl Future<Output = AutumnResult<i64>> + Send; fn exists_by_id( &self, id: i64, ) -> impl Future<Output = AutumnResult<bool>> + Send; fn page( &self, req: &PageRequest, ) -> impl Future<Output = AutumnResult<Page<ExperimentChange>>> + Send; fn list( &self, query: &ListQuery, req: &PageRequest, ) -> impl Future<Output = AutumnResult<Page<ExperimentChange>>> + Send; fn save_many( &self, new: &[NewExperimentChange], ) -> impl Future<Output = AutumnResult<Vec<ExperimentChange>>> + Send; fn save_many_skip_invalid( &self, new: &[NewExperimentChange], ) -> impl Future<Output = AutumnResult<(Vec<ExperimentChange>, Vec<(usize, AutumnError)>)>> + Send; fn update_many( &self, ids: &[i64], changes: &UpdateExperimentChange, ) -> impl Future<Output = AutumnResult<Vec<ExperimentChange>>> + Send; fn delete_many( &self, ids: &[i64], ) -> impl Future<Output = AutumnResult<()>> + Send; fn upsert_many( &self, records: &[ExperimentChange], ) -> impl Future<Output = AutumnResult<Vec<ExperimentChange>>> + Send where ExperimentChange: Insertable<table>;
}
Expand description

Generated repository trait with CRUD + derived queries.

Required Methods§

Source

fn find_by_id( &self, id: i64, ) -> impl Future<Output = AutumnResult<Option<ExperimentChange>>> + Send

Source

fn find_all( &self, ) -> impl Future<Output = AutumnResult<Vec<ExperimentChange>>> + Send

Source

fn save( &self, new: &NewExperimentChange, ) -> impl Future<Output = AutumnResult<ExperimentChange>> + Send

Source

fn update( &self, id: i64, changes: &UpdateExperimentChange, ) -> impl Future<Output = AutumnResult<ExperimentChange>> + Send

Source

fn delete_by_id(&self, id: i64) -> impl Future<Output = AutumnResult<()>> + Send

Source

fn count(&self) -> impl Future<Output = AutumnResult<i64>> + Send

Source

fn exists_by_id( &self, id: i64, ) -> impl Future<Output = AutumnResult<bool>> + Send

Source

fn page( &self, req: &PageRequest, ) -> impl Future<Output = AutumnResult<Page<ExperimentChange>>> + Send

Fetch one page of records using offset pagination.

Accepts a ::autumn_web::pagination::PageRequest extractor value and returns a ::autumn_web::pagination::Page containing the items together with total-elements / total-pages metadata.

Source

fn list( &self, query: &ListQuery, req: &PageRequest, ) -> impl Future<Output = AutumnResult<Page<ExperimentChange>>> + Send

Fetch one page of records applying allowlisted sort + equality filters from a ::autumn_web::pagination::ListQuery, with offset pagination from a ::autumn_web::pagination::PageRequest.

Only the model’s own columns are sortable, and only its non-null String/integer/bool columns are filterable; any other requested key is silently ignored (never interpolated into SQL). An empty or unknown sort falls back to primary-key-descending order.

Source

fn save_many( &self, new: &[NewExperimentChange], ) -> impl Future<Output = AutumnResult<Vec<ExperimentChange>>> + Send

Source

fn save_many_skip_invalid( &self, new: &[NewExperimentChange], ) -> impl Future<Output = AutumnResult<(Vec<ExperimentChange>, Vec<(usize, AutumnError)>)>> + Send

Source

fn update_many( &self, ids: &[i64], changes: &UpdateExperimentChange, ) -> impl Future<Output = AutumnResult<Vec<ExperimentChange>>> + Send

Source

fn delete_many( &self, ids: &[i64], ) -> impl Future<Output = AutumnResult<()>> + Send

Bulk-delete the given ids in one statement.

#1740: dependent(...) cascade actions DO apply on this bulk path. On a repository that declares dependent(...), delete_many runs the same destroy/delete_all/nullify/restrict cascade the single-record delete_by_id/destroy runs — restrict probes first (a typed 409 rolls the whole transaction back), then children, then the bulk parent delete, all in one transaction — so no child is orphaned. Children are cascaded per affected parent row (so destroy recurses into grandchildren, #1739); set-based bulk child mutations are a possible future refinement. Repositories with no dependents keep the plain bulk delete unchanged.

Source

fn upsert_many( &self, records: &[ExperimentChange], ) -> impl Future<Output = AutumnResult<Vec<ExperimentChange>>> + Send

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§