Static Methodgrdb 7.3.0GRDB

annotated(withOptional:)

Returns a request with the columns of the eventual associated record appended to the record selection.

TableRecord+Association.swift:736
static func annotated<A>(withOptional association: A) -> QueryInterfaceRequest<Self> where Self == A.OriginRowDecoder, A : Association

The record selection is determined by databaseSelection, which defaults to all columns.

For example:

// SELECT player.*, team.color
// FROM player LEFT JOIN team ...
let teamColor = Player.team.select(Column("color"))
let request = Player.annotated(withOptional: teamColor)

See annotated(withOptional:) for more information.