From cc762e4e1d253e890377fe7a72b7f0ff7a21d306 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Fri, 21 Jul 2017 12:20:32 +0200 Subject: [PATCH] TODO --- GRDB/Record/TableMapping.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/GRDB/Record/TableMapping.swift b/GRDB/Record/TableMapping.swift index dfe06d0e1..cc5ae7708 100644 --- a/GRDB/Record/TableMapping.swift +++ b/GRDB/Record/TableMapping.swift @@ -67,6 +67,11 @@ extension TableMapping { // Raises a fatal error if there is no unique index on the columns (unless // fatalErrorOnMissingUniqueIndex is false, for testability). + // + // TODO: think about + // - allowing non unique keys in Type.fetchOne(db, key: ...) ??? + // - allowing non unique keys in Type.fetchAll/Cursor(db, keys: ...) + // - forbidding Player.deleteOne(db, key: ["email": nil]) since this may delete several rows (case of a nullable unique key) static func filter(_ db: Database, keys: [[String: DatabaseValueConvertible?]], fatalErrorOnMissingUniqueIndex: Bool = true) throws -> QueryInterfaceRequest { // SELECT * FROM table WHERE ((a=? AND b=?) OR (c=? AND d=?) OR ...) let keyPredicates: [SQLExpression] = try keys.map { key in