Static Methodgrdb 7.3.0GRDB

annotated(with:)

Returns a request with the provided result columns appended to the record selection.

TableRecord+QueryInterfaceRequest.swift:318
static func annotated(with selection: any SQLSelectable...) -> QueryInterfaceRequest<Self>

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

For example:

struct Player: TableRecord { }

// SELECT *, score + bonus AS totalScore FROM player
let totalScore = (Column("score") + Column("bonus")).forKey("totalScore")
let request = Player.annotated(with: totalScore)