diff --git a/GRDB/Record/TableMapping.swift b/GRDB/Record/TableMapping.swift index 887960d3c..bea6da135 100644 --- a/GRDB/Record/TableMapping.swift +++ b/GRDB/Record/TableMapping.swift @@ -249,6 +249,9 @@ extension TableMapping { /// } /// /// - throws: A DatabaseError if table does not exist. + /// - attention: This method is deprecated. It will be removed is the next + /// major version of the library, without any replacement. + @available(*, deprecated) public static func primaryKeyRowComparator(_ db: Database) throws -> (Row, Row) -> Bool { let primaryKey = try rowPrimaryKey(db) return { (lhs, rhs) in diff --git a/Tests/GRDBTests/TableMappingTests.swift b/Tests/GRDBTests/TableMappingTests.swift index bf7cba41f..62bd4b163 100644 --- a/Tests/GRDBTests/TableMappingTests.swift +++ b/Tests/GRDBTests/TableMappingTests.swift @@ -9,6 +9,7 @@ import XCTest class TableMappingTests: GRDBTestCase { + // Test deprecated method primaryKeyRowComparator func testPrimaryKeyRowComparatorWithIntegerPrimaryKey() throws { struct Person : TableMapping { static let databaseTableName = "persons" @@ -32,6 +33,7 @@ class TableMappingTests: GRDBTestCase { } } + // Test deprecated method primaryKeyRowComparator func testPrimaryKeyRowComparatorWithHiddenRowIDPrimaryKey() throws { struct Person : TableMapping { static let databaseTableName = "persons"