Skip to content

Commit 022df89

Browse files
authored
Add primary associated type to PrimaryKeyedTable. (#69)
1 parent 79ac5f5 commit 022df89

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Sources/StructuredQueriesCore/PrimaryKeyed.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
/// A type representing a database table with a primary key.
2-
public protocol PrimaryKeyedTable: Table where TableColumns: PrimaryKeyedTableDefinition {
2+
public protocol PrimaryKeyedTable<PrimaryKey>: Table where TableColumns: PrimaryKeyedTableDefinition<PrimaryKey> {
3+
/// A type representing this table's primary key.
4+
///
5+
/// For auto-incrementing tables, this is typically `Int`.
6+
associatedtype PrimaryKey: QueryBindable
7+
where PrimaryKey.QueryValue == PrimaryKey, PrimaryKey.QueryValue.QueryOutput: Sendable
8+
39
/// A type that represents this type, but with an optional primary key.
410
///
511
/// This type can be used to stage an inserted row.

0 commit comments

Comments
 (0)