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 }