Skip to content

Instance Method

primaryKey(_:named:)

Add a PRIMARY KEY constraint to the table.
@discardableResult func primaryKey(_ columns: String..., named constraintName: String? = nil) -> Self

Parameters

columns

One or more columns to include in the primary key.

constraintName

An optional name to give the constraint.