     /// associated record are selected. The returned association requires
     /// that the associated database table contains a matching row.
     public func including<A: Association>(required association: A) -> Self where A.OriginRowDecoder == RowDecoder {
-        return mapRelation {
+        return mapDestinationRelation {
             $0.including(required: association.sqlAssociation)
         }
     }

    /// associated record are not selected. The returned association requires
    /// that the associated database table contains a matching row.
    public func joining<A: Association>(required association: A) -> Self where A.OriginRowDecoder == RowDecoder {
        return mapRelation {
            $0.joining(required: association.sqlAssociation)
        }
    }

    /// associated record are not selected. The returned relation does not
    /// require that the associated database table contains a matching row.
    func joining(optional sqlAssociation: SQLAssociation) -> SQLRelation {
        return sqlAssociation.mapDestinationRelation { $0.select([]) }.extendedRelation(self, kind: .oneOptional)
    }
    
    /// Creates an relation that joins another one. The columns of the
    /// associated record are not selected. The returned relation requires
    /// that the associated database table contains a matching row.
    func joining(required sqlAssociation: SQLAssociation) -> SQLRelation {
        return sqlAssociation.mapDestinationRelation { $0.select([]) }.extendedRelation(self, kind: .oneRequired)
    }
}

extension Association {
    /// Creates an association that prefetches another one.
    public func including<A: AssociationToMany>(all association: A) -> Self where A.OriginRowDecoder == RowDecoder {
        return mapDestinationRelation {
            $0.including(all: association.sqlAssociation)
        }
    }
