JoinableRequest

public protocol JoinableRequest : _JoinableRequest

The protocol for all requests that can be associated.

  • The record type that can be associated to.

    In the request below, it is Book:

    let request = Book.all()
    

    In the belongsTo association below, it is Author:

    struct Book: TableRecord {
        // BelongsToAssociation<Book, Author>
        static let author = belongsTo(Author.self)
    }
    

    Declaration

    Swift

    associatedtype RowDecoder

JoinableRequest

  • including(all:) Extension method

    Creates a request that prefetches an association.

    Declaration

    Swift

    public func including<A>(all association: A) -> Self where A : AssociationToMany, Self.RowDecoder == A.OriginRowDecoder
  • including(optional:) Extension method

    Creates a request that includes an association. The columns of the associated record are selected. The returned request does not require that the associated database table contains a matching row.

    Declaration

    Swift

    public func including<A>(optional association: A) -> Self where A : Association, Self.RowDecoder == A.OriginRowDecoder
  • including(required:) Extension method

    Creates a request that includes an association. The columns of the associated record are selected. The returned request requires that the associated database table contains a matching row.

    Declaration

    Swift

    public func including<A>(required association: A) -> Self where A : Association, Self.RowDecoder == A.OriginRowDecoder
  • joining(optional:) Extension method

    Creates a request that joins an association. The columns of the associated record are not selected. The returned request does not require that the associated database table contains a matching row.

    Declaration

    Swift

    public func joining<A>(optional association: A) -> Self where A : Association, Self.RowDecoder == A.OriginRowDecoder
  • joining(required:) Extension method

    Creates a request that joins an association. The columns of the associated record are not selected. The returned request requires that the associated database table contains a matching row.

    Declaration

    Swift

    public func joining<A>(required association: A) -> Self where A : Association, Self.RowDecoder == A.OriginRowDecoder