From 39ff90474cda9773cb55849d65d335212fcca4f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 10 Dec 2015 13:33:25 +0100 Subject: [PATCH] DatabasePersistable documentation (#12) --- GRDB/Core/Protocols/DatabasePersistable.swift | 3 +++ README.md | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/GRDB/Core/Protocols/DatabasePersistable.swift b/GRDB/Core/Protocols/DatabasePersistable.swift index 642033d09..79239af10 100644 --- a/GRDB/Core/Protocols/DatabasePersistable.swift +++ b/GRDB/Core/Protocols/DatabasePersistable.swift @@ -54,6 +54,9 @@ public protocol DatabasePersistable : DatabaseTableMapping { /// self.id = rowID /// } /// } + /// + /// - parameter rowID: The inserted rowID. + /// - parameter name: The name of the eventual INTEGER PRIMARY KEY column. mutating func didInsertWithRowID(rowID: Int64, forColumn name: String?) // MARK: - CRUD diff --git a/README.md b/README.md index 8a2b34442..f8b42c133 100644 --- a/README.md +++ b/README.md @@ -1620,6 +1620,10 @@ Your type may store its rowID after a successful insertion: ```swift struct Person { + /// Optional method that is called upon successful insertion. + /// + /// - parameter rowID: The inserted rowID. + /// - parameter name: The name of the eventual INTEGER PRIMARY KEY column. mutating func didInsertWithRowID(rowID: Int64, forColumn name: String?) { self.id = rowID }