3 // Tests that overflows do not occur in certain situations
4 // related to generic diesel code
8 pub trait HandleDelete<K> {}
10 pub fn handle_delete<D, R>()
13 R::Table: HandleDelete<D> + 'static,
17 impl<K, T> HandleDelete<K> for T
19 T: Table + HasTable<Table = T> + 'static,
21 &'static K: Identifiable<Table = T>,
22 T::PrimaryKey: EqAll<<&'static K as Identifiable>::Id>,
23 T::Query: FilterDsl<<T::PrimaryKey as EqAll<<&'static K as Identifiable>::Id>>::Output>,
24 Filter<T::Query, <T::PrimaryKey as EqAll<<&'static K as Identifiable>::Id>>::Output>:
25 IntoUpdateTarget<Table = T>,
34 pub trait Identifiable: HasTable {
38 pub trait EqAll<Rhs> {
42 pub trait IntoUpdateTarget: HasTable {
53 impl<T: Query> AsQuery for T {
57 pub trait FilterDsl<Predicate> {
61 impl<T, Predicate> FilterDsl<Predicate> for T
64 T::Query: FilterDsl<Predicate>,
66 type Output = Filter<T::Query, Predicate>;
69 pub trait QuerySource {
73 pub trait Table: QuerySource + AsQuery + Sized {
77 pub type Filter<Source, Predicate> = <Source as FilterDsl<Predicate>>::Output;