mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-29 04:24:21 +00:00
Documentation
This commit is contained in:
1 parent
343816ed7b
commit
f6f236512b
1 file changed
+4
-4
@@ -2174,7 +2174,7 @@ It is possible to [avoid useless updates](#record-comparison):
|
||||
|
||||
```swift
|
||||
if let player = try Player.fetchOne(db, key: 1) {
|
||||
// does nothing if score has not changed
|
||||
// does not hit the database if score has not changed
|
||||
try player.updateChanges(db) {
|
||||
$0.score = 1000
|
||||
}
|
||||
@@ -2960,7 +2960,7 @@ The `updateChanges` methods perform a database update of the changed columns onl
|
||||
if try newPlayer.updateChanges(db, from: oldPlayer) {
|
||||
print("player was modified, and updated in the database")
|
||||
} else {
|
||||
print("player was not modified")
|
||||
print("player was not modified, and database was not hit")
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -2977,7 +2977,7 @@ The `updateChanges` methods perform a database update of the changed columns onl
|
||||
if modified {
|
||||
print("player was modified, and updated in the database")
|
||||
} else {
|
||||
print("player was not modified")
|
||||
print("player was not modified, and database was not hit")
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -2993,7 +2993,7 @@ The `updateChanges` methods perform a database update of the changed columns onl
|
||||
if try player.updateChanges(db) {
|
||||
print("player was modified, and updated in the database")
|
||||
} else {
|
||||
print("player was not modified")
|
||||
print("player was not modified, and database was not hit")
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Reference in new issue
Block a user