@@ -18,6 +18,8 @@ public protocol TableDraft: Table {
1818 /// A type that represents the table with a primary key.
1919 associatedtype PrimaryTable : PrimaryKeyedTable where PrimaryTable. Draft == Self
2020
21+ typealias PrimaryKey = PrimaryTable . PrimaryKey
22+
2123 /// Creates a draft from a primary keyed table.
2224 init ( _ primaryTable: PrimaryTable )
2325}
@@ -88,7 +90,7 @@ extension PrimaryKeyedTable {
8890 /// - Parameter primaryKey: A primary key identifying a table row.
8991 /// - Returns: A `WHERE` clause.
9092 public static func find(
91- _ primaryKey: some QueryExpression < TableColumns . PrimaryKey >
93+ _ primaryKey: some QueryExpression < PrimaryKey >
9294 ) -> Where < Self > {
9395 find ( [ primaryKey] )
9496 }
@@ -98,7 +100,7 @@ extension PrimaryKeyedTable {
98100 /// - Parameter primaryKey: Primary keys identifying table rows.
99101 /// - Returns: A `WHERE` clause.
100102 public static func find(
101- _ primaryKeys: some Sequence < some QueryExpression < TableColumns . PrimaryKey > >
103+ _ primaryKeys: some Sequence < some QueryExpression < PrimaryKey > >
102104 ) -> Where < Self > {
103105 Self . where { $0. primaryKey. in ( primaryKeys) }
104106 }
@@ -114,7 +116,7 @@ extension TableDraft {
114116 /// - Parameter primaryKey: A primary key identifying a table row.
115117 /// - Returns: A `WHERE` clause.
116118 public static func find(
117- _ primaryKey: some QueryExpression < PrimaryTable . TableColumns . PrimaryKey >
119+ _ primaryKey: some QueryExpression < PrimaryKey >
118120 ) -> Where < Self > {
119121 find ( [ primaryKey] )
120122 }
@@ -124,7 +126,7 @@ extension TableDraft {
124126 /// - Parameter primaryKeys: Primary keys identifying table rows.
125127 /// - Returns: A `WHERE` clause.
126128 public static func find(
127- _ primaryKeys: some Sequence < some QueryExpression < PrimaryTable . TableColumns . PrimaryKey > >
129+ _ primaryKeys: some Sequence < some QueryExpression < PrimaryKey > >
128130 ) -> Where < Self > {
129131 Self . where { $0. primaryKey. in ( primaryKeys) }
130132 }
@@ -135,7 +137,7 @@ extension Where where From: PrimaryKeyedTable {
135137 ///
136138 /// - Parameter primaryKey: A primary key.
137139 /// - Returns: A where clause with the added primary key.
138- public func find( _ primaryKey: some QueryExpression < From . TableColumns . PrimaryKey > ) -> Self {
140+ public func find( _ primaryKey: some QueryExpression < From . PrimaryKey > ) -> Self {
139141 find ( [ primaryKey] )
140142 }
141143
@@ -144,7 +146,7 @@ extension Where where From: PrimaryKeyedTable {
144146 /// - Parameter primaryKeys: A sequence of primary keys.
145147 /// - Returns: A where clause with the added primary keys condition.
146148 public func find(
147- _ primaryKeys: some Sequence < some QueryExpression < From . TableColumns . PrimaryKey > >
149+ _ primaryKeys: some Sequence < some QueryExpression < From . PrimaryKey > >
148150 ) -> Self {
149151 Self . where { $0. primaryKey. in ( primaryKeys) }
150152 }
@@ -155,7 +157,7 @@ extension Where where From: TableDraft {
155157 ///
156158 /// - Parameter primaryKey: A primary key.
157159 /// - Returns: A where clause with the added primary key.
158- public func find( _ primaryKey: some QueryExpression < From . PrimaryTable . TableColumns . PrimaryKey > )
160+ public func find( _ primaryKey: some QueryExpression < From . PrimaryKey > )
159161 -> Self
160162 {
161163 find ( [ primaryKey] )
@@ -166,7 +168,7 @@ extension Where where From: TableDraft {
166168 /// - Parameter primaryKeys: A sequence of primary keys.
167169 /// - Returns: A where clause with the added primary keys condition.
168170 public func find(
169- _ primaryKeys: some Sequence < some QueryExpression < From . PrimaryTable . TableColumns . PrimaryKey > >
171+ _ primaryKeys: some Sequence < some QueryExpression < From . PrimaryKey > >
170172 ) -> Self {
171173 Self . where { $0. primaryKey. in ( primaryKeys) }
172174 }
@@ -177,7 +179,7 @@ extension Select where From: PrimaryKeyedTable {
177179 ///
178180 /// - Parameter primaryKey: A primary key identifying a table row.
179181 /// - Returns: A select statement filtered by the given key.
180- public func find( _ primaryKey: some QueryExpression < From . TableColumns . PrimaryKey > ) -> Self {
182+ public func find( _ primaryKey: some QueryExpression < From . PrimaryKey > ) -> Self {
181183 and ( From . find ( primaryKey) )
182184 }
183185
@@ -186,7 +188,7 @@ extension Select where From: PrimaryKeyedTable {
186188 /// - Parameter primaryKeys: A sequence of primary keys.
187189 /// - Returns: A select statement filtered by the given keys.
188190 public func find(
189- _ primaryKeys: some Sequence < some QueryExpression < From . TableColumns . PrimaryKey > >
191+ _ primaryKeys: some Sequence < some QueryExpression < From . PrimaryKey > >
190192 ) -> Self {
191193 and ( From . find ( primaryKeys) )
192194 }
@@ -198,7 +200,7 @@ extension Select where From: TableDraft {
198200 /// - Parameter primaryKey: A primary key identifying a table row.
199201 /// - Returns: A select statement filtered by the given key.
200202 public func find(
201- _ primaryKey: some QueryExpression < From . PrimaryTable . TableColumns . PrimaryKey >
203+ _ primaryKey: some QueryExpression < From . PrimaryKey >
202204 ) -> Self {
203205 and ( From . find ( primaryKey) )
204206 }
@@ -208,7 +210,7 @@ extension Select where From: TableDraft {
208210 /// - Parameter primaryKeys: A sequence of primary keys.
209211 /// - Returns: A select statement filtered by the given keys.
210212 public func find(
211- _ primaryKeys: some Sequence < some QueryExpression < From . PrimaryTable . TableColumns . PrimaryKey > >
213+ _ primaryKeys: some Sequence < some QueryExpression < From . PrimaryKey > >
212214 ) -> Self {
213215 and ( From . find ( primaryKeys) )
214216 }
@@ -219,7 +221,7 @@ extension Update where From: PrimaryKeyedTable {
219221 ///
220222 /// - Parameter primaryKey: A primary key identifying a table row.
221223 /// - Returns: An update statement filtered by the given key.
222- public func find( _ primaryKey: some QueryExpression < From . TableColumns . PrimaryKey > ) -> Self {
224+ public func find( _ primaryKey: some QueryExpression < From . PrimaryKey > ) -> Self {
223225 find ( [ primaryKey] )
224226 }
225227
@@ -228,7 +230,7 @@ extension Update where From: PrimaryKeyedTable {
228230 /// - Parameter primaryKeys: A sequence of primary keys.
229231 /// - Returns: An update statement filtered by the given keys.
230232 public func find(
231- _ primaryKeys: some Sequence < some QueryExpression < From . TableColumns . PrimaryKey > >
233+ _ primaryKeys: some Sequence < some QueryExpression < From . PrimaryKey > >
232234 ) -> Self {
233235 self . where { $0. primaryKey. in ( primaryKeys) }
234236 }
@@ -239,7 +241,7 @@ extension Update where From: TableDraft {
239241 ///
240242 /// - Parameter primaryKey: A primary key identifying a table row.
241243 /// - Returns: An update statement filtered by the given key.
242- public func find( _ primaryKey: some QueryExpression < From . PrimaryTable . TableColumns . PrimaryKey > )
244+ public func find( _ primaryKey: some QueryExpression < From . PrimaryKey > )
243245 -> Self
244246 {
245247 find ( [ primaryKey] )
@@ -250,7 +252,7 @@ extension Update where From: TableDraft {
250252 /// - Parameter primaryKeys: A sequence of primary keys.
251253 /// - Returns: An update statement filtered by the given keys.
252254 public func find(
253- _ primaryKeys: some Sequence < some QueryExpression < From . PrimaryTable . TableColumns . PrimaryKey > >
255+ _ primaryKeys: some Sequence < some QueryExpression < From . PrimaryKey > >
254256 ) -> Self {
255257 self . where { $0. primaryKey. in ( primaryKeys) }
256258 }
@@ -261,7 +263,7 @@ extension Delete where From: PrimaryKeyedTable {
261263 ///
262264 /// - Parameter primaryKey: A primary key identifying a table row.
263265 /// - Returns: A delete statement filtered by the given key.
264- public func find( _ primaryKey: some QueryExpression < From . TableColumns . PrimaryKey > ) -> Self {
266+ public func find( _ primaryKey: some QueryExpression < From . PrimaryKey > ) -> Self {
265267 find ( [ primaryKey] )
266268 }
267269
@@ -270,7 +272,7 @@ extension Delete where From: PrimaryKeyedTable {
270272 /// - Parameter primaryKeys: A sequence of primary keys.
271273 /// - Returns: A delete statement filtered by the given keys.
272274 public func find(
273- _ primaryKeys: some Sequence < some QueryExpression < From . TableColumns . PrimaryKey > >
275+ _ primaryKeys: some Sequence < some QueryExpression < From . PrimaryKey > >
274276 ) -> Self {
275277 self . where { $0. primaryKey. in ( primaryKeys) }
276278 }
@@ -281,7 +283,7 @@ extension Delete where From: TableDraft {
281283 ///
282284 /// - Parameter primaryKey: A primary key identifying a table row.
283285 /// - Returns: A delete statement filtered by the given key.
284- public func find( _ primaryKey: some QueryExpression < From . PrimaryTable . TableColumns . PrimaryKey > )
286+ public func find( _ primaryKey: some QueryExpression < From . PrimaryKey > )
285287 -> Self
286288 {
287289 find ( [ primaryKey] )
@@ -292,7 +294,7 @@ extension Delete where From: TableDraft {
292294 /// - Parameter primaryKeys: A sequence of primary keys.
293295 /// - Returns: A delete statement filtered by the given keys.
294296 public func find(
295- _ primaryKeys: some Sequence < some QueryExpression < From . PrimaryTable . TableColumns . PrimaryKey > >
297+ _ primaryKeys: some Sequence < some QueryExpression < From . PrimaryKey > >
296298 ) -> Self {
297299 self . where { $0. primaryKey. in ( primaryKeys) }
298300 }
0 commit comments