From 20b68c76fd7cad0c38d20cf764692e8a56cd2028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Wed, 13 Jan 2016 22:11:57 +0100 Subject: [PATCH] Document StatementArguments initializer from any sequence of (key, value) pairs --- GRDB/Core/Statement.swift | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/GRDB/Core/Statement.swift b/GRDB/Core/Statement.swift index aaad6fbd5..d1a989df3 100644 --- a/GRDB/Core/Statement.swift +++ b/GRDB/Core/Statement.swift @@ -493,18 +493,14 @@ public struct StatementArguments { // MARK: Named Arguments - /// Initializes arguments from a dictionary of optional values. + /// Initializes arguments from a sequence of (key, value) pairs, such as + /// a dictionary. /// - /// let values: [String: String?] = ["firstName": nil, "lastName": "Miller"] + /// let values: [String: DatabaseValueConvertible?] = ["firstName": nil, "lastName": "Miller"] /// db.execute("INSERT ... (:firstName, :lastName)", arguments: StatementArguments(values)) /// - /// - parameter dictionary: A dictionary of optional values that adopt the - /// DatabaseValueConvertible protocol. + /// - parameter sequence: A sequence of (key, value) pairs /// - returns: A StatementArguments. -// public init(_ dictionary: [String: DatabaseValueConvertible?]) { -// kind = .Pairs(dictionary.map({ ($0, $1) })) -// } - public init(_ sequence: KeyValueSequence) { kind = .NamedValues(Array(sequence)) }