diff --git a/Sources/StructuredQueriesCore/Documentation.docc/Extensions/PrimaryKeyedTable.md b/Sources/StructuredQueriesCore/Documentation.docc/Extensions/PrimaryKeyedTable.md index 6ee36f85..150077f9 100644 --- a/Sources/StructuredQueriesCore/Documentation.docc/Extensions/PrimaryKeyedTable.md +++ b/Sources/StructuredQueriesCore/Documentation.docc/Extensions/PrimaryKeyedTable.md @@ -125,6 +125,11 @@ Reminder.delete(reminder) ## Topics +### Primary keys + +- ``PrimaryKey`` +- ``primaryKey-swift.property`` + ### Drafts - ``Draft`` diff --git a/Sources/StructuredQueriesCore/PrimaryKeyed.swift b/Sources/StructuredQueriesCore/PrimaryKeyed.swift index 847d91ee..4ae92ecc 100644 --- a/Sources/StructuredQueriesCore/PrimaryKeyed.swift +++ b/Sources/StructuredQueriesCore/PrimaryKeyed.swift @@ -86,6 +86,10 @@ extension PrimaryKeyedTable { ) -> Where { Self.where { $0.primaryKey.eq(primaryKey) } } + + public var primaryKey: PrimaryKey.QueryOutput { + self[keyPath: Self.columns.primaryKey.keyPath] + } } extension TableDraft {