Deprecate TableMapping.primaryKeyRowComparator

This commit is contained in:
Gwendal Roué committed 2017-06-30 07:47:13 +02:00
1 parent 1ee8c73562
commit d12dad2e34
2 files changed
+5

No files matched your search

+3
View File
@@ -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
+2
View File
@@ -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"