mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-29 04:24:21 +00:00
Avoid a compiler warning
This commit is contained in:
1 parent
f435715f75
commit
79ce0ff5f3
1 file changed
+5
-3
@@ -362,11 +362,13 @@ extension QueryInterfaceRequest: SelectionRequest {
|
||||
public func selectID() -> QueryInterfaceRequest<RowDecoder.ID>
|
||||
where RowDecoder: Identifiable
|
||||
{
|
||||
selectWhenConnected { db in
|
||||
let primaryKey = try db.primaryKey(self.databaseTableName)
|
||||
let databaseTableName = self.databaseTableName
|
||||
|
||||
return selectWhenConnected { db in
|
||||
let primaryKey = try db.primaryKey(databaseTableName)
|
||||
GRDBPrecondition(
|
||||
primaryKey.columns.count == 1,
|
||||
"selectID requires a single-column primary key in the table \(self.databaseTableName)")
|
||||
"selectID requires a single-column primary key in the table \(databaseTableName)")
|
||||
return [Column(primaryKey.columns[0])]
|
||||
}.asRequest(of: RowDecoder.ID.self)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user