Static Methodgrdb 7.3.0GRDB

belongsTo(_:key:using:)

Creates a BelongsToAssociation between Self and the destination Table.

TableRecord+Association.swift:238
static func belongsTo<Destination>(_ destination: Table<Destination>, key: String? = nil, using foreignKey: ForeignKey? = nil) -> BelongsToAssociation<Self, Destination>

Parameters

destination

The table at the other side of the association.

key

The association key. By default, it is destination.tableName.

foreignKey

An eventual foreign key. You need to provide one when no foreign key exists to the destination table, or several foreign keys exist.

For more information, see belongsTo(_:key:using:).