mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-30 04:28:44 +00:00
Documentation
This commit is contained in:
1 parent
a8dd424211
commit
62a37ac1f4
1 file changed
+6
-6
@@ -1767,11 +1767,11 @@ When you subclass [Record](#record-class), you simply have to override the custo
|
||||
class Person : Record {
|
||||
var uuid: String?
|
||||
|
||||
override func insert(db: Database) throws {
|
||||
override func insert(writer: DatabaseWriter) throws {
|
||||
if uuid == nil {
|
||||
uuid = NSUUID().UUIDString
|
||||
}
|
||||
try super.insert(db)
|
||||
try super.insert(writer)
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -1782,14 +1782,14 @@ If you use the raw [Persistable](#persistable-protocol) protocol, use one of the
|
||||
struct Link : Persistable {
|
||||
var url: NSURL
|
||||
|
||||
func insert(db: Database) throws {
|
||||
func insert(writer: DatabaseWriter) throws {
|
||||
try validate()
|
||||
try performInsert(db)
|
||||
try performInsert(writer)
|
||||
}
|
||||
|
||||
func update(db: Database) throws {
|
||||
func update(writer: DatabaseWriter) throws {
|
||||
try validate()
|
||||
try performUpdate(db)
|
||||
try performUpdate(writer)
|
||||
}
|
||||
|
||||
func validate() throws {
|
||||
|
||||
Reference in new issue
Block a user