mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-24 04:07:47 +00:00
Cleanup
This commit is contained in:
1 parent
51f02ed46e
commit
ebff14adac
1 file changed
+4
-7
@@ -239,16 +239,13 @@ extension TableMapping {
|
||||
///
|
||||
/// - throws: A DatabaseError if table does not exist.
|
||||
static func primaryKeyFunction(_ db: Database) throws -> (Row) -> [String: DatabaseValue] {
|
||||
let columns: [String]
|
||||
if let primaryKey = try db.primaryKey(databaseTableName) {
|
||||
columns = primaryKey.columns
|
||||
let columns = primaryKey.columns
|
||||
return { row in Dictionary(keys: columns) { row.value(named: $0) } }
|
||||
} else if selectsRowID {
|
||||
columns = ["rowid"]
|
||||
return { row in ["rowid": row.value(named: "rowid")] }
|
||||
} else {
|
||||
columns = []
|
||||
}
|
||||
return { row in
|
||||
return Dictionary<String, DatabaseValue>(keys: columns) { row.value(named: $0) }
|
||||
return { _ in [:] }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user